good morning!!!!

Skip to content
Snippets Groups Projects
Commit 6f21520a authored by Guillaume Ballet's avatar Guillaume Ballet
Browse files

More review feedback

parent fc3000d6
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,7 @@ package scwallet
import (
"bytes"
"encoding/binary"
"fmt"
)
// commandAPDU represents an application data unit sent to a smartcard.
......@@ -66,6 +67,10 @@ type responseAPDU struct {
// deserialize deserializes a response APDU.
func (ra *responseAPDU) deserialize(data []byte) error {
if len(data) < 2 {
return fmt.Errorf("can not deserialize data: payload too short (%d < 2)", len(data))
}
ra.Data = make([]byte, len(data)-2)
buf := bytes.NewReader(data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment