Module: sip-router
Branch: master
Commit: e81b3aac19ab567813d6cb21fcba3d9bd6e1cc90
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e81b3aa…
Author: Konstantin Mosesov <ez(a)voipgroup.org.ua>
Committer: Konstantin Mosesov <ez(a)voipgroup.org.ua>
Date: Sat May 18 13:56:22 2013 +0300
parser/sdp: Fixed segfault in sdp_print() when no SDP body.
- Failed scenario:
remove_body();
msg_apply_changes();
sdp_print("1");
- Result: sdp=0x0
---
parser/sdp/sdp.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/parser/sdp/sdp.c b/parser/sdp/sdp.c
index f46b8de..fde60d3 100644
--- a/parser/sdp/sdp.c
+++ b/parser/sdp/sdp.c
@@ -896,6 +896,12 @@ void print_sdp(sdp_info_t* sdp, int log_level)
{
sdp_session_cell_t *session;
+ if (!sdp)
+ {
+ LOG(log_level, "no sdp body\n");
+ return;
+ }
+
LOG(log_level, "sdp:%p=>%p (%d:%d)\n", sdp, sdp->sessions,
sdp->sessions_num, sdp->streams_num);
session = sdp->sessions;
while (session) {