From: Tom Rini Date: Mon, 16 Oct 2017 20:48:05 -0400 Subject: [U-Boot] cmd/pxe.c: Rework bootargs construction to clarify string checks In-Reply-To: <1507750473-10998-1-git-send-email-trini@konsulko.com> References: <1507750473-10998-1-git-send-email-trini@konsulko.com> Message-ID: <20171017004805.GU12015@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, Oct 11, 2017 at 03:34:33PM -0400, Tom Rini wrote: > As the code currently stands, we first check that the length of the > given command line, along with ip_str/mac_str along with an additional 1 > for the NULL termination will fit within the buffer we have, and if not, > we return an error. The way this code was originally written however > left Coverity "unhappy" due to using strcat rather than strncat. > Switching this to strncat however causes clang to be unhappy that we > aren't enforcing the "1" portion within strncat. Rather than further > re-work the code to include a "- 1" in this case as well, make the > strcat code only be done within the else side of the length test. This > keeps both clang and Coverity happy. > > Fixes: 48ee0a87bc46 ("cmd/pxe.c: Rework initrd and bootargs handling slightly") > 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: