diff options
| author | Po Lu | 2022-04-02 20:12:12 +0800 |
|---|---|---|
| committer | Po Lu | 2022-04-02 20:12:12 +0800 |
| commit | ca5f259cff93ad7fc4d5e70319412420affb6d17 (patch) | |
| tree | 762d44b9f560b358c54c9204609a0bc778d89b73 /src | |
| parent | f66a47b5bca7a9c603040b7c62a2562a925c94d3 (diff) | |
| download | emacs-ca5f259cff93ad7fc4d5e70319412420affb6d17.tar.gz emacs-ca5f259cff93ad7fc4d5e70319412420affb6d17.zip | |
Fix crash when retrieving window property with invalid atom data
This happens when dropping files from dtfile, which somehow puts
non-atom stuff in window properties of type ATOM_PAIR.
* src/xselect.c (x_atom_to_symbol): Catch errors around
XGetAtomName.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xselect.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/xselect.c b/src/xselect.c index 76a2f9f5075..7719876884e 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -285,7 +285,9 @@ x_atom_to_symbol (struct x_display_info *dpyinfo, Atom atom) | |||
| 285 | return QNULL; | 285 | return QNULL; |
| 286 | 286 | ||
| 287 | block_input (); | 287 | block_input (); |
| 288 | x_catch_errors (dpyinfo->display); | ||
| 288 | str = XGetAtomName (dpyinfo->display, atom); | 289 | str = XGetAtomName (dpyinfo->display, atom); |
| 290 | x_uncatch_errors (); | ||
| 289 | unblock_input (); | 291 | unblock_input (); |
| 290 | TRACE1 ("XGetAtomName --> %s", str); | 292 | TRACE1 ("XGetAtomName --> %s", str); |
| 291 | if (! str) return Qnil; | 293 | if (! str) return Qnil; |