diff options
author | Moshe Kaplan <me@moshekaplan.com> | 2020-12-07 17:00:19 -0500 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2020-12-09 00:24:58 +0000 |
commit | c4d19650d5455a7f6e7c12d5b88d87b784124644 (patch) | |
tree | 51bf06795904c07178a245baa7d2fa567f9290a2 /wiretap/erf.c | |
parent | 3bf856868d9108df62fc8407d557eeaa0986722c (diff) |
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.
Diffstat (limited to 'wiretap/erf.c')
-rw-r--r-- | wiretap/erf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/wiretap/erf.c b/wiretap/erf.c index 7633d1e470..ffa4b9f198 100644 --- a/wiretap/erf.c +++ b/wiretap/erf.c @@ -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; } |