From 21cd3483f0814a4175d4b5a1a73ffa4b5011a649 Mon Sep 17 00:00:00 2001 From: bru Date: Wed, 25 Sep 2024 19:56:33 +0000 Subject: [PATCH] Correct an indexing error that may leave stale data in the mousecfg buffer. ok mpi@ --- sbin/wsconsctl/mousecfg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sbin/wsconsctl/mousecfg.c b/sbin/wsconsctl/mousecfg.c index 7fd7bff3d21..3b9d0da28fb 100644 --- a/sbin/wsconsctl/mousecfg.c +++ b/sbin/wsconsctl/mousecfg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mousecfg.c,v 1.10 2023/07/02 21:44:04 bru Exp $ */ +/* $OpenBSD: mousecfg.c,v 1.11 2024/09/25 19:56:33 bru Exp $ */ /* * Copyright (c) 2017 Ulf Brosziewski @@ -222,8 +222,10 @@ mousecfg_put_field(int fd, struct wsmouse_parameters *field) || (err = ioctl(fd, WSMOUSEIO_GETPARAMS, field))) return err; - for (i = 0; i < field->nparams; i++) + for (i = 0; i < field->nparams; i++) { + n = index_of(field->params[i].key); cfg_buffer[n].value = field->params[i].value; + } return (0); } -- 2.20.1