summaryrefslogtreecommitdiffstats
path: root/pnor_partition_table.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pnor_partition_table.cpp')
-rw-r--r--pnor_partition_table.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/pnor_partition_table.cpp b/pnor_partition_table.cpp
index 646f0c3..19bee87 100644
--- a/pnor_partition_table.cpp
+++ b/pnor_partition_table.cpp
@@ -317,6 +317,14 @@ void parseTocLine(const std::string& line, size_t blockSize,
match[NAME_MATCH].str().c_str(), (end - start), blockSize);
}
+ if (start >= end)
+ {
+ std::stringstream err;
+ err << "Partition " << match[NAME_MATCH].str()
+ << " has an invalid range: start offset (0x" << std::hex << start
+ << " is beyond open end (0x" << std::hex << end << ")\n";
+ throw InvalidTocEntry(err.str());
+ }
writeSizes(part, start, end, blockSize);
// Use the shift to convert "80" to 0x80000000
OpenPOWER on IntegriCloud