-
Notifications
You must be signed in to change notification settings - Fork 196
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
SEGV ppd-emit.c:905:22 in ppdEmitString() #849
Closed
Comments
Drawishe
added a commit
to Drawishe/cups
that referenced
this issue
Dec 27, 2023
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
Drawishe
added a commit
to Drawishe/cups
that referenced
this issue
Dec 27, 2023
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
added a commit
that referenced
this issue
Jan 4, 2024
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
zdohnal
added a commit
to zdohnal/libppd
that referenced
this issue
Jan 4, 2024
Original report/fix: OpenPrinting/cups#849
tillkamppeter
pushed a commit
to OpenPrinting/libppd
that referenced
this issue
Jan 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I have found SIGSEGV crashes with cups upstream version (79c602c), using unit test
testppd.c
as a harness for fuzzing.Here is the test.ppd file, which causes SEGV:
testppd.tar.gz
This problem arises due to the lack of verification of size structure for NULL value in
ppdEmitString()
. In that case functionppdPageSize()
returns NULL, which is recorded into structure size, then there is an appeal to the element lenght of size structure, which causes SEGV.cups/cups/ppd-emit.c
Line 891 in 79c602c
cups/cups/ppd-emit.c
Line 905 in 79c602c
To Reproduce
Steps to reproduce the behavior:
cd cups make testppd
Expected behaviour
Test case doesn't crash.
System Information:
The text was updated successfully, but these errors were encountered: