From d0c8f0ffe18e65492643f03a49ae7b95dbea76ee Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 21 Sep 2017 14:46:09 +0100 Subject: [PATCH] v2v: -o libvirt: Use PCRE to verify arch is sane. --- v2v/output_libvirt.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v2v/output_libvirt.ml b/v2v/output_libvirt.ml index b5df8245f..bc7f41ff9 100644 --- a/v2v/output_libvirt.ml +++ b/v2v/output_libvirt.ml @@ -28,8 +28,8 @@ open Xpath_helpers open Create_libvirt_xml let arch_is_sane_or_die = - let rex = Str.regexp "^[-_A-Za-z0-9]+$" in - fun arch -> assert (Str.string_match rex arch 0) + let rex = PCRE.compile ~caseless:true "^[-_a-z0-9]+$" in + fun arch -> assert (PCRE.matches rex arch) let target_features_of_capabilities_doc doc arch = let xpathctx = Xml.xpath_new_context doc in