xentop will segmentation fault in this case:
# ip link set eth1 down
# ip link set eth1 name ETH
# xentop
This patch will let xentop to handle all uppercase network interface name.
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
}
else
/* There were errors when parsing this directly in RE. strpbrk() helps */
- if (iface != NULL)
- strcpy(iface, strpbrk(tmp, "abcdefghijklmnopqrstvuwxyz0123456789"));
+ if (iface != NULL) {
+ char *tmp2 = strpbrk(tmp, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
+ if (tmp2 != NULL)
+ strcpy(iface, tmp2);
+ }
memset(tmp, 0, matches[i].rm_eo - matches[i].rm_so);
}