diff options
author | Bruce Momjian <bruce@momjian.us> | 1998-08-29 02:09:27 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1998-08-29 02:09:27 +0000 |
commit | 3e873022014d5359f4698dc85a7708fb869a09fe (patch) | |
tree | 6fe91c43d9168e9071d2b44e98093b6127c91cfb | |
parent | b9b00d5fe4ca963fa39295b054c83eb99bdec6b0 (diff) | |
download | postgresql-3e873022014d5359f4698dc85a7708fb869a09fe.tar.gz postgresql-3e873022014d5359f4698dc85a7708fb869a09fe.zip |
libpq's pqGetnchar() should not return a null-terminated value
anymore. Fix for large objects.
-rw-r--r-- | src/interfaces/libpq/fe-exec.c | 3 | ||||
-rw-r--r-- | src/interfaces/libpq/fe-misc.c | 9 | ||||
-rw-r--r-- | src/tools/RELEASE_CHANGES | 2 |
3 files changed, 8 insertions, 6 deletions
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c index c909c424468..36847863084 100644 --- a/src/interfaces/libpq/fe-exec.c +++ b/src/interfaces/libpq/fe-exec.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.62 1998/08/17 03:50:35 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.63 1998/08/29 02:09:24 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -612,6 +612,7 @@ getAnotherTuple(PGconn *conn, int binary) if (vlen > 0) if (pqGetnchar((char *) (tup[i].value), vlen, conn)) return EOF; + /* we have to terminate this ourselves */ tup[i].value[vlen] = '\0'; } /* advance the bitmap stuff */ diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 5608a0de2f8..baa0d7feed0 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -24,7 +24,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.18 1998/08/17 03:50:38 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.19 1998/08/29 02:09:25 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -160,8 +160,7 @@ pqPuts(const char *s, PGconn *conn) /* --------------------------------------------------------------------- */ /* pqGetnchar: - get a string of exactly len bytes in buffer s (which must be 1 byte - longer) and terminate it with a '\0'. + get a string of exactly len bytes in buffer s, no null termination */ int pqGetnchar(char *s, int len, PGconn *conn) @@ -170,8 +169,8 @@ pqGetnchar(char *s, int len, PGconn *conn) return EOF; memcpy(s, conn->inBuffer + conn->inCursor, len); - s[len] = '\0'; - + /* no terminating null */ + conn->inCursor += len; if (conn->Pfdebug) diff --git a/src/tools/RELEASE_CHANGES b/src/tools/RELEASE_CHANGES index f7f0ba3db11..276c60d0c2a 100644 --- a/src/tools/RELEASE_CHANGES +++ b/src/tools/RELEASE_CHANGES @@ -11,3 +11,5 @@ update include/version.h after release update backend/parser/scan.c and gram.c so flex/bison not necessary update pgaccess update odbc +update doc/src/sgml/release.sgml + |