Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5fbc313 commit 980c24eCopy full SHA for 980c24e
src/interfaces/libpq/fe-secure.c
@@ -1132,7 +1132,17 @@ initialize_SSL(PGconn *conn)
1132
{
1133
/* Colon, but not in second character, treat as engine:key */
1134
char *engine_str = strdup(conn->sslkey);
1135
- char *engine_colon = strchr(engine_str, ':');
+ 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, ':');
1146
1147
*engine_colon = '\0'; /* engine_str now has engine name */
1148
engine_colon++; /* engine_colon now has key name */
0 commit comments