From: Po Lu Date: Sat, 6 Aug 2022 06:50:04 +0000 (+0800) Subject: Correctly initialize values after a new device is enabled X-Git-Tag: emacs-29.0.90~1447^2~390 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=28c01bd4841be69d01b6db661917f1be9830cc3d;p=emacs.git Correctly initialize values after a new device is enabled * src/xterm.c (handle_one_xevent): Initialize new device to zero. (bug#57011) --- 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); }