[asterisk-commits] russell: trunk r155516 - in /trunk: channels/ include/asterisk/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Nov 8 15:46:43 CST 2008
Author: russell
Date: Sat Nov 8 15:46:43 2008
New Revision: 155516
URL: http://svn.digium.com/view/asterisk?view=rev&rev=155516
Log:
- Check for failure when putting the packet in the ast_str
- fix a spelling error in a header file
Modified:
trunk/channels/chan_sip.c
trunk/include/asterisk/strings.h
Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=155516&r1=155515&r2=155516
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Sat Nov 8 15:46:43 2008
@@ -20132,10 +20132,16 @@
ast_log(LOG_WARNING, "Recv error: %s\n", strerror(errno));
return 1;
}
+
readbuf[res] = '\0';
- if (!(req.data = ast_str_create(SIP_MIN_PACKET)))
+
+ if (!(req.data = ast_str_create(SIP_MIN_PACKET))) {
return 1;
- ast_str_set(&req.data, 0, "%s", readbuf);
+ }
+
+ if (ast_str_set(&req.data, 0, "%s", readbuf) == AST_DYNSTR_BUILD_FAILED) {
+ return -1;
+ }
req.socket.fd = sipsock;
req.socket.type = SIP_TRANSPORT_UDP;
Modified: trunk/include/asterisk/strings.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/strings.h?view=diff&rev=155516&r1=155515&r2=155516
==============================================================================
--- trunk/include/asterisk/strings.h (original)
+++ trunk/include/asterisk/strings.h Sat Nov 8 15:46:43 2008
@@ -569,7 +569,7 @@
* interface simplified).
*/
enum {
- /*! An error has occured and the contents of the dynamic string
+ /*! An error has occurred and the contents of the dynamic string
* are undefined */
AST_DYNSTR_BUILD_FAILED = -1,
/*! The buffer size for the dynamic string had to be increased, and
More information about the asterisk-commits
mailing list