From cca9492eb4e7226142ac36eaf637f3dd76570c45 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 3 Nov 2016 14:22:55 +0100 Subject: [PATCH] use better regex for remote ip check while the input should be correctly generated by the other site its still better to be on the safe side, so check if the IP is really an valid one. Signed-off-by: Thomas Lamprecht --- src/PVE/AbstractMigrate.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/PVE/AbstractMigrate.pm b/src/PVE/AbstractMigrate.pm index b58d459..140b479 100644 --- a/src/PVE/AbstractMigrate.pm +++ b/src/PVE/AbstractMigrate.pm @@ -95,8 +95,7 @@ sub get_remote_migration_ip { PVE::Tools::run_command($cmd, outfunc => sub { my $line = shift; - # use non-restrictive regex for ip, its already checked by the remote side - if ($line =~ m/^ip: '(\S+)'$/) { + if ($line =~ m/^ip: '($PVE::Tools::IPRE)'$/) { $ip = $1; } }); -- 2.39.2