Skip to content

ppd-emit.c: Fix SEGV in 'ppdEmitString()'#850

Merged
zdohnal merged 3 commits intoOpenPrinting:masterfrom
Drawishe:master
Jan 4, 2024
Merged

ppd-emit.c: Fix SEGV in 'ppdEmitString()'#850
zdohnal merged 3 commits intoOpenPrinting:masterfrom
Drawishe:master

Conversation

@Drawishe
Copy link
Contributor

When using testppd.c as a harness, a fuzzer found a way to call ppdPageSize() with NULL return value.
This caused a segmentation fault because the size structure, which is used by values[pos], was assigned a NULL value.
To avoid this, we need to add a NULL value check for the size structure, free allocated memory, and return NULL.

Fixes #849

When using testppd.c as a harness, a fuzzer found a way to call
ppdPageSize() with NULL return value. This caused a segmentation fault
because the size structure, which is used by values[pos],
was assigned a NULL value. To avoid this, we need to add a
NULL value check for the size structure, free allocated memory,
and return NULL.

Fixes OpenPrinting#849
@zdohnal
Copy link
Member

zdohnal commented Jan 2, 2024

Note to myself - push it into libppd once merged.

Copy link
Member

@zdohnal zdohnal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you Kirill!

@zdohnal
Copy link
Member

zdohnal commented Jan 4, 2024

Tests are failing on the similar place as before, so it looks ok to me.

@zdohnal zdohnal merged commit 0a834c3 into OpenPrinting:master Jan 4, 2024
@zdohnal
Copy link
Member

zdohnal commented Jan 4, 2024

@Drawishe thank you for the fix!

@zdohnal
Copy link
Member

zdohnal commented Jan 4, 2024

One late note - it would be great if you squashed the commits next time if possible, it gives cleaner git history.

@jsmeix
Copy link

jsmeix commented Jan 4, 2024

@zdohnal
did you really mean "git stash"?

@zdohnal
Copy link
Member

zdohnal commented Jan 4, 2024

@jsmeix thanks Johannes, it was really "squash"....

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.

SEGV ppd-emit.c:905:22 in ppdEmitString()

3 participants