Closed
Bug 1233813
Opened 10 years ago
Closed 10 years ago
[MDNS] fix issue with resolving services with no TXT records
Categories
(Core :: Networking, defect)
Core
Networking
Tracking
()
RESOLVED
FIXED
mozilla46
| Tracking | Status | |
|---|---|---|
| firefox46 | --- | fixed |
People
(Reporter: djvj, Assigned: djvj)
Details
Attachments
(1 file)
|
586 bytes,
patch
|
schien
:
review+
|
Details | Diff | Splinter Review |
Resolving mDNS services with zero TXT records causes a crash, for the following reasons:
In MDNSResponderOperator.cpp, we initialize the "attributes" property bag to nullptr if there are no TXT attributes.
See: https://dxr.mozilla.org/mozilla-central/source/netwerk/dns/mdns/libmdns/MDNSResponderOperator.cpp#635
Later, in GetAddrInfoOperator::Reply, we construct a new instance of nsDNSServiceInfo using the previous instance (which has a null |attributes| field).
See: https://dxr.mozilla.org/mozilla-central/source/netwerk/dns/mdns/libmdns/MDNSResponderOperator.cpp#757
This crashes in nsDNSServiceInfo's initialize-from-pointer constructor.
See: https://dxr.mozilla.org/mozilla-central/source/netwerk/dns/mdns/libmdns/nsDNSServiceInfo.cpp#46
The issue is that when |nsDNSServiceInfo->SetAttribute()| gets called with a nullptr, its |mIsAttributesSet| is set to true unconditionally. That should depend on whether the incoming pointer is null or not.
Fix attached.
Attachment #8700130 -
Flags: review?(schien)
Comment 1•10 years ago
|
||
Comment on attachment 8700130 [details] [diff] [review]
fix-mdns-attributes-set.patch
Review of attachment 8700130 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks for catching this bug!
Attachment #8700130 -
Flags: review?(schien) → review+
Comment 3•10 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox46:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in
before you can comment on or make changes to this bug.
Description
•