diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-10-08 15:48:37 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-10-08 22:49:08 +0000 |
commit | d1ec1e85f8ff7800843952b69a196f0fa4e58f0e (patch) | |
tree | 0196dcaea0b3a0e9a035b8f84653fa9ae49f22c7 /wiretap | |
parent | 0066776f729742982014b8828c7fdfbf0d544c10 (diff) |
Use WTAP_ERR_DECOMPRESS for decompression errors.
Distringuish "the compression data has a problem" from "the capture file
(not compressed, or after decompression) data has a problem", with
WTAP_ERR_DECOMPRESS used for the former (whether it's the gzipping
decoded by our gunzip code or the Sniffer compression) and
WTAP_ERR_BAD_FILE used for the latter.
Change-Id: I8e6bff7edb480deba00c52a9e5afff607492e085
Reviewed-on: https://code.wireshark.org/review/4568
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/ngsniffer.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/wiretap/ngsniffer.c b/wiretap/ngsniffer.c index ce6fd45676..df4b30cc6e 100644 --- a/wiretap/ngsniffer.c +++ b/wiretap/ngsniffer.c @@ -2180,7 +2180,7 @@ ngsniffer_dump_close(wtap_dumper *wdh, int *err) record at the end. outlen - length of outbuf. err - return error code here - err_info - for WTAP_ERR_BAD_FILE, return descriptive string here + err_info - for WTAP_ERR_DECOMPRESS, return descriptive string here Return value is the number of bytes in outbuf on return. */ @@ -2192,7 +2192,7 @@ ngsniffer_dump_close(wtap_dumper *wdh, int *err) #define CHECK_INPUT_POINTER( length ) \ if ( pin + (length - 1) >= pin_end ) \ { \ - *err = WTAP_ERR_BAD_FILE; \ + *err = WTAP_ERR_DECOMPRESS; \ *err_info = g_strdup("ngsniffer: Compressed data item goes past the end of the compressed block"); \ return ( -1 ); \ } @@ -2243,14 +2243,14 @@ ngsniffer_dump_close(wtap_dumper *wdh, int *err) /* Check if offset would put us back past begin of buffer */ \ if ( pout - offset < outbuf ) \ { \ - *err = WTAP_ERR_BAD_FILE; \ + *err = WTAP_ERR_DECOMPRESS; \ *err_info = g_strdup("ngsniffer: LZ77 compressed data has bad offset to string"); \ return ( -1 ); \ } \ /* Check if offset would cause us to copy on top of ourselves */ \ if ( pout - offset + length > pout ) \ { \ - *err = WTAP_ERR_BAD_FILE; \ + *err = WTAP_ERR_DECOMPRESS; \ *err_info = g_strdup("ngsniffer: LZ77 compressed data has bad offset to string"); \ return ( -1 ); \ } \ |