Skip to content

Commit ed1b2fd

Browse files
committed
buffer: use size_t instead of uint_32_t to avoid segmentation fault
Fixes: #46836
1 parent 32691bd commit ed1b2fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/string_bytes.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ size_t StringBytes::hex_encode(
528528
"not enough space provided for hex encode");
529529

530530
dlen = slen * 2;
531-
for (uint32_t i = 0, k = 0; k < dlen; i += 1, k += 2) {
531+
for (size_t i = 0, k = 0; k < dlen; i += 1, k += 2) {
532532
static const char hex[] = "0123456789abcdef";
533533
uint8_t val = static_cast<uint8_t>(src[i]);
534534
dst[k + 0] = hex[val >> 4];

0 commit comments

Comments
 (0)