From 7978bd892111e4235f93211919bd713c78d87c80 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Wed, 27 Jun 2012 20:16:46 +0000 Subject: [PATCH] Don't truncate 5-digit port numbers The adj_port buffer was only 5 bytes wide, so we were truncating any port numbers >= 10000 that were written to this variable as snprintf ensures the last byte is null. FS-4354 --resolve --- src/switch_rtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index c76eb2b41b..33be911b2c 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -3502,7 +3502,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ const char *tx_host; const char *old_host; char bufa[30], bufb[30]; - char adj_port[5]; + char adj_port[6]; tx_host = switch_get_addr(bufa, sizeof(bufa), rtp_session->from_addr); old_host = switch_get_addr(bufb, sizeof(bufb), rtp_session->remote_addr);