mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-08-19 05:36:58 +00:00
fix: resolve S3 server startup panic due to nil pointer dereference
Fixed nil pointer dereference in s3.go line 246 when accessing iamConfig pointer. Added proper nil-checking before dereferencing s3opt.iamConfig. - Check if s3opt.iamConfig is nil before dereferencing - Use safe variable for passing IAM config path - Prevents segmentation violation on server startup - Maintains backward compatibility
This commit is contained in:
+4
-2
@@ -243,7 +243,9 @@ func (s3opt *S3Options) startS3Server() bool {
|
||||
var s3ApiServer_err error
|
||||
|
||||
// Create S3 server with optional advanced IAM integration
|
||||
if *s3opt.iamConfig != "" {
|
||||
var iamConfigPath string
|
||||
if s3opt.iamConfig != nil && *s3opt.iamConfig != "" {
|
||||
iamConfigPath = *s3opt.iamConfig
|
||||
glog.V(0).Infof("Starting S3 API Server with advanced IAM integration")
|
||||
} else {
|
||||
glog.V(0).Infof("Starting S3 API Server with standard IAM")
|
||||
@@ -262,7 +264,7 @@ func (s3opt *S3Options) startS3Server() bool {
|
||||
LocalFilerSocket: localFilerSocket,
|
||||
DataCenter: *s3opt.dataCenter,
|
||||
FilerGroup: filerGroup,
|
||||
IamConfig: *s3opt.iamConfig, // Advanced IAM config (optional)
|
||||
IamConfig: iamConfigPath, // Advanced IAM config (optional)
|
||||
})
|
||||
if s3ApiServer_err != nil {
|
||||
glog.Fatalf("S3 API Server startup error: %v", s3ApiServer_err)
|
||||
|
||||
Reference in New Issue
Block a user