From: miod Date: Fri, 17 May 2024 20:11:58 +0000 (+0000) Subject: Make sure `row' is not used uninitialized in wsmouse_matching(). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ad01c761a193a7e69cfc4e0e16f05ddf3b60bbbc;p=openbsd Make sure `row' is not used uninitialized in wsmouse_matching(). --- 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)) {