diff options
author | Donald Sharp <sharpd@nvidia.com> | 2022-07-29 21:55:01 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2022-07-29 21:55:01 +0200 |
commit | c4a97dc54a86c59d36aab2f92f5617f00ebd5fcf (patch) | |
tree | 2e609aca26ef19397dc08f67e968397072be5cab /lib | |
parent | tests: Fix test_ospf_topo1 as that it sometimes fails (diff) | |
download | frr-c4a97dc54a86c59d36aab2f92f5617f00ebd5fcf.tar.xz frr-c4a97dc54a86c59d36aab2f92f5617f00ebd5fcf.zip |
lib: Coverity wants strlen to include null character
Ensure that the string has the null terminating character available
as well.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/yang_wrappers.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/yang_wrappers.c b/lib/yang_wrappers.c index bee76c6e0..ea21d1324 100644 --- a/lib/yang_wrappers.c +++ b/lib/yang_wrappers.c @@ -715,7 +715,7 @@ size_t yang_dnode_get_binary_buf(char *buf, size_t size, canon = YANG_DNODE_XPATH_GET_CANON(dnode, xpath_fmt); cannon_len = strlen(canon); - decode_len = cannon_len; + decode_len = cannon_len + 1; value_str = (char *)malloc(decode_len); base64_init_decodestate(&s); cnt = base64_decode_block(canon, cannon_len, value_str, &s); |