fix possible endless loop
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 22 Sep 2013 14:31:02 +0000 (16:31 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 22 Sep 2013 14:31:02 +0000 (16:31 +0200)
citadel/modules/smtp/serv_smtpqueue.c

index 1a5761b6bf720d3bb25fb1d864cd7f8d1be0534d..99b9d0795ae105075911d9e6f60c5cfe0702c711 100644 (file)
@@ -853,7 +853,10 @@ void smtp_do_procmsg(long msgnum, void *userdata) {
        /* Strip out the headers (no not amd any other non-instruction) line */
        while (pch != NULL) {
                pch = strchr(pch, '\n');
-               if ((pch != NULL) && (*(pch + 1) == '\n')) {
+               if ((pch != NULL) &&
+                   ((*(pch + 1) == '\n') ||
+                    (*(pch + 1) == '\r')))
+               {
                        instr = pch + 2;
                        pch = NULL;
                }