From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Wed, 26 Jun 2013 13:35:44 +0200 Subject: [U-Boot] [PATCH] dfu:function: Fix number of allocated DFU function pointers In-Reply-To: <1372239973-25200-1-git-send-email-l.majewski@samsung.com> References: <1372239973-25200-1-git-send-email-l.majewski@samsung.com> Message-ID: <51CAD210.9020306@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Lukasz, Am 26.06.2013 11:46, schrieb Lukasz Majewski: > This subtle change fix problem with too small amount of allocated > memory to store DFU function pointers. > > One needs to allocate extra space for sentinel NULL pointer in this array > of function pointers. > > With the previous code, the NULL value overwrites malloc internal data > and afterwards free(f_dfu->function) crashes. > > Signed-off-by: Lukasz Majewski > Signed-off-by: Kyungmin Park > Cc: Marek Vasut > --- > drivers/usb/gadget/f_dfu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Acked-by: Heiko Schocher Thanks! bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany