mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
[9.20] 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 Backport of MR !9131 Merge branch 'backport-4798-cid-498025-and-cid-498031-overflowed-constant-integer_overflow-9.20' into 'bind-9.20' See merge request isc-projects/bind9!9229
This commit is contained in:
commit
b6298b394e
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