]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix unittest valgrind false positive uninitialised value report,
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 16 Aug 2019 10:18:23 +0000 (12:18 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 16 Aug 2019 10:18:23 +0000 (12:18 +0200)
  where if gcc 9.1.1 uses -O2 (but not -O1) then valgrind 3.15.0
  issues an uninitialised value for the token buffer at the str2wire.c
  rrinternal_get_owner() strcmp with the '@' value.  Rewritten to use
  straight character comparisons removes the false positive.  Also
  valgrinds --expensive-definedness-checks=yes can stop this false
  positive.

doc/Changelog
sldns/str2wire.c

index 02ed719e2cb517c0fb2b31bd186c451aedb25b6a..1dbf9f555a8aca8785d33d0d5f8d8a947abe4fa6 100644 (file)
@@ -1,3 +1,12 @@
+16 August 2019: Wouter
+       - Fix unittest valgrind false positive uninitialised value report,
+         where if gcc 9.1.1 uses -O2 (but not -O1) then valgrind 3.15.0
+         issues an uninitialised value for the token buffer at the str2wire.c
+         rrinternal_get_owner() strcmp with the '@' value.  Rewritten to use
+         straight character comparisons removes the false positive.  Also
+         valgrinds --expensive-definedness-checks=yes can stop this false
+         positive.
+
 15 August 2019: Wouter
        - iana portlist updated.
        - Fix autotrust temp file uniqueness windows compile.
index 1a51bb695607a634b0f66f850c9f95b851240918..097f621017f127f93213ceeccba7bf94e09e7654 100644 (file)
@@ -187,7 +187,7 @@ rrinternal_get_owner(sldns_buffer* strbuf, uint8_t* rr, size_t* len,
                        sldns_buffer_position(strbuf));
        }
 
-       if(strcmp(token, "@") == 0) {
+       if(token[0]=='@' && token[1]=='\0') {
                uint8_t* tocopy;
                if (origin) {
                        *dname_len = origin_len;