Skip to content
This repository was archived by the owner on Dec 1, 2020. It is now read-only.

Commit 6accce7

Browse files
committed
fix: Fix buffer overflow
If we write the 1024th element on an array whose length is 1024, it will cause buffer overflow.
1 parent 8b16905 commit 6accce7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/test_ipc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ void spawn_helper(uv_pipe_t* channel,
285285
TUV_ASSERT(r == 0);
286286
TUV_ASSERT(channel->ipc);
287287

288-
exepath_size = sizeof(exepath);
288+
exepath_size = sizeof(exepath) - 1;
289289
r = uv_exepath(exepath, &exepath_size);
290290
TUV_ASSERT(r == 0);
291291

0 commit comments

Comments
 (0)