server/server.c: don't deref NULL on failed strdup
PATCH 1/1 server/server.c: don't deref NULL on failed strdup
From 6193423b13197c63ff36d01438a23b4b1278825b Mon Sep 17 00:00:00 2001
From: Jim Meyering <[email protected]>
Date: Thu, 23 Sep 2010 11:02:36 +0200
Subject: [PATCH tabled] server/server.c: don't deref NULL on failed strdup
Here, pathtokey does handle a NULL argument, but the following applog/printf would dereference NULL (of course, that's ok with glibc's printf machinery, but not for other C libraries).
Signed-off-by Jim Meyering <[email protected]>
--- server/server.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
server/server.c +2 -1
@@ -1000,7 +1000,8 @@ static bool cli_evt_http_req(struct client *cli, unsigned int events)if (debugging)applog (LOG_INFO ,"%s: method %s, path '%s', key '%s', bucket '%s'" , - cli->addr_host, method, path, key, bucket); + cli->addr_host, method, path ? path :"<NULL>" , + key, bucket);if (auth) { err = authcheck(&cli->req, buck_in_path? NULL: bucket, auth,
--
1.7.3.234.g7bba3