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

Commit

Permalink
fix: Fix buffer overflow
Browse files Browse the repository at this point in the history
If we write the 1024th element on an array whose
length is 1024, it will cause buffer overflow.
  • Loading branch information
howjmay committed Jan 14, 2020
1 parent 8b16905 commit 6accce7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/test_ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ void spawn_helper(uv_pipe_t* channel,
TUV_ASSERT(r == 0);
TUV_ASSERT(channel->ipc);

exepath_size = sizeof(exepath);
exepath_size = sizeof(exepath) - 1;
r = uv_exepath(exepath, &exepath_size);
TUV_ASSERT(r == 0);

Expand Down

0 comments on commit 6accce7

Please sign in to comment.