Skip to content

Commit 72244ea

Browse files
committed
bugfix: fixed a potential data alignment issue in the ngx.var setter API.
1 parent 87bdfc1 commit 72244ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ngx_http_lua_variable.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,8 @@ ngx_http_lua_ffi_var_set(ngx_http_request_t *r, u_char *name_data,
405405
dd("set variables with set_handler");
406406

407407
if (value != NULL && value_len) {
408-
vv = ngx_pnalloc(r->pool, sizeof(ngx_http_variable_value_t)
409-
+ value_len);
408+
vv = ngx_palloc(r->pool, sizeof(ngx_http_variable_value_t)
409+
+ value_len);
410410
if (vv == NULL) {
411411
goto nomem;
412412
}

0 commit comments

Comments
 (0)