Commit Diff


commit - c5d5d231399df478b6d2d42ca6fde072abf57009
commit + 1296d9c0d7b4c0ba87e1881b77ae34b576ba572d
blob - e5b9488f40f225bed7324435cbdaf60e140ee421
blob + 01ebf9d6be5336bf7400e641f55519ec4dc5f7d0
--- fcgi.c
+++ fcgi.c
@@ -341,13 +341,18 @@ fcgi_parse_params(struct fcgi *fcgi, struct evbuffer *
 			fcgi->fcg_toread -= vlen;
 			evbuffer_remove(src, &path, vlen);
 			path[vlen] = '\0';
-
-			if (vlen == 0)
-				(void) strlcpy(path, "/", sizeof(path));
 
 			free(clt->clt_path_info);
-			if ((clt->clt_path_info = strdup(path)) == NULL)
+			clt->clt_path_info = NULL;
+
+			if (*path != '/')
+				asprintf(&clt->clt_path_info, "/%s", path);
+			else
+				clt->clt_path_info = strdup(path);
+
+			if (clt->clt_path_info == NULL)
 				return (-1);
+
 			log_debug("clt %d: path_info: %s", clt->clt_id,
 			    clt->clt_path_info);
 			continue;