Commit 0c542291 authored by Bruce Momjian's avatar Bruce Momjian

Protects you from coredumps if you do eg. str::int4 where str is a text

field. cf. Tom Lane's <19021.950544016@sss.pgh.pa.us> 14 Feb hackers
message.

Cheers,

Patrick Welche
parent 8fa8f80c
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.33 2000/02/21 03:36:48 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.34 2000/03/07 23:58:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -288,6 +288,9 @@ text_int2(text *string)
int len;
char *str;
if (!string)
return 0;
len = (VARSIZE(string) - VARHDRSZ);
str = palloc(len + 1);
......@@ -329,6 +332,9 @@ text_int4(text *string)
int len;
char *str;
if (!string)
return 0;
len = (VARSIZE(string) - VARHDRSZ);
str = palloc(len + 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment