Skip to content

Fix undefined behavior leading to crash with clang#1

Open
AMDmi3 wants to merge 2 commits intopetewarden:masterfrom
AMDmi3:ub
Open

Fix undefined behavior leading to crash with clang#1
AMDmi3 wants to merge 2 commits intopetewarden:masterfrom
AMDmi3:ub

Conversation

@AMDmi3
Copy link

@AMDmi3 AMDmi3 commented Nov 1, 2014

This code crashes with clang 3.4.1+, most likely due to arithmetics to null pointer, which is undefined behavior. I've fixed two apparent cases, there may be more.

PS. I'll be unavailable for 2 weeks, after that I'll try to find other cases.
PPS. FYI, there's bunch of other code fixes to catdoc in Debian, you'd probably like to review and merge them as well. Catdoc it still in high demand, and I really hope we can bring it back to shape.

This code crashes with clang 3.4.1+, most likely due to arithmetics
to null pointer, which is undefined behavior
@AMDmi3
Copy link
Author

AMDmi3 commented Nov 1, 2014

PPPS. I've just realized you may not be catdoc author. Still, fixes are relevant.

@skierpage
Copy link

Victor Wagner's 0.95 release of catdoc from 2016 makes changes at the same code sites in the two functions find_file() and list_charsets() ; I have these fixes in my fork. @AMDmi3 , do you think the UB bugs are fixed?

@AMDmi3
Copy link
Author

AMDmi3 commented Jul 10, 2025

I'm no longer interested in this project, sorry.

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

Successfully merging this pull request may close these issues.

2 participants