Hi Boinc developers,

Michael Tautschnig, has discovered a bug in the zip code with a really nice 
code checker tool and reported on debian bug 747964

https://bugs.debian.org/747964

can you please apply the attached patch from him?

Have many thanks,

Gianfranco




Il Giovedì 2 Aprile 2015 10:41, Michael Tautschnig <[email protected]> ha scritto:
Hi,

Many thanks for getting back so quickly.

On Thu, Apr 02, 2015 at  8:09:57 +0000, Gianfranco Costamagna wrote:
[...]
> Yes, IIRC upstream told me the code was actually not used by boinc, it was a 
> bundled zip library, but we should use a subset of it,
> and not the line above.
> 
> But this is upstream, not me :)
> 
> http://lists.ssl.berkeley.edu/pipermail/boinc_dev/2014-May/020956.html
> 
> I don't remember the exact mail, I just found the thread above...
> 
> Do you still have the build failure?
> 
> I might add the patch again if needed!
> 

I am attaching a patch that more or less has the effect of your proposal in that
thread. Yet if I understand the response in

http://lists.ssl.berkeley.edu/pipermail/boinc_dev/2014-May/020958.html

correctly, one should rather change the call so as not to do any results
checking?

Anyway, the attached patch makes things compile in a consistent manner. It it's
not more broken than the existing code :-)

Best,

Michael
diff -urN a/zip/zip/util.c b/zip/zip/util.c
--- a/zip/zip/util.c    2015-04-02 00:03:00.000000000 +0100
+++ b/zip/zip/util.c    2015-04-02 00:04:10.000000000 +0100
@@ -802,7 +802,7 @@
  |     to make the action of the code less obscure.
  ****************************************************************/
 
-void envargs(Pargc, Pargv, envstr, envstr2)
+int envargs(Pargc, Pargv, envstr, envstr2)
     int *Pargc;
     char ***Pargv;
     char *envstr;
@@ -825,7 +825,7 @@
             while (isspace((uch)*envptr))
                 envptr++;
     if (envptr == NULL || *envptr == '\0')
-        return;
+        return 0;
 
     /* count the args so we can allocate room for them */
     argc = count_args(envptr);
@@ -902,6 +902,7 @@
     /* save the values and return */
     *Pargv = argvect;
     *Pargc = argc;
+    return 0;
 }
 
 local int count_args(s)
diff -urN a/zip/zip/zip.h b/zip/zip/zip.h
--- a/zip/zip/zip.h     2015-04-02 00:18:02.000000000 +0100
+++ b/zip/zip/zip.h     2015-04-02 00:18:58.000000000 +0100
@@ -811,7 +811,7 @@
 
 zvoid far **search OF((ZCONST zvoid *, ZCONST zvoid far **, extent,
                        int (*)(ZCONST zvoid *, ZCONST zvoid far *)));
-void envargs       OF((int *, char ***, char *, char *));
+int  envargs       OF((int *, char ***, char *, char *));
 void expand_args   OF((int *, char ***));
 
 int  is_text_buf   OF((ZCONST char *buf_ptr, unsigned buf_size));
_______________________________________________
boinc_dev mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.

Reply via email to