aboutsummaryrefslogtreecommitdiff
path: root/pcap-netmap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-10-17 00:59:40 -0700
committerGuy Harris <guy@alum.mit.edu>2018-10-17 00:59:40 -0700
commitbcbef226ca11662342b5e267e7f12066bcfd60d0 (patch)
treea5d4f2473df643590eed03b4e9e0eee99da0a588 /pcap-netmap.c
parentdb833b997d9d825a4bb0e78804d85552b38a562a (diff)
Plug some memory leaks.
For ARCNET and MAC addresses, don't convert them to binary until we get to gen_acode() and gen_ecode(); instead, just save the string in a buffe that's allocated in a way that gets cleaned up when the parser finishes, the same way we do for some other string tokens. Otherwise, if the parser fails before we get to free it, it gets leaked; that was happening. Save the generated binary address in the parser state until we're done with it, so that, if a call that uses the parser state calls bpf_error(), the generated binary address gets freed. Credit to OSS-Fuzz for finding this issue.
Diffstat (limited to 'pcap-netmap.c')
0 files changed, 0 insertions, 0 deletions