From 37840f2932fdca7b09ab0701eb380385d6d09577 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Sat, 17 Jan 2009 04:20:00 +0000 Subject: * Fix assertion when selecting text at end of line * Fix problems when large buffers come in at once with multiple lines. --- module/bsnmp-regex.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/bsnmp-regex.c') 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); -- cgit v1.2.3