]> git.ipfire.org Git - thirdparty/freeswitch.git/commit
ftmod_isdn: Avoid stack smashing buffer overflow in isdn_tones_run().
authorStefan Knoblich <stkn@openisdn.net>
Fri, 10 Aug 2012 15:05:46 +0000 (17:05 +0200)
committerStefan Knoblich <stkn@openisdn.net>
Fri, 10 Aug 2012 15:16:05 +0000 (17:16 +0200)
commit2ad2b6d31bf201b0779a5c217039860e2e009395
treeacacbcf56d091b679132e88bb9ae109fe84fb0c5
parent036063d2a9ed56eb123acc77c2a7d1d9c733263d
ftmod_isdn: Avoid stack smashing buffer overflow in isdn_tones_run().

The len variable can, in certain situations (large burst of incoming non-SLIN audio),
exceed the size of the on-stack frame buffer, which causes ftdm_buffer_read_loop() to
overwrite the dt_buffer pointer.

Use ftdm_min() to make sure len (after conversion to SLIN units) isn't larger
than the frame buffer size.

Also adds are couple more code comments.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
libs/freetdm/src/ftmod/ftmod_isdn/ftmod_isdn.c