mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 14:07:59 +00:00
3533. [contrib] query-loc-0.4.0: memory leaks. [RT #32960]
3532. [contrib] zkt: fixed buffer overrun, resource leaks. [RT #32960]
This commit is contained in:
4
CHANGES
4
CHANGES
@@ -1,3 +1,7 @@
|
||||
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]
|
||||
|
||||
|
@@ -151,7 +151,8 @@ getlocbyaddr (addr, mask)
|
||||
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)
|
||||
{
|
||||
@@ -162,13 +163,12 @@ getlocbyaddr (addr, mask)
|
||||
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);
|
||||
|
@@ -70,7 +70,7 @@ static dki_t *dki_alloc ()
|
||||
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;
|
||||
|
@@ -120,14 +120,17 @@ static int read_serial_fromfile (const char *fname, unsigned long *serial)
|
||||
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) )
|
||||
@@ -136,7 +139,10 @@ static int read_serial_fromfile (const char *fname, unsigned long *serial)
|
||||
|
||||
*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);
|
||||
|
||||
|
Reference in New Issue
Block a user