+3533. [contrib] query-loc-0.4.0: memory leaks. [RT #32960]
+
+3532. [contrib] zkt: fixed buffer overrun, resource leaks. [RT #32960]
+
3531. [bug] win32: A uninitialized value could be returned on out
of memory. [RT #32960]
struct in_addr netaddr;
u_int32_t a;
struct in_addr themask;
- char *text_addr, *text_mask;
+ char text_addr[sizeof("255.255.255.255")],
+ text_mask[sizeof("255.255.255.255")];
if (mask == NULL)
{
themask = *mask;
}
- text_addr = (char *) malloc (256);
- text_mask = (char *) malloc (256);
strcpy (text_addr, inet_ntoa (addr));
strcpy (text_mask, inet_ntoa (themask));
if (debug >= 2)
printf ("Testing address %s/%s\n", text_addr, text_mask);
+
if (mask == NULL)
{
a = ntohl (addr.s_addr);
dki_estr[0] = '\0';
dki_t *dkp = malloc (sizeof (dki_t));
- if ( (dkp = malloc (sizeof (dki_t))) )
+ if ( dkp != NULL )
{
memset (dkp, 0, sizeof (dki_t));
return dkp;
soafound = 0;
while ( !soafound && fgets (buf, sizeof buf, fp) )
{
- if ( sscanf (buf, "%*s %*d IN SOA %255s %*s (\n", master) == 1 )
+ if ( sscanf (buf, "%*s %*d IN SOA %254s %*s (\n", master) == 1 )
soafound = 1;
- else if ( sscanf (buf, "%*s IN SOA %255s %*s (\n", master) == 1 )
+ else if ( sscanf (buf, "%*s IN SOA %254s %*s (\n", master) == 1 )
soafound = 1;
}
if ( !soafound )
+ {
+ fclose (fp);
return -2; /* no zone file (soa not found) */
+ }
/* move forward until any non ws is reached */
while ( (c = getc (fp)) != EOF && isspace (c) )
*serial = 0L; /* read in the current serial number */
if ( fscanf (fp, "%lu", serial) != 1 ) /* try to get serial no */
+ {
+ fclose (fp);
return -3; /* no serial number found */
+ }
fclose (fp);