diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-03-23 20:11:46 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-03-23 20:11:46 +0000 |
commit | 501ea346d12eaf6da7be5993af811fcc27ca02c3 (patch) | |
tree | e643cfe0e19ef574e8d71e397c3285cb5d8f1ba9 /packet-wtp.c | |
parent | c400685ad612683be83c4b6ba0263d706ed8d508 (diff) | |
download | wireshark-501ea346d12eaf6da7be5993af811fcc27ca02c3.tar.gz wireshark-501ea346d12eaf6da7be5993af811fcc27ca02c3.tar.bz2 wireshark-501ea346d12eaf6da7be5993af811fcc27ca02c3.zip |
Don't convert a WTP PDU type to a string by using as an index into a
"value_string" array, do it the right way, by using "val_to_str()" - the
PDU type is 4 bits, but there aren't 16 entries in the array, so a bogus
PDU type (*don't* assume that can't happen...) can cause a core dump.
svn path=/trunk/; revision=3169
Diffstat (limited to 'packet-wtp.c')
-rw-r--r-- | packet-wtp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/packet-wtp.c b/packet-wtp.c index 5245f08754..73cfe76602 100644 --- a/packet-wtp.c +++ b/packet-wtp.c @@ -2,7 +2,7 @@ * * Routines to dissect WTP component of WAP traffic. * - * $Id: packet-wtp.c,v 1.11 2001/02/13 00:17:54 guy Exp $ + * $Id: packet-wtp.c,v 1.12 2001/03/23 20:11:46 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -243,7 +243,8 @@ dissect_wtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) pdut = pdu_type( b0 ); /* Develop the string to put in the Info column */ - cchInfo = snprintf( szInfo, sizeof( szInfo ), "WTP %s", vals_pdu_type[ ( int )pdut ].strptr ); + cchInfo = snprintf( szInfo, sizeof( szInfo ), "WTP %s", + val_to_str(pdut, vals_pdu_type, "Unknown PDU type 0x%x")); switch( pdut ) { case INVOKE: |