Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0c54229

Browse files
committed
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 hackersmessage.Cheers,Patrick Welche
1 parent8fa8f80 commit0c54229

File tree

1 file changed

+7
-1
lines changed
  • src/backend/utils/adt

1 file changed

+7
-1
lines changed

‎src/backend/utils/adt/int.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.33 2000/02/21 03:36:48 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.34 2000/03/07 23:58:38 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -288,6 +288,9 @@ text_int2(text *string)
288288
intlen;
289289
char*str;
290290

291+
if (!string)
292+
return0;
293+
291294
len= (VARSIZE(string)-VARHDRSZ);
292295

293296
str=palloc(len+1);
@@ -329,6 +332,9 @@ text_int4(text *string)
329332
intlen;
330333
char*str;
331334

335+
if (!string)
336+
return0;
337+
332338
len= (VARSIZE(string)-VARHDRSZ);
333339

334340
str=palloc(len+1);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp