From 72fa4a2e5edb6b76f0217b985390d6b592b75106 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 15 Dec 2018 17:37:50 -0500 Subject: [PATCH] Installer: Check return value of GetMountPoint. Probably fixes #14586 (NULL dereference in the strcmp on the next line) but I couldn't quite manage to reproduce it. --- src/apps/installer/WorkerThread.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/apps/installer/WorkerThread.cpp b/src/apps/installer/WorkerThread.cpp index 01cc30221a..452d381ad3 100644 --- a/src/apps/installer/WorkerThread.cpp +++ b/src/apps/installer/WorkerThread.cpp @@ -773,7 +773,8 @@ SourceVisitor::Visit(BPartition *partition, int32 level) bool isBootPartition = false; if (partition->IsMounted()) { BPath mountPoint; - partition->GetMountPoint(&mountPoint); + if (partition->GetMountPoint(&mountPoint) != B_OK) + return false; isBootPartition = strcmp(BOOT_PATH, mountPoint.Path()) == 0; }