From: Otto Moerbeek Date: Thu, 14 Apr 2022 05:43:36 +0000 (+0200) Subject: Fix Coverity 1487923 Out-of-bounds read (wrong use of sizeof) X-Git-Tag: auth-4.8.0-alpha0~141^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0aef4ca5459c907024bc83156dd19e91036e95b5;p=thirdparty%2Fpdns.git Fix Coverity 1487923 Out-of-bounds read (wrong use of sizeof) --- diff --git a/pdns/syncres.cc b/pdns/syncres.cc index b7439ee4c0..b13f99e2c1 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -302,7 +302,7 @@ struct DoTStatus { const std::string n[] = { "Unknown", "Busy", "Bad", "Good"}; unsigned int v = static_cast(d_status); - return v >= sizeof(n) ? "?" : n[v]; + return v > Status::Good ? "?" : n[v]; } };