提交 8834795e 编写于 作者: M Marc G. Fournier

From: Raymond Toy <toy@rtp.ericsson.se>

Subject: [PATCHES] 970417:  two more patches for large objects

Here are two more patches:

        1.  pg_getint doesn't properly set the status flag when
            calling pqGetShort or pqGetLong.  This is required when
            accessing large objects via libpq.  This, combined with
            problem 1 above causes postgres to crash when postgres
            tries to print out the message that the status was not
            good.

        2.  ExceptionalCondition crashes when called with detail =
            NULL.  This patch prevents dereferencing the NULL.
上级 a1f229b1
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.15 1997/04/16 06:25:13 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.16 1997/04/17 20:38:16 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -303,10 +303,10 @@ pq_getint(int b) ...@@ -303,10 +303,10 @@ pq_getint(int b)
status = ((n = fgetc(Pfin)) == EOF); status = ((n = fgetc(Pfin)) == EOF);
break; break;
case 2: case 2:
pqGetShort(&n, Pfin); status = pqGetShort(&n, Pfin);
break; break;
case 4: case 4:
pqGetLong(&n, Pfin); status = pqGetLong(&n, Pfin);
break; break;
default: default:
fprintf(stderr, "** Unsupported size %d\n", b); fprintf(stderr, "** Unsupported size %d\n", b);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/error/assert.c,v 1.3 1996/11/11 11:49:40 scrappy Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/error/assert.c,v 1.4 1997/04/17 20:38:26 scrappy Exp $
* *
* NOTE * NOTE
* This should eventually work with elog(), dlog(), etc. * This should eventually work with elog(), dlog(), etc.
...@@ -46,7 +46,7 @@ ExceptionalCondition(char* conditionName, ...@@ -46,7 +46,7 @@ ExceptionalCondition(char* conditionName,
} else { } else {
fprintf(stderr, fprintf(stderr,
"%s(\"%s:%s\", File: \"%s\", Line: %d)\n", "%s(\"%s:%s\", File: \"%s\", Line: %d)\n",
exceptionP->message, conditionName, detail, exceptionP->message, conditionName, detail == NULL ? "" : detail,
fileName, lineNumber); fileName, lineNumber);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册