Module: sip-router
Branch: master
Commit: c2b0be97a3ef8e4e1bff34a5c73328a63979aa61
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c2b0be9…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Sep 16 23:38:35 2014 +0200
core: safety check for outbound buffer
- pointer can end up being NULL if replacement fails to be built (e.g.,
via topoh)
---
forward.h | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/forward.h b/forward.h
index 271e6c7..2c5d942 100644
--- a/forward.h
+++ b/forward.h
@@ -145,6 +145,11 @@ static inline int msg_send(struct dest_info* dst, char* buf, int
len)
outb.len = len;
sr_event_exec(SREV_NET_DATA_OUT, (void*)&outb);
+ if(outb.s==NULL) {
+ LM_ERR("failed to update outgoing buffer\n");
+ return -1;
+ }
+
#ifdef USE_TCP
if (unlikely((dst->proto == PROTO_WS
#ifdef USE_TLS