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

Commitb13da41

Browse files
committed
Fix unsafe loop test, and declare as_ident as bool rather than int.
1 parentd666796 commitb13da41

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎src/interfaces/libpq/fe-exec.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.207 2010/01/2114:58:53 rhaas Exp $
11+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.208 2010/01/2118:43:25 rhaas Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -3066,7 +3066,7 @@ PQescapeString(char *to, const char *from, size_t length)
30663066
* of memory condition, we return NULL, storing an error message into conn.
30673067
*/
30683068
staticchar*
3069-
PQescapeInternal(PGconn*conn,constchar*str,size_tlen,intas_ident)
3069+
PQescapeInternal(PGconn*conn,constchar*str,size_tlen,boolas_ident)
30703070
{
30713071
constchar*s;
30723072
char*result;
@@ -3082,7 +3082,7 @@ PQescapeInternal(PGconn *conn, const char *str, size_t len, int as_ident)
30823082
returnNULL;
30833083

30843084
/* Scan the string for characters that must be escaped. */
3085-
for (s=str;*s!='\0'&&(s-str)<len;++s)
3085+
for (s=str; (s-str)<len&&*s!='\0';++s)
30863086
{
30873087
if (*s==quote_char)
30883088
++num_quotes;
@@ -3188,13 +3188,13 @@ PQescapeInternal(PGconn *conn, const char *str, size_t len, int as_ident)
31883188
char*
31893189
PQescapeLiteral(PGconn*conn,constchar*str,size_tlen)
31903190
{
3191-
returnPQescapeInternal(conn,str,len,0);
3191+
returnPQescapeInternal(conn,str,len,false);
31923192
}
31933193

31943194
char*
31953195
PQescapeIdentifier(PGconn*conn,constchar*str,size_tlen)
31963196
{
3197-
returnPQescapeInternal(conn,str,len,1);
3197+
returnPQescapeInternal(conn,str,len,true);
31983198
}
31993199

32003200
/* HEX encoding support for bytea */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp