[svn-commits] simon.perreault: branch group/v6 r85090 - /team/group/v6/trunk/main/netsock.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Tue Oct 9 07:09:04 CDT 2007
Author: simon.perreault
Date: Tue Oct 9 07:09:03 2007
New Revision: 85090
URL: http://svn.digium.com/view/asterisk?view=rev&rev=85090
Log:
Trying to make name lookup errors more recognizable. Also fixes reading off the end of the
buffer in case of an error.
Modified:
team/group/v6/trunk/main/netsock.c
Modified: team/group/v6/trunk/main/netsock.c
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/main/netsock.c?view=diff&rev=85090&r1=85089&r2=85090
==============================================================================
--- team/group/v6/trunk/main/netsock.c (original)
+++ team/group/v6/trunk/main/netsock.c Tue Oct 9 07:09:03 2007
@@ -410,8 +410,8 @@
{
int netsocket = -1;
int *ioref;
- char iabuf[NI_MAXHOST];
- char sbuf[NI_MAXSERV];
+ char iabuf[NI_MAXHOST] = "<error>";
+ char sbuf[NI_MAXSERV] = "<error>";
struct ast_vinetsock *ns = NULL;
@@ -545,9 +545,9 @@
const char* module_name)
{
int result = -1;
- char iabuf[NI_MAXHOST];
- char sbuf[NI_MAXSERV];
- char hostport[NI_MAXHOST];
+ char iabuf[NI_MAXHOST] = "<error>";
+ char sbuf[NI_MAXSERV] = "<error>";
+ char hostport[NI_MAXHOST] = "<error>";
if (!ns) return -1;
@@ -635,7 +635,7 @@
int ast_vinetsock_sa_get_host(const struct sockaddr* sa, socklen_t salen,
char* host, size_t hostlen)
{
- char iabuf[NI_MAXHOST];
+ char iabuf[NI_MAXHOST] = "<error>";
if (!sa || !host)
return 1;
@@ -667,8 +667,8 @@
char *hostport, size_t hplen)
{
int result = 1;
- char host[NI_MAXHOST];
- char sbuf[NI_MAXSERV];
+ char host[NI_MAXHOST] = "<error>";
+ char sbuf[NI_MAXSERV] = "<error>";
if (!sa || !salen)
return result;
@@ -801,8 +801,8 @@
int ast_vinetsock_sa_fromstr2( const char* hostport, const char* defport,
struct sockaddr* sa, socklen_t *salen )
{
- char host[NI_MAXHOST];
- char port[NI_MAXSERV];
+ char host[NI_MAXHOST] = "<error>";
+ char port[NI_MAXSERV] = "<error>";
int status;
status = ast_vinetsock_str2hp( host, sizeof(host), port, sizeof(port),
@@ -1085,8 +1085,8 @@
int socktype)
{
int sockfd = -1;
- char iabuf[NI_MAXHOST];
- char sbuf[NI_MAXSERV];
+ char iabuf[NI_MAXHOST] = "<error>";
+ char sbuf[NI_MAXSERV] = "<error>";
if (!dst || !src)
return -1;
@@ -1130,7 +1130,7 @@
int portno)
{
struct addrinfo hints, *res = NULL;
- char port[NI_MAXSERV];
+ char port[NI_MAXSERV] = "<error>";
if (!dst || !src)
return -1;
@@ -1258,10 +1258,10 @@
int ignore_port)
{
int result = 1;
- char hbuf1[NI_MAXHOST];
- char hbuf2[NI_MAXHOST];
- char sbuf1[NI_MAXSERV];
- char sbuf2[NI_MAXSERV];
+ char hbuf1[NI_MAXHOST] = "<error>";
+ char hbuf2[NI_MAXHOST] = "<error>";
+ char sbuf1[NI_MAXSERV] = "<error>";
+ char sbuf2[NI_MAXSERV] = "<error>";
if (NULL == sa1 || NULL == sa2)
return 1;
@@ -1294,8 +1294,8 @@
const struct sockaddr *sa2,
socklen_t sa2len)
{
- char sbuf1[NI_MAXSERV];
- char sbuf2[NI_MAXSERV];
+ char sbuf1[NI_MAXSERV] = "<error>";
+ char sbuf2[NI_MAXSERV] = "<error>";
if (NULL == sa1 || NULL == sa2)
return 1;
More information about the svn-commits
mailing list