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
This commit is contained in:
Travis Cross 2012-06-27 20:16:46 +00:00
parent e9a66618ff
commit 7978bd8921

View File

@ -3502,7 +3502,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
const char *tx_host; const char *tx_host;
const char *old_host; const char *old_host;
char bufa[30], bufb[30]; 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); tx_host = switch_get_addr(bufa, sizeof(bufa), rtp_session->from_addr);
old_host = switch_get_addr(bufb, sizeof(bufb), rtp_session->remote_addr); old_host = switch_get_addr(bufb, sizeof(bufb), rtp_session->remote_addr);