diff --git a/executer/user/mcexec.c b/executer/user/mcexec.c index 14f872aa..181a4685 100644 --- a/executer/user/mcexec.c +++ b/executer/user/mcexec.c @@ -3311,8 +3311,10 @@ int main_loop(struct thread_data_s *my_thread) 0); break; } - strncat(pathbuf, "/", 1); - strncat(pathbuf, tmpbuf, strlen(tmpbuf) + 1); + strncat(pathbuf, "/", + sizeof(pathbuf) - strlen(pathbuf) - 1); + strncat(pathbuf, tmpbuf, + sizeof(pathbuf) - strlen(pathbuf) - 1); } else { }