summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 {