diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2017-09-17 21:15:08 +0200 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2017-09-17 20:01:34 +0000 |
commit | e77d4dffff3eb189cd9e1cbb7ee9c7561f439999 (patch) | |
tree | 3313813afce56bbed62e29c9d05120559742d0ee /epan/dissectors/asn1/rrc | |
parent | 17651065a57f912ebb11d731d50a2245cbeda494 (diff) |
RRC: check wmem_strbuf_t pointer before using it
Digit field is also ussed by other fields than PLMN-Identity and
IMSI-GSM-MAP
Bug: 14069
Change-Id: Ic8cf4dc148fecf24e28ef1be21c3968d46e4b456
Reviewed-on: https://code.wireshark.org/review/23590
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/asn1/rrc')
-rw-r--r-- | epan/dissectors/asn1/rrc/rrc.cnf | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/epan/dissectors/asn1/rrc/rrc.cnf b/epan/dissectors/asn1/rrc/rrc.cnf index f0a01b5a8e..7ee9b77b03 100644 --- a/epan/dissectors/asn1/rrc/rrc.cnf +++ b/epan/dissectors/asn1/rrc/rrc.cnf @@ -753,7 +753,6 @@ HandoverFromUTRANCommand-GSM-r6-IEs/gsm-message/single-GSM-Message single-GSM-Me #.FN_BODY Digit VAL_PTR = &digit guint32 digit; - gchar digit_char; wmem_strbuf_t* digits_strbuf; /* The string of either an IMSI or a MCC-MNC pair */ %(DEFAULT_BODY)s @@ -762,16 +761,20 @@ HandoverFromUTRANCommand-GSM-r6-IEs/gsm-message/single-GSM-Message single-GSM-Me } digits_strbuf = private_data_get_digits_strbuf(actx); - if(digit > 9) { - private_data_set_digits_strbuf_parsing_failed_flag(actx, TRUE); - return offset; - } + if (digits_strbuf) { + gchar digit_char; + + if(digit > 9) { + private_data_set_digits_strbuf_parsing_failed_flag(actx, TRUE); + return offset; + } - /* Converting to the matching gchar */ - digit_char = (gchar)(digit + '0'); + /* Converting to the matching gchar */ + digit_char = (gchar)(digit + '0'); - /* Appending to the digits string */ - wmem_strbuf_append_c(digits_strbuf, digit_char); + /* Appending to the digits string */ + wmem_strbuf_append_c(digits_strbuf, digit_char); + } #.FN_BODY RSR-VCC-Info/ims-Information VAL_PTR = &imsInformation_tvb tvbuff_t *imsInformation_tvb=NULL; |