From d765ac44b1d1747f28e595f8c8df1c39160e4488 Mon Sep 17 00:00:00 2001 From: Mohammed Keyvanzadeh Date: Wed, 28 Jun 2023 20:54:03 +0330 Subject: [PATCH] src: fix logically dead code reported by Coverity Value of the `nwrite` variable will always be less than 0 when it reaches the `switch` statement because of the previous check, which causes `case 0` to never be executed, change the check to allow 0 or less. --- src/quic/session.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quic/session.cc b/src/quic/session.cc index 87a4a8e54557f7..73ca658e3ed062 100644 --- a/src/quic/session.cc +++ b/src/quic/session.cc @@ -792,7 +792,7 @@ uint64_t Session::SendDatagram(Store&& data) { 1, uv_hrtime()); - if (nwrite < 0) { + if (nwrite < 1) { // Nothing was written to the packet. switch (nwrite) { case 0: {