From 7f2b6c9a360777369ffd31a1d1844f1c3cf3f5e2 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Wed, 30 Jan 2019 01:26:55 -0600 Subject: [PATCH] Overanalyzing --- src/pcapng.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/pcapng.c b/src/pcapng.c index c71140e..0e24acf 100644 --- a/src/pcapng.c +++ b/src/pcapng.c @@ -11,7 +11,8 @@ ssize_t hexagram_pcapng_read_options(hexagram_pcapng_stream *stream, hexagram_pcapng_option_handler *handler, uint32_t type, - size_t len) { + size_t len, + void *data) { hexagram_pcapng_option option; ssize_t total = 0; @@ -26,7 +27,7 @@ ssize_t hexagram_pcapng_read_options(hexagram_pcapng_stream *stream, total += readlen; } - if ((readlen = handler(stream, type, option.code, option.length)) < 0) { + if ((readlen = handler(stream, type, option.code, option.length, data)) < 0) { goto error_io; } else if (readlen < option.length) { stream->error = HEXAGRAM_PCAPNG_ERROR_TRUNCATED; @@ -79,7 +80,8 @@ void hexagram_pcapng_stream_destroy(hexagram_pcapng_stream *stream) { } ssize_t hexagram_pcapng_stream_read(hexagram_pcapng_stream *stream, - hexagram_pcapng_block_handler *handler) { + hexagram_pcapng_block_handler *handler, + void *data) { hexagram_pcapng_block_header header; hexagram_pcapng_block_footer footer; ssize_t total = 0; @@ -104,7 +106,7 @@ ssize_t hexagram_pcapng_stream_read(hexagram_pcapng_stream *stream, expected = header.length - sizeof(header) - sizeof(footer); - if ((readlen = handler(stream, header.type, expected)) < 0) { + if ((readlen = handler(stream, header.type, expected, data)) < 0) { goto error_io; } else { total += readlen;