mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #442] Bug: workbook_validate_sheet_name buffer-overflow #348
Labels
No labels
awaiting user feedback
bug
cmake
cmake
docs
feature request
in progress
long term
medium term
medium term
pull-request
question
question
ready to close
short term
under investigation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/libxlsxwriter#348
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ym-xie on GitHub (May 8, 2024).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/442
Originally assigned to: @jmcnamara on GitHub.
hello, maybe there exist a bug in workbook_validate_sheet_name.
When
sheetnameis an empty string (""), theworkbook_validate_sheet_namefunction does not check if the string length is 0, leading to a buffer overflow.The following is the relevant code, the crash occurs at workbook.c:workbook_validate_sheet_name.@jmcnamara commented on GitHub (May 8, 2024):
Thanks for the report. That is omission/bug. I'll add a fix.
@jmcnamara commented on GitHub (May 8, 2024):
I've pushed a fix for this to main. There is now a new error code called
LXW_ERROR_SHEETNAME_IS_BLANKfor this condition.@ym-xie commented on GitHub (May 9, 2024):
Should verify in advance that
nameis NULL?@jmcnamara commented on GitHub (May 9, 2024):
My initial thought was that the end user should check for NULL and that
workbook_validate_sheet_name()should validate the name and not the string. However, most libxlsxwriter functions check forNULLso I've added aLXW_ERROR_NULL_PARAMETER_IGNOREDerror as well.I've force pushed that change to main.