1
0
mirror of https://github.com/open-simh/simh.git synced 2026-01-13 15:27:46 +00:00

SCP: Fix potential NULL pointer dereference - Coverity

This commit is contained in:
Mark Pizzolato 2018-08-04 08:28:12 -07:00
parent 9316978403
commit a8d4fe8846

2
scp.c
View File

@ -12263,7 +12263,7 @@ while ((eol = strchr (debug_line_buf, '\n')) || flush) {
}
}
debug_line_offset -= linesize;
if (debug_line_offset > 0)
if ((debug_line_offset > 0) && (!flush))
memmove (debug_line_buf, eol + 1, debug_line_offset);
debug_line_buf[debug_line_offset] = '\0';
}