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:
parent
3bf856868d
commit
c4d19650d5
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue