From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Thu, 19 Jun 2014 11:20:02 -0400 Subject: [U-Boot] [U-Boot, v2] libfdt: Fix segfault when calling fit_check_format() on corrupt FIT images In-Reply-To: <1393432341-1654-1-git-send-email-trini@ti.com> References: <1393432341-1654-1-git-send-email-trini@ti.com> Message-ID: <20140619152002.GD20480@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Feb 26, 2014 at 11:32:21AM -0500, Tom Rini wrote: > From: Jon Nalley > > It has been observed that fit_check_format() will fail when passed a > corrupt FIT image. This was tracked down to _fdt_string_eq(): > return (strlen(p) == len) && (memcmp(p, s, len) == 0); > > In the case of a corrupt FIT image one can't depend on 'p' being NULL > terminated. I changed it to use strnlen() to fix the issue. > > Signed-off-by: Tom Rini Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: