1 |
commit: e36e9a30eb830ea27b467383fa2ae02cd2b0d9d4 |
2 |
Author: Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com> |
3 |
AuthorDate: Thu Jun 28 21:08:57 2018 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jun 29 14:07:47 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=e36e9a30 |
7 |
|
8 |
rc-status: initialize uptime pointer to prevent memory corruption |
9 |
|
10 |
This fixes #231. |
11 |
|
12 |
src/rc/rc-status.c | 2 +- |
13 |
1 file changed, 1 insertion(+), 1 deletion(-) |
14 |
|
15 |
diff --git a/src/rc/rc-status.c b/src/rc/rc-status.c |
16 |
index 85e71dbb..cebdc5ed 100644 |
17 |
--- a/src/rc/rc-status.c |
18 |
+++ b/src/rc/rc-status.c |
19 |
@@ -87,7 +87,7 @@ static char *get_uptime(const char *service) |
20 |
time_t diff_hours = (time_t) 0; |
21 |
time_t diff_mins = (time_t) 0; |
22 |
time_t diff_secs = (time_t) 0; |
23 |
- char *uptime; |
24 |
+ char *uptime = NULL; |
25 |
|
26 |
if (state & RC_SERVICE_STARTED) { |
27 |
start_count = rc_service_value_get(service, "start_count"); |