aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-25 15:42:11 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-25 15:42:11 +0000
commite3b881abfe8375aa4794ebeb6f4fcfaad8eb5b4b (patch)
tree666cd10412b61fb0b3497b88121a5e93997e53ba
parentd686e9230bc89035926cd5573e49ce4021ed54f0 (diff)
Only get the low 16 bits if we actually have a message count
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@30242 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_iax2.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index e66b18b76..e685db8b3 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -5380,7 +5380,7 @@ static int iax2_ack_registry(struct iax_ies *ies, struct sockaddr_in *sin, int c
struct iax2_registry *reg;
/* Start pessimistic */
char peer[256] = "";
- char msgstatus[40];
+ char msgstatus[60];
int refresh = 0;
char ourip[256] = "<Unspecified>";
struct sockaddr_in oldus;
@@ -5410,7 +5410,8 @@ static int iax2_ack_registry(struct iax_ies *ies, struct sockaddr_in *sin, int c
return -1;
}
memcpy(&reg->us, &us, sizeof(reg->us));
- reg->messages = ies->msgcount & 0xffff; /* only low 16 bits are used in the transmission of the IE */
+ if (ies->msgcount >= 0)
+ reg->messages = ies->msgcount & 0xffff; /* only low 16 bits are used in the transmission of the IE */
/* always refresh the registration at the interval requested by the server
we are registering to
*/