[PATCH 1 of 1] fix crash with ngx_setproctitle

Markus Linnala Markus.Linnala at cybercom.com
Sun Aug 17 18:23:04 UTC 2014


# HG changeset patch
# User Markus Linnala <Markus.Linnala at cybercom.com>
# Date 1408298513 -10800
#      Sun Aug 17 21:01:53 2014 +0300
# Node ID 5524fc592881550bc5ed108993af148ebd09fa22
# Parent  79553cb7774753f9c40a6fa6744b0e0611e41908
fix crash with ngx_setproctitle

Test ngx_init_setproctitle return value to prevent crash at ngx_setproctitle.

diff -r 79553cb77747 -r 5524fc592881 src/os/unix/ngx_posix_init.c
--- a/src/os/unix/ngx_posix_init.c	Fri Aug 15 14:09:29 2014 +0400
+++ b/src/os/unix/ngx_posix_init.c	Sun Aug 17 21:01:53 2014 +0300
@@ -40,7 +40,9 @@
     }
 #endif
 
-    ngx_init_setproctitle(log);
+    if (ngx_init_setproctitle(log) != NGX_OK) {
+        return NGX_ERROR;
+    }
 
     ngx_pagesize = getpagesize();
     ngx_cacheline_size = NGX_CPU_CACHE_LINE;



More information about the nginx-devel mailing list