diff options
author | Jiri Pirko <jiri@resnulli.us> | 2013-12-18 13:26:49 +0100 |
---|---|---|
committer | Jiri Pirko <jiri@resnulli.us> | 2013-12-18 13:26:49 +0100 |
commit | 4376e752c822444f1a26b5e1e974ddd7104ae15c (patch) | |
tree | 5dcfe1c111bc7464091d17343edd897e178b82c9 /include | |
parent | 98bdaa1cb94faff0ccf992abc40a352ea16640fa (diff) | |
download | libndp-4376e752c822444f1a26b5e1e974ddd7104ae15c.tar.gz |
libndp: fix [cppcheck] Undefined behavior: Variable 'buf' is used as parameter and destination in s[n]printf()
cppcheck --enable=all --inconclusive --std=posix .
ndp_msg_opt_dnssl_domain():
if (dom_len > len)
return NULL;
if (strlen(buf))
----> sprintf(buf, "%s.", buf);
buf[strlen(buf) + dom_len] = '\0';
memcpy(buf + strlen(buf), ptr, dom_len);
So just use strcat instead.
Reported-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions