From 0aef4ca5459c907024bc83156dd19e91036e95b5 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Thu, 14 Apr 2022 07:43:36 +0200 Subject: [PATCH] Fix Coverity 1487923 Out-of-bounds read (wrong use of sizeof) --- pdns/syncres.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]; } }; -- 2.47.2