From f937c32693868734f6c5481b17d28b1f05df447d Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Tue, 20 Sep 2011 13:25:15 +0200 Subject: [PATCH] Fix wrong buffer size in has_phy_80211_subdir() https://fedorahosted.org/sssd/ticket/1002 --- src/monitor/monitor_netlink.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/monitor/monitor_netlink.c b/src/monitor/monitor_netlink.c index 7bc90ef..b8c3967 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; -- 1.7.6