File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,9 @@ const PD_MAX_PRIORITY: u8 = 254;
41
41
/// In microseconds
42
42
const BUDGET_DEFAULT : u64 = 1000 ;
43
43
44
+ /// The maximum number of domains supported by the kernel
45
+ const DOMAIN_COUNT_MAX : u64 = 256 ;
46
+
44
47
/// The purpose of this function is to parse an integer that could
45
48
/// either be in decimal or hex format, unlike the normal parsing
46
49
/// functionality that the Rust standard library provides.
@@ -840,6 +843,12 @@ impl DomainSchedule {
840
843
loc_string( xml_sdf, pos)
841
844
) ) ;
842
845
}
846
+ if domain_names. size ( ) > DOMAIN_COUNT_MAX {
847
+ return Err ( format ! (
848
+ "Error: number of domains in domain schedule exceeds maximum of 256: {}" ,
849
+ loc_string( xml_sdf, pos)
850
+ ) ) ;
851
+ }
843
852
844
853
let time = checked_lookup ( xml_sdf, & child, "length" ) ?. parse :: < u64 > ( ) ;
845
854
if let Err ( _) = time {
You can’t perform that action at this time.
0 commit comments