From b5b8276db1da149f9f7d21405a66eddeac94560c Mon Sep 17 00:00:00 2001 From: Dmitrii Merkurev Date: Wed, 15 Feb 2023 15:21:22 +0000 Subject: [PATCH] fastboot: Use copy constructor to copy fastboot match callback Test: fastboot -s 15171FDF6000CV getvar all on OSX Bug: 269348113 Change-Id: I968626c95ee19ea348bac48cac308e3c817e0d55 Signed-off-by: Dmitrii Merkurev --- fastboot/usb_osx.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fastboot/usb_osx.cpp b/fastboot/usb_osx.cpp index a4b93079b..5b9e5c8af 100644 --- a/fastboot/usb_osx.cpp +++ b/fastboot/usb_osx.cpp @@ -456,8 +456,7 @@ static int init_usb(ifc_match_func callback, std::unique_ptr* handle } if (h.success) { - handle->reset(new usb_handle); - memcpy(handle->get(), &h, sizeof(usb_handle)); + handle->reset(new usb_handle(h)); ret = 0; break; }