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
jasnell and tniessen authored Dec 23, 2023
1 parent dce39f4 commit e7ba2bf
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 @@ -523,10 +523,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 e7ba2bf

Please sign in to comment.