gnats-prs
[Top][All Lists]
Advanced

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

gnats/317: bad decl of tmpdir in temporary_directory() in misc.c


From: forrest
Subject: gnats/317: bad decl of tmpdir in temporary_directory() in misc.c
Date: Wed, 02 Jan 2002 23:36:17 -0500

>Number:         317
>Category:       gnats
>Synopsis:       bad decl of tmpdir in  temporary_directory() in misc.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 02 23:36:17 -0500 2002
>Originator:     Forrest Cavalier
>Release:        
>Organization:
Mib Software
>Environment:
GNATS 4.0 from cvs.
On WIN32
>Description:
In misc.c, bad decl of tmpdir
  char tmpdir = *getenv ("TMPDIR");
  if (tmpdir == NULL)

>How-To-Repeat:
Generates a warning, but probably incorrect
code too.  Could segfault since getenv() could
return NULL, leading to *(NULL).
>Fix:
--- gnats/gnats/gnats/misc.c    Thu Dec 06 17:25:21 2001
+++ modified/gnats/misc.c       Wed Jan 02 23:29:29 2002
@@ -499,7 +499,7 @@
 #ifdef P_tmpdir
   return P_tmpdir;
 #else
-  char tmpdir = *getenv ("TMPDIR");
+  char *tmpdir = getenv ("TMPDIR");
   if (tmpdir == NULL)
     {
       tmpdir = "/tmp";
>Unformatted:
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]