mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
more static analyser fixups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36843 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f8a14cae14
commit
f7182588d0
5 changed files with 34 additions and 12 deletions
|
@ -2,6 +2,10 @@
|
|||
|
||||
* Source/cifframe.m: Fix possible incorrect free of non-malloc'ed
|
||||
memory.
|
||||
* Source/NSHost.m: fix uninitialised data warning
|
||||
* Source/NSMethodSignature.m: fix uninitialised variable
|
||||
* Source/NSPropertyList.m: avoid static analyser warning
|
||||
* Tools/gdomap.c: fix uninitialised data warning
|
||||
|
||||
2013-07-05 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
|
|
|
@ -191,6 +191,7 @@ static id null = nil;
|
|||
{
|
||||
NSString *addr;
|
||||
|
||||
memset((void*)&in, '\0', sizeof(in));
|
||||
memcpy((void*)&in.s_addr, (const void*)ptr, entry->h_length);
|
||||
addr = [NSString stringWithUTF8String: (char*)inet_ntoa(in)];
|
||||
[addresses addObject: addr];
|
||||
|
|
|
@ -76,7 +76,11 @@ next_arg(const char *typePtr, NSArgumentInfo *info, char *outTypes)
|
|||
BOOL flag;
|
||||
BOOL negative = NO;
|
||||
|
||||
if (info == 0)
|
||||
if (0 == typePtr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if (0 == info)
|
||||
{
|
||||
info = &local;
|
||||
}
|
||||
|
|
|
@ -1133,14 +1133,10 @@ static id parsePlItem(pldata* pld)
|
|||
|
||||
len--;
|
||||
// Allow for quoted values.
|
||||
if (ptr[0] == '"' && len > 1)
|
||||
if (len > 2 && '"' == ptr[0] && '"' == ptr[len - 1])
|
||||
{
|
||||
len--;
|
||||
len -= 2;
|
||||
ptr++;
|
||||
if (ptr[len - 1] == '"')
|
||||
{
|
||||
len--;
|
||||
}
|
||||
}
|
||||
if (type == 'I')
|
||||
{
|
||||
|
|
|
@ -2085,7 +2085,7 @@ init_probe()
|
|||
int broadcast = 0;
|
||||
int elen = 0;
|
||||
struct in_addr *other = 0;
|
||||
struct in_addr sin;
|
||||
struct in_addr sin { 0 };
|
||||
int high = 0;
|
||||
int low = 0;
|
||||
unsigned long net = 0;
|
||||
|
@ -2567,6 +2567,13 @@ handle_read(int desc)
|
|||
int r;
|
||||
|
||||
ri = getRInfo(desc, 0);
|
||||
if (0 == ri)
|
||||
{
|
||||
snprintf(ebuf, sizeof(ebuf),
|
||||
"request not found on descriptor %d", desc);
|
||||
gdomap_log(LOG_DEBUG);
|
||||
return;
|
||||
}
|
||||
ptr = ri->buf.b;
|
||||
|
||||
while (ri->pos < GDO_REQ_SIZE && done == 0)
|
||||
|
@ -2619,6 +2626,13 @@ handle_recv()
|
|||
int r;
|
||||
|
||||
ri = getRInfo(udp_desc, 0);
|
||||
if (0 == ri)
|
||||
{
|
||||
snprintf(ebuf, sizeof(ebuf),
|
||||
"request not found on descriptor %d", udp_desc);
|
||||
gdomap_log(LOG_DEBUG);
|
||||
return;
|
||||
}
|
||||
addr = &(ri->addr);
|
||||
ptr = ri->buf.b;
|
||||
|
||||
|
@ -3674,8 +3688,8 @@ tryWrite(int desc, int tim, unsigned char* dat, int len)
|
|||
* On error - return non-zero with reason in 'errno'
|
||||
*/
|
||||
static int
|
||||
tryHost(unsigned char op, unsigned char len, const unsigned char* name,
|
||||
int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
||||
tryHost(unsigned char op, unsigned char len, const unsigned char *name,
|
||||
int ptype, struct sockaddr_in *addr, unsigned short *p, uptr *v)
|
||||
{
|
||||
int desc = socket(AF_INET, SOCK_STREAM, 0);
|
||||
int e = 0;
|
||||
|
@ -3835,7 +3849,10 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
#endif
|
||||
return 5;
|
||||
}
|
||||
*v = b;
|
||||
if (0 != v)
|
||||
{
|
||||
*v = b;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Special case for GDO_NAMES - allocate buffer and read list.
|
||||
|
@ -4031,7 +4048,7 @@ nameServer(const char* name, const char* host, int op, int ptype, struct sockadd
|
|||
if (multi)
|
||||
{
|
||||
unsigned short num;
|
||||
struct in_addr* b;
|
||||
struct in_addr *b;
|
||||
|
||||
/*
|
||||
* A host name of '*' is a special case which should do lookup on
|
||||
|
|
Loading…
Reference in a new issue