wiretap/erf: Use memmove instead of memcpy

It's possible for memcpy's source and destination
to be the same address, and so therefore
'overlap'. Use memmove instead, which
is safe for overlapping regions.
This fixes Coverity 1450802.
This commit is contained in:
Moshe Kaplan 2020-12-07 17:00:19 -05:00 committed by Wireshark GitLab Utility
parent 3bf856868d
commit c4d19650d5
1 changed files with 1 additions and 1 deletions

View File

@ -1967,7 +1967,7 @@ static gboolean erf_dump(
/* XXX: What about ERF-in-pcapng with existing comment (that wasn't
* modified)? */
if(rec->has_comment_changed) {
memcpy(&other_phdr, pseudo_header, sizeof(union wtap_pseudo_header));
memmove(&other_phdr, pseudo_header, sizeof(union wtap_pseudo_header));
if(!erf_write_anchor_meta_update_phdr(wdh, dump_priv, rec, &other_phdr, err)) return FALSE;
pseudo_header = &other_phdr;
}