Skip to content

Commit d80d6ca

Browse files
jasnelltniessen
authored andcommitted
Apply suggestions from code review
Co-authored-by: Tobias Nießen <[email protected]>
1 parent 98d8590 commit d80d6ca

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/string_bytes.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -626,10 +626,8 @@ size_t StringBytes::hex_encode(
626626
size_t slen,
627627
char* dst,
628628
size_t dlen) {
629-
CHECK(slen * 2 >= slen && "overflow in hex encode");
630-
631629
// We know how much we'll write, just make sure that there's space.
632-
CHECK(dlen >= slen * 2 &&
630+
CHECK(dlen >= MultiplyWithOverflowCheck<size_t>(slen, 2u) &&
633631
"not enough space provided for hex encode");
634632

635633
dlen = slen * 2;

0 commit comments

Comments
 (0)