Fixed memcpy(dest, NULL, 0) Undefined Behavior.
nxt_str_null() setted the loc.start pointer to NULL, which was being passed to memcpy(3) through nxt_debug(). That caused Undefined Behavior, so we now pass an empty string.
This commit is contained in:
@@ -80,7 +80,7 @@ nxt_http_return(nxt_task_t *task, nxt_http_request_t *r,
|
||||
conf = action->u.conf;
|
||||
|
||||
if (conf->location == NULL) {
|
||||
nxt_str_null(&loc);
|
||||
nxt_str_set(&loc, "");
|
||||
|
||||
} else {
|
||||
nxt_var_raw(conf->location, &loc);
|
||||
|
||||
Reference in New Issue
Block a user