[collectd] [PATCH] email plugin: Prevent a segfault in read_line ().

Sebastian Harl sh<span style="display: none;">.trailing-username</span>(a)<span style="display: none;">leading-domain.</span>tokkee.org
Fri Dec 8 15:12:00 CET 2006


Signed-off-by: Sebastian Harl <sh<span style="display: none;">.trailing-username</span>(a)<span style="display: none;">leading-domain.</span>tokkee.org>
---
 src/email.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/email.c b/src/email.c
index 58d94d1..c1e139e 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';
-- 
1.4.3.2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20061208/86a11876/attachment.pgp


More information about the collectd mailing list