From: Joshua Colp Date: Thu, 25 May 2006 15:42:11 +0000 (+0000) Subject: Only get the low 16 bits if we actually have a message count X-Git-Tag: 1.4.0-beta1~1201 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=336fd1a2dea7f52f288d0759053f35db455db7fe;p=thirdparty%2Fasterisk.git Only get the low 16 bits if we actually have a message count git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@30242 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index e66b18b766..e685db8b35 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] = ""; 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(®->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 */