From ad01c761a193a7e69cfc4e0e16f05ddf3b60bbbc Mon Sep 17 00:00:00 2001 From: miod Date: Fri, 17 May 2024 20:11:58 +0000 Subject: [PATCH] Make sure `row' is not used uninitialized in wsmouse_matching(). --- sys/dev/wscons/wsmouse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/wscons/wsmouse.c b/sys/dev/wscons/wsmouse.c index 785e7811c7a..e0d6cd2ab2f 100644 --- a/sys/dev/wscons/wsmouse.c +++ b/sys/dev/wscons/wsmouse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsmouse.c,v 1.71 2024/03/25 13:01:49 mvs Exp $ */ +/* $OpenBSD: wsmouse.c,v 1.72 2024/05/17 20:11:58 miod Exp $ */ /* $NetBSD: wsmouse.c,v 1.35 2005/02/27 00:27:52 perry Exp $ */ /* @@ -1255,6 +1255,7 @@ wsmouse_matching(int *matrix, int m, int n, int *buffer) for (; p < mc; *p++ = 0) {} for (col = 0; col < n; col++) { delta = INT_MAX; + row = 0; for (i = 0, p = matrix + col; i < m; i++, p += n) { d = *p - red[i]; if (d < delta || (d == delta && r2c[i] < 0)) { -- 2.20.1