mirror of
https://github.com/danielmiessler/SecLists.git
synced 2025-06-08 05:57:52 +00:00
Merge pull request #936 from molangning/patch-6
Edited script so that workflow does not blow up when it reads a unicode files
This commit is contained in:
commit
d02c14efe6
@ -9,7 +9,7 @@ print("[+] New line check")
|
|||||||
|
|
||||||
if not sys.argv[1]:
|
if not sys.argv[1]:
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
files=sys.argv[1].split(" ")
|
files=sys.argv[1].split(" ")
|
||||||
|
|
||||||
for i in files:
|
for i in files:
|
||||||
@ -18,17 +18,16 @@ for i in files:
|
|||||||
exit(2)
|
exit(2)
|
||||||
|
|
||||||
for i in files:
|
for i in files:
|
||||||
f=open(i,"r")
|
contents=open(i,"rb").read()
|
||||||
contents=f.read()
|
|
||||||
|
if contents[-1] == b'\n':
|
||||||
if contents[-1] == '\n':
|
|
||||||
print("[!] %s ends with a new line!"%(i))
|
print("[!] %s ends with a new line!"%(i))
|
||||||
exit(2)
|
exit(2)
|
||||||
print("[+] %s passed new line check!"%(i))
|
print("[+] %s passed new line check!"%(i))
|
||||||
|
|
||||||
counter=1
|
counter=1
|
||||||
|
|
||||||
for line in contents.split('\n'):
|
for line in contents.split(b'\n'):
|
||||||
if len(line)==0:
|
if len(line)==0:
|
||||||
print("[!] %s has an empty entry at line %i!"%(i,counter))
|
print("[!] %s has an empty entry at line %i!"%(i,counter))
|
||||||
exit(2)
|
exit(2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user