patch-src_formisc_c 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. $OpenBSD: patch-src_formisc_c,v 1.2 2014/09/05 13:52:19 sthen Exp $
  2. Hunk #1: CVE-2014-3618, heap overflow in formail when parsing addresses
  3. with unbalanced quotes.
  4. --- src/formisc.c.orig Fri Jun 29 03:20:45 2001
  5. +++ src/formisc.c Thu Sep 4 16:15:48 2014
  6. @@ -84,12 +84,11 @@ normal: *target++= *start++;
  7. case '"':*target++=delim='"';start++;
  8. }
  9. ;{ int i;
  10. - do
  11. + while(*start)
  12. if((i= *target++= *start++)==delim) /* corresponding delimiter? */
  13. break;
  14. else if(i=='\\'&&*start) /* skip quoted character */
  15. *target++= *start++;
  16. - while(*start); /* anything? */
  17. }
  18. hitspc=2;
  19. }
  20. @@ -115,7 +114,7 @@ void loadchar(c)const int c; /* append one char
  21. buf[buffilled++]=c;
  22. }
  23. -int getline P((void)) /* read a newline-terminated line */
  24. +int get_line P((void)) /* read a newline-terminated line */
  25. { if(buflast==EOF) /* at the end of our Latin already? */
  26. { loadchar('\n'); /* fake empty line */
  27. return EOF; /* spread the word */