Review Request: Avoid possible null pointer dereferences in khtml
Ruurd Pels
ruurd at tiscali.nl
Fri Oct 7 16:49:59 BST 2011
> On Oct. 7, 2011, 2:35 p.m., Ruurd Pels wrote:
> > Revert the whitespace changes with git. Other than that I dislike multiple exit points even in trivially short functions. It really does not hurt to create a local variable holding the result of the function and then return that as the result of a function. Another pet-peeve is negative tests, for example ... if ( !xxx->isEmpty() ) ... and would prefer conditions always yielding true, for example if ( xxx->isEmpty() == false) ) instead.
>
> Christoph Feck wrote:
> If you read the "!isEmpty" as "is not Empty", the first version sounds clearer, natural, and easier to understand than the second version.
Free after my fellow countryman Edsger Dijkstra: Negate considered harmful. It is easy to overlook the !-operator and negative tests require an extra mental step to be able to follow the logic. And yes it is a pet peeve.
- Ruurd
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/102794/#review7165
-----------------------------------------------------------
On Oct. 7, 2011, 2:13 p.m., Jaime Torres Amate wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/102794/
> -----------------------------------------------------------
>
> (Updated Oct. 7, 2011, 2:13 p.m.)
>
>
> Review request for kdelibs.
>
>
> 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
> -----
>
> 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/23a89396/attachment.htm>
More information about the kde-core-devel
mailing list