fixed compiler warning in plugin_fix_bogus_via.c

This commit is contained in:
Thomas Ries
2021-02-07 17:58:27 +01:00
parent 9e05d8cba5
commit 006d8e6d5e
2 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -154,8 +154,8 @@ static int sip_patch_topvia(sip_ticket_t *ticket) {
/* set new port number */
osip_free(via->port);
via->port=osip_malloc(6); /* 5 digits + \0 */
snprintf(via->port, 5, "%u", ntohs(ticket->from.sin_port));
via->port=osip_malloc(PORTSTRING_SIZE); /* 5 digits + \0 */
snprintf(via->port, PORTSTRING_SIZE, "%u", ntohs(ticket->from.sin_port));
via->port[5-1] ='\0';
DEBUGC(DBCLASS_PLUGIN, "plugin_fix_bogus_via: -> %s:%s",
+2 -1
View File
@@ -309,7 +309,8 @@ int unload_plugins(void);
#define HOSTNAME_SIZE 128 /* max string length of a hostname */
#define USERNAME_SIZE 128 /* max string length of a username (auth) */
#define PASSWORD_SIZE 128 /* max string length of a password (auth) */
#define IPSTRING_SIZE 16 /* stringsize of IP address xxx.xxx.xxx.xxx */
#define IPSTRING_SIZE 16 /* stringsize of IP address xxx.xxx.xxx.xxx\0 */
#define PORTSTRING_SIZE 6 /* stringsize of port number xxxxx\0 */
#define VIA_BRANCH_SIZE 128 /* max string length for via branch param */
/* scratch buffer for gethostbyname_r() */