[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
unitialized buffer used in error situation
From: |
Todd C. Miller |
Subject: |
unitialized buffer used in error situation |
Date: |
Thu, 25 Sep 2003 14:03:44 -0600 |
One of the OpenBSD developers (David Krause) recently ran into a
cvs crash caused by the use of an unitialized buffer. I examined
the traceback and found the source of the crash. The simple fix
follows.
- todd
Index: rcs.c
===================================================================
RCS file: /cvs/src/gnu/usr.bin/cvs/src/rcs.c,v
retrieving revision 1.16
diff -u -r1.16 rcs.c
--- rcs.c 8 Jan 2002 08:01:45 -0000 1.16
+++ rcs.c 25 Sep 2003 15:44:04 -0000
@@ -8427,6 +8427,11 @@
(void) tm_to_internet (datebuf, wm);
(void) sprintf (label, "-L%s\t%s", path, datebuf);
}
+ else
+ {
+ free(label);
+ label = NULL;
+ }
}
return label;
}
- unitialized buffer used in error situation,
Todd C. Miller <=