hakluke / hakcheckurl

Takes a list of URLs and returns their HTTP response codes
MIT License
389 stars 44 forks source link

It crashses giving the following error #7

Closed dark-warlord14 closed 4 years ago

dark-warlord14 commented 4 years ago
goroutine 408 [running]:                                                
main.main.func1(0xc00001a340, 0xc00001e180, 0xc000068ba0, 0xc0000991d0, 0x46)                                                                         
        /root/go/src/github.com/hakluke/hakcheckurl/main.go:51 +0xe5                                                                                  
created by main.main                                                                                                                                  
        /root/go/src/github.com/hakluke/hakcheckurl/main.go:46 +0x2df

panic: runtime error: invalid memory address or nil pointer dereference                                                                               
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x62f8c5]
hakluke commented 4 years ago

Hey @dark-warlord14 can you give me the exact command you ran?

Also ensure that you are using the most recent version.

dark-warlord14 commented 4 years ago

I used the most basic one waybackurls -no-subs yahoo.com | hakcheckurl > result.txt May be it is due handling of goroutines. I dont know much about go but the crash happens if you feed the tool a vast amount of data.

Ice3man543 commented 4 years ago

@hakluke this seems to be caused by assigning headers before checking if the request has been created successfully. A moving the error check up would solve the issue.

https://github.com/hakluke/hakcheckurl/blob/831a993f088daebdfaf3a0a532dfd4f332364e4a/main.go#L50-L55

pczajkowski commented 4 years ago

Should've been fixed by 014c9fc.

hakluke commented 4 years ago

Done!