diff options
author | Tom Rini <trini@konsulko.com> | 2017-10-11 19:34:33 (GMT) |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-10-16 13:42:51 (GMT) |
commit | 59ee8f83b6e77550d5697fced4899e9b5173981f (patch) | |
tree | 1b1fa301031d679bedac1dd69d9441c08008fae5 /lib/sha256.c | |
parent | ecc9709fc12cc8e1a07b062d07cb8a5b296888d7 (diff) | |
download | u-boot-59ee8f83b6e77550d5697fced4899e9b5173981f.tar.xz |
cmd/pxe.c: Rework bootargs construction to clarify string checks
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 <trini@konsulko.com>
Diffstat (limited to 'lib/sha256.c')
0 files changed, 0 insertions, 0 deletions