From fb94f03b4388dd50bf908a1a0ab3d3eeccb8b1ad Mon Sep 17 00:00:00 2001 From: emersion Date: Tue, 4 Sep 2018 22:50:59 +0200 Subject: [PATCH] backend/drm: prevent use of uninitialized data --- backend/drm/util.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/drm/util.c b/backend/drm/util.c index 66819c96..4681f85a 100644 --- a/backend/drm/util.c +++ b/backend/drm/util.c @@ -298,6 +298,9 @@ size_t match_obj(size_t num_objs, const uint32_t objs[static restrict num_objs], size_t num_res, const uint32_t res[static restrict num_res], uint32_t out[static restrict num_res]) { uint32_t solution[num_res]; + for (size_t i = 0; i < num_res; ++i) { + solution[i] = UNMATCHED; + } struct match_state st = { .num_objs = num_objs,