- 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.
This commit is contained in:
W.C.A. Wijngaards 2019-08-16 12:18:23 +02:00
parent 0532cdd357
commit d8a8730cac
2 changed files with 10 additions and 1 deletions

View 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.

View 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;