[GH-ISSUE #456] Crash if filename is longer than 31 characters #357

Closed
opened 2026-05-05 12:11:41 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @duncangroenewald on GitHub (Oct 6, 2024).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/456

Subject: [WARNING]: workbook_add_worksheet(): worksheet name 'xxxxxxxxxxxxxxxxxxxxxx' has error: Worksheet name exceeds Excel's limit of 31 characters.

This results in a crash here on macOS 14 - which shouldn't have any such restriction because MS Excel seems to open files with long filenames without any problems.

/* In optimization mode we don't change dimensions for rows that are */
/* already written. */
if (!ignore_row && !ignore_col && self->optimize) {             <<<<< Crash in self->optimise
    if (row_num < self->optimize_row->row_num)
        return LXW_ERROR_WORKSHEET_INDEX_OUT_OF_RANGE;
}

Been using an earlier version 1.1.5 of the library with no problems.

Originally created by @duncangroenewald on GitHub (Oct 6, 2024). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/456 > Subject: [WARNING]: workbook_add_worksheet(): worksheet name 'xxxxxxxxxxxxxxxxxxxxxx' has error: Worksheet name exceeds Excel's limit of 31 characters. This results in a crash here on macOS 14 - which shouldn't have any such restriction because MS Excel seems to open files with long filenames without any problems. /* In optimization mode we don't change dimensions for rows that are */ /* already written. */ if (!ignore_row && !ignore_col && self->optimize) { <<<<< Crash in self->optimise if (row_num < self->optimize_row->row_num) return LXW_ERROR_WORKSHEET_INDEX_OUT_OF_RANGE; } Been using an earlier version 1.1.5 of the library with no problems.
Author
Owner

@duncangroenewald commented on GitHub (Oct 6, 2024):

OK my bad - I was mistakenly setting the worksheet name to the filename and not reading the error message properly. The error had nothing to do with the filename !

<!-- gh-comment-id:2395342167 --> @duncangroenewald commented on GitHub (Oct 6, 2024): OK my bad - I was mistakenly setting the worksheet name to the filename and not reading the error message properly. The error had nothing to do with the filename !
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/libxlsxwriter#357
No description provided.