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

[BUG] GetAttachedFiles causes panic #565

Closed
crashingfish opened this issue Sep 6, 2024 · 7 comments
Closed

[BUG] GetAttachedFiles causes panic #565

crashingfish opened this issue Sep 6, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@crashingfish
Copy link

crashingfish commented Sep 6, 2024

Description

GetAttachedFiles was introduced in 3.5. Calling it on a pdf file with attachment consistently causes panic.

Expected Behavior

Return a list of attachments if any.

Actual Behavior

Steps to reproduce the behavior:

  1. Read a pdf file with attachments
  2. Call GetAttachedFiles to test.

Sample code

`
fileBytes, _ := os.ReadFile(filename)

pdfReader, err := model.NewPdfReader(bytes.NewReader(fileBytes))

attachments, err := pdfReader.GetAttachedFiles()
`

Attachments

Cannot share internal pdf file due to compliance issues. However the code was testing against loads of files and the issue is consistent.

Copy link

github-actions bot commented Sep 6, 2024

Welcome! Thanks for posting your first issue. The way things work here is that while customer issues are prioritized, other issues go into our backlog where they are assessed and fitted into the roadmap when suitable. If you need to get this done, consider buying a license which also enables you to use it in your commercial products. More information can be found on https://unidoc.io/

@3ace
Copy link

3ace commented Sep 6, 2024

@crashingfish thank you for the report. We'll investigate this immediately.

@3ace 3ace added the bug Something isn't working label Sep 6, 2024
@crashingfish
Copy link
Author

@3ace I missed to share this. Hope this helps.

[signal SIGSEGV: segmentation violation code=0x2 addr=0x20 pc=0x102e97340]

goroutine 1 [running]:
github.com/unidoc/unipdf/v3/model.(*PdfReader).GetAttachedFiles(0x140004cdce8?)
/go/pkg/mod/github.com/unidoc/unipdf/[email protected]/model/model.go:3095 +0x1d0

@3ace
Copy link

3ace commented Sep 6, 2024

@crashingfish I've already located the issue and has implement a fix for this. The fix is currently in review internally and hopefully it would be available with our next UniPDF release.

@crashingfish
Copy link
Author

crashingfish commented Sep 9, 2024 via email

@3ace
Copy link

3ace commented Sep 16, 2024

@crashingfish we've released new UniPDF version 3.62.0 that should contain a fix for this issue https://github.com/unidoc/unipdf/tree/v3.62.0.

Please test it and let us know the result.

@3ace
Copy link

3ace commented Oct 21, 2024

@crashingfish As we haven't received any further updates from you, we are closing this ticket for now. If you experience any additional issues, please open a new ticket. Thank you!

@3ace 3ace closed this as completed Oct 21, 2024
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

No branches or pull requests

2 participants