Fix use-after-free in local_dests for DNS-SD discovery (Issue #1531)#1586
Open
abubakarsabir924-cell wants to merge 4 commits into
Open
Conversation
Member
|
@abubakarsabir924-cell The code of this PR seems to be exactly what I have proposed for 2.4.x, but it seems to contain elements which @michaelrsweet has already fixed after accepting your PR #1573. Please make sure to provide your changes relative to the current state of the repo. |
…#1531) - Added check for _CUPS_DNSSD_INCOMPATIBLE state in enumeration loop - Store UUID in device options for comparison - Incompatible devices are now properly skipped during enumeration
- Properly copy local cupsd queues using calloc/memcpy instead of storing a raw pointer that gets freed - Free local_dests copy at end of cups_enum_dests()
This reverts commit 9df1569.
79a000e to
1e6c8a7
Compare
Contributor
Author
|
@tillkamppeter, about the conflict — I forgot to rebase before pushing. Fixed now! |
Member
|
Thanks for the rebase, but now your changes are missing some random parts of my 2.4.x patch. Please re-check. Especially the initialization of |
…ing#1531) - Initialize local_dests to NULL before DNS-SD discovery - Use cupsCopyDest() in enumeration loop for proper deep copy - Skip urn:uuid: prefix (9 chars) when comparing UUIDs - Free local_dests at all exit points
1e6c8a7 to
a15637b
Compare
Contributor
Author
|
@tillkamppeter Sir! Fixed! Sorry for the missing initialization — I missed it during conflict resolution. |
Member
|
I have tested it and it work for me now. |
tillkamppeter
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the use-after-free bug identified by @tillkamppeter in the
local_dests pointer used during DNS-SD discovery.
Root cause: local_dests was storing a raw pointer to a list that
got freed before DNS-SD discovery ran, causing segfaults.
Changes:
instead of storing a raw pointer
via http-support.c that master uses same format
Note: I don't have a setup to reproduce the issue locally.
Testing by @tillkamppeter would be appreciated.