Fix segv error when filename is zero length (data

Bart Warmerdam bartw at xs4all.nl
Tue Apr 7 17:39:19 UTC 2015


# HG changeset patch
# User Bart Warmerdam <bartw at xs4all.nl>
# Date 1428423894 -7200
#      Tue Apr 07 18:24:54 2015 +0200
# Branch ngx_files
# Node ID 6f5542336a1a0487c8c8b05883596752019de4f5
# Parent  a70af6f10942d7d21d140049b432081e8c76ba35
Change format of print string to ngx_str type.

diff -r a70af6f10942 -r 6f5542336a1a src/os/unix/ngx_files.c
--- a/src/os/unix/ngx_files.c   Tue Apr 07 18:35:33 2015 +0300
+++ b/src/os/unix/ngx_files.c   Tue Apr 07 18:24:54 2015 +0200
@@ -36,7 +36,7 @@

       if (n == -1) {
           ngx_log_error(NGX_LOG_CRIT, file->log, ngx_errno,
-                      "pread() \"%s\" failed", file->name.data);
+                      "pread() \"%V\" failed", &file->name);
           return NGX_ERROR;
       }



More information about the nginx-devel mailing list