diff options
author | Jessica Wagantall <jwagantall@cyngn.com> | 2016-08-02 11:02:19 -0700 |
---|---|---|
committer | Jessica Wagantall <jwagantall@cyngn.com> | 2016-08-02 11:37:45 -0700 |
commit | 705773dcb7d480586af0f88541c114d26aee3171 (patch) | |
tree | 29e443ad4a5d3822f066056866b9093524874d4d | |
parent | 4b473858028ff1a8bd328a8e788b35c2caaff609 (diff) | |
parent | a209ff12ba9617c10550678ff93d01fb72a33399 (diff) | |
download | frameworks_opt_net_wifi-705773dcb7d480586af0f88541c114d26aee3171.tar.gz frameworks_opt_net_wifi-705773dcb7d480586af0f88541c114d26aee3171.tar.bz2 frameworks_opt_net_wifi-705773dcb7d480586af0f88541c114d26aee3171.zip |
Merge tag 'android-6.0.1_r61' into HEAD
Android 6.0.1 Release 61 (MOB30Z)
Change-Id: Ica841d345cecfd7ea1aedfa360b5c1a28f915860
-rw-r--r-- | service/jni/com_android_server_wifi_WifiNative.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/service/jni/com_android_server_wifi_WifiNative.cpp b/service/jni/com_android_server_wifi_WifiNative.cpp index d2cbe11..a6d4f4e 100644 --- a/service/jni/com_android_server_wifi_WifiNative.cpp +++ b/service/jni/com_android_server_wifi_WifiNative.cpp @@ -763,15 +763,23 @@ static byte parseHexChar(char ch) { } static byte parseHexByte(const char * &str) { + if (str[0] == '\0') { + ALOGE("Passed an empty string"); + return 0; + } byte b = parseHexChar(str[0]); - if (str[1] == ':' || str[1] == '\0') { - str += 2; - return b; + if (str[1] == '\0' || str[1] == ':') { + str ++; } else { b = b << 4 | parseHexChar(str[1]); - str += 3; - return b; + str += 2; + } + + // Skip trailing delimiter if not at the end of the string. + if (str[0] != '\0') { + str++; } + return b; } static void parseMacAddress(const char *str, mac_addr addr) { |