Skip to content

Commit

Permalink
Fixed undefined behavior when left shifting signed integer.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdocguard committed Aug 4, 2016
1 parent e62a16e commit 31389e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/os/unix/ngx_process_cycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ ngx_worker_process_init(ngx_cycle_t *cycle, ngx_int_t worker)
"sigprocmask() failed");
}

srandom((ngx_pid << 16) ^ ngx_time());
srandom(((unsigned) ngx_pid << 16) ^ ngx_time());

/*
* disable deleting previous events for the listening sockets because
Expand Down

0 comments on commit 31389e4

Please sign in to comment.