summaryrefslogtreecommitdiffstats
path: root/misc/sdcv/patches/13_zlib-return-value.patch
blob: 171ac15538637605e3b406a9cd04e6da73da261f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
From: Michal Čihař <nijel@debian.org>
Subject: Zlib can return negative value, but gulong is unsigned, so it can not catch the error state.
--- a/src/lib/lib.cpp
+++ b/src/lib/lib.cpp
@@ -751,12 +751,12 @@
 		
 	idxdatabuf = (gchar *)g_malloc(fsize);
 		
-	gulong len = gzread(in, idxdatabuf, fsize);
+	ssize_t len = gzread(in, idxdatabuf, fsize);
 	gzclose(in);
 	if (len < 0)
 		return false;
 
-	if (len != fsize)
+	if (len != (ssize_t)fsize)
 		return false;
 
   wordlist.resize(wc+1);