diff options
author | Daniel Atallah <datallah@pidgin.im> | 2009-04-30 05:19:41 +0000 |
---|---|---|
committer | Daniel Atallah <datallah@pidgin.im> | 2009-04-30 05:19:41 +0000 |
commit | 11df7e5f8c50bc1cc6862e047613767b56b77e05 (patch) | |
tree | dc44b0213e0aed5baa9e00be038921e75e671eba | |
parent | 5c23068a32af54ced8977246a582d726ebe85b73 (diff) | |
download | pidgin-11df7e5f8c50bc1cc6862e047613767b56b77e05.tar.gz |
Backport 7829ec76bdb008583f8da54e238c2265a1140db2 (#8706 - Corruption in PurpleCircBuffer)
-rw-r--r-- | COPYRIGHT | 1 | ||||
-rw-r--r-- | libpurple/circbuffer.c | 3 |
2 files changed, 3 insertions, 1 deletions
@@ -8,6 +8,7 @@ Saleem Abdulrasool Dave Ahlswede Manuel Amador Matt Amato +Josef Andrysek Geoffrey Antos Daniel Atallah Paul Aurich diff --git a/libpurple/circbuffer.c b/libpurple/circbuffer.c index 4563ab0c11..4f6d31666b 100644 --- a/libpurple/circbuffer.c +++ b/libpurple/circbuffer.c @@ -68,7 +68,8 @@ static void grow_circ_buffer(PurpleCircBuffer *buf, gsize len) { /* 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, |