Suspicious code in kdewebdev-3.5.2

Christoph Bartoschek bartoschek at gmx.de
Fri Apr 21 20:43:40 BST 2006


------------------------------------------------------------------
Misc problems:
------------------------------------------------------------------

- kxsldbg/kxsldbgpart/libxsldbg/options.cpp:360 

The if condition in line 359 looks strange for me. But here I would
expect type - OPTIONS_FIRST_OPTIONID.

- kxsldbg/kxsldbgpart/libxsldbg/files_unix.cpp:119 

The maximum allowed value for fileNumber is currently 1.But
sizeof(tempNames) is 8 on a 32bit machine, such that fileNumber can be
up to 7 here.

- kxsldbg/kxsldbgpart/xsldbgconfigimpl.cpp:153

Why not  || instead of |?

- quanta/treeviews/templatestreeview.cpp:226
- quanta/treeviews/templatestreeview.cpp:102

!QDir::Hidden is 0 or 1.  I guess you mean:  (compl QDir::Hidden) or for
the old fashioned:  (~QDir::Hidden)

- kommander/widgets/closebutton.cpp:138
- quanta/components/debugger/gubed/quantadebuggergubed.cpp:378
- quanta/components/debugger/dbgp/dbgpnetwork.cpp:239

Use delete [] buffer.

- quanta/project/projectupload.cpp:409

The loop can be executed at most once.

- quanta/project/projectprivate.cpp:1503

?  dbg is used before it is set.

- quanta/parsers/node.cpp:366
- quanta/parsers/node.cpp:340 (similar)

The if condition indicates that parent can be NULL, if this is the case
then bCol, bLine, eLine and eCol are uninitialized in line 366.


- quanta/components/tableeditor/tableeditor.cpp:492
- quanta/components/tableeditor/tableeditor.cpp:518

Why not (ok && rowValue > 1)

- quanta/parts/kafka/kafkahtmlpart.cpp:1152

deactivated code?

------------------------------------
Problems involving the NULL pointer:
------------------------------------

- kimagemapeditor/kimedialogs.cpp:424

If a is NULL as indicated by line 416, then line 424 crashes.

- kxsldbg/kxsldbgpart/xsldbgdebugger.cpp:97

If e is NULL then this line crashes.

- kxsldbg/kxsldbgpart/libxsldbg/debugXSL.cpp:619

If ctxt->pctxt is NULL as indicated by line 579, then line 619 crashes.

- quanta/parts/kafka/wkafkapart.cpp:2158

If _node->parent is NULL as indicated by line 2134, then line 2158
crashes.

- quanta/parts/kafka/wkafkapart.cpp:1484

If _currentNode is NULL as indicated by line 1475, but if the if
condition in the same line is not true, then line 1484 crashes.

- quanta/parts/kafka/kafkacommon.cpp:1990
- quanta/parts/kafka/kafkacommon.cpp:2068

If startSelection is NULL as indicated by line 1982, then line 1990
crashes. Same for endSelection.

- quanta/parts/kafka/kafkacommon.cpp:1573
- quanta/parts/kafka/kafkacommon.cpp:236 (similar)
- quanta/parts/kafka/kafkacommon.cpp:180 (similar)

Is it possible that commonParent is NULL in line 1558 and then line 1573
is executed?

- quanta/parts/kafka/htmldocumentproperties.cpp:420

titleNode->child can be not NULL and the loop in line 406 is entered.
But it is left, when node becomes NULL. Because titleNode->child is
still not NULL, line 420 is entered and crashes.

- quanta/components/debugger/dbgp/dbgpnetwork.cpp:56

Line 48 indicates that m_socket is NULL for lines 51-56. I guess this
cannot be good.

- quanta/components/debugger/dbgp/dbgpnetwork.cpp:134

If m_socket is NULL as indicated by line 115, then line 134 crashes.

- quanta/parsers/dtd/dtdparser.cpp:262

If el_ptr is NULL as indicated by line 229, then line 262 crashes.

- kommander/widgets/subdialog.cpp:106

If m_dialog is NULL as indicated by line 102, then line 106 crashes.

- kommander/editor/actioneditorimpl.cpp:90
- kommander/editor/actioneditorimpl.cpp:101

In line 88 the Pointer currentAction is deleted. Is its usage legal here?

- quanta/project/projectupload.cpp:421

A dynamic_cast indicates that the result can be NULL.

-----------------------------------------------------------------
Cases from switch statements that fall through in some cases but 
do not have a fall through comment as in most such cases.
------------------------------------------------------------------

- kommander/editor/formfile.cpp:178

-----------------------------------------------------------------
Lines where boolean expressions are used in non-boolean contexts:

I suspect that at least the lines marked with !!! are bugs
-----------------------------------------------------------------


- quanta/project/project.cpp:914  (why  > 0)
- kxsldbg/kxsldbgpart/libxsldbg/option_cmds.cpp:95




More information about the kde-core-devel mailing list