summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Atallah <datallah@pidgin.im>2009-04-30 05:19:41 +0000
committerDaniel Atallah <datallah@pidgin.im>2009-04-30 05:19:41 +0000
commit11df7e5f8c50bc1cc6862e047613767b56b77e05 (patch)
treedc44b0213e0aed5baa9e00be038921e75e671eba
parent5c23068a32af54ced8977246a582d726ebe85b73 (diff)
downloadpidgin-11df7e5f8c50bc1cc6862e047613767b56b77e05.tar.gz
Backport 7829ec76bdb008583f8da54e238c2265a1140db2 (#8706 - Corruption in PurpleCircBuffer)
-rw-r--r--COPYRIGHT1
-rw-r--r--libpurple/circbuffer.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/COPYRIGHT b/COPYRIGHT
index 036ea73197..3d9b98577c 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -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,