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

leaked temp files when unzip failed #1680

Closed
soderasen-au opened this issue Oct 3, 2023 · 2 comments
Closed

leaked temp files when unzip failed #1680

soderasen-au opened this issue Oct 3, 2023 · 2 comments

Comments

@soderasen-au
Copy link

unzip sometimes fails in func (f *File) ReadZipReader(r *zip.Reader) when reading in large xlsx while there's not sufficient disk space, and the related temp file won't be cleared in this case.

a draft fix would be something like:

			tempFile, err := f.unzipToTemp(v)
			if tempFile != "" {
				f.tempFiles.Store(fileName, tempFile)
			}
			if err == nil {
				continue
			}
@soderasen-au
Copy link
Author

this might be related to #1062

@xuri xuri added needs more info This issue can't reproduce, need more info and removed needs more info This issue can't reproduce, need more info labels Oct 4, 2023
@xuri xuri added the in progress Working in progress label Oct 8, 2023
@xuri xuri closed this as completed in 87a00e4 Oct 8, 2023
@xuri
Copy link
Member

xuri commented Oct 8, 2023

Thanks for your issue. This issue has been fixed, please try to upgrade the master branch code, and this patch will be released in the next version.

@xuri xuri removed the in progress Working in progress label Oct 8, 2023
jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this issue Oct 22, 2023
…temporary files can not be clear

- Delete image files from the workbook internally when deleting pictures to reduce generated workbook size and resolve potential security issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants