From afc2039f220821155796b64de5f08ccd09fd8412 Mon Sep 17 00:00:00 2001
From: Armin <me@obrown.io>
Date: Mon, 18 Dec 2017 12:28:26 +0100
Subject: [PATCH] accounts/keystore: Improved error message

* Fix for #15668
---
 accounts/keystore/presale.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/accounts/keystore/presale.go b/accounts/keystore/presale.go
index ed900ad08..1554294e1 100644
--- a/accounts/keystore/presale.go
+++ b/accounts/keystore/presale.go
@@ -58,6 +58,9 @@ func decryptPreSaleKey(fileContent []byte, password string) (key *Key, err error
 	if err != nil {
 		return nil, errors.New("invalid hex in encSeed")
 	}
+	if len(encSeedBytes) < 16 {
+		return nil, errors.New("invalid encSeed, too short")
+	}
 	iv := encSeedBytes[:16]
 	cipherText := encSeedBytes[16:]
 	/*
-- 
GitLab