Module: sip-router Branch: master Commit: cb8c24f1ef873d16fd5c7edd96e2c0d3847b3dda URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=cb8c24f1...
Author: Alexandr Dubovikov alexandr.dubovikov@gmail.com Committer: Alexandr Dubovikov alexandr.dubovikov@gmail.com Date: Wed Mar 14 09:29:24 2012 +0100
modules/sipcapture: added check for corrupted and defragmented packets
---
modules/sipcapture/sipcapture.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/modules/sipcapture/sipcapture.c b/modules/sipcapture/sipcapture.c index 7e3a228..506c215 100644 --- a/modules/sipcapture/sipcapture.c +++ b/modules/sipcapture/sipcapture.c @@ -1528,6 +1528,12 @@ int raw_capture_rcv_loop(int rsock, int port1, int port2, int ipip) { /* fill dst_port && src_port */ dst_port=ntohs(udph->uh_dport); src_port=ntohs(udph->uh_sport); + + /* if the message has not alpha */ + if(!isalnum((buf+offset)[0])) { + DBG("not alpha and not digit... skiping...\n"); + continue; + }
DBG("PORT: [%d] and [%d]\n", port1, port2); @@ -1586,6 +1592,7 @@ int raw_capture_rcv_loop(int rsock, int port1, int port2, int ipip) {
ri.bind_address=si; + /* and now recieve message */ receive_msg(buf+offset, len, &ri); if(si) pkg_free(si);