]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5790 --resolve mod_rayo: fix buffer overflow when reading stereo .wav file
authorChris Rienzo <chris.rienzo@grasshopper.com>
Thu, 19 Sep 2013 03:20:26 +0000 (23:20 -0400)
committerChris Rienzo <chris.rienzo@grasshopper.com>
Thu, 19 Sep 2013 03:20:26 +0000 (23:20 -0400)
src/mod/event_handlers/mod_rayo/rayo_output_component.c

index e85a12cece4f142a7dfc5b1e63ca1ec34771f6cb..e092ebd046e9e44bfb1a9559f683aefc96d3264e 100644 (file)
@@ -642,7 +642,7 @@ static switch_status_t fileman_file_open(switch_file_handle_t *handle, const cha
        switch_mutex_unlock(fileman_globals.mutex);
 
        context->max_frame_len = (handle->samplerate / 1000 * SWITCH_MAX_INTERVAL);
-       switch_zmalloc(context->abuf, FILE_STARTBYTES);
+       switch_zmalloc(context->abuf, FILE_STARTBYTES * sizeof(*context->abuf));
 
        if (!context->fh.audio_buffer) {
                switch_log_printf(SWITCH_CHANNEL_UUID_LOG(context->uuid), SWITCH_LOG_DEBUG, "Create audio buffer\n");