Add safety check for codec implementations with bytes_per_frames being larger than the recommended buffer size (Klocwork #1039)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8514 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Stefan Knoblich
2008-05-21 22:26:30 +00:00
parent 0bdd7007d0
commit 088b842ced
2 changed files with 10 additions and 4 deletions

View File

@@ -487,6 +487,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session,
if (switch_test_flag(read_frame, SFF_CNG)) {
sendlen = read_codec->implementation->bytes_per_frame;
switch_assert(sendlen <= SWITCH_RECOMMENDED_BUFFER_SIZE);
memset(decoded, 255, sendlen);
sendbuf = decoded;
tstatus = SWITCH_STATUS_SUCCESS;