Skip to content

Commit 3c237e7

Browse files
committed
I have two small patches which correct some very obscure bug in the parser
of the array constants and in one of the loadable modules I posted some time ago. Submitted by: Massimo Dal Zotto <dz@cs.unitn.it>
1 parent 8594ade commit 3c237e7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

contrib/string/string_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ string_output(char *data, int size)
7979
len++;
8080
break;
8181
default:
82-
if (NOTPRINTABLE(c)) {
82+
if (NOTPRINTABLE(*p)) {
8383
len += 3;
8484
}
8585
}

src/backend/utils/adt/arrayfuncs.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.4 1996/08/27 07:32:27 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.5 1996/09/19 20:04:56 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -235,6 +235,10 @@ _ArrayCount(char *str, int dim[], int typdelim)
235235
}
236236
break;
237237
#endif
238+
case '\0':
239+
/* Signal a premature end of the string. DZ - 2-9-1996 */
240+
elog(WARN, "malformed array constant: %s", str);
241+
break;
238242
case '\"':
239243
scanning_string = ! scanning_string;
240244
break;

0 commit comments

Comments
 (0)