mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-16 15:57:00 +00:00
getdata: potential overflow due unit change
The commit c28488cbe8 introduced
potential memory overflow due unintentional unit change.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
c28488cbe8
commit
3c1d033a79
1 changed files with 3 additions and 0 deletions
|
|
@ -148,6 +148,7 @@ int parse_leases(void)
|
||||||
leasesmallocsize =
|
leasesmallocsize =
|
||||||
sizeof(unsigned long int) * num_leases * 2;
|
sizeof(unsigned long int) * num_leases * 2;
|
||||||
leases = safe_realloc(leases, leasesmallocsize);
|
leases = safe_realloc(leases, leasesmallocsize);
|
||||||
|
leasesmallocsize /= sizeof(unsigned long int);
|
||||||
}
|
}
|
||||||
sw_active_lease = 1;
|
sw_active_lease = 1;
|
||||||
} else if (strstr(line, " binding state free")) {
|
} else if (strstr(line, " binding state free")) {
|
||||||
|
|
@ -158,6 +159,7 @@ int parse_leases(void)
|
||||||
sizeof(unsigned long int) * num_touches * 2;
|
sizeof(unsigned long int) * num_touches * 2;
|
||||||
touches =
|
touches =
|
||||||
safe_realloc(touches, touchesmallocsize);
|
safe_realloc(touches, touchesmallocsize);
|
||||||
|
touchesmallocsize /= sizeof(unsigned long int);
|
||||||
}
|
}
|
||||||
} else if (strstr(line, " binding state backup")) {
|
} else if (strstr(line, " binding state backup")) {
|
||||||
if (num_backups == 0) {
|
if (num_backups == 0) {
|
||||||
|
|
@ -172,6 +174,7 @@ int parse_leases(void)
|
||||||
sizeof(unsigned long int) * num_backups * 2;
|
sizeof(unsigned long int) * num_backups * 2;
|
||||||
backups =
|
backups =
|
||||||
safe_realloc(backups, backupsmallocsize);
|
safe_realloc(backups, backupsmallocsize);
|
||||||
|
backupsmallocsize /= sizeof(unsigned long int);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue