properly terminate string which recvfrom does not do

This commit is contained in:
Gilles Depeyrot
2021-07-16 09:36:26 +08:00
committed by Max Lv
parent 49ead5e570
commit 0a7d178134
+3
View File
@@ -614,6 +614,9 @@ manager_recv_cb(EV_P_ ev_io *w, int revents)
return;
}
// properly terminate string which recvfrom does not do
buf[r] = '\0';
char *action = get_action(buf, r);
if (action == NULL) {
return;