trac 29 convert more snprintf stowaways
Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
86aa80509f
commit
6c72070fd4
1 changed files with 12 additions and 2 deletions
|
@ -732,8 +732,18 @@ int main(int argc, char **argv)
|
|||
info.ssl_cert_filepath = NULL;
|
||||
info.ssl_private_key_filepath = NULL;
|
||||
} else {
|
||||
snprintf(cert_path, sizeof(cert_path), "%s/libwebsockets-test-server.pem", resource_path);
|
||||
snprintf(key_path, sizeof(cert_path), "%s/libwebsockets-test-server.key.pem", resource_path);
|
||||
if (strlen(resource_path) > sizeof(cert_path) - 32) {
|
||||
lwsl_err("resource path too long\n");
|
||||
return -1;
|
||||
}
|
||||
sprintf(cert_path, "%s/libwebsockets-test-server.pem",
|
||||
resource_path);
|
||||
if (strlen(resource_path) > sizeof(key_path) - 32) {
|
||||
lwsl_err("resource path too long\n");
|
||||
return -1;
|
||||
}
|
||||
sprintf(key_path, "%s/libwebsockets-test-server.key.pem",
|
||||
resource_path);
|
||||
|
||||
info.ssl_cert_filepath = cert_path;
|
||||
info.ssl_private_key_filepath = key_path;
|
||||
|
|
Loading…
Add table
Reference in a new issue