Skip to content

Commit c5e87b1

Browse files
fix off by one
1 parent 0c35caf commit c5e87b1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

appsec/src/extension/request_abort.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,9 @@ zend_array *nonnull dd_request_abort_static_page_spec(
515515
}
516516

517517
{
518-
char buf[sizeof("18446744073709551615") - 1];
519-
size_t len = sprintf(buf, "%zu", body_len);
518+
// This magic number is the string representation of SIZE_MAX on 64 bit systems
519+
char buf[sizeof("18446744073709551615")];
520+
size_t len = snprintf(buf, sizeof(buf), "%zu", body_len);
520521
zend_string *s = zend_string_init(buf, len, 0);
521522
zval cont_len_zv;
522523
ZVAL_STR(&cont_len_zv, s);

0 commit comments

Comments
 (0)