Commit 61ee8180 authored by Michal Malek's avatar Michal Malek
Browse files

Fixed crash on detecting writing speeds

Device::Device::determineSupportedWriteSpeeds() method
lacked checking if data array is of enough size before accessing
it.

BUG: 272427
FIXED-IN: 2.0.3

Conflicts:

	libk3bdevice/k3bdevice.cpp
	libk3bdevice/k3bdevice_mmc.cpp
parent 6110dc54
......@@ -4,6 +4,7 @@ Bugfixes:
* Missing "Extract Digital Audio with K3b" in device notifier for Audio CD medium (265819)
* Clearing up track info in audio project when CDDB query failed
* Improper track number in CDDB track edit window title (276681)
* Crash on detecting writing speeds (272427)
2.0.2
=====
......
......@@ -3253,7 +3253,7 @@ QList<int> K3b::Device::Device::determineSupportedWriteSpeeds() const
int max = 0;
unsigned char* data = 0;
unsigned int dataLen = 0;
if( modeSense( &data, dataLen, 0x2A ) ) {
if( modeSense( &data, dataLen, 0x2A ) && dataLen >= 8 ) {
mm_cap_page_2A* mm = (mm_cap_page_2A*)&data[8];
// MMC1 used byte 18 and 19 for the max write speed
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment