Code:  static byte parseHexByte(const char * &str) {
     byte b = parseHexChar(str[0]);
    if (str[1] == ':' || str[1] == '\0') {
        str += 2;
        return b;
     } else {
         b = b << 4 | parseHexChar(str[1]);
        str += 3;
        return b;
     }
 }

Vulnerability Type: +Info 
CWE ID: CWE-200
Summary: service/jni/com_android_server_wifi_WifiNative.cpp in Wi-Fi in Android 5.0.x before 5.0.2, 5.1.x before 5.1.1, and 6.x before 2016-08-01 allows attackers to obtain sensitive information via a crafted application that provides a MAC address with too few characters, aka internal bug 28164077.
Commit Message: 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
