Skip to content

Commit

Permalink
return early if jar manifest has no sections
Browse files Browse the repository at this point in the history
Signed-off-by: AdamKorcz <adam@adalogics.com>
  • Loading branch information
AdamKorcz authored and mtharp committed Jul 26, 2023
1 parent 7c03f01 commit 535f0ec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/signjar/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ func ParseManifest(manifest []byte) (files *FilesMap, err error) {
if err != nil {
return nil, err
}
if len(sections) == 0 {
return nil, errors.New("manifest has no sections")
}
files = &FilesMap{
Order: make([]string, 0, len(sections)-1),
Files: make(map[string]http.Header, len(sections)-1),
Expand Down

0 comments on commit 535f0ec

Please sign in to comment.