{"thread":{"id":"47554","subject":"Errors and other unpleasant things found by Cppcheck","startedAt":"2018-01-06T22:20:51Z","lastAt":"2018-01-08T11:43:49Z","messageCount":2,"participants":["Friedrich Spee von Langenfeld","Philip Oakley"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"336071","messageId":"5fb2c981-7a7b-5a0f-f2bb-b16189980d9b@arcor.de","threadId":"47554","inReplyTo":null,"subject":"Errors and other unpleasant things found by Cppcheck","fromName":"Friedrich Spee von Langenfeld","fromEmail":"stehlampen@arcor.de","sentAt":"2018-01-06T22:13:23Z","receivedAt":"2018-01-06T22:20:51Z","isPatch":false,"sender":{"key":"stehlampen@arcor.de","avatar":null},"body":"Hi,\n\nI analyzed the GitHub repository with Cppcheck. The resulting XML file \nis attached. Please open it in Cppcheck to view it comfortably.\n\nEspecially the bunch of errors could be of interest to you.\n\nGreetings\n\nFriedrich\n\n\n\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<results version=\"2\">\n    <cppcheck version=\"1.81\"/>\n    <errors>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: git_dir\" verbose=\"Uninitialized variable: git_dir\">\n            <location file=\"config.c\" line=\"219\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: oe\" verbose=\"Uninitialized variable: oe\">\n            <location file=\"fast-import.c\" line=\"3006\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: oe\" verbose=\"Uninitialized variable: oe\">\n            <location file=\"fast-import.c\" line=\"3023\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: mrtree\" verbose=\"Uninitialized variable: mrtree\">\n            <location file=\"merge-recursive.c\" line=\"2064\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: saved_namelen\" verbose=\"Uninitialized variable: saved_namelen\">\n            <location file=\"read-cache.c\" line=\"2107\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: explicit\" verbose=\"Uninitialized variable: explicit\">\n            <location file=\"ref-filter.c\" line=\"1287\"/>\n        </error>\n        <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\">\n            <location file=\"wildmatch.c\" line=\"263\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: item\" verbose=\"Uninitialized variable: item\">\n            <location file=\"builtin\\clean.c\" line=\"268\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: item\" verbose=\"Uninitialized variable: item\">\n            <location file=\"builtin\\clean.c\" line=\"692\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: item\" verbose=\"Uninitialized variable: item\">\n            <location file=\"builtin\\clean.c\" line=\"758\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: string_list_item\" verbose=\"Uninitialized variable: string_list_item\">\n            <location file=\"builtin\\clean.c\" line=\"357\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: item\" verbose=\"Uninitialized variable: item\">\n            <location file=\"builtin\\clean.c\" line=\"688\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: item\" verbose=\"Uninitialized variable: item\">\n            <location file=\"builtin\\clean.c\" line=\"1009\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: item\" verbose=\"Uninitialized variable: item\">\n            <location file=\"builtin\\clone.c\" line=\"1000\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: item\" verbose=\"Uninitialized variable: item\">\n            <location file=\"builtin\\config.c\" line=\"456\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: item\" verbose=\"Uninitialized variable: item\">\n            <location file=\"builtin\\describe.c\" line=\"161\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: item\" verbose=\"Uninitialized variable: item\">\n            <location file=\"builtin\\describe.c\" line=\"175\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: pos\" verbose=\"Uninitialized variable: pos\">\n            <location file=\"builtin\\interpret-trailers.c\" line=\"46\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: tmp\" verbose=\"Uninitialized variable: tmp\">\n            <location file=\"builtin\\interpret-trailers.c\" line=\"46\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: item\" verbose=\"Uninitialized variable: item\">\n            <location file=\"builtin\\ls-files.c\" line=\"259\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: item\" verbose=\"Uninitialized variable: item\">\n            <location file=\"builtin\\name-rev.c\" line=\"202\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: item\" verbose=\"Uninitialized variable: item\">\n            <location file=\"builtin\\name-rev.c\" line=\"213\"/>\n        </error>\n        <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.\">\n            <location file=\"builtin\\notes.c\" line=\"265\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: item\" verbose=\"Uninitialized variable: item\">\n            <location file=\"builtin\\repack.c\" line=\"314\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: reaches\" verbose=\"Uninitialized variable: reaches\">\n            <location file=\"builtin\\rev-list.c\" line=\"482\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: all\" verbose=\"Uninitialized variable: all\">\n            <location file=\"builtin\\rev-list.c\" line=\"482\"/>\n        </error>\n        <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.\">\n            <location file=\"compat\\mingw.c\" line=\"2139\"/>\n        </error>\n        <error id=\"memleak\" severity=\"error\" msg=\"Memory leak: sbcset\" verbose=\"Memory leak: sbcset\">\n            <location file=\"compat\\regex\\regcomp.c\" line=\"3085\"/>\n        </error>\n        <error id=\"memleak\" severity=\"error\" msg=\"Memory leak: mbcset\" verbose=\"Memory leak: mbcset\">\n            <location file=\"compat\\regex\\regcomp.c\" line=\"3085\"/>\n        </error>\n        <error id=\"memleak\" severity=\"error\" msg=\"Memory leak: sbcset\" verbose=\"Memory leak: sbcset\">\n            <location file=\"compat\\regex\\regcomp.c\" line=\"3633\"/>\n        </error>\n        <error id=\"memleak\" severity=\"error\" msg=\"Memory leak: mbcset\" verbose=\"Memory leak: mbcset\">\n            <location file=\"compat\\regex\\regcomp.c\" line=\"3633\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: table_size\" verbose=\"Uninitialized variable: table_size\">\n            <location file=\"compat\\regex\\regcomp.c\" line=\"2801\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: table_size\" verbose=\"Uninitialized variable: table_size\">\n            <location file=\"compat\\regex\\regcomp.c\" line=\"2804\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: lrr_count\" verbose=\"Uninitialized variable: lrr_count\">\n            <location file=\"contrib\\examples\\builtin-fetch--tool.c\" line=\"420\"/>\n        </error>\n        <error id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: lrr_list\" verbose=\"Uninitialized variable: lrr_list\">\n            <location file=\"contrib\\examples\\builtin-fetch--tool.c\" line=\"427\"/>\n        </error>\n        <error id=\"preprocessorErrorDirective\" severity=\"error\" msg=\"No header in #include\" verbose=\"No header in #include\">\n            <location file=\"sha1dc\\ubc_check.c\" line=\"31\"/>\n        </error>\n        <error id=\"preprocessorErrorDirective\" severity=\"error\" msg=\"No header in #include\" verbose=\"No header in #include\">\n            <location file=\"sha1dc\\ubc_check.c\" line=\"371\"/>\n        </error>\n        <error id=\"preprocessorErrorDirective\" severity=\"error\" msg=\"No header in #include\" verbose=\"No header in #include\">\n            <location file=\"sha1dc\\ubc_check.h\" line=\"49\"/>\n        </error>\n        <error id=\"memleak\" severity=\"error\" msg=\"Memory leak: entries\" verbose=\"Memory leak: entries\">\n            <location file=\"t\\helper\\test-hashmap.c\" line=\"129\"/>\n        </error>\n        <error id=\"memleak\" severity=\"error\" msg=\"Memory leak: hashes\" verbose=\"Memory leak: hashes\">\n            <location file=\"t\\helper\\test-hashmap.c\" line=\"129\"/>\n        </error>\n        <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.\">\n            <location file=\"t\\t4051\\appended1.c\" line=\"3\"/>\n        </error>\n        <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.\">\n            <location file=\"t\\t4051\\appended2.c\" line=\"35\"/>\n        </error>\n    </errors>\n</results>\n"},{"id":"336133","messageId":"5D41958DFAC74BD8B69761D171C572DB@PhilipOakley","threadId":"47554","inReplyTo":"5fb2c981-7a7b-5a0f-f2bb-b16189980d9b@arcor.de","subject":"Re: Errors and other unpleasant things found by Cppcheck","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":null,"receivedAt":"2018-01-08T11:43:49Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Friedrich Spee von Langenfeld\" <stehlampen@arcor.de>\n> Hi,\n>\n> I analyzed the GitHub repository with Cppcheck. The resulting XML file\n> is attached. Please open it in Cppcheck to view it comfortably.\n>\n> Especially the bunch of errors could be of interest to you.\n>\nHi,\n\nThanks for the submission.\n\nThe list prefers that useful information is in plain text so as to avoid \nopening file types that may hide undesirable effects.\n\nWas your analysis part of an organised scan, or a personal insight? It would \nhelp to know the background.\n\nThe project does have a number of known and accepted cases of 'unitialised \nvariables' and known memory leaks which are acceptable in those cases.\n\nIf you picked out the few key issues that you feel should be addressed then \na patch can be considered, e.g. the suggestion of the wildmatch macro (L263) \nthat depends on the order of evaluation of side effects.\n\n--\nPhilip \n\n"}]}