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
Fix crash found with go-fuzz #131
Conversation
Hi! Unfortunately it is a little bit more complicated. The real issue here is handling invalid/unsupported filters.
|
Do you prefer that i close this PR and open an issue instead? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix you are suggesting is a side effect of improper handling of unknown filters.
You can fix the root problem in pkg/filter/filter.go in
func NewFilter(filterName string, parms map[string]int) (filter Filter, err error):
...
case DCT:
fallthrough
case JBIG2:
fallthrough
case JPX:
log.Info.Printf("Unsupported filter: <%s>\n", filterName)
err = ErrUnsupportedFilter
default:
err = errors.Errorf("Invalid filter: <%s>\n", filterName)
}
return filter, err
}
If you provide a signed commit I can merge this in.
I will made these changes tonight, thanks for the proper fix. |
8d93ef7
to
6e5759c
Compare
Done with some tests to cover modifications on |
Signed-off-by: Ryar Nyah <ryarnyah@gmail.com>
6e5759c
to
f99a631
Compare
When i was testing go-fuzz, i found some crash on
pdfcpu.parseObjectStream
with this code:You can reproduce it with:
crash-18673daced3f9579540897da71f8c9437ae87f44.zip