libpq's pqGetnchar() should not return a null-terminated value
authorBruce Momjian
Sat, 29 Aug 1998 02:09:27 +0000 (02:09 +0000)
committerBruce Momjian
Sat, 29 Aug 1998 02:09:27 +0000 (02:09 +0000)
anymore.  Fix for large objects.

src/interfaces/libpq/fe-exec.c
src/interfaces/libpq/fe-misc.c
src/tools/RELEASE_CHANGES

index c909c42446893ca9f7a853b5c6a633b8c27ed4fe..36847863084dee2a85e5d6c55c69c84e45ef6d54 100644 (file)
@@ -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 */
index 5608a0de2f8942733e8f89ac5a6527dd1f696392..baa0d7feed013a3b028782a7d1dff9975933abf3 100644 (file)
@@ -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)
index f7f0ba3db116edb7a68749cce7f3f59f685b6a04..276c60d0c2a6ed78931e440d60e75e3b4f0b4ae5 100644 (file)
@@ -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 
+