Skip to content

Commit

Permalink
Must validate the sslmode parameter FRiCKLE#67
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-at-startupmedia committed Sep 23, 2023
1 parent 14712d5 commit daa78db
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ngx_postgres_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,14 @@ ngx_postgres_conf_server(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
continue;
}

if (ngx_strncmp(value[i].data, "sslmode=", sizeof("sslmode=") - 1)
== 0)
{
pgs->sslmode.len = value[i].len - (sizeof("sslmode=") - 1);
pgs->sslmode.data = &value[i].data[sizeof("sslmode=") - 1];
continue;
}

ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"postgres: invalid parameter \"%V\" in"
" \"postgres_server\"", &value[i]);
Expand Down

0 comments on commit daa78db

Please sign in to comment.