summaryrefslogtreecommitdiff
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-08-28 16:31:33 -0700
committerGuy Harris <guy@alum.mit.edu>2015-08-28 23:32:18 +0000
commit1663224c24b38dac3218c8690d1035f5b63a548f (patch)
treeb71b7ecc93d2754d5cb5219ac486f26c69d9f664 /wiretap
parent15c9923d642cb321854a05257b598e066f008b0b (diff)
downloadwireshark-1663224c24b38dac3218c8690d1035f5b63a548f.tar.gz
Block sizes are unsigned 32-bit quantities; don't stuff them into an int.
*Especially* don't stuff the amount of remaining data in a block into an int that will then be passed to file_skip() as an amount to skip ahead, as a Really Large Value will turn into a negative value and produce various forms of bizarre and tricky-to-debug behavior. Change-Id: I4d0a6b36fe50df84925690ad688a3ab0433ceb17 Reviewed-on: https://code.wireshark.org/review/10299 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/pcapng.c2
-rw-r--r--wiretap/pcapng_module.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c
index 603e5fc4db..8bc118800f 100644
--- a/wiretap/pcapng.c
+++ b/wiretap/pcapng.c
@@ -2161,7 +2161,7 @@ pcapng_read_interface_statistics_block(FILE_T fh, pcapng_block_header_t *bh, pca
static gboolean
pcapng_read_unknown_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *pn _U_, wtapng_block_t *wblock _U_, int *err, gchar **err_info)
{
- int block_read;
+ guint32 block_read;
guint32 block_total_length;
#ifdef HAVE_PLUGINS
block_handler *handler;
diff --git a/wiretap/pcapng_module.h b/wiretap/pcapng_module.h
index 1707a4d04f..c735380ab6 100644
--- a/wiretap/pcapng_module.h
+++ b/wiretap/pcapng_module.h
@@ -41,7 +41,7 @@
/*
* Reader and writer routines for pcap-ng block types.
*/
-typedef gboolean (*block_reader)(FILE_T, int, gboolean, struct wtap_pkthdr *,
+typedef gboolean (*block_reader)(FILE_T, guint32, gboolean, struct wtap_pkthdr *,
Buffer *, int *, gchar **);
typedef gboolean (*block_writer)(wtap_dumper *, const struct wtap_pkthdr *,
const guint8 *, int *);