hiyohiyo / CrystalDiskInfo

CrystalDiskInfo
https://github.com/hiyohiyo/CrystalDiskInfo
MIT License
1.6k stars 178 forks source link

Array indices out of bounds? #163

Closed mjunix closed 2 years ago

mjunix commented 2 years ago
  1. https://github.com/hiyohiyo/CrystalDiskInfo/blob/656db0d0904a6c0388f65b074617a1f2eaced0ea/OptionDlg.cpp#L108 m_ColorCode is accessed at index 128 but the array only has 81 elements.

  2. https://github.com/hiyohiyo/CrystalDiskInfo/blob/656db0d0904a6c0388f65b074617a1f2eaced0ea/AtaSmart.cpp#L2282 commandTypeString has 24 elements (last index 23), if commandType is equal to COMMAND_TYPE::CMD_TYPE_DEBUG of value 24 then that would be outside the array. (Is commandTypeString missing an entry for debug at end which exist in COMMAND_TYPE? Or perhaps the check in if-condition should be changed to "commandType < COMMAND_TYPE::CMD_TYPE_DEBUG"? I'm not sure which...)

hiyohiyo commented 2 years ago

Thank you for your bug report. I will fix it in the 8.15.1.