mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
coverity 160167 resource_path set at cmake may overflow buffer
resource_path is configured at cmake time (it's like /usr/share/libwebsockets-test-server) it's true if you gave a >255 char path there it would blow up. It's fixed but again not network-accessible. Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
parent
1536c5beb6
commit
09490aeb93
1 changed files with 2 additions and 1 deletions
|
@ -152,7 +152,8 @@ int callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user,
|
|||
if (lws_hdr_total_length(wsi, WSI_TOKEN_POST_URI))
|
||||
return 0;
|
||||
|
||||
strcpy(buf, resource_path);
|
||||
strncpy(buf, resource_path, sizeof(buf) - 1);
|
||||
buf[sizeof(buf) - 1] = '\0';
|
||||
if (strcmp(in, "/")) {
|
||||
if (*((const char *)in) != '/')
|
||||
strcat(buf, "/");
|
||||
|
|
Loading…
Add table
Reference in a new issue