The configuration parsing functions seemed to have worked fine before,
but these were real bugs even if they did not show up in practice.
hostapd_ip_diff() was broken for IPv6 addresses (overwrote address and
always returned 1.
os_memcpy(psk->addr, addr, ETH_ALEN);
pos = buf + 17;
- if (pos == '\0') {
+ if (*pos == '\0') {
printf("No PSK on line %d in '%s'\n", line, fname);
os_free(psk);
ret = -1;
return -1;
start = buf;
- while (start != '\0') {
+ while (*start != '\0') {
while (*start == ' ' || *start == '\t')
start++;
if (*start == '\0')
return -1;
start = buf;
- while (start != '\0') {
+ while (*start != '\0') {
while (*start == ' ' || *start == '\t')
start++;
if (*start == '\0')
break;
#ifdef CONFIG_IPV6
case AF_INET6:
- if (os_memcpy(&a->u.v6, &b->u.v6, sizeof(a->u.v6))
- != 0)
+ if (os_memcmp(&a->u.v6, &b->u.v6, sizeof(a->u.v6)) != 0)
return 1;
break;
#endif /* CONFIG_IPV6 */