Skip to content

Commit ee73bcb

Browse files
committed
Fix DNS-SD browsing leak on Windows (Issue #199)
1 parent 93777ea commit ee73bcb

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎CHANGES.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ v3.0.4 - YYYY-MM-DD
4444
- Fixed a bug in `cupsJSONExportString` when exporting a child node (Issue #187)
4545
- Fixed the ECDSA P-256 curve used for JWT and X.509 certificates and signatures
4646
(Issue #188)
47+
- Fixed a DNS-SD browsing issue on Windows (Issue #199)
4748
- Fixed PAM support in `ippeveprinter`.
4849
- Fixed a typo in the JWT HS verification code.
4950
- Fixed `ippValidateAttribute` not returning `false` for too-long URIs.

‎cups/dnssd.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ cupsDNSSDBrowseNew(
422422
if (count == 1)
423423
count ++;
424424

425-
for (i = 1; i < count; i ++)
425+
for (i = 1; i < count && i < _CUPS_DNSSD_MAX; i ++)
426426
{
427427
subtype = (const char *)cupsArrayGetElement(tarray, i);
428428

@@ -453,6 +453,8 @@ cupsDNSSDBrowseNew(
453453
}
454454
}
455455

456+
browse->num_browsers = i;
457+
456458
cupsArrayDelete(tarray);
457459

458460
#else // HAVE_AVAHI

0 commit comments

Comments
 (0)