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

Commit980c24e

Browse files
committed
Check for NULL result from strdup
Per Coverity Scan
1 parent5fbc313 commit980c24e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,17 @@ initialize_SSL(PGconn *conn)
11321132
{
11331133
/* Colon, but not in second character, treat as engine:key */
11341134
char*engine_str=strdup(conn->sslkey);
1135-
char*engine_colon=strchr(engine_str,':');
1135+
char*engine_colon;
1136+
1137+
if (engine_str==NULL)
1138+
{
1139+
printfPQExpBuffer(&conn->errorMessage,
1140+
libpq_gettext("out of memory\n"));
1141+
return-1;
1142+
}
1143+
1144+
/* cannot return NULL because we already checked before strdup */
1145+
engine_colon=strchr(engine_str,':');
11361146

11371147
*engine_colon='\0';/* engine_str now has engine name */
11381148
engine_colon++;/* engine_colon now has key name */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp