Still open issues of the report from Christoph Bartoschek: ------------------------------------------------------------------ Misc problems: ------------------------------------------------------------------ - kpilot/conduits/docconduit/makedoc9.cc:314 Can the else part be enterd in the first iteration of the loop at line 280? If yes, then line 314 uses uninitialized values from out_buf. - kmail/kmheaders.cpp:2573 [PATCH PENDING] The variable i controls the for loops in line 2573 and 2565. - ktnef/gui/qwmf.cpp:274 If the condition in line 228 is true, then header is still uninitialized here. - libkcal/icalformatimpl.cpp:270 When line 270 is executed only period.start and period.duration or period.end are initialized. - libkcal/icalformatimpl.cpp:205 It seems to be possible that lines 197 and 202 are not visited because line 193 and 201 do not satisfy the condition. In this case end is not initialized. - kalarm/kamail.cpp:957 The loop is executed at most once. All paths inside leave the loop. - kaddressbook/xxport/pab_pablib.cpp:320 s2 is a unsigned short. For a unsigned short only shifts up to 15 are allowed, when the size is 16 bits. This command sets s2 to 0. - kaddressbook/xxport/gnokii_xxport.cpp:214 A lot of entries of gn_phonebook_entry are not initialized here.For example in line 282 one object is created and caller_group is used in line 308 without initialization. - kaddressbook/xxport/gnokii_xxport.cpp:234 A pointer to the deallocated local variable entry is exposed to the outside world here. - kaddressbook/xxport/gnokii_xxport.cpp:688 A pointer to the deallocated local variable entry is exposed to the outside world here. ------------------------------------ Problems involving the NULL pointer: ------------------------------------ - kmail/kmfoldertree.cpp:1549 [PARTIAL FIXED] If folder is NULL as indicated by line 1537, then line 1549 crashes. ----------------------------------------------------------------- Cases from switch statements that fall through in some cases but do not have a fall through comment as in most such cases. ------------------------------------------------------------------ - kmail/kmfoldercachedimap.cpp:686 - kmail/kmfoldercachedimap.cpp:702 - kmail/kmfoldercachedimap.cpp:854 - kmail/kmfoldercachedimap.cpp:881 - kmail/kmfoldercachedimap.cpp:925 - kmail/kmfoldercachedimap.cpp:960 - kmail/kmfoldercachedimap.cpp:998 - kmail/kmfoldercachedimap.cpp:986 - mimelib/binhex.cpp:262 - kandy/src/modem.cpp:488 - libkdepim/kimportdialog.cpp:416 - libkdepim/addresseelineedit.cpp:384 ----------------------------------------------------------------- Lines where boolean expressions are used in non-boolean contexts: I suspect that at least the lines marked with !!! are bugs ----------------------------------------------------------------- - kresources/kolab/knotes/resourcekolab.cpp:143 - kresources/kolab/knotes/resourcekolab.cpp:145 - kresources/kolab/kcal/resourcekolab.cpp:222 - kresources/kolab/kcal/resourcekolab.cpp:211 - kresources/kolab/kabc/resourcekolab.cpp:256 - indexlib/bitstream.cpp:68 - indexlib/bitstream.cpp:77 - kresources/kolab/kabc/resourcekolab.cpp:268 - ktnef/lib/ktnefwriter.cpp:326-339 Part 2: ------------------------------------ Problems involving the NULL pointer: ------------------------------------ - kresources/groupwise/soap/stdsoap2.cpp:9325 If content->location is NULL as indicated in line 9322 but content->description is not NULL then line 9325 calls strlen with a NULL pointer. - kresources/groupwise/soap/gwjobs.cpp:244 - kresources/groupwise/soap/gwjobs.cpp:672 (similar) The indendation of the lines 241 till 248 suggests that the author makes an error. If item is NULL as indicated in line 241, then 244 crashes. Correct indendation would be: if ( item ) if ( item->name ) kdDebug() << "ITEM: " << item->name->c_str() << endl; if ( item->id ) kdDebug() << "ITEM: (" << item->id->c_str() << ")" << endl; else kdDebug() << "ITEM is null" << endl; My suggestion is: Never write if/else conditions without braces. Even when this seems to be silly as in: if (foo) { bar(); } ----------------------------------------------------------------- Cases from switch statements that fall through in some cases but do not have a fall through comment as in most such cases. ------------------------------------------------------------------ - korganizer/plugins/hebrew/holiday.cpp:317 - korganizer/korgac/alarmdialog.cpp:125 - korganizer/korgac/alarmdialog.cpp:127 - korganizer/korgac/alarmdialog.cpp:129 - kresources/groupwise/soap/stdsoap2.cpp:6618 ----------------------------------------------------------------- Lines where boolean expressions are used in non-boolean contexts: I suspect that at least the lines marked with !!! are bugs ----------------------------------------------------------------- - kresources/groupwise/soap/stdsoap2.cpp:8867 - kresources/groupwise/soap/groupwiseserver.cpp:1014 - kresources/groupwise/soap/groupwiseserver.cpp:1025 - kresources/groupwise/soap/groupwiseserver.cpp:1051 - kresources/groupwise/soap/groupwiseserver.cpp:1016 - kresources/groupwise/soap/groupwiseserver.cpp:1057