summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-09-20 13:25:15 +0200
committerStephen Gallagher <sgallagh@redhat.com>2011-09-20 10:43:11 -0400
commit5d98dce1111f04475e0d14ace9a4bcb876206fa5 (patch)
tree26f9807036ca38376bf4e6b241089298e6b4d108 /src
parentfa3db4695a82b09cab30d0499114159b836e6357 (diff)
downloadsssd-5d98dce1111f04475e0d14ace9a4bcb876206fa5.tar.gz
sssd-5d98dce1111f04475e0d14ace9a4bcb876206fa5.tar.xz
sssd-5d98dce1111f04475e0d14ace9a4bcb876206fa5.zip
Fix wrong buffer size in has_phy_80211_subdir()
https://fedorahosted.org/sssd/ticket/1002
Diffstat (limited to 'src')
-rw-r--r--src/monitor/monitor_netlink.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/monitor/monitor_netlink.c b/src/monitor/monitor_netlink.c
index 7bc90efc4..b8c396723 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;