projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
61bdad4
)
Fix byte-swapping of Motif DND tables
author
Po Lu
<luangruo@yahoo.com>
Thu, 16 Jun 2022 07:26:55 +0000
(15:26 +0800)
committer
Po Lu
<luangruo@yahoo.com>
Thu, 16 Jun 2022 07:30:21 +0000
(15:30 +0800)
* src/xterm.c (xm_read_targets_table_rec): Swap nitems first
before checking the length.
src/xterm.c
patch
|
blob
|
history
diff --git
a/src/xterm.c
b/src/xterm.c
index 04e3223478f6219638fc5e98f2b91e01304a583f..45c96c51060ca76068fd45fb2a46a9f65d8c51c5 100644
(file)
--- a/
src/xterm.c
+++ b/
src/xterm.c
@@
-1663,12
+1663,12
@@
xm_read_targets_table_rec (uint8_t *bytes, ptrdiff_t length,
nitems = *(uint16_t *) bytes;
- if (length < 2 + nitems * 4)
- return NULL;
-
if (byteorder != XM_BYTE_ORDER_CUR_FIRST)
SWAPCARD16 (nitems);
+ if (length < 2 + nitems * 4)
+ return NULL;
+
rec = xmalloc (FLEXSIZEOF (struct xm_targets_table_rec,
targets, nitems * 4));
rec->n_targets = nitems;