From mboxrd@z Thu Jan 1 00:00:00 1970 From: Graeme Russ Date: Sun, 13 Nov 2011 22:43:19 +1100 Subject: [U-Boot] [PATCH v2] x86: Change printf to puts to avoid a buffer overflow In-Reply-To: <1321149776-14830-1-git-send-email-gabeblack@chromium.org> References: <4EBE48E3.8070606@gmail.com> <1321149776-14830-1-git-send-email-gabeblack@chromium.org> Message-ID: <4EBFAD57.30607@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 13/11/11 13:02, Gabe Black wrote: > printf as currently implemented in u-boot has a problem where it can > overflow an internal buffer if it prints an expanded string that's too > long. Our command lines are long enough to cause this problem. A fix > should be coming, but in the mean time this change replaces a problematic > printf with a few calls to puts that have the same effect. This may perform > slightly better because it should avoid a copy and scanning for format > specifiers. The amount of time it actually takes up is very tiny relative > to everything else so in practice that's probably irrelevant. > > Signed-off-by: Gabe Black Applied to u-boot-x86/master Thanks, Graeme