summaryrefslogtreecommitdiff
path: root/p11-kit
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2018-01-17 13:23:28 +0100
committerDaiki Ueno <ueno@gnu.org>2018-01-17 13:49:14 +0100
commit031d3c74c0ff5da8e9650da0615bbb8107ab1fde (patch)
treeba0d082a9a8288c281ed5f1e419f7834c003cb87 /p11-kit
parent50b752e081e1ca8b674d05e8ddeaf04451065629 (diff)
server: Avoid null-dereference of timespec value on timeout
Spotted by clang-analyzer.
Diffstat (limited to 'p11-kit')
-rw-r--r--p11-kit/server.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/p11-kit/server.c b/p11-kit/server.c
index b86d424..d8ffd78 100644
--- a/p11-kit/server.c
+++ b/p11-kit/server.c
@@ -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;
}