aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/ndpi_main.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index 897f16492..e71ca668e 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -5092,10 +5092,14 @@ void ndpi_parse_packet_line_info(struct ndpi_detection_module_struct *ndpi_str,
if(packet->content_line.len > 0) {
/* application/json; charset=utf-8 */
- char *c = strchr((char*)packet->content_line.ptr, ';');
-
- if(c != NULL) {
- packet->content_line.len = c - (char*)packet->content_line.ptr;
+ char separator[] = { ';', '\r', '\0' };
+ int i;
+
+ for(i=0; separator[i] != '\0'; i++) {
+ char *c = memchr((char*)packet->content_line.ptr, separator[i], packet->content_line.len);
+
+ if(c != NULL)
+ packet->content_line.len = c - (char*)packet->content_line.ptr;
}
}