From: Remi Gacogne Date: Wed, 29 May 2019 09:35:35 +0000 (+0200) Subject: dnsbulktest: Explicitely check that find() returned 0 X-Git-Tag: dnsdist-1.4.0-beta1~8^2~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1ee9e847c7ff20f1929d9468dfe9762f06ef5d14;p=thirdparty%2Fpdns.git dnsbulktest: Explicitely check that find() returned 0 std::string::find() will return 0 if the line starts with '.', but it was not obvious from the existing code whether we tested for 0 or a string::npos since we treated the return value as a boolean. Reported by Coverity (CID 1401631). --- diff --git a/pdns/dnsbulktest.cc b/pdns/dnsbulktest.cc index 27a288173b..c2f21ba92b 100644 --- a/pdns/dnsbulktest.cc +++ b/pdns/dnsbulktest.cc @@ -293,7 +293,7 @@ try split=splitField(line,','); if (split.second.empty()) split=splitField(line,'\t'); - if(!split.second.find('.')) // skip 'Hidden profile' in quantcast list. + if(split.second.find('.') == 0) // skip 'Hidden profile' in quantcast list. continue; pos=split.second.find('/'); if(pos != string::npos) // alexa has whole urls in the list now.