mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
The attached patch changes most of the usages of sprintf() to
snprintf() in contrib/. I didn't touch the places where pointer arithmatic was being used, or other areas where the fix wasn't trivial. I would think that few, if any, of the usages of sprintf() were actually exploitable, but it's probably better to be paranoid... Neil Conway
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* PostgreSQL type definitions for managed LargeObjects.
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/contrib/lo/lo.c,v 1.11 2001/12/07 04:18:31 inoue Exp $
|
||||
* $Header: /cvsroot/pgsql/contrib/lo/lo.c,v 1.12 2002/08/15 02:58:29 momjian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -92,7 +92,7 @@ lo_out(Blob * addr)
|
||||
return (NULL);
|
||||
|
||||
result = (char *) palloc(32);
|
||||
sprintf(result, "%u", *addr);
|
||||
snprintf(result, 32, "%u", *addr);
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user