nginx/nginx

Potential null dereference in ngx_time.c

Closed

#169 opened on Sep 12, 2024

 (3 comments) (0 reactions) (1 assignee)C (7,903 forks)batch import
Complexity - hardbuggood first issue

Repository metrics

Stars
 (30,331 stars)
PR merge metrics
 (Avg merge 27d 8h) (17 merged PRs in 30d)

Description

In results of static analyze of nginx sources I founded potential null dereference

https://github.com/nginx/nginx/blob/00637cce366f17b78fe1ed5c1ef0e534143045f6/src/os/unix/ngx_time.c#L48-L50

localtime() function potentially can return NULL value, which will dereference in strftime(). How about to add check for this case?

Contributor guide