Skip to content

Commit daa78db

Browse files
Must validate the sslmode parameter #67
1 parent 14712d5 commit daa78db

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/ngx_postgres_module.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,14 @@ ngx_postgres_conf_server(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
471471
continue;
472472
}
473473

474+
if (ngx_strncmp(value[i].data, "sslmode=", sizeof("sslmode=") - 1)
475+
== 0)
476+
{
477+
pgs->sslmode.len = value[i].len - (sizeof("sslmode=") - 1);
478+
pgs->sslmode.data = &value[i].data[sizeof("sslmode=") - 1];
479+
continue;
480+
}
481+
474482
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
475483
"postgres: invalid parameter \"%V\" in"
476484
" \"postgres_server\"", &value[i]);

0 commit comments

Comments
 (0)