Check for valid MTP_Storage_ID before adding or removing
Attempting to add a storage ID of 0 was causing a seg fault. Change-Id: If8797186405be36ee70dbca63bd1063a62ba2812
This commit is contained in:
@@ -2015,6 +2015,8 @@ bool TWPartitionManager::Add_Remove_MTP_Storage(TWPartition* Part, int message_t
|
||||
}
|
||||
|
||||
if (Part) {
|
||||
if (Part->MTP_Storage_ID == 0)
|
||||
return false;
|
||||
if (message_type == MTP_MESSAGE_REMOVE_STORAGE) {
|
||||
mtp_message.message_type = MTP_MESSAGE_REMOVE_STORAGE; // Remove
|
||||
LOGINFO("sending message to remove %i\n", Part->MTP_Storage_ID);
|
||||
|
||||
Reference in New Issue
Block a user