From: Maulik Mankad Date: Tue, 22 Dec 2009 10:49:53 +0000 (+0530) Subject: USB: musb: Fix array index out of bounds issue X-Git-Tag: v2.6.33-rc2~11^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ea52ff44f7a30781881ca2debf35e47b2676171;p=platform%2Fkernel%2Flinux-stable.git USB: musb: Fix array index out of bounds issue This patch fixes the below array index out of bounds issue. Buffer overflow, array index of 'aInfo' may be out of bounds. Array 'aInfo' of size 78 may use index value(s) 6..84 The data stored in 'aInfo' array exceeds the array size of 78. This patch increases the size of this array to hold the string correctly without any memory corruption. This issue was reported by Klockwork tool. Signed-off-by: Maulik Mankad Cc: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 24ff097..5eb9318 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1319,7 +1319,7 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb) #endif u8 reg; char *type; - char aInfo[78], aRevision[32], aDate[12]; + char aInfo[90], aRevision[32], aDate[12]; void __iomem *mbase = musb->mregs; int status = 0; int i;