aboutsummaryrefslogtreecommitdiff
path: root/zhead
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-07-10 00:01:37 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-07-10 00:01:37 +0200
commit7891501b5e373fe00d1ba5556473a866ae15979e (patch)
tree8c2a18b3b7506a8dd7b305511e416cb5cbe344f6 /zhead
parenta84719762a6073ccaba8ed547da065faacea433d (diff)
Check inSum
Diffstat (limited to 'zhead')
-rw-r--r--zhead/header.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/zhead/header.go b/zhead/header.go
index 2984345..90678a2 100644
--- a/zhead/header.go
+++ b/zhead/header.go
@@ -4,6 +4,7 @@ import (
"bufio"
"bytes"
"encoding/hex"
+ "errors"
"io"
"strconv"
"strings"
@@ -67,6 +68,9 @@ func Parse(r io.Reader) (Header, error) {
}
h.BlockSize = i
case line == "":
+ if inSum {
+ return Header{}, errors.New("already in sum part")
+ }
inSum = true
}
if inSum {