From 109260481ab7f3f8c94831968be92ee98e4725fb Mon Sep 17 00:00:00 2001 From: Sharad Binjola <31142146+sharadb-amazon@users.noreply.github.com> Date: Mon, 14 Jun 2021 07:24:05 -0700 Subject: [PATCH] Fix: Inserting VP into txtFields in Advertiser_ImplMinimalMdns (#7572) --- src/lib/mdns/Advertiser_ImplMinimalMdns.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/mdns/Advertiser_ImplMinimalMdns.cpp b/src/lib/mdns/Advertiser_ImplMinimalMdns.cpp index 2bc83bf49799d9..83374ac6788ead 100644 --- a/src/lib/mdns/Advertiser_ImplMinimalMdns.cpp +++ b/src/lib/mdns/Advertiser_ImplMinimalMdns.cpp @@ -568,13 +568,15 @@ FullQName AdvertiserMinMdns::GetCommisioningTextEntries(const CommissionAdvertis size_t numTxtFields = 0; char txtVidPid[chip::Mdns::kKeyVendorProductMaxLength + 4]; - if (params.GetProductId().HasValue()) + if (params.GetProductId().HasValue() && params.GetVendorId().HasValue()) { sprintf(txtVidPid, "VP=%d+%d", params.GetVendorId().Value(), params.GetProductId().Value()); + txtFields[numTxtFields++] = txtVidPid; } - else + else if (params.GetVendorId().HasValue()) { sprintf(txtVidPid, "VP=%d", params.GetVendorId().Value()); + txtFields[numTxtFields++] = txtVidPid; } char txtDeviceType[chip::Mdns::kKeyDeviceTypeMaxLength + 4];