From e1a4f99eaaeed740b45cfd551f7b1e639906818b Mon Sep 17 00:00:00 2001 From: blemasle Date: Wed, 25 Mar 2015 15:39:36 +0100 Subject: [PATCH] fixed panic error on user login --- modules/asn1-ber/ber.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/asn1-ber/ber.go b/modules/asn1-ber/ber.go index 52b9a591801..b9537e30602 100644 --- a/modules/asn1-ber/ber.go +++ b/modules/asn1-ber/ber.go @@ -5,6 +5,7 @@ import ( "fmt" "io" "reflect" + "errors" ) type Packet struct { @@ -177,6 +178,10 @@ func readBytes(reader io.Reader, buf []byte) error { idx := 0 buflen := len(buf) + if reader == nil { + return errors.New("reader was nil, aborting") + } + for idx < buflen { n, err := reader.Read(buf[idx:]) if err != nil {