]> 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>
Wed, 16 Oct 2019 20:23:41 +0000 (22:23 +0200)
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 <Uninit>
     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

lib/dns/spnego_asn1.c

index 921994c2e8cf5dc52ba166e0601bc096424e4249..e8e7fc5337d6874b10d5227986afe8a4c4b3dcd9 100644 (file)
@@ -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);