23633828 Uninitialized variable in tcsd platform.c platform_get_runlevel()
authorDan Anderson <dan.anderson@oracle.com>
Thu, 23 Jun 2016 11:25:33 -0700
changeset 6274 f5bb4b0c7563
parent 6273 00fae564957b
child 6276 b5b0d91feeac
23633828 Uninitialized variable in tcsd platform.c platform_get_runlevel()
components/trousers/patches/tcsd_platform.c.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/trousers/patches/tcsd_platform.c.patch	Thu Jun 23 11:25:33 2016 -0700
@@ -0,0 +1,15 @@
+# Fix access to uninitialized memory in platform_get_runlevel()
+# Error found by Parfait.
+# This change was implemented in-house and is suitable for upstream use.
+#
+--- src/tcsd/platform.c	2014-04-24 11:05:44.000000000 -0700
++++ src/tcsd/platform.c	2016-06-22 09:54:56.854695113 -0700
[email protected]@ -113,7 +113,7 @@
+ char
+ platform_get_runlevel()
+ {
+-	char runlevel;
++	char runlevel = 'u'; /* unknown run level */
+ 	struct utmpx ut, *utp = NULL;
+ 
+ 	MUTEX_LOCK(utmp_lock);