From: Tom Rini Date: Sat, 7 Oct 2017 09:09:08 -0400 Subject: [U-Boot] cmd/nvedit.c: Update input handling to cover overflow cases In-Reply-To: <1506469031-11572-1-git-send-email-trini@konsulko.com> References: <1506469031-11572-1-git-send-email-trini@konsulko.com> Message-ID: <20171007130908.GF25966@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, Sep 26, 2017 at 07:37:11PM -0400, Tom Rini wrote: > When we have multiple messages provided, we need to be sure that we do > not exceed the length of our 'message' buffer. In the for loop, make > sure that pos is not larger than message. Only copy in at most however > much of the message buffer remains. Finally, if we have not reached the > end of the message buffer, put in a space and NULL, and if we have, > ensure the buffer is now NULL termined. > > Reported-by: Coverity (CID: 165116) > Signed-off-by: Tom Rini 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: