From 903bb86f96c94aba095fdd5749f1376a43bb5a5e Mon Sep 17 00:00:00 2001 From: Anthony De Meulemeester Date: Thu, 27 Sep 2018 08:21:31 +0200 Subject: [PATCH] Task/fix sc template (#100) * Fixed security issue in smart contract template * Bumped version * fixed typo --- VERSION | 2 +- examples/token-sale/token_sale.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index c6cd196e6..e74136f3c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.44.8 +0.44.9 diff --git a/examples/token-sale/token_sale.go b/examples/token-sale/token_sale.go index c6f399b18..9455cb2b6 100644 --- a/examples/token-sale/token_sale.go +++ b/examples/token-sale/token_sale.go @@ -228,6 +228,9 @@ func approve(ctx storage.Context, owner, spender []byte, amount int) bool { if !runtime.CheckWitness(owner) || amount < 0 { return false } + if len(spender) != 20 { + return false + } toSpend := storage.Get(ctx, owner).(int) if toSpend < amount { return false