Skip to content

Commit

Permalink
server: Avoid null-dereference of timespec value on timeout
Browse files Browse the repository at this point in the history
Spotted by clang-analyzer.
  • Loading branch information
ueno committed Jan 17, 2018
1 parent 50b752e commit 031d3c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion p11-kit/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,8 @@ server_loop (Server *server,
if (ret == -1 && errno == EINTR)
continue;

if (ret == 0 && children_avail == 0) { /* timeout */
/* timeout */
if (ret == 0 && children_avail == 0 && timeout != NULL) {
p11_message ("no connections to %s for %lu secs, exiting", server->socket_name, timeout->tv_sec);
break;
}
Expand Down

0 comments on commit 031d3c7

Please sign in to comment.