diff options
author | Stef Walter <stef@memberwebs.com> | 2009-09-16 21:26:22 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2009-09-16 21:26:22 +0000 |
commit | 5f85395a780cbe43daa287156a133e2af65b5a55 (patch) | |
tree | b2b150b29db854905a6b1f97af37d004f1ba2bb3 /module | |
parent | 5665604d7fcafd3d24877562dd36d60895c29cc6 (diff) |
Fix off by one error in line parsing
Diffstat (limited to 'module')
-rw-r--r-- | module/bsnmp-regex.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/module/bsnmp-regex.c b/module/bsnmp-regex.c index d30679b..ffc22c1 100644 --- a/module/bsnmp-regex.c +++ b/module/bsnmp-regex.c @@ -484,15 +484,15 @@ io_data (int fd, void *user_data) for (;;) { t = strchr (line_buffer, '\n'); if (t == NULL) { - /* Break really long lines */ - if (len >= LINE_LENGTH - 1) - t = line_buffer + len; - else + /* Wait for more data */ + if (len < LINE_LENGTH - 1) break; + /* Break really long lines */ + n = t = line_buffer + len; + } else { + n = t + 1; } - n = t + 1; - /* Break line (also DOS line) */ *t = 0; if (line_buffer != t && *(t - 1) == '\r') |