mirror of
https://github.com/distribution/distribution.git
synced 2025-08-31 14:37:56 +00:00
Fix the pointer initialization
If the overwriteStruct() finds an uninitialized pointer, it tries to initialize it, but does it incorrectly. It tries to assign a pointer to pointer, instead of pointer. Signed-off-by: Gladkov Alexey <agladkov@redhat.com>
This commit is contained in:
@@ -220,7 +220,7 @@ func (p *Parser) overwriteStruct(v reflect.Value, fullpath string, path []string
|
||||
}
|
||||
case reflect.Ptr:
|
||||
if field.IsNil() {
|
||||
field.Set(reflect.New(sf.Type))
|
||||
field.Set(reflect.New(field.Type().Elem()))
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user