On Tue, 12 Jul 2016 15:02:31 -0400 Jorge Arellano Cid <jcid at dillo.org> wrote:
Hi Nick,
On Sat, Jul 09, 2016 at 12:35:10PM +0100, Nick Warne wrote:
Hi all,
While waiting for the Tour De France to start on TV, I ran cppcheck on Dillo source for something to do - a few errors were picked up!
I have compacted the findings (with two comments from me)and attached it as a plain text file.
Thanks for the report. I personally didn't know of cppcheck.
I have used it in the past - a few years ago, but as I say I was bored so found something to do...
We have used several code cleanup tools in the past and we usually honour them as sometimes they catch important flaws.
A bunch of patches was just committed. You may peruse them with "hg log -vp" for the details/explanations.
Good stuff. I watch the dillo hg site anyway as I like to see (and learn) all this C++ stuff.
It may be a trivial s/%u/%d/, but after reading it a bit I'd prefer Sebastian to double check it.
Not committed.
I looked and looked at that, but alas, don't understand why it's wrong/right :)
Checking ../../slackbuilds/dillo/hg/dillo/dw/iterator.cc... [../../slackbuilds/dillo/hg/dillo/dw/iterator.cc:124]: (error) Memory leak: eit3
Done.
AFAICS, this is a false positive. Patched to please cppcheck anyway.
Yes, even I got that, but wasn't sure.
Checking ../../slackbuilds/dillo/hg/dillo/dw/ooffloatsmgr.cc... [../../slackbuilds/dillo/hg/dillo/dw/ooffloatsmgr.cc:654]: (error) Possible null pointer dereference: vloat
Well, the code should never reach there. Not changed.
@Sebastian, BTW, coincidentally I'm using something like:
SortedFloatsVector *list; list = isSubRefLeftFloat(ref) ? leftFloats : rightFloats; Float *vloat = list->get (getFloatIndexFromSubRef (ref));
[../../slackbuilds/dillo/hg/dillo/src/md5.c:216]: (error) Uninitialized variable: X in md5.c
Untouched: I'm not md5 savvy. Maybe corvid.
Nor am I. I looked a lot at that code, and K[] whatever doesn't seem to be declared anywhere (with my little knowledge). Strange GCC doesn't squinny on that one? Thanks, Nick -- Gosh that takes me back... or is it forward? That's the trouble with time travel, you never can tell." -- Doctor Who "Androids of Tara"