SCP: Avoid potential buffer overflow when formatting debug repeat count

As reported in #915
This commit is contained in:
Mark Pizzolato 2020-07-15 20:15:21 -07:00
parent 936a7a8c2d
commit a6198d8fad

2
scp.c
View file

@ -13072,7 +13072,7 @@ while ((eol = strchr (debug_line_buf, '\n')) || flush) {
else {
_debug_fwrite (debug_line_buf_last, strlen (debug_line_buf_last));
if (debug_line_count > 1) {
char countstr[32];
char countstr[40];
sprintf (countstr, "same as above (%d time%s)\r\n", (int)(debug_line_count - 1), ((debug_line_count - 1) != 1) ? "s" : "");
_debug_fwrite (debug_line_last_prefix, strlen (debug_line_last_prefix));