BIND 10 trac2414, updated. 4838e909a1458198896cd2911488b2d3d442952f [2414] {first, last}AddrInPrefix not handles invalid prefix lengths
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Nov 1 17:34:34 UTC 2012
The branch, trac2414 has been updated
via 4838e909a1458198896cd2911488b2d3d442952f (commit)
from fd94c6a10376330c5e87d9b618c422b9f9832708 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 4838e909a1458198896cd2911488b2d3d442952f
Author: Tomek Mrugalski <tomasz at isc.org>
Date: Thu Nov 1 18:34:17 2012 +0100
[2414] {first,last}AddrInPrefix not handles invalid prefix lengths
-----------------------------------------------------------------------
Summary of changes:
src/lib/dhcp/addr_utilities.cc | 12 ++++++++++++
1 file changed, 12 insertions(+)
-----------------------------------------------------------------------
diff --git a/src/lib/dhcp/addr_utilities.cc b/src/lib/dhcp/addr_utilities.cc
index de1e8b4..5ecb4dd 100644
--- a/src/lib/dhcp/addr_utilities.cc
+++ b/src/lib/dhcp/addr_utilities.cc
@@ -162,8 +162,14 @@ namespace dhcp {
isc::asiolink::IOAddress firstAddrInPrefix(const isc::asiolink::IOAddress& prefix,
uint8_t len) {
if (prefix.getFamily() == AF_INET) {
+ if (len>32) {
+ isc_throw(BadValue, "IPv4 prefix length too large:" << len);
+ }
return firstAddrInPrefix4(prefix, len);
} else {
+ if (len>128) {
+ isc_throw(BadValue, "IPv6 prefix length too large:" << len);
+ }
return firstAddrInPrefix6(prefix, len);
}
}
@@ -171,8 +177,14 @@ isc::asiolink::IOAddress firstAddrInPrefix(const isc::asiolink::IOAddress& prefi
isc::asiolink::IOAddress lastAddrInPrefix(const isc::asiolink::IOAddress& prefix,
uint8_t len) {
if (prefix.getFamily() == AF_INET) {
+ if (len>32) {
+ isc_throw(BadValue, "IPv4 prefix length too large:" << len);
+ }
return lastAddrInPrefix4(prefix, len);
} else {
+ if (len>128) {
+ isc_throw(BadValue, "IPv6 prefix length too large:" << len);
+ }
return lastAddrInPrefix6(prefix, len);
}
}
More information about the bind10-changes
mailing list