Mercurial > pidgin.yaz
diff libpurple/circbuffer.c @ 25876:70df8067d41e
Backport 7829ec76bdb008583f8da54e238c2265a1140db2 (#8706 - Corruption in PurpleCircBuffer)
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Thu, 30 Apr 2009 05:19:41 +0000 |
parents | 5f2496830fd4 |
children | 01f1929d0936 |
line wrap: on
line diff
--- a/libpurple/circbuffer.c Thu Apr 30 05:18:04 2009 +0000 +++ b/libpurple/circbuffer.c Thu Apr 30 05:19:41 2009 +0000 @@ -68,7 +68,8 @@ /* If the fill pointer is wrapped to before the remove * pointer, we need to shift the data */ - if (in_offset < out_offset) { + if (in_offset < out_offset + || (in_offset == out_offset && buf->bufused > 0)) { int shift_n = MIN(buf->buflen - start_buflen, in_offset); memcpy(buf->buffer + start_buflen, buf->buffer,