From a12b4e279bc12a7cd7b7d679fcac4689ac4aba7b Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Mon, 2 Sep 2002 06:11:43 +0000 Subject: I checked all the previous string handling errors and most of them were already fixed by You. However there were a few left and attached patch should fix the rest of them. I used StringInfo only in 2 places and both of them are inside debug ifdefs. Only performance penalty will come from using strlen() like all the other code does. I also modified some of the already patched parts by changing snprintf(buf, 2 * BUFSIZE, ... style lines to snprintf(buf, sizeof(buf), ... where buf is an array. Jukka Holappa --- doc/src/sgml/spi.sgml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/spi.sgml b/doc/src/sgml/spi.sgml index ca6d62e1ae1..e25c2a259cc 100644 --- a/doc/src/sgml/spi.sgml +++ b/doc/src/sgml/spi.sgml @@ -1,5 +1,5 @@ @@ -3815,7 +3815,7 @@ execq(text *sql, int cnt) HeapTuple tuple = tuptable->vals[j]; for (i = 1, buf[0] = 0; i <= tupdesc->natts; i++) - sprintf(buf + strlen (buf), " %s%s", + snprintf(buf + strlen (buf), sizeof(buf) - strlen(buf)," %s%s", SPI_getvalue(tuple, tupdesc, i), (i == tupdesc->natts) ? " " : " |"); elog (INFO, "EXECQ: %s", buf); -- cgit v1.2.3