Selaa lähdekoodia

core: safety check for outbound buffer

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

(cherry picked from commit c2b0be97a3ef8e4e1bff34a5c73328a63979aa61)
(cherry picked from commit 555537769f5ecbf8dacc3de7529da05bfbdd3d04)
Daniel-Constantin Mierla 11 vuotta sitten
vanhempi
commit
cada614c54
1 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  1. 5 0
      forward.h

+ 5 - 0
forward.h

@@ -143,6 +143,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