Selaa lähdekoodia

Fix OtoL() to accumulate data in a long instead of an int

On 64-bit architectures where the long is bigger than the int, it makes
it possible to have files bigger than 2GB.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
Martin Dorey 15 vuotta sitten
vanhempi
commit
94bf966f04
2 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 2 0
      debian/changelog
  2. 1 1
      lib/dpkg/tarfn.c

+ 2 - 0
debian/changelog

@@ -63,6 +63,8 @@ dpkg (1.16.0) UNRELEASED; urgency=low
   * Update dpkg-shlibdeps to be multiarch-ready:
     - use get_control_path() to find symbols/shlibs files
     - parse correctly the output of dpkg --search
+  * Small fix to support files >2GB in .deb on 64-bit systems. Closes: #616502
+    Thanks to Martin Dorey <mdorey@bluearc.com> for the patch.
 
   [ Jonathan Nieder ]
   * Remove support for use of synchronous sync(2), due to its pernicious

+ 1 - 1
lib/dpkg/tarfn.c

@@ -65,7 +65,7 @@ struct tar_header {
 static long
 OtoL(const char *s, int size)
 {
-	int n = 0;
+	long n = 0;
 
 	while (*s == ' ') {
 		s++;