[PATCH tabled] server/server.c: don't deref NULL on failed strdup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From 6193423b13197c63ff36d01438a23b4b1278825b Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@xxxxxxxxxx>
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 <meyering@xxxxxxxxxx>
---
 server/server.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/server/server.c b/server/server.c
index 87681a9..2b4ef1c 100644
--- a/server/server.c
+++ b/server/server.c
@@ -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
--
To unsubscribe from this list: send the line "unsubscribe hail-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Fedora Clound]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux