From: Patrik Flykt Date: Mon, 14 May 2012 12:20:44 +0000 (+0300) Subject: config: Reject invalid SSID hexadecimal entries X-Git-Tag: 2.0_alpha~205 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9d4a0b844ae47893e2b928556901c22756f1d47c;p=framework%2Fconnectivity%2Fconnman.git config: Reject invalid SSID hexadecimal entries Reject provisioning .config file SSID entries that are not in hexadecimal. --- diff --git a/src/config.c b/src/config.c index 781427d..66e1316 100644 --- a/src/config.c +++ b/src/config.c @@ -258,7 +258,13 @@ static int load_service(GKeyFile *keyfile, const char *group, } for (i = 0; i < hex_ssid_len; i += 2) { - sscanf(hex_ssid + i, "%02x", &hex); + if (sscanf(hex_ssid + i, "%02x", &hex) <= 0) { + connman_warn("Invalid SSID %s", hex_ssid); + g_free(ssid); + g_free(hex_ssid); + err = -EILSEQ; + goto err; + } ssid[j++] = hex; }