Browse code

core: safety check for outbound buffer

- pointer can end up being NULL if replacement fails to be built (e.g.,
via topoh)

Daniel-Constantin Mierla authored on 16/09/2014 21:38:35
Showing 1 changed files
... ...
@@ -145,6 +145,11 @@ static inline int msg_send(struct dest_info* dst, char* buf, int len)
145 145
 	outb.len = len;
146 146
 	sr_event_exec(SREV_NET_DATA_OUT, (void*)&outb);
147 147
 
148
+	if(outb.s==NULL) {
149
+		LM_ERR("failed to update outgoing buffer\n");
150
+		return -1;
151
+	}
152
+
148 153
 #ifdef USE_TCP
149 154
 	if (unlikely((dst->proto == PROTO_WS
150 155
 #ifdef USE_TLS