From: Michał Kępień Date: Wed, 16 Oct 2019 20:06:00 +0000 (+0200) Subject: Suppress cppcheck 1.89 false positive X-Git-Tag: v9.15.6~57^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db7fd16346317600f6e1da0c25d50c37fddcf681;p=thirdparty%2Fbind9.git Suppress cppcheck 1.89 false positive cppcheck 1.89 emits a false positive for lib/dns/spnego_asn1.c: lib/dns/spnego_asn1.c:698:9: error: Uninitialized variable: data [uninitvar] memset(data, 0, sizeof(*data)); ^ lib/dns/spnego.c:1707:47: note: Calling function 'decode_NegTokenResp', 3rd argument '&resp' value is ret = decode_NegTokenResp(buf + taglen, len, &resp, NULL); ^ lib/dns/spnego_asn1.c:698:9: note: Uninitialized variable: data memset(data, 0, sizeof(*data)); ^ This message started appearing with cppcheck 1.89 [1], but it will be gone in the next release [2], so just suppress it for the time being. [1] https://github.com/danmar/cppcheck/commit/af214e8212efa303e664920a468de00ee0b1fe3d [2] https://github.com/danmar/cppcheck/commit/2595b826349a7ffbe1c958b806498b6e336bea33 --- diff --git a/lib/dns/spnego_asn1.c b/lib/dns/spnego_asn1.c index 921994c2e8c..e8e7fc5337d 100644 --- a/lib/dns/spnego_asn1.c +++ b/lib/dns/spnego_asn1.c @@ -695,6 +695,7 @@ decode_NegTokenResp(const unsigned char *p, size_t len, NegTokenResp * data, siz size_t l; int e; + /* cppcheck-suppress uninitvar */ memset(data, 0, sizeof(*data)); reallen = 0; e = der_match_tag_and_length(p, len, ASN1_C_UNIV, CONS, UT_Sequence, &reallen, &l);