summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author无闻 <u@gogs.io>2015-03-25 12:23:54 -0400
committer无闻 <u@gogs.io>2015-03-25 12:23:54 -0400
commit5a5f0721773e9d519669cd1fbd2a1681f94bfc44 (patch)
treeb5f855f8afaa9f3abcb2bb61fc97e60525e97bbe
parentc5c5aac7a5a0c7a39720334f0f432c3939a2da52 (diff)
parente1a4f99eaaeed740b45cfd551f7b1e639906818b (diff)
downloadgitea-5a5f0721773e9d519669cd1fbd2a1681f94bfc44.tar.gz
gitea-5a5f0721773e9d519669cd1fbd2a1681f94bfc44.zip
Merge pull request #1147 from blemasle/develop
fixed panic error on user login
-rw-r--r--modules/asn1-ber/ber.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/asn1-ber/ber.go b/modules/asn1-ber/ber.go
index 52b9a59180..b9537e3060 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 {