Add various bugfixes from upstream 2.0 branch (forwarded request 145797 from sumski) OBS-URL: https://build.opensuse.org/request/show/145798 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/k3b?expand=0&rev=48
34 lines
958 B
Diff
34 lines
958 B
Diff
From: Michal Malek <michalm@jabster.pl>
|
|
Date: Sat, 09 Jul 2011 22:03:55 +0000
|
|
Subject: Fixed crash on detecting writing speeds
|
|
X-Git-Url: http://quickgit.kde.org/?p=k3b.git&a=commitdiff&h=61ee818030f29e57556248adf1398b6c9e5ee7de
|
|
---
|
|
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
|
|
---
|
|
|
|
|
|
--- a/libk3bdevice/k3bdevice.cpp
|
|
+++ b/libk3bdevice/k3bdevice.cpp
|
|
@@ -3253,7 +3253,7 @@
|
|
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
|
|
|