From: David ‘Bombe’ Roden Date: Sat, 5 Jul 2008 17:22:49 +0000 (+0200) Subject: fix resizing of buffer X-Git-Tag: 0.1~34 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=103de92fa4c872bd5d613afe9f95b54368c2c07f;p=ecparse.git fix resizing of buffer --- diff --git a/GrowingBuffer.cpp b/GrowingBuffer.cpp index 8e3bd4a..2841741 100644 --- a/GrowingBuffer.cpp +++ b/GrowingBuffer.cpp @@ -58,7 +58,7 @@ void GrowingBuffer::write(const void* buffer, size_t length) { } while (length > (newSize - limit)); GlobalSettings::isVerbose() && fprintf(stderr, "[%s:%d] resizing buffer from %d to %d bytes to fit in %d bytes.\n", __FILE__, __LINE__, size, newSize, length); void* newData = malloc(newSize); - memcpy(newData, data, position); + memcpy(newData, data, limit); free(data); data = newData; }