trac 29 convert more snprintf stowaways

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2013-05-02 08:15:53 +08:00
parent 86aa80509f
commit 6c72070fd4

View file

@ -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;