From f89edd4b64c4c903e10c4f73e6cd7da5b55ace97 Mon Sep 17 00:00:00 2001 From: deraadt Date: Wed, 26 Aug 2009 20:40:40 +0000 Subject: initialize tmpdir before use; PR 6214 --- usr.bin/sendbug/sendbug.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'usr.bin/sendbug/sendbug.c') diff --git a/usr.bin/sendbug/sendbug.c b/usr.bin/sendbug/sendbug.c index 160c8d04559..aaba5133c5c 100644 --- a/usr.bin/sendbug/sendbug.c +++ b/usr.bin/sendbug/sendbug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sendbug.c,v 1.62 2009/06/07 15:36:45 ray Exp $ */ +/* $OpenBSD: sendbug.c,v 1.63 2009/08/26 20:40:40 deraadt Exp $ */ /* * Written by Ray Lai . @@ -109,14 +109,15 @@ main(int argc, char *argv[]) if (argc > 0) usage(); + if ((tmpdir = getenv("TMPDIR")) == NULL || tmpdir[0] == '\0') + tmpdir = _PATH_TMP; + if (Pflag) { init(); template(stdout); exit(0); } - if ((tmpdir = getenv("TMPDIR")) == NULL || tmpdir[0] == '\0') - tmpdir = _PATH_TMP; if (asprintf(&tmppath, "%s%sp.XXXXXXXXXX", tmpdir, tmpdir[strlen(tmpdir) - 1] == '/' ? "" : "/") == -1) err(1, "asprintf"); -- cgit v1.2.3-59-g8ed1b