Checks for invalid sizes in TDF validation script
This commit is contained in:
@@ -256,6 +256,9 @@ class ValidationService
|
|||||||
|
|
||||||
} elseif ($addressSpace->size > 0xFFFFFFFF) {
|
} elseif ($addressSpace->size > 0xFFFFFFFF) {
|
||||||
$failures[] = 'Size exceeds 32-bit unsigned integer';
|
$failures[] = 'Size exceeds 32-bit unsigned integer';
|
||||||
|
|
||||||
|
} elseif ($addressSpace->size < 1) {
|
||||||
|
$failures[] = 'Invalid size (' . $addressSpace->size . ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($addressSpace->memorySegments)) {
|
if (empty($addressSpace->memorySegments)) {
|
||||||
@@ -332,6 +335,9 @@ class ValidationService
|
|||||||
|
|
||||||
} elseif ($segment->size > 0xFFFFFFFF) {
|
} elseif ($segment->size > 0xFFFFFFFF) {
|
||||||
$failures[] = 'Size exceeds 32-bit unsigned integer';
|
$failures[] = 'Size exceeds 32-bit unsigned integer';
|
||||||
|
|
||||||
|
} elseif ($segment->size < 1) {
|
||||||
|
$failures[] = 'Invalid size (' . $segment->size . ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($segment->executable === null) {
|
if ($segment->executable === null) {
|
||||||
@@ -390,6 +396,9 @@ class ValidationService
|
|||||||
|
|
||||||
if ($section->size === null) {
|
if ($section->size === null) {
|
||||||
$failures[] = 'Missing size';
|
$failures[] = 'Missing size';
|
||||||
|
|
||||||
|
} elseif ($section->size < 1) {
|
||||||
|
$failures[] = 'Invalid size (' . $section->size . ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
$processedSectionKeys = [];
|
$processedSectionKeys = [];
|
||||||
@@ -592,6 +601,9 @@ class ValidationService
|
|||||||
|
|
||||||
if ($register->size === null) {
|
if ($register->size === null) {
|
||||||
$failures[] = 'Missing size';
|
$failures[] = 'Missing size';
|
||||||
|
|
||||||
|
} elseif ($register->size < 1) {
|
||||||
|
$failures[] = 'Invalid size (' . $register->size . ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
$processedBitFieldKeys = [];
|
$processedBitFieldKeys = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user