mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-14 11:42:29 -08:00
Avoid undefined behaviour when copying part of structure
* src/dispnew.c (copy_row_except_pointers): Don't use address of
subobject as starting point.
(cherry picked from commit 6943786b5c)
This commit is contained in:
parent
c4daff9cf8
commit
de9d27f679
1 changed files with 1 additions and 1 deletions
|
|
@ -1034,7 +1034,7 @@ copy_row_except_pointers (struct glyph_row *to, struct glyph_row *from)
|
|||
{
|
||||
enum { off = offsetof (struct glyph_row, x) };
|
||||
|
||||
memcpy (&to->x, &from->x, sizeof *to - off);
|
||||
memcpy ((char *) to + off, (char *) from + off, sizeof *to - off);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue