summaryrefslogtreecommitdiffhomepage
path: root/diff.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'diff.cpp')
-rw-r--r--diff.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/diff.cpp b/diff.cpp
index ee17fad..99a2f14 100644
--- a/diff.cpp
+++ b/diff.cpp
@@ -115,6 +115,10 @@ void Diff::create(const std::string& xml)
m_pos0 = tree.get<int>("diff.start");
m_pos1 = tree.get<int>("diff.end");
+
+ if (m_pos0 > m_pos1)
+ throw std::runtime_error("Bad range in diff");
+
m_data = tree.get<std::string>("diff.data");
}