Search Linux Wireless

[PATCH 12/35] Fix hex2str() and mac2str() to avoid buffer overlap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Declarations for two-dimensional arrays were written backwards.

Signed-off-by: Pavel Roskin <proski@xxxxxxx>
---

 drivers/net/wireless/at76_usb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/drivers/net/wireless/at76_usb.c b/drivers/net/wireless/at76_usb.c
index 6ad6248..2ed80eb 100644
--- a/drivers/net/wireless/at76_usb.c
+++ b/drivers/net/wireless/at76_usb.c
@@ -474,7 +474,7 @@ static inline void at76_iwevent_bss_disconnect(struct net_device *netdev)
 static char *hex2str(void *buf, int len)
 {
 	static atomic_t a = ATOMIC_INIT(0);
-	static char bufs[3 * HEX2STR_MAX_LEN + 1][HEX2STR_BUFFERS];
+	static char bufs[HEX2STR_BUFFERS][3 * HEX2STR_MAX_LEN + 1];
 	char *ret = bufs[atomic_inc_return(&a) & (HEX2STR_BUFFERS - 1)];
 	char *obuf = ret;
 	u8 *ibuf = buf;
@@ -503,7 +503,7 @@ static char *hex2str(void *buf, int len)
 static inline char *mac2str(u8 *mac)
 {
 	static atomic_t a = ATOMIC_INIT(0);
-	static char bufs[6 * 3][MAC2STR_BUFFERS];
+	static char bufs[MAC2STR_BUFFERS][6 * 3];
 	char *str;
 
 	str = bufs[atomic_inc_return(&a) & (MAC2STR_BUFFERS - 1)];
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux