]> git.eshelyaron.com Git - emacs.git/commitdiff
Correctly initialize values after a new device is enabled
authorPo Lu <luangruo@yahoo.com>
Sat, 6 Aug 2022 06:50:04 +0000 (14:50 +0800)
committerPo Lu <luangruo@yahoo.com>
Sat, 6 Aug 2022 06:51:08 +0000 (14:51 +0800)
* src/xterm.c (handle_one_xevent): Initialize new device to
zero.  (bug#57011)

src/xterm.c

index b1e564a92328c6db8eb4c356a13be04cceecc1d9..8f84edc63eed047dbf981a6f0a95a3fa723ad5cd 100644 (file)
@@ -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);
                        }