Skip to content

Commit f68f073

Browse files
authored
maage: fix: use memchr to scan ngx_string.
==13043==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x621000074100 at pc 0x563ba79d56c9 bp 0x7ffec6e4cf70 sp 0x7ffec6e4c720 READ of size 4097 at 0x621000074100 thread T0
1 parent b6c193c commit f68f073

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ngx_http_eval_module.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,8 @@ ngx_http_eval_parse_param(ngx_http_request_t *r, ngx_http_eval_ctx_t *ctx,
515515
ngx_str_t name;
516516
ngx_str_t value;
517517

518-
p = (u_char *) ngx_strchr(param->data, '=');
518+
/* param->data is not \0 terminated */
519+
p = (u_char *) memchr(param->data, '=', param->len);
519520

520521
if (p == NULL) {
521522
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,

0 commit comments

Comments
 (0)