From: W.C.A. Wijngaards Date: Fri, 16 Aug 2019 10:18:23 +0000 (+0200) Subject: - Fix unittest valgrind false positive uninitialised value report, X-Git-Tag: release-1.9.3rc2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8a8730cac0eef3f3a7aff1672ed129d91ffaf22;p=thirdparty%2Funbound.git - 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. --- diff --git a/doc/Changelog b/doc/Changelog index 02ed719e2..1dbf9f555 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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. diff --git a/sldns/str2wire.c b/sldns/str2wire.c index 1a51bb695..097f62101 100644 --- a/sldns/str2wire.c +++ b/sldns/str2wire.c @@ -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;