# HG changeset patch # User Daniel Atallah # Date 1237516958 0 # Node ID bcbc5994d21c46bac8eadd4de4bfea3ff605702c # Parent c884b702ec17990a706110e432552e6c5942ff0e Josef Andrysek noticed that there's a scenario where the PurpleCircBuffer gets corrupted and supplied a patch to fix it. Fixes #8706 diff -r c884b702ec17 -r bcbc5994d21c COPYRIGHT --- a/COPYRIGHT Wed Mar 18 19:30:16 2009 +0000 +++ b/COPYRIGHT Fri Mar 20 02:42:38 2009 +0000 @@ -8,6 +8,7 @@ Dave Ahlswede Manuel Amador Matt Amato +Josef Andrysek Geoffrey Antos Daniel Atallah Paul Aurich diff -r c884b702ec17 -r bcbc5994d21c libpurple/circbuffer.c --- a/libpurple/circbuffer.c Wed Mar 18 19:30:16 2009 +0000 +++ b/libpurple/circbuffer.c Fri Mar 20 02:42:38 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,