Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
VoltrexKeyva committed Jun 28, 2023
commit d765ac44b1d1747f28e595f8c8df1c39160e4488
2 changes: 1 addition & 1 deletion src/quic/session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down