From e73d15d5f5ea12ff94afb77c1e7f1867bd4c5acf Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Wed, 24 Jan 2018 15:12:21 -0800 Subject: watchdog: Fix enabled value type When deserializing a bool with sd_bus_message_read, it expects the storage of the passed in container to be 4 bytes. A bool is not guaranteed to be this large and will cause sd_bus_message_read to scribble on the stack. Change enabled to int to guarantee enough space to deserialize the result. For reference libsystemd is doing: *(int*) p = !!*(uint8_t*) q; Change-Id: Ic299e303fcb70941757c453a7b4f643337220afb Signed-off-by: William A. Kennington III --- app/watchdog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/watchdog.cpp b/app/watchdog.cpp index 7b04faa..da83ca3 100644 --- a/app/watchdog.cpp +++ b/app/watchdog.cpp @@ -125,7 +125,7 @@ ipmi_ret_t ipmi_app_reset_watchdog( char *busname = NULL; // Current properties of the watchdog daemon. - bool enabled = false; + int enabled = 0; uint64_t interval = 0; // Status code. -- cgit v1.2.1