git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* Errors and other unpleasant things found by Cppcheck
@ 2018-01-06 22:13 Friedrich Spee von Langenfeld
  2018-01-08 11:43 ` Philip Oakley
  0 siblings, 1 reply; 2+ messages in thread
From: Friedrich Spee von Langenfeld @ 2018-01-06 22:13 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 225 bytes --]

Hi,

I analyzed the GitHub repository with Cppcheck. The resulting XML file 
is attached. Please open it in Cppcheck to view it comfortably.

Especially the bunch of errors could be of interest to you.

Greetings

Friedrich


[-- Attachment #2: Cppcheck results for Git.xml --]
[-- Type: text/xml, Size: 9108 bytes --]

<?xml version="1.0" encoding="UTF-8"?>
<results version="2">
    <cppcheck version="1.81"/>
    <errors>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: git_dir" verbose="Uninitialized variable: git_dir">
            <location file="config.c" line="219"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: oe" verbose="Uninitialized variable: oe">
            <location file="fast-import.c" line="3006"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: oe" verbose="Uninitialized variable: oe">
            <location file="fast-import.c" line="3023"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: mrtree" verbose="Uninitialized variable: mrtree">
            <location file="merge-recursive.c" line="2064"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: saved_namelen" verbose="Uninitialized variable: saved_namelen">
            <location file="read-cache.c" line="2107"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: explicit" verbose="Uninitialized variable: explicit">
            <location file="ref-filter.c" line="1287"/>
        </error>
        <error id="unknownEvaluationOrder" severity="error" msg="Expression &amp;#039;prev_ch=p_ch,(p_ch=*++p)!=&amp;#039;]&amp;#039;&amp;#039; depends on order of evaluation of side effects" verbose="Expression &amp;#039;prev_ch=p_ch,(p_ch=*++p)!=&amp;#039;]&amp;#039;&amp;#039; depends on order of evaluation of side effects">
            <location file="wildmatch.c" line="263"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\clean.c" line="268"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\clean.c" line="692"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\clean.c" line="758"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: string_list_item" verbose="Uninitialized variable: string_list_item">
            <location file="builtin\clean.c" line="357"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\clean.c" line="688"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\clean.c" line="1009"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\clone.c" line="1000"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\config.c" line="456"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\describe.c" line="161"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\describe.c" line="175"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: pos" verbose="Uninitialized variable: pos">
            <location file="builtin\interpret-trailers.c" line="46"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: tmp" verbose="Uninitialized variable: tmp">
            <location file="builtin\interpret-trailers.c" line="46"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\ls-files.c" line="259"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\name-rev.c" line="202"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\name-rev.c" line="213"/>
        </error>
        <error id="doubleFree" severity="error" msg="Memory pointed to by &amp;#039;buf&amp;#039; is freed twice." verbose="Memory pointed to by &amp;#039;buf&amp;#039; is freed twice.">
            <location file="builtin\notes.c" line="265"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\repack.c" line="314"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: reaches" verbose="Uninitialized variable: reaches">
            <location file="builtin\rev-list.c" line="482"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: all" verbose="Uninitialized variable: all">
            <location file="builtin\rev-list.c" line="482"/>
        </error>
        <error id="leakNoVarFunctionCall" severity="error" msg="Allocation with malloc_startup, memcpy doesn&amp;#039;t release it." verbose="Allocation with malloc_startup, memcpy doesn&amp;#039;t release it.">
            <location file="compat\mingw.c" line="2139"/>
        </error>
        <error id="memleak" severity="error" msg="Memory leak: sbcset" verbose="Memory leak: sbcset">
            <location file="compat\regex\regcomp.c" line="3085"/>
        </error>
        <error id="memleak" severity="error" msg="Memory leak: mbcset" verbose="Memory leak: mbcset">
            <location file="compat\regex\regcomp.c" line="3085"/>
        </error>
        <error id="memleak" severity="error" msg="Memory leak: sbcset" verbose="Memory leak: sbcset">
            <location file="compat\regex\regcomp.c" line="3633"/>
        </error>
        <error id="memleak" severity="error" msg="Memory leak: mbcset" verbose="Memory leak: mbcset">
            <location file="compat\regex\regcomp.c" line="3633"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: table_size" verbose="Uninitialized variable: table_size">
            <location file="compat\regex\regcomp.c" line="2801"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: table_size" verbose="Uninitialized variable: table_size">
            <location file="compat\regex\regcomp.c" line="2804"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: lrr_count" verbose="Uninitialized variable: lrr_count">
            <location file="contrib\examples\builtin-fetch--tool.c" line="420"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: lrr_list" verbose="Uninitialized variable: lrr_list">
            <location file="contrib\examples\builtin-fetch--tool.c" line="427"/>
        </error>
        <error id="preprocessorErrorDirective" severity="error" msg="No header in #include" verbose="No header in #include">
            <location file="sha1dc\ubc_check.c" line="31"/>
        </error>
        <error id="preprocessorErrorDirective" severity="error" msg="No header in #include" verbose="No header in #include">
            <location file="sha1dc\ubc_check.c" line="371"/>
        </error>
        <error id="preprocessorErrorDirective" severity="error" msg="No header in #include" verbose="No header in #include">
            <location file="sha1dc\ubc_check.h" line="49"/>
        </error>
        <error id="memleak" severity="error" msg="Memory leak: entries" verbose="Memory leak: entries">
            <location file="t\helper\test-hashmap.c" line="129"/>
        </error>
        <error id="memleak" severity="error" msg="Memory leak: hashes" verbose="Memory leak: hashes">
            <location file="t\helper\test-hashmap.c" line="129"/>
        </error>
        <error id="syntaxError" severity="error" msg="Invalid number of character &amp;#039;{&amp;#039; when no macros are defined." verbose="Invalid number of character &amp;#039;{&amp;#039; when no macros are defined.">
            <location file="t\t4051\appended1.c" line="3"/>
        </error>
        <error id="syntaxError" severity="error" msg="Invalid number of character &amp;#039;{&amp;#039; when no macros are defined." verbose="Invalid number of character &amp;#039;{&amp;#039; when no macros are defined.">
            <location file="t\t4051\appended2.c" line="35"/>
        </error>
    </errors>
</results>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Errors and other unpleasant things found by Cppcheck
  2018-01-06 22:13 Errors and other unpleasant things found by Cppcheck Friedrich Spee von Langenfeld
@ 2018-01-08 11:43 ` Philip Oakley
  0 siblings, 0 replies; 2+ messages in thread
From: Philip Oakley @ 2018-01-08 11:43 UTC (permalink / raw)
  To: git, Friedrich Spee von Langenfeld

From: "Friedrich Spee von Langenfeld" <stehlampen@arcor.de>
> Hi,
>
> I analyzed the GitHub repository with Cppcheck. The resulting XML file
> is attached. Please open it in Cppcheck to view it comfortably.
>
> Especially the bunch of errors could be of interest to you.
>
Hi,

Thanks for the submission.

The list prefers that useful information is in plain text so as to avoid 
opening file types that may hide undesirable effects.

Was your analysis part of an organised scan, or a personal insight? It would 
help to know the background.

The project does have a number of known and accepted cases of 'unitialised 
variables' and known memory leaks which are acceptable in those cases.

If you picked out the few key issues that you feel should be addressed then 
a patch can be considered, e.g. the suggestion of the wildmatch macro (L263) 
that depends on the order of evaluation of side effects.

--
Philip 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-08 11:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-06 22:13 Errors and other unpleasant things found by Cppcheck Friedrich Spee von Langenfeld
2018-01-08 11:43 ` Philip Oakley

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.version-control.git
	nntp://ie5yzdi7fg72h7s4sdcztq5evakq23rdt33mfyfcddc5u3ndnw24ogqd.onion/inbox.comp.version-control.git
	nntp://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git