From 28c01bd4841be69d01b6db661917f1be9830cc3d Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 6 Aug 2022 14:50:04 +0800 Subject: [PATCH] Correctly initialize values after a new device is enabled * src/xterm.c (handle_one_xevent): Initialize new device to zero. (bug#57011) --- src/xterm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/xterm.c b/src/xterm.c index b1e564a9232..8f84edc63ee 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -22144,6 +22144,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, dpyinfo->devices = xrealloc (dpyinfo->devices, (sizeof *dpyinfo->devices * ++dpyinfo->num_devices)); + memset (dpyinfo->devices + dpyinfo->num_devices - 1, + 0, sizeof *dpyinfo->devices); device = &dpyinfo->devices[dpyinfo->num_devices - 1]; xi_populate_device_from_info (device, info); } -- 2.39.2