Code Review
/
vpp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(from parent 1:
e57df7c
)
vat: fix static analysis warning
04/26404/3
author
Andreas Schultz
<andreas.schultz@travelping.com>
Tue, 7 Apr 2020 11:40:36 +0000
(13:40 +0200)
committer
Dave Barach
<openvpp@barachs.net>
Fri, 17 Apr 2020 19:09:28 +0000
(19:09 +0000)
replace hand crafted version with existing vector function
Type: fix
Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
Change-Id: I94834852469ed316c7bdbd48bb7f479648b2c8e5
src/vat/json_format.h
patch
|
blob
|
history
diff --git
a/src/vat/json_format.h
b/src/vat/json_format.h
index
260c32e
..
71db79e
100644
(file)
--- a/
src/vat/json_format.h
+++ b/
src/vat/json_format.h
@@
-94,8
+94,7
@@
vat_json_set_string_copy (vat_json_node_t * json, const u8 * str)
{
u8 *ns = NULL;
int len = strlen ((const char *) str);
- vec_validate (ns, len);
- memcpy ((char *) ns, (const char *) str, len + 1);
+ vec_validate_init_c_string (ns, str, len);
vat_json_set_string (json, ns);
}