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

check whether xform->Lut is valid in cmsTransform2DeviceLink #408

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

x2018
Copy link
Contributor

@x2018 x2018 commented Nov 1, 2023

In cmsTransform2DeviceLink(), it does not check if xform -> Lut is valid, which can result in potential NULL dereference:

==27935==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000000670a92 bp 0x7fffad69b910 sp 0x7fffad69b900 T0)
==27935==The signal is caused by a READ memory access.
==27935==Hint: address points to the zero page.
    #0 0x670a92 in cmsPipelineGetPtrToFirstStage Little-CMS-lcms2.15/src/cmslut.c:1639:18
    #1 0x6de22c in cmsTransform2DeviceLink Little-CMS-lcms2.15/src/cmsvirt.c:1079:11

The xform -> Lut can be NULL as cmsCreateExtendedTransform() will return a fake transform that sets xform -> Lut to NULL, when the flag is cmsFLAGS_NULLTRANSFORM.

Note: here I suppose the valid of arguments should be checked by the caller, so I did not add checks to the related functions in cmslut.c.

@mm2 mm2 merged commit c58f881 into mm2:master Nov 1, 2023
9 checks passed
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