mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-14 22:10:01 -04:00
fix: dev: CID 498025 and CID 498031: Overflowed constant INTEGER_OVERFLOW
Add INSIST to fail if the multiplication would cause the variables to overflow. Closes #4798 Merge branch '4798-cid-498025-and-cid-498031-overflowed-constant-integer_overflow' into 'main' Closes #4798 See merge request isc-projects/bind9!9131
This commit is contained in:
commit
35d93624a5
2 changed files with 2 additions and 0 deletions
|
|
@ -183,6 +183,7 @@ retry:
|
|||
result = dns_rdata_totext(rdata, NULL, b);
|
||||
if (result == ISC_R_NOSPACE) {
|
||||
isc_buffer_free(&b);
|
||||
INSIST(bufsize <= (UINT_MAX / 2));
|
||||
bufsize *= 2;
|
||||
goto retry;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -189,6 +189,7 @@ printrdata(dns_rdata_t *rdata) {
|
|||
check_result(result, "dns_rdata_totext");
|
||||
}
|
||||
isc_buffer_free(&b);
|
||||
INSIST(size <= (UINT_MAX / 2));
|
||||
size *= 2;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue