Skip to content

Commit

Permalink
Fix potential null pointer deref
Browse files Browse the repository at this point in the history
  • Loading branch information
vit9696 committed Mar 30, 2020
1 parent 0bafc57 commit e827287
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lilu/Sources/kern_devinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ void BaseDeviceInfo::updateModelInfo() {
}

auto data = OSDynamicCast(OSData, entry->getProperty("Model"));
size_t dataSize = data->getLength();
if (data && dataSize > 0) {
size_t dataSize = data ? data->getLength() : 0;
if (dataSize > 0) {
auto bytes = static_cast<const char16_t *>(data->getBytesNoCopy());
size_t i = 0;
while (bytes[i] != '\0' && i < sizeof(modelIdentifier) - 1 && i < dataSize) {
Expand Down

0 comments on commit e827287

Please sign in to comment.