Skip to content

rastertoz.c: Fix SEGV (signal 11).#52

Open
karfas wants to merge 1 commit into
klirichek:masterfrom
karfas:fix-segv
Open

rastertoz.c: Fix SEGV (signal 11).#52
karfas wants to merge 1 commit into
klirichek:masterfrom
karfas:fix-segv

Conversation

@karfas

@karfas karfas commented Oct 5, 2024

Copy link
Copy Markdown

No description provided.

@egormanga

Copy link
Copy Markdown

Doesn't cupsRasterReadPixels() return unsigned?

@karfas

karfas commented Sep 12, 2025

Copy link
Copy Markdown
Author

It's years ago that I had a look on this.

As far as I remember:

  • Certain values of the arguments to compress_buffer() might cause the returned min(iSize, pTarget - pBuf) to become negative (I think the semantics of the difference between two pointers are not standardized in C).
  • The original code assumed a positive (unsigned) result from compress_buffer(), calculating wrong pointers and causing the SEGV later on.

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.

3 participants