Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes when malformed date #90

Closed
maop opened this issue Jun 16, 2024 · 3 comments · Fixed by #91
Closed

Crashes when malformed date #90

maop opened this issue Jun 16, 2024 · 3 comments · Fixed by #91
Labels
bug Something isn't working

Comments

@maop
Copy link

maop commented Jun 16, 2024

Hello!

When trying to preview this feed: https://www.sinembargo.mx/feed nom crashes with a panic error

$ nom -v -f https://www.sinembargo.mx/feed
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa9c018]

goroutine 22 [running]:
github.com/guyfedwards/nom/v2/internal/rss.feedToRSS({{0x7fff14fd2ba8?, 0x7fff14fd2ba8?}, {0x0?, 0x10dc770?}}, 0xc0005722c0)
	github.com/guyfedwards/nom/v2/internal/rss/rss.go:76 +0x1d8
github.com/guyfedwards/nom/v2/internal/rss.Fetch({{0x7fff14fd2ba8?, 0x0?}, {0x0?, 0x0?}}, {0x0?, 0x0?})
	github.com/guyfedwards/nom/v2/internal/rss/rss.go:43 +0x267
github.com/guyfedwards/nom/v2/internal/commands.fetchFeed(0xc000032420, 0x0?, {{0x7fff14fd2ba8?, 0x0?}, {0x0?, 0x0?}}, {0x0?, 0x0?})
	github.com/guyfedwards/nom/v2/internal/commands/commands.go:372 +0xa5
created by github.com/guyfedwards/nom/v2/internal/commands.Commands.fetchAllFeeds in goroutine 1
	github.com/guyfedwards/nom/v2/internal/commands/commands.go:263 +0x138

I think is because the pubDate is malformed, example: <pubDate>Dom, 16 Jun 2024 00:05:38 +0000 2024-06-16 00:05:38</pubDate> and gofeed does not parse it so *it.PublishedParsed doesn't exist

Also i think it should just continue with either an empty date or just the origin pubDate like other rss tools do, maybe?

Thank you for this tool it's exactly what i've been looking for, i love that i can use custom openers, mpv for youtube, or reader to get complete articles when the rss has only a little extract. is brilliant! 👏

@guyfedwards
Copy link
Owner

Thanks for reporting @maop I'll take a look!

@guyfedwards guyfedwards added the bug Something isn't working label Jun 16, 2024
guyfedwards added a commit that referenced this issue Jun 16, 2024
prevents panics when PublishedParsed is nil due to non-english date

closes #90
guyfedwards added a commit that referenced this issue Jun 16, 2024
prevents panics when PublishedParsed is nil due to non-english date

closes #90
@guyfedwards
Copy link
Owner

Fixed in https://github.com/guyfedwards/nom/releases/tag/v2.5.1, thanks again for reporting @maop

@maop
Copy link
Author

maop commented Jun 23, 2024

Great! thank you for taking a look on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants