From 60c1a0204e6e550366da8409c9a5d0904a600ae1 Mon Sep 17 00:00:00 2001 From: Razvan Crainea Date: Wed, 31 Oct 2018 11:10:11 +0200 Subject: [PATCH] stun: prevent buffer overflow on error (cherry picked from commit dca22b0484725ddbbbb7d8acd1e0faf57f278e38) --- modules/stun/stun.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/stun/stun.c b/modules/stun/stun.c index d791d6d9ea0..ef0c148e81d 100644 --- a/modules/stun/stun.c +++ b/modules/stun/stun.c @@ -318,8 +318,8 @@ int receive(int sockfd, struct receive_info *ri, str *msg, void* param) else if(sockfd == sockfd4) sprintf(s, "%i %s %d", sockfd4, alternate_ip, port2); else{ - sprintf(s, "%i unknown %s %d", sockfd, alternate_ip, port2); - LM_DBG("Received: on [%s] from [%s %i]; drop msg\n", s, inet_ntoa(client->sin_addr), + LM_DBG("Received: on [%i unknown %s %d] from [%s %i]; drop msg\n", + sockfd, alternate_ip, port2, inet_ntoa(client->sin_addr), ntohs(client->sin_port)); return -1; }