Fix a stack smashing bug
authorRoman Shterenzon <r@yokee.tv>
Sun, 20 Jan 2019 09:32:20 +0000 (11:32 +0200)
committerTristan Matthews <tmatth@videolan.org>
Thu, 24 Jan 2019 22:17:54 +0000 (17:17 -0500)
Signed-off-by: Tristan Matthews <tmatth@videolan.org>
libspeexdsp/buffer.c

index 048be83..b06a155 100644 (file)
@@ -135,7 +135,7 @@ EXPORT int speex_buffer_read(SpeexBuffer *st, void *_data, int len)
    char *data = _data;
    if (len > st->available)
    {
-      SPEEX_MEMSET(data+st->available, 0, st->size-st->available);
+      SPEEX_MEMSET(data+st->available, 0, len - st->available);
       len = st->available;
    }
    end = st->read_ptr + len;