qt: Fix potential null pointer access in media history
This commit is contained in:
@@ -132,8 +132,9 @@ void MediaHistoryManager::serializeImageHistoryType(ui::MediaType type)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for ( int slot = 0; slot < MAX_PREV_IMAGES; slot++) {
|
for ( int slot = 0; slot < MAX_PREV_IMAGES; slot++) {
|
||||||
|
if (device_history_ptr[slot] != nullptr) {
|
||||||
strncpy(device_history_ptr[slot], master_list[type][device][slot].toUtf8().constData(), MAX_IMAGE_PATH_LEN);
|
strncpy(device_history_ptr[slot], master_list[type][device][slot].toUtf8().constData(), MAX_IMAGE_PATH_LEN);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user