• Idefisk
  • Tools
  • Tutorials
  • Reviews
  • VoIP Providers
  • Archives
ZOIPER softphone
AsteriskGuru Archives
Mailing List Archives
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[svn-commits] seanbright: branch 1.6.0 r198384 - in /branche

 
   AsteriskGuru Archives Forum Index -> Asterisk-CVS
View previous topic :: View next topic  
Author Message
svn-commits at lists.digi
Guest





PostPosted: Sat May 30, 2009 7:23 pm    Post subject: [svn-commits] seanbright: branch 1.6.0 r198384 - in /branche

Author: seanbright
Date: Sat May 30 15:19:27 2009
New Revision: 198384

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=198384
Log:
Merged revisions 198375 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r198375 | seanbright | 2009-05-30 16:11:33 -0400 (Sat, 30 May 2009) | 13 lines

Properly terminate the receive buffer before sending to iksemel.

aji_io_recv takes the maximum number of bytes to read (instead of the total
buffer size), so we have to subtract 1 from our buffer size. Without this, when
we receive packets that are larger than our buffer, iksemel will choke and
things get wonky.

(closes issue #15232)
Reported by: lp0
Patches:
05302009_res_jabber.c.patch uploaded by seanbright (license 71)
Tested by: seanbright, lp0
........

Modified:
branches/1.6.0/ (props changed)
branches/1.6.0/res/res_jabber.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/res/res_jabber.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.0/res/res_jabber.c?view=diff&rev=198384&r1=198383&r2=198384
==============================================================================
--- branches/1.6.0/res/res_jabber.c (original)
+++ branches/1.6.0/res/res_jabber.c Sat May 30 15:19:27 2009
@@ -645,8 +645,8 @@
static int aji_recv (struct aji_client *client, int timeout)
{
int len, ret;
- char buf[NET_IO_BUF_SIZE -1];
- char newbuf[NET_IO_BUF_SIZE -1];
+ char buf[NET_IO_BUF_SIZE - 1];
+ char newbuf[NET_IO_BUF_SIZE - 1];
int pos = 0;
int newbufpos = 0;
unsigned char c;
@@ -655,7 +655,7 @@
memset(newbuf, 0, sizeof(newbuf));

while (1) {
- len = aji_io_recv(client, buf, NET_IO_BUF_SIZE - 1, timeout);
+ len = aji_io_recv(client, buf, NET_IO_BUF_SIZE - 2, timeout);
if (len < 0) return IKS_NET_RWERR;
if (len == 0) return IKS_NET_EXPIRED;
buf[len] = '\0';
@@ -688,8 +688,18 @@
ret = iks_parse(client->p, newbuf, 0, 0);
memset(newbuf, 0, sizeof(newbuf));

+ switch (ret) {
+ case IKS_NOMEM:
+ ast_log(LOG_WARNING, "Parsing failure: Out of memory.\n");
+ break;
+ case IKS_BADXML:
+ ast_log(LOG_WARNING, "Parsing failure: Invalid XML.\n");
+ break;
+ case IKS_HOOK:
+ ast_log(LOG_WARNING, "Parsing failure: Hook returned an error.\n");
+ break;
+ }
if (ret != IKS_OK) {
- ast_log(LOG_WARNING, "XML parsing failed\n");
return ret;
}
ast_debug(3, "XML parsing successful\n");


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/svn-commits
Back to top
Display posts from previous:   
   AsteriskGuru Archives Forum Index -> Asterisk-CVS All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
contact us at: support@asteriskguru.com - asterisKGuru.com © all rights reserved   |   *asterisk is registered trademark of © Digium™