mirror of
https://github.com/postgres/postgres.git
synced 2025-08-08 06:02:22 +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:
@@ -68,14 +68,14 @@ main(int argc, char **argv)
|
||||
{
|
||||
unset_result(relres);
|
||||
if (strcmp(typname, "oid") == 0)
|
||||
sprintf(query, "\
|
||||
snprintf(query, 4000, "\
|
||||
DECLARE c_matches BINARY CURSOR FOR \
|
||||
SELECT count(*)::int4 \
|
||||
FROM \"%s\" t1, \"%s\" t2 \
|
||||
WHERE t1.\"%s\" = t2.oid ",
|
||||
relname, relname2, attname);
|
||||
else
|
||||
sprintf(query, "\
|
||||
sprintf(query, 4000, "\
|
||||
DECLARE c_matches BINARY CURSOR FOR \
|
||||
SELECT count(*)::int4 \
|
||||
FROM \"%s\" t1, \"%s\" t2 \
|
||||
|
Reference in New Issue
Block a user