]> 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 09:13:30 +0000 (11:13 +0200)
cppcheck 1.89 emits a false positive for lib/isc/sha1.c:

    lib/isc/sha1.c:273:16: error: Uninitialized variable: block [uninitvar]
     (void)memmove(block, buffer, 64);
                   ^
    lib/isc/sha1.c:272:10: note: Assignment 'block=&workspace', assigned value is <Uninit>
     block = &workspace;
             ^
    lib/isc/sha1.c:273:16: note: Uninitialized variable: block
     (void)memmove(block, buffer, 64);
                   ^

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/isc/sha1.c

index c0c89b4c99a7b02361a245d141a228b208e08240..4f133c6d401430d84c79b0f09d21bd93e60bd19b 100644 (file)
@@ -270,6 +270,7 @@ transform(uint32_t state[5], const unsigned char buffer[64]) {
        INSIST(state != NULL);
 
        block = &workspace;
+       /* cppcheck-suppress uninitvar */
        (void)memmove(block, buffer, 64);
 
        /* Copy context->state[] to working vars */