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

cups-browsed gets SIGSEGV when generating PPD file #314

Closed
zdohnal opened this issue Oct 27, 2020 · 1 comment
Closed

cups-browsed gets SIGSEGV when generating PPD file #314

zdohnal opened this issue Oct 27, 2020 · 1 comment

Comments

@zdohnal
Copy link
Member

zdohnal commented Oct 27, 2020

Hi,

we have an issue in Fedora about cups-browsed getting SIGSEGV when generating PPD file.

cups-browsed is set to BrowsePoll to CentOS 7 server, where a print queue with following ppd is installed. CUPS-1.6.3 from CentOS is not capable to return media-col-database via response, so Get-Printer-Attributes operation passes only with All keyword for requested attributes.

The attached gdb log shows ppdname contains A4 because media-col-default contains non-borderless value, but other attributes are missing (media-col-database) or are set as borderless (media-size-supported, media-supported).

Then the SIGSEGV comes in this code:

2224 
2225     if (all_borderless) {
2226       suffix = strcasestr(ppdname, ".Borderless");
2227       *suffix = '\0';
2228     }

all_borderless is still 1, because all medias in sizes are Borderless, but ppdname is A4, so it segfaults on *suffix = '\0'; because suffix is NULL.

The quick fix would be to check whether suffix is NULL, but it feels like narrow fix - what do you think about how the code should behave in situations when media-col-default tells non-borderless media and other medias are borderless?

@tillkamppeter
Copy link
Member

Simple addition of NULL checks is OK here, as we only want to remove unneeded ".Borderless" suffixes.
Fixed in commit 240ffb9 in master. Merge to 1.x will come later.

zdohnal added a commit to zdohnal/cups-filters that referenced this issue Dec 7, 2020
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

No branches or pull requests

2 participants