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
Reference in a new issue