[k3b] [Bug 382941] Segfault from getSupportedWriteSpeedsVia2A

Mark bugzilla_noreply at kde.org
Fri Aug 11 23:07:53 UTC 2017


https://bugs.kde.org/show_bug.cgi?id=382941

Mark <magpie240 at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |VERIFIED
         Resolution|WAITINGFORINFO              |WORKSFORME

--- Comment #8 from Mark <magpie240 at gmx.com> ---
Right, let's put this puppy to bed once and for all ;P 

Firstly, k3bdeviceglobals.cpp line 215- can revert to:

quint16 K3b::Device::from2Byte(const unsigned char* d)
{
    if (d == NULL) {
        qWarning() << "Invalid Byte!";

Now, the actual fix. data.size() returns (for me) 34 so (34 - 32 - 8) becomes
negative which is then assigned to an unsigned int.

Here's my workaround:
k3bdevice.cpp 3241

// Ensure number of descriptors claimed actually fits in the data
// returned by the mode sense command.
if ((data.size() - 32 - 8) > 0) {
    if( static_cast<int>( numDesc ) > ((data.size() - 32 - 8) / 4) )
         numDesc = (data.size() - 32 - 8) / 4;
}

cd_wr_speed_performance* wr = (cd_wr_speed_performance*)mm->wr_speed_des;

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the k3b mailing list