<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 64: Results of the static analysis tool FB Infer on zip source files </title><link>https://sourceforge.net/p/infozip/bugs/64/</link><description>Recent changes to 64: Results of the static analysis tool FB Infer on zip source files </description><atom:link href="https://sourceforge.net/p/infozip/bugs/64/feed.rss" rel="self"/><language>en</language><lastBuildDate>Tue, 13 Apr 2021 04:40:41 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/infozip/bugs/64/feed.rss" rel="self" type="application/rss+xml"/><item><title>#64 Results of the static analysis tool FB Infer on zip source files </title><link>https://sourceforge.net/p/infozip/bugs/64/?limit=25#1526</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;The analyzed package was zip-3.0-27.fc33 (default version on Fedora 33). I wasn't&lt;br/&gt;
able to find version zip31d on this site, only zip31c which seems to be the latest&lt;br/&gt;
modified. I have checked the issues against this version and they are still present,&lt;br/&gt;
but line numbers are a bit different. Updated line numbers:&lt;/p&gt;
&lt;p&gt;1) unix/unix.c:343: error: Null Dereference&lt;br/&gt;
  When i was looking at the issue again, i noticed that for x == "//" the NULL&lt;br/&gt;
  dereference won't happen, but for x == "//host" or "//host/share" will. I made&lt;br/&gt;
  a mistake while copying my notes.&lt;/p&gt;
&lt;p&gt;4) unix/unix.c:557: error: Memory Leak&lt;br/&gt;
  Allocation: 554&lt;br/&gt;
  Return without free: 557&lt;/p&gt;
&lt;p&gt;I also found another possible issue:&lt;/p&gt;
&lt;p&gt;5) fileio.c:1295: error: Null Dereference&lt;br/&gt;
  The function 'localtime' can return NULL and the value is dereferenced at the&lt;br/&gt;
  next line.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tomáš Beránek</dc:creator><pubDate>Tue, 13 Apr 2021 04:40:41 -0000</pubDate><guid>https://sourceforge.neta1ba36d278bc2da7554bfd4347a2d90e58dd10d6</guid></item><item><title>#64 Results of the static analysis tool FB Infer on zip source files </title><link>https://sourceforge.net/p/infozip/bugs/64/?limit=25#0554</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Sorry for the delay getting back to you.&lt;/p&gt;
&lt;p&gt;Where did you download this copy of Zip?  Just want to confirm we are looking at the same package.  Note that end providers, like Fedora, tend to edit our base packages before including them in their distributions.&lt;/p&gt;
&lt;p&gt;That said, we've made considerable modifications to Zip.  Beta version Zip 3.1d should be on this site.  Version Zip 3.1e hopefully should be hopefully posting in a month or so and should be close to being released as Zip 3.1.  I'll check the latest internal beta to see if these issues have been addressed, but I should compare to Fedora's release to see the issues in context.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ed Gordon</dc:creator><pubDate>Thu, 08 Apr 2021 16:34:41 -0000</pubDate><guid>https://sourceforge.net696081eae96aa4fd2301407ab36f771dd37f4a22</guid></item><item><title>Results of the static analysis tool FB Infer on zip source files </title><link>https://sourceforge.net/p/infozip/bugs/64/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;as a part of my Bachelor's thesis I have been analyzing packages on Fedora&lt;br/&gt;
with static analysis tool called Facebook Infer. When analyzing package&lt;br/&gt;
zip-3.0-27.fc33 Infer produced some interesting errors. I have checked them&lt;br/&gt;
manually and it seems, that they are real (not false positives).&lt;br/&gt;
I will summarize them into a single bug report:&lt;/p&gt;
&lt;p&gt;1) unix/unix.c:256: error: Null Dereference&lt;br/&gt;
pointer &lt;code&gt;t&lt;/code&gt; last assigned on line 236 could be null and is dereferenced at line 256, column 10.&lt;/p&gt;
&lt;p&gt;In function 'ex2in' (unix/unix.c:228) null dereference can happen on the variable 't',&lt;br/&gt;
if the parameter 'x' is, for example, '//' or '//host'. I'm not sure if 'x' can have&lt;br/&gt;
these values, but since there is a check (for example, unix/unix.c:252) for it,&lt;br/&gt;
I assume, that it is possible. However, if this happens, then the initial NULL value&lt;br/&gt;
stored in 't' will not be overwritten and will be dereferenced at unix/unix.c:256.&lt;/p&gt;
&lt;p&gt;2) crypt.c:265: error: Dead Store&lt;br/&gt;
The value written to &amp;amp;res (type int) is never used.&lt;/p&gt;
&lt;p&gt;This DEAD_STORE leads to a dereference on an uninitialized pointer. If malloc fails&lt;br/&gt;
in the function 'readlocal', then 'localz' variable will not be initialized. Since&lt;br/&gt;
the return value of the function 'readlocal' is not checked, the program will continue&lt;br/&gt;
until unix/unix.c:273 where dereference happens and most likely will fail.&lt;/p&gt;
&lt;p&gt;3) crypt.c:354: error: Dead Store&lt;br/&gt;
The value written to &amp;amp;res (type int) is never used.&lt;/p&gt;
&lt;p&gt;A similar issue as #2.&lt;/p&gt;
&lt;p&gt;4) unix/unix.c:469: error: Memory Leak&lt;br/&gt;
memory dynamically allocated at line 467 by call to &lt;code&gt;malloc&lt;/code&gt;, is not freed after the last access at line 469, column 7.&lt;/p&gt;
&lt;p&gt;While checking other Infer reports I have noticed, that you try to free every&lt;br/&gt;
allocated memory even if the program fails. So I assume, that this memory leak&lt;br/&gt;
is not intentional. If the first malloc (unix/unix.c:467) succeeds and the second&lt;br/&gt;
malloc (unix/unix.c:469) fails, then the first one will not be freed before exit.&lt;/p&gt;
&lt;p&gt;I haven't managed to find your active repository, otherwise, I would have created a pull&lt;br/&gt;
request with a fix to some of the errors mentioned above to save you some time.&lt;/p&gt;
&lt;p&gt;Thank you in advance for any feedback.&lt;/p&gt;
&lt;p&gt;All the best,&lt;br/&gt;
Tomáš Beránek&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tomáš Beránek</dc:creator><pubDate>Wed, 31 Mar 2021 13:03:38 -0000</pubDate><guid>https://sourceforge.net937684e9e255e385eadbfe8593be986153ffb3fa</guid></item></channel></rss>