From: Tom Rini Date: Tue, 19 Jun 2018 14:40:21 -0400 Subject: [U-Boot] [U-Boot, v2, 3/8] sandbox: Use memcpy() to move overlapping regions In-Reply-To: <20180612060502.196817-4-sjg@chromium.org> References: <20180612060502.196817-4-sjg@chromium.org> Message-ID: <20180619184021.GR4609@bill-the-cat.ec.rr.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 Tue, Jun 12, 2018 at 12:04:57AM -0600, Simon Glass wrote: > The use of strcpy() to remove characters at the start of a string is safe > in U-Boot, since we know the implementation. But in os.c we are using the > C library's strcpy() function, where this behaviour is not permitted. > > Update the code to use memcpy() instead. > > Reported-by: Coverity (CID: 173279) > Signed-off-by: Simon Glass > --- > > Changes in v2: > - Also remove the leading / from the "/spl" path > > arch/sandbox/cpu/os.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) This ends up breaking the sandbox_spl portions of 'make tests. -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: