From 5b288accbe0b4b0a23711fb6ec79e1d80d593174 Mon Sep 17 00:00:00 2001 From: Stefan Reitshamer Date: Mon, 14 Dec 2020 17:24:51 -0500 Subject: [PATCH] if AWS region not found, return an error --- ArqRestoreCommand.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ArqRestoreCommand.m b/ArqRestoreCommand.m index 27ed627..b2ed91d 100644 --- a/ArqRestoreCommand.m +++ b/ArqRestoreCommand.m @@ -697,6 +697,10 @@ HSLogError(@"failed to get location of %@: %@", s3BucketName, myError); } else { AWSRegion *awsRegion = [AWSRegion regionWithLocation:location]; + if (awsRegion == nil) { + SETNSERROR([self errorDomain], -1, @"unknown location: %@", location); + return nil; + } HSLogDebug(@"awsRegion for s3BucketName %@: %@", s3BucketName, location); NSURL *s3Endpoint = [awsRegion s3EndpointWithSSL:YES];