Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1515072 - libzip version 1.3.2
Summary: libzip version 1.3.2
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: libzip
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Remi Collet
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-20 06:13 UTC by Remi Collet
Modified: 2017-11-20 14:53 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-11-20 14:08:58 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
PHP Bug Tracker 75540 None None None 2017-11-20 08:25:27 UTC

Description Remi Collet 2017-11-20 06:13:05 UTC
libzip 1.3.1 is released

PLEASE: do not update to this latest version.


Sadly this version introduce a unwanted change, which may raise segfault, at least in the php extension:


(gdb) bt
#0  zip_source_free (src=0x7478742e) at zip_source_free.c:46
#1  0x00007fffec9212fe in zip_source_free (src=0x555555c9d530) at zip_source_free.c:68
#2  0x00007fffec919b97 in zip_discard (za=0x555555c9bef0) at zip_discard.c:54
#3  0x00007fffecb34271 in c_ziparchive_close (execute_data=<optimized out>, return_value=0x7ffff3814150) at /work/GIT/php_zip/php7/php_zip.c:1540


Changes in libzip

diff -ru libzip-1.3.0/lib/zip_close.c libzip-1.3.1/lib/zip_close.c
--- libzip-1.3.0/lib/zip_close.c        2017-05-17 19:41:59.000000000 +0200
+++ libzip-1.3.1/lib/zip_close.c        2017-11-13 10:59:12.000000000 +0100
@@ -218,14 +218,13 @@
 
     if (error) {
        zip_source_rollback_write(za->src);
-       return -1;
     }
 
     _zip_progress_end(za->progress);
 
     zip_discard(za);
     
-    return 0;
+    return error ? -1 : 0;
 }
 
 
In short, this mean return value from zip_close cannot be used to know if za need to be free.

In extension sources

	if ((err = zip_close(intern))) {
		php_error_docref(NULL, E_WARNING, "%s", zip_strerror(intern));
		zip_discard(intern);
	}

If we drop the zip_discard call, we fix the segfault but introduce a memory leak.

Need investigation with upstream.


PLEASE: do not update to this latest version.

Comment 1 Remi Collet 2017-11-20 09:13:11 UTC
Fixed by libzip upstream.

So, will wait for 1.3.2 (to come shortly, from upstream answer)


Note You need to log in before you can comment on or make changes to this bug.