# HG changeset patch # User Matti Hamalainen # Date 1528843146 -10800 # Node ID 86d10d5d49157e219644dfd40f2442ee66684282 # Parent a29d38862037b889302c3a3eb41d30ce53d0ee4d Fix case where DMGrowBuf is growing backwards and needs to be reallocated in dmGrowBufRealloc() and the data is moved to the "end" of the newly grown buffer. Previously we used clrsize as data size, but that is (in retrospect) obviously incorrect. Use old buffer size instead. diff -r a29d38862037 -r 86d10d5d4915 src/dmgrowbuf.c --- a/src/dmgrowbuf.c Wed Jun 13 01:37:36 2018 +0300 +++ b/src/dmgrowbuf.c Wed Jun 13 01:39:06 2018 +0300 @@ -174,7 +174,7 @@ DM_DBG(" clrsize=%" DM_PRIu_SIZE_T "\n", clrsize); if (buf->backwards) { - memmove(buf->data + clrsize, buf->data, clrsize); + memmove(buf->data + clrsize, buf->data, buf->size); buf->offs += clrsize; }