eap: check scanf return value (CID 1373396).

Change-Id: I4b602110fc3959dd7214fe15e9c37e3870794c1d
Reviewed-on: https://code.wireshark.org/review/17967
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
This commit is contained in:
Dario Lombardo 2016-09-28 13:59:52 +02:00
parent 148e4f77e9
commit 4f636d100e
1 changed files with 4 additions and 2 deletions

View File

@ -594,8 +594,10 @@ dissect_eap_identity_wlan(tvbuff_t *tvb, packet_info* pinfo, proto_tree* tree, i
dissect_e212_utf8_imsi(tvb, pinfo, eap_identity_tree, offset + 1, (guint)strlen(tokens[0]) - 1);
/* guess if we have a 3 bytes mnc by comparing the first bytes with the imsi */
sscanf(tokens[2] + 3, "%u", &mnc);
sscanf(tokens[3] + 3, "%u", &mcc);
if (!sscanf(tokens[2] + 3, "%u", &mnc) || !sscanf(tokens[3] + 3, "%u", &mcc)) {
ret = FALSE;
goto end;
}
if (!g_ascii_strncasecmp(tokens[0], tokens[2] + 3, 3)) {
mcc_mnc = 1000 * mcc + mnc;