ttsession: Coverity (memory corruption, moderate)
authorJon Trulson <jon@radscan.com>
Fri, 26 Dec 2014 23:14:35 +0000 (16:14 -0700)
committerJon Trulson <jon@radscan.com>
Fri, 26 Dec 2014 23:14:35 +0000 (16:14 -0700)
cde/lib/tt/bin/ttsession/mp_server.C

index 18b58a86d941c633da48d083002585aa342fbbad..c0ea10c0c9af84de1a17d4c7b5103833468ed359 100644 (file)
@@ -890,7 +890,8 @@ sig_handler(int sig)
                // session we print out the child session's id.
                if ((background_mode) && (forked_pid > 0)) {
                        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);
                        }
                        // this is the signal from the forked