]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Suppress cppcheck 1.89 false positive
authorMichał Kępień <michal@isc.org>
Wed, 16 Oct 2019 20:06:00 +0000 (22:06 +0200)
committerMichał Kępień <michal@isc.org>
Thu, 17 Oct 2019 08:52:19 +0000 (10:52 +0200)
cppcheck 1.89 emits a false positive for lib/dns/spnego_asn1.c:

    lib/dns/spnego_asn1.c:700:9: error: Uninitialized variable: data [uninitvar]
     memset(data, 0, sizeof(*data));
            ^
    lib/dns/spnego.c:1709:47: note: Calling function 'decode_NegTokenResp', 3rd argument '&resp' value is <Uninit>
     ret = decode_NegTokenResp(buf + taglen, len, &resp, NULL);
                                                  ^
    lib/dns/spnego_asn1.c:700: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

(cherry picked from commit db7fd16346317600f6e1da0c25d50c37fddcf681)

lib/dns/spnego_asn1.c

index 46e487a3fc03dbffe3dddacaec14b93dd08861a3..e407bfdaee5713af9894deb4dd1867ffcf8551af 100644 (file)
@@ -697,6 +697,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);