Skip to content

Commit 221f5eb

Browse files
committed
http: silence cov-scan warning about null check
CID 1596030: (#1 of 1): Dereference after null check (FORWARD_NULL) 15. var_deref_op: Dereferencing null pointer b.
1 parent b1ceb30 commit 221f5eb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

exch/http/http_parser.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,9 +1622,11 @@ tproc_status http_parser::wrrep(http_context *pcontext)
16221622
* hexdump starts at the ROP part.
16231623
*/
16241624
auto b = static_cast<const uint8_t *>(pcontext->write_buff);
1625-
if (HXio_fullwrite(STDERR_FILENO, b, pfx) < 0)
1626-
/* ignore */;
1627-
HX_hexdump(stderr, &b[pfx], written_len - pfx);
1625+
if (b != nullptr) {
1626+
if (HXio_fullwrite(STDERR_FILENO, b, pfx) < 0)
1627+
/* ignore */;
1628+
HX_hexdump(stderr, &b[pfx], written_len - pfx);
1629+
}
16281630
}
16291631
fprintf(stderr, ">>-EOP\n");
16301632
}

0 commit comments

Comments
 (0)