From: Donald Sharp Date: Fri, 29 Jul 2022 19:55:01 +0000 (-0400) Subject: lib: Coverity wants strlen to include null character X-Git-Tag: base_8.4~173^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=c4a97dc54a86c59d36aab2f92f5617f00ebd5fcf;p=matthieu%2Ffrr.git 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 --- diff --git a/lib/yang_wrappers.c b/lib/yang_wrappers.c index bee76c6e0f..ea21d1324b 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);