From 5d98dce1111f04475e0d14ace9a4bcb876206fa5 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Tue, 20 Sep 2011 13:25:15 +0200 Subject: Fix wrong buffer size in has_phy_80211_subdir() https://fedorahosted.org/sssd/ticket/1002 --- src/monitor/monitor_netlink.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/monitor') diff --git a/src/monitor/monitor_netlink.c b/src/monitor/monitor_netlink.c index 7bc90efc..b8c39672 100644 --- a/src/monitor/monitor_netlink.c +++ b/src/monitor/monitor_netlink.c @@ -64,7 +64,8 @@ #define SYSFS_IFACE_PATH_MAX (21+IFNAMSIZ) #define PHY_80211_SUBDIR "phy80211" -#define SYSFS_SUBDIR_PATH_MAX (SYSFS_IFACE_PATH_MAX+9) +/* 9 = strlen(PHY_80211_SUBDIR)+1, 1 = path delimeter */ +#define SYSFS_SUBDIR_PATH_MAX (SYSFS_IFACE_PATH_MAX+9+1) #define BUFSIZE 8 @@ -154,7 +155,7 @@ static bool has_ethernet_encapsulation(const char *sysfs_path) static bool has_phy_80211_subdir(const char *sysfs_path) { - char phy80211_path[SYSFS_IFACE_PATH_MAX]; + char phy80211_path[SYSFS_SUBDIR_PATH_MAX]; struct stat statbuf; errno_t ret; -- cgit