Skip to content

Commit 310ad69

Browse files
committed
outofrange and nil dereference panics fix
1 parent 7235d32 commit 310ad69

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

v3/control.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,9 @@ func (c *ControlServerSideSorting) GetControlType() string {
929929
}
930930

931931
func NewControlServerSideSorting(value *ber.Packet) (*ControlServerSideSorting, error) {
932+
if value == nil || len(value.Children) < 2 {
933+
return new(ControlServerSideSorting), nil
934+
}
932935
sortKeys := []*SortKey{}
933936

934937
val := value.Children[1].Children

0 commit comments

Comments
 (0)