From 7f01386ea110cb90cbefa2905da4aa741abf2a64 Mon Sep 17 00:00:00 2001 From: Lorenzo Miniero Date: Wed, 6 Dec 2017 16:54:09 +0100 Subject: [PATCH] Fixed problem of printing non-terminated string when logging in SCTP code --- sctp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sctp.c b/sctp.c index e9510d3a6d..a3bba3405e 100644 --- a/sctp.c +++ b/sctp.c @@ -340,7 +340,7 @@ static int janus_sctp_incoming_data(struct socket *sock, union sctp_sockstore ad void janus_sctp_send_data(janus_sctp_association *sctp, char *buf, int len) { if(sctp == NULL || buf == NULL || len <= 0) return; - JANUS_LOG(LOG_VERB, "[%"SCNu64"] SCTP data to send (%d bytes) coming from a plugin: %s\n", sctp->handle_id, len, buf); + JANUS_LOG(LOG_VERB, "[%"SCNu64"] SCTP data to send (%d bytes) coming from a plugin: %.*s\n", sctp->handle_id, len, len, buf); /* FIXME Is there any open channel we can use? */ int i = 0, found = 0; for(i = 0; i < NUMBER_OF_CHANNELS; i++) {