diff options
author | Stef Walter <stef@memberwebs.com> | 2009-01-17 04:20:00 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2009-01-17 04:20:00 +0000 |
commit | 37840f2932fdca7b09ab0701eb380385d6d09577 (patch) | |
tree | 46e6d54fc69675ae77ad0d705d88da13722ac4d4 /module | |
parent | 025c8070f7f93a15db86345429cbf76dfc15eba5 (diff) |
* Fix assertion when selecting text at end of line
* Fix problems when large buffers come in at once with multiple lines.
Diffstat (limited to 'module')
-rw-r--r-- | module/bsnmp-regex.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/module/bsnmp-regex.c b/module/bsnmp-regex.c index 5a77d6e..d30679b 100644 --- a/module/bsnmp-regex.c +++ b/module/bsnmp-regex.c @@ -330,8 +330,8 @@ process_result (struct data_entry *data, char *line, int len, #else /* WITH_PCRE */ if (pm[idx].rm_so != -1 && pm[idx].rm_eo != -1) { ASSERT (pm[idx].rm_eo >= pm[idx].rm_so); - ASSERT (pm[idx].rm_eo < len); - ASSERT (pm[idx].rm_so < len); + ASSERT (pm[idx].rm_eo <= len); + ASSERT (pm[idx].rm_so <= len); rlen += (pm[idx].rm_eo - pm[idx].rm_so); rlen += 1; } @@ -491,7 +491,7 @@ io_data (int fd, void *user_data) break; } - n = t; + n = t + 1; /* Break line (also DOS line) */ *t = 0; @@ -504,7 +504,7 @@ io_data (int fd, void *user_data) /* Move data to front of buffer */ len -= (n - line_buffer); - memmove (line_buffer, n, len); + memmove (line_buffer, n, len + 1); } } while (r > 0); |