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

Commitd2d52bb

Browse files
committed
xmlGetUTF8Char()'s second argument is both input and output. Fix
uninitialized value, and avoid invoking the function nine separatetimes in the pg_xmlIsNameChar macro. Should resolve buildfarm failures.Per report from Ben Leslie.
1 parent58ac0f9 commitd2d52bb

File tree

1 file changed

+9
-5
lines changed
  • src/backend/utils/adt

1 file changed

+9
-5
lines changed

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.54 2007/11/09 15:52:51 petere Exp $
10+
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.55 2007/11/10 18:51:20 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -998,20 +998,22 @@ xml_init(void)
998998
while (xmlIsBlank_ch(*(p))) (p)++
999999

10001000
/* Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender */
1001-
#definepg_xmlIsNameChar(c) \
1001+
/* Beware of multiple evaluations of argument! */
1002+
#definePG_XMLISNAMECHAR(c) \
10021003
(xmlIsBaseChar_ch(c) || xmlIsIdeographicQ(c) \
10031004
|| xmlIsDigit_ch(c) \
10041005
|| c == '.' || c == '-' || c == '_' || c == ':' \
10051006
|| xmlIsCombiningQ(c) \
10061007
|| xmlIsExtender_ch(c))
10071008

10081009
staticint
1009-
parse_xml_decl(constxmlChar*str,size_t*lenp,
1010+
parse_xml_decl(constxmlChar*str,size_t*lenp,
10101011
xmlChar**version,xmlChar**encoding,int*standalone)
10111012
{
10121013
constxmlChar*p;
10131014
constxmlChar*save_p;
10141015
size_tlen;
1016+
intutf8char;
10151017
intutf8len;
10161018

10171019
xml_init();
@@ -1028,8 +1030,10 @@ parse_xml_decl(const xmlChar *str,size_t *lenp,
10281030
if (xmlStrncmp(p, (xmlChar*)"<?xml",5)!=0)
10291031
gotofinished;
10301032

1031-
/* This means it's a PI like <?xml-stylesheet ...?>. */
1032-
if (pg_xmlIsNameChar(xmlGetUTF8Char(&p[5],&utf8len)))
1033+
/* if next char is name char, it's a PI like <?xml-stylesheet ...?> */
1034+
utf8len=strlen((constchar*) (p+5));
1035+
utf8char=xmlGetUTF8Char(p+5,&utf8len);
1036+
if (PG_XMLISNAMECHAR(utf8char))
10331037
gotofinished;
10341038

10351039
p+=5;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp