diff options
| author | 2012-04-04 14:26:40 +0000 | |
|---|---|---|
| committer | 2012-04-04 14:26:40 +0000 | |
| commit | 92e8e13ba90d83215e3fcf413a702a15395e0c55 (patch) | |
| tree | a946115520e2ab289f287a16df560df58a519698 /usr.sbin/nginx/src/core/ngx_file.c | |
| parent | Don't 'reserve' a head/track if there is only only 1 head and 1 (diff) | |
| download | wireguard-openbsd-92e8e13ba90d83215e3fcf413a702a15395e0c55.tar.xz wireguard-openbsd-92e8e13ba90d83215e3fcf413a702a15395e0c55.zip | |
Set the correct string lengths when stripping the chroot prefix
from the paths because ngx_str_set() does not set it correctly for us.
This change also avoid a use after free() case which was discovered by sthen@
Based on a diff from Steffen Daode Nurpmeso, tested by me and sthen@
Diffstat (limited to 'usr.sbin/nginx/src/core/ngx_file.c')
| -rw-r--r-- | usr.sbin/nginx/src/core/ngx_file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/nginx/src/core/ngx_file.c b/usr.sbin/nginx/src/core/ngx_file.c index 38d1c6a2f2b..56d5a2aa75c 100644 --- a/usr.sbin/nginx/src/core/ngx_file.c +++ b/usr.sbin/nginx/src/core/ngx_file.c @@ -474,7 +474,7 @@ ngx_create_pathes(ngx_cycle_t *cycle, ngx_uid_t user) ngx_err_t err; ngx_uint_t i; ngx_path_t **path; - char *buf; + char *buf = NULL; path = cycle->pathes.elts; for (i = 0; i < cycle->pathes.nelts; i++) { |
