bug-coreutils
[Top][All Lists]
Advanced

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

[patch] uninitialized var in fold(1)


From: Tim Waugh
Subject: [patch] uninitialized var in fold(1)
Date: Fri, 11 Apr 2003 23:45:25 +0100
User-agent: Mutt/1.4.1i

Hi,

It seems that line_out is used uninitialized in some circumstances in
fold; this caused a segfault here.  Here's the fix (applies to 5.0
too):

--- coreutils-4.5.3/src/fold.c.init     2003-04-11 16:44:57.000000000 -0400
+++ coreutils-4.5.3/src/fold.c  2003-04-11 16:44:46.000000000 -0400
@@ -269,7 +269,7 @@
   mbstate_t state, state_bak;  /* State of the stream. */
   int convfail;                /* 1, when conversion is failed. Otherwise 0. */
 
-  char *line_out;
+  char *line_out = NULL;
   size_t offset_out = 0;       /* Index in `line_out' for next char. */
   size_t allocated_out = 0;
 

Tim.
*/




reply via email to

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