diff options
author | Simon Ser <simon.ser@intel.com> | 2019-06-18 15:51:10 +0300 |
---|---|---|
committer | Simon Ser <simon.ser@intel.com> | 2019-06-19 09:46:49 +0300 |
commit | c8ea85cc199671cb6662ebbf96c3d01ec6684a10 (patch) | |
tree | abaf2051d10e9899cea38378b72fab7bf681769c /lib/igt_eld.c | |
parent | 65500f98e5ec747fda8877ffad40c053b9abdbb2 (diff) |
lib/igt_eld: fix potential read from undefined value
If the ELD doesn't contain a monitor_present line (this shouldn't happen), then
the value is garbage. Define the variable as a safety net.
Signed-off-by: Simon Ser <simon.ser@intel.com>
Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
Diffstat (limited to 'lib/igt_eld.c')
-rw-r--r-- | lib/igt_eld.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/igt_eld.c b/lib/igt_eld.c index 15dd8ac9..3d7fd4dd 100644 --- a/lib/igt_eld.c +++ b/lib/igt_eld.c @@ -152,7 +152,7 @@ static bool eld_parse_entry(const char *path, struct eld_entry *eld) char buf[1024]; char *key, *value, *sad_key; size_t len; - bool monitor_present; + bool monitor_present = false; int sad_index; memset(eld, 0, sizeof(*eld)); |