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

dest.c: Call cupsEnumDests() only if data.name is not NULL (fixes #719) #721

Merged
merged 2 commits into from
Jun 6, 2023

Conversation

zdohnal
Copy link
Member

@zdohnal zdohnal commented Jun 6, 2023

Fixes regression created by #452 - in case there is no default
destination and cupsGetNamedDest() is called to get one (by calling it
with argument name as NULL), the function crashes.

It happens because we try to look for the default printer on the network
(where we access data.name, which is NULL, in callback), but we never
found out the printer's name.

Original fix by Emilio Cobos Alvarez.

…nPrinting#719)

Fixes regression created by OpenPrinting#452 - in case there is no default
destination and `cupsGetNamedDest()` is called to get one (by calling it
with argument `name` as NULL), the function crashes.

It happens because we try to look for the default printer on the network
(where we access `data.name`, which is NULL, in callback), but we never
found out the printer's name.

Original fix by Emilio Cobos Alvarez.
@zdohnal zdohnal added bug Something isn't working priority-high labels Jun 6, 2023
@zdohnal zdohnal added this to the v2.4.4 milestone Jun 6, 2023
@zdohnal
Copy link
Member Author

zdohnal commented Jun 6, 2023

(Once this is reviewed - I'll merge it to 2.4.x as well)

Copy link
Member

@michaelrsweet michaelrsweet left a comment

Choose a reason for hiding this comment

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

LGTM

@michaelrsweet
Copy link
Member

I'll make sure this is mirrored in the libcups3 repo as well.

@zdohnal zdohnal merged commit c822716 into OpenPrinting:master Jun 6, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-high
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants