From 7cc78f1d99b2c84da325048e11d7c4a75eb38102 Mon Sep 17 00:00:00 2001 From: krypton36 Date: Tue, 12 Jul 2022 09:40:18 -0700 Subject: [PATCH] Resolve crasher in Matter.framework when parsing query image params (#20592) --- src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm b/src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm index b5675ca4f79bbe..96da43ad219203 100644 --- a/src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm +++ b/src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm @@ -158,7 +158,9 @@ } if (commandData.location.HasValue()) { - commandParams.location = [NSString stringWithUTF8String:commandData.location.Value().data()]; + commandParams.location = [[NSString alloc] initWithBytes:commandData.location.Value().data() + length:commandData.location.Value().size() + encoding:NSUTF8StringEncoding]; } if (commandData.requestorCanConsent.HasValue()) {