From: Sebastian Harl Date: Fri, 8 Dec 2006 14:12:00 +0000 (+0100) Subject: email plugin: Prevent a segfault in read_line (). X-Git-Tag: collectd-3.11.0~22 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=80cc7fdf78fbda3f154666f20a2868988dcc68b2;p=collectd.git email plugin: Prevent a segfault in read_line (). Signed-off-by: Sebastian Harl --- diff --git a/src/email.c b/src/email.c index 58d94d1d..c1e139ea 100644 --- a/src/email.c +++ b/src/email.c @@ -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';