public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/2] lib/igt_eld: fix potential read from undefined value
@ 2019-06-18 12:55 Simon Ser
  2019-06-18 12:55 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_chamelium: fix read from uninitialized value in flatline audio test Simon Ser
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Simon Ser @ 2019-06-18 12:55 UTC (permalink / raw)
  To: igt-dev; +Cc: martin.peres

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>
---
 lib/igt_eld.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_eld.c b/lib/igt_eld.c
index 15dd8ac95189..3d7fd4dd0a82 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));
-- 
2.22.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-06-19  2:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-18 12:55 [igt-dev] [PATCH i-g-t 1/2] lib/igt_eld: fix potential read from undefined value Simon Ser
2019-06-18 12:55 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_chamelium: fix read from uninitialized value in flatline audio test Simon Ser
2019-06-18 13:01   ` Peres, Martin
2019-06-18 13:01 ` [igt-dev] [PATCH i-g-t 1/2] lib/igt_eld: fix potential read from undefined value Peres, Martin
2019-06-18 14:18 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] " Patchwork
2019-06-19  2:16 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox