From 25375a6b4876b48ac3263b1bc873391957f4458e Mon Sep 17 00:00:00 2001 From: Neeraj Kumar Kashyap Date: Fri, 4 May 2018 11:24:32 +0530 Subject: [PATCH] Validate the URL fixed inefficient usage of find --- src/s3fs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s3fs.cpp b/src/s3fs.cpp index ef383db..4c940b9 100644 --- a/src/s3fs.cpp +++ b/src/s3fs.cpp @@ -4740,7 +4740,7 @@ static int my_fuse_opt_proc(void* data, const char* arg, int key, struct fuse_ar length = host.length(); } // Check url for http / https protocol string - if((host.find("https://") != 0) && (host.find("http://") != 0)) { + if((host.compare(0, 8, "https://") != 0) && (host.compare(0, 7, "http://") != 0)) { S3FS_PRN_EXIT("option url has invalid format, missing http / https protocol"); return -1; }