diff options
author | Dario Lombardo <lomato@gmail.com> | 2016-10-11 09:29:26 +0200 |
---|---|---|
committer | Dario Lombardo <lomato@gmail.com> | 2016-10-13 15:11:25 +0000 |
commit | fcbb77191bbae90b1b193e9b3d7dc57610e444ca (patch) | |
tree | 930f4ce3f0ea582c25755a765536834cb56259d5 /epan | |
parent | 2534b8ece13136ddd3a6e12c7bb6c2acce0f77dc (diff) |
iso8583: use unsigned and fix bug in conversion routine.
Change-Id: I0ba30bda3abec004f51f9402d65c38b3b1081113
Reviewed-on: https://code.wireshark.org/review/18144
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Paulo Roberto Brandão <betobrandao@gmail.com>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-iso8583.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/epan/dissectors/packet-iso8583.c b/epan/dissectors/packet-iso8583.c index 1673bf3053..dd44607635 100644 --- a/epan/dissectors/packet-iso8583.c +++ b/epan/dissectors/packet-iso8583.c @@ -383,7 +383,7 @@ static struct iso_type *data_array = NULL; static gint charset_pref = ASCII_CHARSET; static gint bin_encode_pref = BIN_ASCII_ENC; -static gint iso8583_len=-1; /* # of bytes captured by the dissector */ +static guint32 iso8583_len = 0; /* # of bytes captured by the dissector */ static gint len_byte_order = LITEND; /* @@ -602,12 +602,12 @@ static guint64 hex2bin(const char* hexstr, int len) if((offset -2 + len) > iso8583_len)\ return NULL -static gchar *get_bit(guint ind, tvbuff_t *tvb, gint *off_set, proto_tree *tree, proto_item **exp, gint *length ) +static gchar *get_bit(guint ind, tvbuff_t *tvb, guint *off_set, proto_tree *tree, proto_item **exp, gint *length ) { gchar aux[1024]; gchar* ret=NULL; - gint len; - gint offset = *off_set; + guint32 len; + guint offset = *off_set; gboolean str_input = FALSE; /* Check if it is a fixed or variable length @@ -624,13 +624,13 @@ static gchar *get_bit(guint ind, tvbuff_t *tvb, gint *off_set, proto_tree *tree, { case ASCII_CHARSET: { + guint8* sizestr; checksize(len); - if (!ws_strtoi32(tvb_get_string_enc(wmem_packet_scope(), tvb, offset, - len , ENC_ASCII), NULL, &len)) + sizestr = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len , ENC_ASCII); + offset += len; + if (!ws_strtou32(sizestr, NULL, &len)) return NULL; - - offset+=len; break; } case NUM_NIBBLE_CHARSET: @@ -736,7 +736,7 @@ static gchar *get_bit(guint ind, tvbuff_t *tvb, gint *off_set, proto_tree *tree, } -static int get_bitmap(tvbuff_t *tvb, guint64* bitmap, gint offset, gint* nbitmaps) +static int get_bitmap(tvbuff_t *tvb, guint64* bitmap, guint offset, gint* nbitmaps) { gchar* hexbit; gint i; |