Fixed nginx worker segmentation fault if http context is not defined. #718
+6
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit fixes segmentation fault in case when there is no http context defined in nginx configuration:
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00000000004b43be in ngx_http_modsecurity_init_process (cycle=)
#2 0x000000000042b9db in ngx_worker_process_init (cycle=0x14b4980, worker=) at src/os/unix/ngx_process_cycle.c:979
#3 0x000000000042bf92 in ngx_worker_process_cycle (cycle=0x14b4980, data=) at src/os/unix/ngx_process_cycle.c:744
#4 0x000000000042a721 in ngx_spawn_process (cycle=0x14b4980, proc=0x42bf6a <ngx_worker_process_cycle>, data=0x0, name=0x4ff403 "worker process", respawn=0)
#5 0x000000000042cae8 in ngx_reap_children (cycle=0x14b4980) at src/os/unix/ngx_process_cycle.c:628
#6 ngx_master_process_cycle (cycle=0x14b4980) at src/os/unix/ngx_process_cycle.c:181
#7 0x000000000040d02b in main (argc=, argv=) at src/core/nginx.c:407
(gdb)