mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
ctype functions require an unsigned char
Ensure that characters are represented as unsigned char when using isblank() and isspace(). These function take in a "int c" argument, but it needs to be unsigned for the cases where EOF is not indicated. Signed-off-by: Roy Marples <roy@marples.name>
This commit is contained in:
parent
a5a3efccc2
commit
640b0b933a
@ -1877,13 +1877,13 @@ static int hostapd_ctrl_iface_vendor(struct hostapd_data *hapd, char *cmd,
|
||||
|
||||
/* cmd: <vendor id> <subcommand id> [<hex formatted data>] */
|
||||
vendor_id = strtoul(cmd, &pos, 16);
|
||||
if (!isblank(*pos))
|
||||
if (!isblank((unsigned char) *pos))
|
||||
return -EINVAL;
|
||||
|
||||
subcmd = strtoul(pos, &pos, 10);
|
||||
|
||||
if (*pos != '\0') {
|
||||
if (!isblank(*pos++))
|
||||
if (!isblank((unsigned char) *pos++))
|
||||
return -EINVAL;
|
||||
data_len = os_strlen(pos);
|
||||
}
|
||||
|
@ -183,12 +183,12 @@ wpa_get_wowlan_triggers(const char *wowlan_triggers,
|
||||
|
||||
start = buf;
|
||||
while (*start != '\0') {
|
||||
while (isblank(*start))
|
||||
while (isblank((unsigned char) *start))
|
||||
start++;
|
||||
if (*start == '\0')
|
||||
break;
|
||||
end = start;
|
||||
while (!isblank(*end) && *end != '\0')
|
||||
while (!isblank((unsigned char) *end) && *end != '\0')
|
||||
end++;
|
||||
last = *end == '\0';
|
||||
*end = '\0';
|
||||
|
@ -86,7 +86,7 @@ int hwaddr_masked_aton(const char *txt, u8 *addr, u8 *mask, u8 maskable)
|
||||
return -1;
|
||||
|
||||
/* check for optional mask */
|
||||
if (*r == '\0' || isspace(*r)) {
|
||||
if (*r == '\0' || isspace((unsigned char) *r)) {
|
||||
/* no mask specified, assume default */
|
||||
os_memset(mask, 0xff, ETH_ALEN);
|
||||
} else if (maskable && *r == '/') {
|
||||
|
@ -4712,7 +4712,7 @@ static int p2ps_ctrl_parse_cpt_priority(const char *pos, u8 *cpt)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (isblank(*last)) {
|
||||
if (isblank((unsigned char) *last)) {
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
@ -6917,13 +6917,13 @@ static int wpa_supplicant_vendor_cmd(struct wpa_supplicant *wpa_s, char *cmd,
|
||||
|
||||
/* cmd: <vendor id> <subcommand id> [<hex formatted data>] */
|
||||
vendor_id = strtoul(cmd, &pos, 16);
|
||||
if (!isblank(*pos))
|
||||
if (!isblank((unsigned char) *pos))
|
||||
return -EINVAL;
|
||||
|
||||
subcmd = strtoul(pos, &pos, 10);
|
||||
|
||||
if (*pos != '\0') {
|
||||
if (!isblank(*pos++))
|
||||
if (!isblank((unsigned char) *pos++))
|
||||
return -EINVAL;
|
||||
data_len = os_strlen(pos);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user