From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Mon, 27 Jan 2014 09:53:03 -0500 Subject: [U-Boot] lib: fix return codes when CONFIG_SYS_VSNPRINTF is enabled In-Reply-To: <1387494859-25158-1-git-send-email-drambo@broadcom.com> References: <1387494859-25158-1-git-send-email-drambo@broadcom.com> Message-ID: <20140127145303.GF3277@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 Thu, Dec 19, 2013 at 03:14:19PM -0800, Darwin Rambo wrote: > When CONFIG_SYS_VSNPRINTF is enabled, it protects print operations > such as sprintf, snprintf, vsnprintf, etc., from buffer overflows. > But vsnprintf_internal includes the terminating NULL character in > the calculation of number of characters written. This affects sprintf > and snprintf return values. Fix this issue by setting pointer 'str' > back to the location of the '\0'. > > Signed-off-by: Darwin Rambo > Reviewed-by: Steve Rae 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: