cisco / joy

A package for capturing and analyzing network flow data and intraflow data, for network research, forensics, and security monitoring.
Other
1.31k stars 329 forks source link

Fixed case in http.c producing invalid JSON. #167

Closed aaronsaderholm closed 6 years ago

aaronsaderholm commented 6 years ago

This fixes a bug in http_print_header. Previously if it hit the length < 4 check it would produce an output similar to this:

"http": [ {
    "out":
} ]

Now it will print this:

"http":[ {
    "out": []
} ]

The original case is not valid JSON and will trip up JSON parsers such as python's json.loads().

fliphil commented 6 years ago

Thanks for catching this!