https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=14686

--- Comment #2 from Peter Wu <pe...@lekensteyn.nl> ---
To reproduce this, apply this patch:

diff --git a/wsutil/buffer.c b/wsutil/buffer.c
index bbe0ed11d2..317836196b 100644
--- a/wsutil/buffer.c
+++ b/wsutil/buffer.c
@@ -63,6 +63,21 @@ ws_buffer_assure_space(Buffer* buffer, gsize space)
        gsize space_used;
        gboolean space_at_beginning;

+#if 1
+       /* Exact-size buffer for memory debugging. */
+       if (buffer->start > 0) {
+               space_used = buffer->first_free - buffer->start;
+               memmove(buffer->data, buffer->data + buffer->start,
space_used);
+               buffer->start = 0;
+               buffer->first_free = space_used;
+       }
+       if (space != buffer->allocated) {
+               buffer->allocated = space;
+               buffer->data = (guint8*)g_realloc(buffer->data,
buffer->allocated);
+               return;
+       }
+#endif
+
        /* If we've got the space already, good! */
        if (space <= available_at_end) {
                return;

-- 
You are receiving this mail because:
You are watching all bug changes.
___________________________________________________________________________
Sent via:    Wireshark-bugs mailing list <wireshark-bugs@wireshark.org>
Archives:    https://www.wireshark.org/lists/wireshark-bugs
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-bugs
             mailto:wireshark-bugs-requ...@wireshark.org?subject=unsubscribe

Reply via email to