Skip to content

Commit

Permalink
cannot test if capacity is equal to or greater than size_t
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuho committed Jan 9, 2024
1 parent 531d1ef commit 6031b2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/picotls.h
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@ static uint8_t *ptls_encode_quicint(uint8_t *p, uint64_t v);
} while (0); \
size_t body_size = (buf)->off - body_start; \
if (capacity != -1) { \
if (body_size >= (size_t)1 << (capacity * 8)) { \
if (capacity < sizeof(size_t) && body_size >= (size_t)1 << (capacity * 8)) { \
ret = PTLS_ERROR_BLOCK_OVERFLOW; \
goto Exit; \
} \
Expand Down

0 comments on commit 6031b2e

Please sign in to comment.