1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

ttsession: Coverity (memory corruption, moderate)

This commit is contained in:
Jon Trulson 2014-12-26 16:14:35 -07:00
parent e45843bc95
commit ce7bdf9f62

View file

@ -890,7 +890,8 @@ sig_handler(int sig)
// session we print out the child session's id. // session we print out the child session's id.
if ((background_mode) && (forked_pid > 0)) { if ((background_mode) && (forked_pid > 0)) {
if (print_sessid) { if (print_sessid) {
read(ds_fds[0], session_buf, 255); memset(session_buf, 0, 255);
read(ds_fds[0], session_buf, 255 - 1);
printf("%s", session_buf); printf("%s", session_buf);
} }
// this is the signal from the forked // this is the signal from the forked