From: Tom Rini Date: Thu, 26 Jul 2018 15:54:11 -0400 Subject: [U-Boot] mtdparts: fixed buffer overflow bug In-Reply-To: <20180717061939.6034-1-Kay.Potthoff@microsys.de> References: <20180717061939.6034-1-Kay.Potthoff@microsys.de> Message-ID: <20180726195411.GH7590@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 Tue, Jul 17, 2018 at 08:19:39AM +0200, Kay Potthoff wrote: > In the case that there was no name defined for a partition the > code assumes that name_len is 22 and therefore allocates exactly > that space for a dummy name. But the function sprintf() first > resolves "0x%08llx at 0x%08llx" to a string that is longer than 22 > bytes. This leads to a buffer overflow. The replacement function > snprintf() limits the copied bytes to name_len and therefore > avoids the buffer overflow. > > Signed-off-by: Kay Potthoff Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: