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

Commit0347d31

Browse files
committed
Oh, for crying in a bucket ... relax Assert so that glibc's strxfrm
does not dump core.
1 parent59d9a37 commit0347d31

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*
1717
* IDENTIFICATION
18-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.140 2003/07/17 20:52:36 tgl Exp $
18+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.141 2003/07/1722:20:14 tgl Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -2700,11 +2700,16 @@ convert_string_datum(Datum value, Oid typid)
27002700
* However, it seems that some versions of Solaris have buggy
27012701
* strxfrm that can write past the specified buffer length in that
27022702
* scenario. So, do it the dumb way for portability.
2703+
*
2704+
* Yet other systems (e.g., glibc) sometimes return a smaller value
2705+
* from the second call than the first; thus the Assert must be <=
2706+
* not == as you'd expect. Can't any of these people program their
2707+
* way out of a paper bag?
27032708
*/
27042709
xfrmlen=strxfrm(NULL,val,0);
27052710
xfrmstr= (char*)palloc(xfrmlen+1);
27062711
xfrmlen2=strxfrm(xfrmstr,val,xfrmlen+1);
2707-
Assert(xfrmlen2==xfrmlen);
2712+
Assert(xfrmlen2<=xfrmlen);
27082713
pfree(val);
27092714
val=xfrmstr;
27102715
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp