From 99c8dbf215ec7721f75f790633e1f6c7f0729b42 Mon Sep 17 00:00:00 2001 From: Dees Troy Date: Mon, 10 Mar 2014 16:53:58 +0000 Subject: Check to ensure that selinux_handle is populated before using Change-Id: I6de4c5db3e3183229d7029fc72b957c7ef61f23a --- partition.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partition.cpp b/partition.cpp index 172633c07..640a280ef 100644 --- a/partition.cpp +++ b/partition.cpp @@ -1386,7 +1386,7 @@ bool TWPartition::Wipe_EXT4() { gui_print("Formatting %s using make_ext4fs function.\n", Display_Name.c_str()); - if (selabel_lookup(selinux_handle, &secontext, Mount_Point.c_str(), S_IFDIR) < 0) { + if (!selinux_handle || selabel_lookup(selinux_handle, &secontext, Mount_Point.c_str(), S_IFDIR) < 0) { LOGINFO("Cannot lookup security context for '%s'\n", Mount_Point.c_str()); ret = make_ext4fs(Actual_Block_Device.c_str(), Length, Mount_Point.c_str(), NULL); } else { -- cgit v1.2.3