summaryrefslogtreecommitdiffstats
path: root/service/java/com
diff options
context:
space:
mode:
authorPaul Stewart <pstew@google.com>2016-05-31 17:31:03 -0700
committerThe Android Automerger <android-build@google.com>2016-06-23 15:06:32 -0700
commita209ff12ba9617c10550678ff93d01fb72a33399 (patch)
tree1d023f32ee9f59c3174e94700cd9f08e4d0a63e4 /service/java/com
parent7a0e978a5ba16f237c7ef8aac9cb6154d2d183bd (diff)
downloadframeworks_opt_net_wifi-a209ff12ba9617c10550678ff93d01fb72a33399.tar.gz
frameworks_opt_net_wifi-a209ff12ba9617c10550678ff93d01fb72a33399.tar.bz2
frameworks_opt_net_wifi-a209ff12ba9617c10550678ff93d01fb72a33399.zip
Deal correctly with short strings
The parseMacAddress function anticipates only properly formed MAC addresses (6 hexadecimal octets separated by ":"). This change properly deals with situations where the string is shorter than expected, making sure that the passed in char* reference in parseHexByte never exceeds the end of the string. BUG: 28164077 TEST: Added a main function: int main(int argc, char **argv) { unsigned char addr[6]; if (argc > 1) { memset(addr, 0, sizeof(addr)); parseMacAddress(argv[1], addr); printf("Result: %02x:%02x:%02x:%02x:%02x:%02x\n", addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); } } Tested with "", "a" "ab" "ab:c" "abxc". Change-Id: I0db8d0037e48b62333d475296a45b22ab0efe386
Diffstat (limited to 'service/java/com')
0 files changed, 0 insertions, 0 deletions