Review Request: Avoid possible null pointer dereferences in khtml
Jaime Torres Amate
jtamate at gmail.com
Fri Oct 7 17:25:51 BST 2011
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/102794/
-----------------------------------------------------------
(Updated Oct. 7, 2011, 4:25 p.m.)
Review request for kdelibs.
Changes
-------
Removed the trailing whitespace changes (I've always been asked to remove then before commiting).
Using a local ret variable and only one return.
If there is a isNotEmpty method, then I'll change !isEmpty() with it, otherwise I'll leave it untouched.
boolean disertation:
I agree with Christoph and Dijkstra.
!isEmpty() is read as "not is empty?" or as "is not empty?" and isEmpty()==false is read as "is empty false?" .Which one is easier? Please, do not answer.
In python it is if not isEmpty(): or if isEmpty()==False:
Description
-------
The real changes are:
Avoid possible null pointer dereferences in khtml.
The common check
if (a && something(a)) do return bla(a) else blabla(a) uses blabla(a) with null a. changed to
if (a) { if something(a)) do return bla(a) else blabla(a) }
As a side effect:
kate has removed a lot of tailing spaces in the edited files.
Avoid a possible crash checking the index limit before accesing the array.
Move some variables inside the #ifdef block where they are used
Diffs (updated)
-----
khtml/css/css_valueimpl.cpp 3fb2898
khtml/ecma/kjs_window.cpp 0e7394b
khtml/html/htmltokenizer.cpp b64e83d
khtml/java/kjavaappletserver.cpp 234c6f3
khtml/khtml_part.cpp 53929fa
khtml/khtmlimage.cpp c6e6366
khtml/khtmlview.cpp 28dbac3
khtml/rendering/render_form.cpp c15247a
khtml/rendering/render_table.cpp 5b07714
khtml/xpath/util.cpp 079008d
Diff: http://git.reviewboard.kde.org/r/102794/diff/diff
Testing
-------
no regressions in kdelibs tests.
Thanks,
Jaime Torres Amate
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20111007/a1ed3737/attachment.htm>
More information about the kde-core-devel
mailing list