From 50e4c55afddad7f1001c80f3682ea7400a808747 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 8 Jun 2013 17:55:19 +0200 Subject: [PATCH] Try to check if setproctitle() constructor got passed arguments --- src/setproctitle.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/setproctitle.c b/src/setproctitle.c index 2137190..e4f648a 100644 --- a/src/setproctitle.c +++ b/src/setproctitle.c @@ -135,6 +135,10 @@ spt_init(int argc, char *argv[], char *envp[]) char *base, *end, *nul, *tmp; int i, error; + /* Try to make sure we got called with main() arguments. */ + if (argc < 0) + return; + base = argv[0]; if (base == NULL) return; -- 2.47.3