bvi-1.3.2-fix-buffer-overflow.patch 622 B

1234567891011121314151617181920212223
  1. diff --git a/edit.c b/edit.c
  2. index 328a0cd..3cf6572 100644
  3. --- a/edit.c
  4. +++ b/edit.c
  5. @@ -42,7 +42,7 @@ char contru[][4] = {"NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
  6. "CAN", " EM", "SUB", "ESC", " FS", " GS", " RS", " US",
  7. "DEL" };
  8. char tmpbuf[10];
  9. -char linbuf[256];
  10. +char linbuf[16384];
  11. static char getcbuff[BUFFER];
  12. static char *getcnext = NULL;
  13. @@ -492,7 +492,7 @@ printline(mempos, scpos)
  14. *(string + print_pos) = '.';
  15. }
  16. *(string + Anzahl) = '\0';
  17. - strcat(linbuf, string);
  18. + strncat(linbuf, string, sizeof(linbuf) - strlen(linbuf) - 1);
  19. mvaddstr(scpos, 0, linbuf);
  20. }