]> git.kaiwu.me - nginx.git/commitdiff
The data pointer in ngx_open_file_t objects must be initialized.
authorValentin Bartenev <vbart@nginx.com>
Tue, 8 Jan 2013 14:01:57 +0000 (14:01 +0000)
committerValentin Bartenev <vbart@nginx.com>
Tue, 8 Jan 2013 14:01:57 +0000 (14:01 +0000)
Uninitialized pointer may result in arbitrary segfaults if access_log is used
without buffer and without variables in file path.

Patch by Tatsuhiko Kubo (ticket #268).

src/core/ngx_conf_file.c

index 0eb6388cbe900390092c7bec9d9e1b8318c9d871..ed7a2ce920d9fe6a80dfc64e0dff1291ed960842 100644 (file)
@@ -946,6 +946,7 @@ ngx_conf_open_file(ngx_cycle_t *cycle, ngx_str_t *name)
     }
 
     file->flush = NULL;
+    file->data = NULL;
 
     return file;
 }