rtl8188eu: Fix smatch warnings in core/rtw_efuse.c

Smatch reports the following warnings:

  CHECK   /home/finger/rtl8188eu/core/rtw_efuse.c
/home/finger/rtl8188eu/core/rtw_efuse.c:646 rtw_efuse_map_write() error: buffer overflow 'newdata' 8 <= 8
/home/finger/rtl8188eu/core/rtw_efuse.c:655 rtw_efuse_map_write() error: buffer overflow 'newdata' 8 <= 8
/home/finger/rtl8188eu/core/rtw_efuse.c:738 rtw_BT_efuse_map_write() error: buffer overflow 'newdata' 8 <= 8
/home/finger/rtl8188eu/core/rtw_efuse.c:747 rtw_BT_efuse_map_write() error: buffer overflow 'newdata' 8 <= 8

These are due to an off-by-one error in an array size.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2013-09-05 12:08:39 -05:00
parent 4769256ac2
commit 8f7fde8d6a

View file

@ -599,7 +599,7 @@ u8 rtw_efuse_map_write(struct adapter *padapter, u16 addr, u16 cnts, u8 *data)
{
u8 offset, word_en;
u8 *map;
u8 newdata[PGPKT_DATA_SIZE];
u8 newdata[PGPKT_DATA_SIZE + 1];
s32 i, idx;
u8 ret = _SUCCESS;
u16 mapLen = 0;
@ -691,7 +691,7 @@ u8 rtw_BT_efuse_map_write(struct adapter *padapter, u16 addr, u16 cnts, u8 *data
{
u8 offset, word_en;
u8 *map;
u8 newdata[PGPKT_DATA_SIZE];
u8 newdata[PGPKT_DATA_SIZE + 1];
s32 i, idx;
u8 ret = _SUCCESS;
u16 mapLen = 0;