package: ideviceinstaller
version: 1.0.0-1.1
severity: serious
tags: patch

gcc -DHAVE_CONFIG_H -I. -I..    -Wall -Wextra -Wmissing-declarations 
-Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default 
-Wno-unused-parameter -Werror -g -pthread -I/usr/include/glib-2.0 
-I/usr/lib/arm-linux-gnueabi/glib-2.0/include -I/usr/include/p11-kit-1 
-I/usr/include/libxml2   -I/usr/include/libxml2   -I/usr/lib/libzip/include   
-g -O2 -c -o ideviceinstaller-ideviceinstaller.o `test -f 'ideviceinstaller.c' 
|| echo './'`ideviceinstaller.c
ideviceinstaller.c: In function 'zip_f_get_contents':
ideviceinstaller.c:165:3: error: format '%ld' expects argument of type 'long 
int', but argument 3 has type 'zip_uint64_t' [-Werror=format]
cc1: all warnings being treated as errors

I have attatched an updated verion of 653893-libzip-0.10.patch which typecasts the value 
to type "unsigned long long" and changes the format specifier to %llu.


Description: fix build failure with libzip 0.10
 zip_fread returns signed int64 while zip_stat size is an unsigned int64.
From: Fathi Boudra <f...@debian.org>
Bug-Debian: http://bugs.debian.org/653893

---
 src/ideviceinstaller.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: ideviceinstaller-1.0.0/src/ideviceinstaller.c
===================================================================
--- ideviceinstaller-1.0.0.orig/src/ideviceinstaller.c	2011-03-19 15:56:32.000000000 +0000
+++ ideviceinstaller-1.0.0/src/ideviceinstaller.c	2012-01-22 23:50:01.000000000 +0000
@@ -161,8 +161,8 @@
 	}
 
 	*buffer = malloc(zs.size);
-	if (zip_fread(zfile, *buffer, zs.size) != zs.size) {
-		fprintf(stderr, "ERROR: zip_fread %ld bytes from '%s'\n", zs.size, filename);
+	if (zs.size>LLONG_MAX || zip_fread(zfile, *buffer, zs.size) != (zip_int64_t)zs.size) {
+		fprintf(stderr, "ERROR: zip_fread %llu bytes from '%s'\n", (unsigned long long)(zs.size), filename);
 		free(*buffer);
 		*buffer = NULL;
 		zip_fclose(zfile);

Reply via email to