(ef_write): Don't memcpy() onto itself; behavior's undefined.
This commit is contained in:
parent
fe1a3e57c6
commit
661b650c1a
1 changed files with 2 additions and 1 deletions
|
@ -359,7 +359,8 @@ ef_write(int type, int id, void *from)
|
|||
if (id >= ep->baseid && id < ep->baseid + ep->cids) {
|
||||
/* update the cache if necessary */
|
||||
to = ep->cache + (id - ep->baseid) * ep->size;
|
||||
memcpy(to, from, ep->size);
|
||||
if (to != from)
|
||||
memcpy(to, from, ep->size);
|
||||
}
|
||||
if (id >= ep->fids) {
|
||||
/* write beyond end of file extends it, take note */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue