mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-12-23 09:18:55 +00:00
Fixed issue: 293
1) Command line argument bucket: causes segv(Issue: 293) If it specifies the bucket name which is terminated ":", s3fs run and crush(segv). This bug is fixed. git-svn-id: http://s3fs.googlecode.com/svn/trunk@409 df820570-a93a-0410-bd06-b72b767a4274
This commit is contained in:
parent
a632af8f90
commit
cec9bc5f3a
@ -3841,14 +3841,17 @@ static int my_fuse_opt_proc(void *data, const char *arg, int key, struct fuse_ar
|
||||
char *bucket_name = (char*)arg;
|
||||
if(strstr(arg, ":")){
|
||||
bucket = strtok(bucket_name, ":");
|
||||
mount_prefix = strtok(NULL, ":");
|
||||
char* pmount_prefix = strtok(NULL, ":");
|
||||
if(pmount_prefix){
|
||||
mount_prefix = pmount_prefix;
|
||||
// remove trailing slash
|
||||
if(mount_prefix.at(mount_prefix.size() - 1) == '/')
|
||||
if(mount_prefix.at(mount_prefix.size() - 1) == '/'){
|
||||
mount_prefix = mount_prefix.substr(0, mount_prefix.size() - 1);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
bucket = arg;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user