From 3b09d817bdb5daa12159d2033738aa679969aad7 Mon Sep 17 00:00:00 2001 From: felixfrank Date: Fri, 9 Feb 2018 12:45:37 +0000 Subject: [PATCH] Fix segfault when no USER env variable --- src/zproxy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zproxy.c b/src/zproxy.c index a49349359..e5c512f1d 100644 --- a/src/zproxy.c +++ b/src/zproxy.c @@ -560,7 +560,7 @@ zproxy_test (bool verbose) sink = zsock_new_sub(">inproc://backend", "whatever"); #else // vagrant vms don't like using shared storage for ipc pipes.. - if (streq(getenv("USER"), "vagrant")) + if (getenv("USER") && streq(getenv("USER"), "vagrant")) sink = zsock_new_sub (">ipc:///tmp/backend", "whatever"); else sink = zsock_new_sub (">ipc://backend", "whatever"); @@ -571,7 +571,7 @@ zproxy_test (bool verbose) zstr_sendx (proxy, "BACKEND", "XPUB", "inproc://backend", NULL); #else // vagrant vms don't like using shared storage for ipc pipes.. - if (streq(getenv("USER"), "vagrant")) + if (getenv("USER") && streq(getenv("USER"), "vagrant")) zstr_sendx(proxy, "BACKEND", "XPUB", "ipc:///tmp/backend", NULL); else zstr_sendx(proxy, "BACKEND", "XPUB", "ipc://backend", NULL);