From 1f018b8e1d4187fccb297b3481064cb196230ce7 Mon Sep 17 00:00:00 2001 From: = <=> Date: Sun, 4 Feb 2024 11:34:39 +0100 Subject: [PATCH] increase driver link buffer --- hcxdumptool.c | 10 +++++----- include/hcxdumptool.h | 4 ++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/hcxdumptool.c b/hcxdumptool.c index 82cf3fe90..3183acbc1 100644 --- a/hcxdumptool.c +++ b/hcxdumptool.c @@ -3289,8 +3289,8 @@ static struct genlmsghdr *glh; static struct nlattr *nla; static struct nlmsgerr *nle; static char *drivername = NULL; -static char driverfmt[128] = { 0 }; -static char driverlink[128] = { 0 }; +static char driverfmt[DRIVER_FORMAT] = { 0 }; +static char driverlink[DRIVER_LINK] = { 0 }; nlh = (struct nlmsghdr*)nltxbuffer; nlh->nlmsg_type = nlfamily; @@ -3336,9 +3336,9 @@ while(1) if(nla->nla_type == NL80211_ATTR_WIPHY) { (ifpresentlist + ii)->wiphy = *((u32*)nla_data(nla)); - snprintf(driverfmt, 64, "/sys/class/ieee80211/phy%d/device/driver", (ifpresentlist + ii)->wiphy); - memset(&driverlink, 0, 128); - if((dnlen = readlink(driverfmt, driverlink, 64)) > 0) + snprintf(driverfmt, DRIVER_FORMAT, "/sys/class/ieee80211/phy%d/device/driver", (ifpresentlist + ii)->wiphy); + memset(&driverlink, 0, DRIVER_LINK); + if((dnlen = readlink(driverfmt, driverlink, DRIVER_LINK)) > 0) { drivername = basename(driverlink); if(drivername != NULL) strncpy((ifpresentlist + ii)->driver, drivername, DRIVERNAME_MAX -1); diff --git a/include/hcxdumptool.h b/include/hcxdumptool.h index bfbea8d2b..a996a6657 100644 --- a/include/hcxdumptool.h +++ b/include/hcxdumptool.h @@ -96,6 +96,10 @@ #define EAPOLM2TIMEOUT 20000000ULL #define EAPOLM3TIMEOUT 20000000ULL + +#define DRIVER_FORMAT 128 +#define DRIVER_LINK 128 + #define RCAD_MAX 40 #define PROBERESPONSETX_MAX 5