diff options
author | Ashvini Varatharaj <ashvinivaratharaj@gmail.com> | 2013-10-19 15:22:28 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-19 14:35:05 -0700 |
commit | f32eca7d6f962a9d8e998dc28a96665a9a7deb78 (patch) | |
tree | f634b3cf1ac64290605e321a629d740e2d756f08 /drivers/staging/dgnc | |
parent | e15b0c4eeb88ed5f37ed2e887b6610bd1aa44348 (diff) | |
download | talos-op-linux-f32eca7d6f962a9d8e998dc28a96665a9a7deb78.tar.gz talos-op-linux-f32eca7d6f962a9d8e998dc28a96665a9a7deb78.zip |
Staging: dgnc: avoiding buffer overflow
drivers/staging/dgnc/dgnc_neo.c:1969 neo_vpd() error: buffer overflow 'brd->vpd' 128 <= 128
drivers/staging/dgnc/dgnc_neo.c:1970 neo_vpd() warn: buffer overflow 'brd->vpd' 128 <= 130
drivers/staging/dgnc/dgnc_neo.c:1970 neo_vpd() warn: buffer overflow 'brd->vpd' 128 <= 130
Signed-off-by: Ashvini Varatharaj <ashvinivaratharaj@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/dgnc')
-rw-r--r-- | drivers/staging/dgnc/dgnc_neo.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c index 0e2a5e144cfe..dc5a138d8d4a 100644 --- a/drivers/staging/dgnc/dgnc_neo.c +++ b/drivers/staging/dgnc/dgnc_neo.c @@ -1965,7 +1965,7 @@ static void neo_vpd(struct dgnc_board *brd) } else { /* Search for the serial number */ - for (i = 0; i < NEO_VPD_IMAGESIZE * 2; i++) { + for (i = 0; i < NEO_VPD_IMAGEBYTES - 3; i++) { if (brd->vpd[i] == 'S' && brd->vpd[i + 1] == 'N') { strncpy(brd->serial_num, &(brd->vpd[i + 3]), 9); } |