Code

email plugin: Prevent a segfault in read_line ().
authorSebastian Harl <sh@tokkee.org>
Fri, 8 Dec 2006 14:12:00 +0000 (15:12 +0100)
committerFlorian Forster <octo@huhu.verplant.org>
Fri, 8 Dec 2006 14:29:34 +0000 (15:29 +0100)
Signed-off-by: Sebastian Harl <sh@tokkee.org>
src/email.c

index 58d94d1d4322047becb78f957a372f618fb014a5..c1e139ea5aedd164ee65fcc5373b5234cf3c4a90 100644 (file)
@@ -332,7 +332,7 @@ char *read_line (collector_t *src)
                        break;
        }
 
-       if ('\n' != src->buffer[i]) {
+       if (i == src->idx) {
                fd_set fdset;
        
                ssize_t len = 0;
@@ -369,7 +369,7 @@ char *read_line (collector_t *src)
                                break;
                }
 
-               if ('\n' != src->buffer[i]) {
+               if (i == src->idx) {
                        ret = (char *)smalloc (1);
 
                        ret[0] = '\0';