summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-03-28 08:19:18 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2014-03-28 08:19:18 (GMT)
commit3b3385ca09c9cab412dd9213f7f018309b438140 (patch)
tree9c43897a58ffcf16e3831f88fe7ea01c75dc9cb1
parent5f7fe78d1119fd068e8c932bb0ea321b31088787 (diff)
downloadlibparserutils-3b3385ca09c9cab412dd9213f7f018309b438140.tar.gz
libparserutils-3b3385ca09c9cab412dd9213f7f018309b438140.tar.bz2
Fix memmove beyond buffer length in parserutlis_buffer_discard. Thanks to Elie Roudninski.
-rw-r--r--src/utils/buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils/buffer.c b/src/utils/buffer.c
index 5a2a7ce..716e67c 100644
--- a/src/utils/buffer.c
+++ b/src/utils/buffer.c
@@ -134,7 +134,7 @@ parserutils_error parserutils_buffer_discard(parserutils_buffer *buffer,
return PARSERUTILS_BADPARM;
memmove(buffer->data + offset, buffer->data + offset + len,
- buffer->length - len);
+ buffer->length - (len + offset));
buffer->length -= len;