Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information
2 people authored and aduh95 committed May 11, 2024
1 parent 98d8590 commit d80d6ca
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/string_bytes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -626,10 +626,8 @@ size_t StringBytes::hex_encode(
size_t slen,
char* dst,
size_t dlen) {
CHECK(slen * 2 >= slen && "overflow in hex encode");

// We know how much we'll write, just make sure that there's space.
CHECK(dlen >= slen * 2 &&
CHECK(dlen >= MultiplyWithOverflowCheck<size_t>(slen, 2u) &&
"not enough space provided for hex encode");

dlen = slen * 2;
Expand Down

0 comments on commit d80d6ca

Please sign in to comment.