summaryrefslogtreecommitdiff
path: root/src/util.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-04-26 16:42:43 +0200
committerCarl Hetherington <cth@carlh.net>2023-04-26 16:42:47 +0200
commit928b10e8f4195c29a31fe643e38fb00b6c1b8953 (patch)
treec09ebb9b816b7840312f12c8ef80a4fcce63cf11 /src/util.cc
parentaae2f02038b1cd36e1b1bf2e4f0821e86cff2841 (diff)
Give better errors when invalid urn:uuid: strings are found (DoM #2521).
Diffstat (limited to 'src/util.cc')
-rw-r--r--src/util.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/util.cc b/src/util.cc
index 9cc35ad6..bbfcd30e 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -314,7 +314,10 @@ dcp::find_child (xmlpp::Node const * node, string name)
string
dcp::remove_urn_uuid (string raw)
{
- DCP_ASSERT (raw.substr(0, 9) == "urn:uuid:");
+ if (raw.substr(0, 9) != "urn:uuid:") {
+ throw BadURNUUIDError(raw);
+ }
+
return raw.substr (9);
}