Skip to content

Commit e7a7fa6

Browse files
authored
Merge pull request #9 from assetnote/fix-gh-issue-8
GH-8 Wordlist panic fix
2 parents 0a0184b + 0fe7cbf commit e7a7fa6

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

internal/scan/options.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,23 @@ func LoadTextWordlist(fns []string, extensions []string, dirsearchCompatabilityM
280280
return nil
281281
}
282282

283+
if strings.HasSuffix(filename, ".kite") {
284+
return fmt.Errorf("attempted to load kitefile as plain text wordlist: %s. Please provide a plain wordlist", filename)
285+
}
286+
287+
if strings.HasSuffix(filename, ".json") {
288+
return fmt.Errorf("attempted to load json as plain text wordlist: %s. Please provide a plain wordlist", filename)
289+
}
290+
283291
lines, err := readLines(filename)
284292
if err != nil {
285293
return fmt.Errorf("failed to load file %s: %w", filename, err)
286294
}
287295

288296
for _, v := range lines {
297+
if len(v) == 0 {
298+
continue
299+
}
289300
// ensure we prepend the / for a path
290301
if v[0] != '/' {
291302
v = append([]byte("/"), v...)

0 commit comments

Comments
 (0)