[k3b] Review Request 120944: Don't increase iterator after it's already at the end

Albert Astals Cid aacid at kde.org
Mon Nov 3 21:11:48 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120944/
-----------------------------------------------------------

(Updated Nov. 3, 2014, 9:11 p.m.)


Status
------

This change has been marked as submitted.


Review request for Gardening Team and K3b.


Bugs: 340515
    http://bugs.kde.org/show_bug.cgi?id=340515


Repository: k3b


Description
-------

Don't increase it after it's already at the end. We are increasing the iterator inside of the loop, and as part of the for so it'll be past the end and the it != l.constEnd() will be true and we will crash. 

Changed the code so that it only increases the iterator if we know it's not at the end already.


Diffs
-----

  src/k3blsofwrapper.cpp 5306f3d 

Diff: https://git.reviewboard.kde.org/r/120944/diff/


Testing
-------

Did some stand-alone code that runs over

const char * processResult = "p1445\ncchrome\nf5\nf6\nf12\nf13\nf16\nf17\nf21\nf22\nf26\nf27\nf32\nf33\np1453\ncchrome\nf6\nf7\np1528\ncdbus-launch\nf8\np1530\ncenlightenment\nf5\nf6\nf10\nf11\nf34\nf37\nf38\np1533\ncefreetd\nf6\nf7\np1540\ncgvfsd\nf6\nf7\np1565\ncterminology\nf5\nf6\nf10\nf11\np1566\ncfirefox\nf10\nf11\nf12\nf13\nf14\nf15\nf22\nf23\nf161\nf162\np1619\ncenlightenment_f\nf5\nf6\np1631\nctempget\nf1\nf5\nf6\nf37\nf38\np1679\ncat-spi-bus-laun\nf5\nf6\np1736\ncplugin-containe\nf6\nf7\nf11\nf12\np1822\ncthunderbird\nf10\nf11\nf12\nf13\nf14\nf15\nf21\nf22\nf44\nf176\np2261\nckdeinit4\nf0\nf3\nf5\np2263\ncklauncher\nf0\nf3\nf4\nf5\nf6\nf10\nf11\np2265\nckded4\nf0\nf4\nf6\np2267\ncgam_server\nf6\nf7\np2346\nckuiserver\nf0\nf4\nf6\np2381\ncknotify4\nf0\nf4\nf6\np2633\nck3b\nf5\nf6\nf14\nf21\nf22\nf25\nf26\nf28\nf33\nf34\np2791\nclsof\nf0\nf1\nf2\nf4\nf5\np2792\nclsof\nf3\nf6\n";

And it crashed, now doesn't crash anymore


Thanks,

Albert Astals Cid

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/k3b/attachments/20141103/4a2f7cbe/attachment.html>


More information about the k3b mailing list