Make directory reading code in iOSSimulatorDevices() more strict
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Aug 2016 20:33:08 +0000 (20:33 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Aug 2016 20:33:08 +0000 (20:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=160702

Reviewed by Tim Horton.

* Scripts/webkitdirs.pm:
(iOSSimulatorDevices):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204292 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitdirs.pm

index 3a9fafe..48fb247 100644 (file)
@@ -1,3 +1,13 @@
+2016-08-09  Alexey Proskuryakov  <ap@apple.com>
+
+        Make directory reading code in iOSSimulatorDevices() more strict
+        https://bugs.webkit.org/show_bug.cgi?id=160702
+
+        Reviewed by Tim Horton.
+
+        * Scripts/webkitdirs.pm:
+        (iOSSimulatorDevices):
+
 2016-08-06  Sam Weinig  <sam@webkit.org>
 
         Replace NodeOrString with std::variant<RefPtr<Node>, String>
index 7d9cb6e..89f840c 100755 (executable)
@@ -1257,7 +1257,7 @@ sub iOSSimulatorDevices
     my $devicesPath = iOSSimulatorDevicesPath();
     opendir(DEVICES, $devicesPath);
     my @udids = grep {
-        $_ =~ m/[0-9A-F]{8}-([0-9A-F]{4}-){3}[0-9A-F]{12}/;
+        $_ =~ m/^[0-9A-F]{8}-([0-9A-F]{4}-){3}[0-9A-F]{12}$/;
     } readdir(DEVICES);
     close(DEVICES);