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

crash with strange format on xlsx file #12

Open
gvollant opened this issue May 17, 2024 · 4 comments · May be fixed by #13
Open

crash with strange format on xlsx file #12

gvollant opened this issue May 17, 2024 · 4 comments · May be fixed by #13
Labels
bug Something isn't working

Comments

@gvollant
Copy link
Contributor

I received and xlsx file with this strange format

mini5.xlsx

#,##0\ "gche";[Red]\-#,##0\ "gche"

xlsx_drone crash when xlsx_open is called (in get_formetted function, called by get_related_category)

I'll subit a PR with a string length verification

gvollant added a commit to gvollant/xlsx_drone that referenced this issue May 17, 2024
@gvollant
Copy link
Contributor Author

@damian-m-g

@gvollant
Copy link
Contributor Author

gvollant commented Jun 2, 2024

@damian-m-g what do you think?

@damian-m-g
Copy link
Owner

Hi Gilles, thanks for reporting the problem. I checked the XLSX, not in depth, but at least I found that cell category (aka format code):

image

I couldn't yet debug the lib to reproduce the error, but I've tried to follow the problem by bare eye. I see no way, in which the length of the cell category could cause a problem. So get_related_category() which in time calls get_formatter(), gets passed the length of the cell category:

image

And then on get_related_category(), the code never pass an index out of the bounds of the cell category length:

image

So your first check according to this analysis could be in vain. About your second check, I followed this specific case and it should work fine (without the fix). In conclusion, I need to set up my machine to debug this code, as it got formatted recently. This could even be a problem of the third hand libraries we are using (perhaps SXMLC), or something else. When I have some time available I'll do it.

@damian-m-g damian-m-g added the bug Something isn't working label Jul 3, 2024
@Neustradamus
Copy link

@damian-m-g: Any progress on it?

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

Successfully merging a pull request may close this issue.

3 participants