elm quicklaunch binary - fix possible 0 termination issue with strings

the input strings for agrs/env could be not 0 terminated tho the
sender guarantees it. ensure they are by 0'ing the last byte

fix CID 1353607
This commit is contained in:
Carsten Haitzler 2016-07-08 12:18:59 +09:00
parent 1e4b63e885
commit e3f1984833
1 changed files with 1 additions and 0 deletions

View File

@ -114,6 +114,7 @@ handle_run(int fd, unsigned long bytes)
return;
}
close(fd);
if (bytes > 0) buf[bytes - 1] = 0;
argc = ((unsigned long *)(buf))[0];
envnum = ((unsigned long *)(buf))[1];