Wireshark-dev: [Wireshark-dev] clang analysis
Date Prev · Date Next · Thread Prev · Thread Next
From: Kaul <mykaul@xxxxxxxxx>
Date: Sat, 1 May 2010 22:57:51 +0300
Hi,

I've ran clang static analyser on SVN latest and got the following:

Bug Summary

Bug TypeQuantityDisplay?
All Bugs2769
Dead store
Dead assignment1692
Dead increment998
Dead initialization25
Dead nested assignment32
Logic errors
Null dereference21
Use of uninitialized value1


Obviously, there's little chance I can fix all of them. I can try fix a few from the dissectors I'm familiar with, though.
Some (most of the dead) might/probably are removed by current generation compiler, so aren't so important to fix, although it'd be nice to.
The rest may be a bit more important to fix.
Example of such bug (from packet-bgp.c, which should REALLY be refactored to functions!):
2235 ti = proto_tree_add_text(subtree2, tvb, o + i + aoff, tlen,
2236 "Cluster list: %s", cluster_list_emstr->str);


15
Dereference of null pointer (cluster_list_emstr)