aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/ndpi_main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index 897f16492..7a2d5a01e 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -5092,9 +5092,13 @@ 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, ';');
+ char separator[] = { ';', '\r', '\0' };
+ int i;
- if(c != NULL) {
+ for(i=0; separator[i] != '\0'; i++) {
+ char *c = strchr((char*)packet->content_line.ptr, separator[i]);
+
+ if(c != NULL)
packet->content_line.len = c - (char*)packet->content_line.ptr;
}
}