Patchwork [Fortran,committed] PR54678 - don't use an uninitialized variable

login
register
mail settings
Submitter Tobias Burnus
Date Jan. 6, 2013, 12:44 p.m.
Message ID <50E971C2.8030504@net-b.de>
Download mbox | patch
Permalink /patch/209752/
State New
Headers show

Comments

Tobias Burnus - Jan. 6, 2013, 12:44 p.m.
Committed as obvious (Rev. 194948) - with Thomas' approval in the PR.

Tobias

Patch

Index: libgfortran/ChangeLog
===================================================================
--- libgfortran/ChangeLog	(Revision 194947)
+++ libgfortran/ChangeLog	(Arbeitskopie)
@@ -1,3 +1,9 @@ 
+2013-01-06  Tobias Burnus  <burnus@net-b.de>
+
+	PR fortran/54678
+	* intrinsics/env.c (get_environment_variable_i8): Don't use
+	uninitialized variable.
+
 2013-01-02  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
 	PR libfortran/55818
Index: libgfortran/intrinsics/env.c
===================================================================
--- libgfortran/intrinsics/env.c	(Revision 194947)
+++ libgfortran/intrinsics/env.c	(Arbeitskopie)
@@ -185,7 +185,8 @@  get_environment_variable_i8 (char *name, char *val
     trim_name4 = *trim_name;
 
   get_environment_variable_i4 (name, value, &length4, &status4, 
-			       &trim_name4, name_len, value_len);
+			       trim_name ? &trim_name4 : NULL,
+			       name_len, value_len);
 
   if (length)
     *length = length4;