Skip to content

Commit 4973781

Browse files
committed
KASM-6773 Use snprintf instead of sprintf for safer path handling
1 parent 4e087ba commit 4973781

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common/network/websocket.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1689,7 +1689,7 @@ static uint8_t ownerapi(ws_ctx_t *ws_ctx, const char *in, const char * const use
16891689
if (!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, ".."))
16901690
continue;
16911691

1692-
sprintf(path, "%s/%s", allpath, ent->d_name);
1692+
snprintf(path, PATH_MAX, "%s/%s", allpath, ent->d_name);
16931693
struct stat st;
16941694
if (lstat(path, &st))
16951695
continue;

0 commit comments

Comments
 (0)