Description: Fix heap-overflow in formail
 CVE-2014-3618: Heap-overflow in formail when processing
 specially-crafted email headers.
Origin: http://www.openwall.com/lists/oss-security/2014/09/03/8
Bug-Debian: https://bugs.debian.org/704675
Bug-Debian: https://bugs.debian.org/760443
Forwarded: not-needed
Last-Update: 2014-09-04

CVE: CVE-2014-3618
Upstream-Status: Inactive-Upstream [lastrelease: 2001]
Signed-off-by: Peter Marko <peter.marko@siemens.com>

--- a/src/formisc.c
+++ b/src/formisc.c
@@ -84,12 +84,11 @@ normal:	   *target++= *start++;
 	case '"':*target++=delim='"';start++;
       }
      ;{ int i;
-	do
+	while(*start)
 	   if((i= *target++= *start++)==delim)	 /* corresponding delimiter? */
 	      break;
 	   else if(i=='\\'&&*start)		    /* skip quoted character */
 	      *target++= *start++;
-	while(*start);						/* anything? */
       }
      hitspc=2;
    }
