PhysicalDisk (OpenBSD): fix potencial out-of-bound read

This commit is contained in:
李通洲
2026-04-03 15:44:47 +08:00
parent 3da344db1f
commit e639700387
@@ -73,7 +73,8 @@ const char* ffDetectPhysicalDisk(FFlist* result, FFPhysicalDiskOptions* options)
ffStrbufAppendC(&device->name, ' ');
ffStrbufAppendNS(&device->name, (uint32_t) ARRAY_SIZE(inquiry.product), inquiry.product);
ffStrbufTrimRight(&device->name, ' ');
ffStrbufSetS(&device->revision, inquiry.revision);
ffStrbufSetNS(&device->revision, (uint32_t) ARRAY_SIZE(inquiry.revision), inquiry.revision);
ffStrbufTrimRight(&device->revision, ' ');
device->type |= inquiry.dev_qual2 & SID_REMOVABLE ? FF_PHYSICALDISK_TYPE_REMOVABLE : FF_PHYSICALDISK_TYPE_FIXED;
}