From 959e4ab22df829e4aadd4cf75f00491fd8ef4e76 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Tue, 3 Jan 2012 11:29:41 -0500 Subject: [PATCH] freetdm: ISDN - Added check for receiving frames that are too big --- .../ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c index add4d3fad0..7083fe25ec 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c @@ -481,6 +481,11 @@ void sngisdn_snd_data(ftdm_channel_t *dchan, uint8_t *data, ftdm_size_t len) sng_l1_frame_t l1_frame; sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) dchan->span->signal_data; + if (len > sizeof(l1_frame.data)) { + ftdm_assert(FTDM_FALSE, "Received frame exceeding max size\n"); + return; + } + memset(&l1_frame, 0, sizeof(l1_frame)); l1_frame.len = len;