Просмотр исходного кода

Exit with an error instead of an assert if a file name is too long when
building a .deb package. Closes: #393069

Guillem Jover лет назад: 19
Родитель
Сommit
975003265c
3 измененных файлов с 9 добавлено и 1 удалено
  1. 4 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 3 1
      dpkg-deb/build.c

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+2007-02-13  Guillem Jover  <guillem@debian.org>
+
+	* dpkg-deb/build.c (getfi): Exit with an error instead of an assert.
+
 2007-02-13  Guillem Jover  <guillem@debian.org>
 
 	* dpkg-deb/dpkg-deb.h (MAXFILENAME): New macro.

+ 2 - 0
debian/changelog

@@ -32,6 +32,8 @@ dpkg (1.14.0) UNRELEASED; urgency=low
   * Fix confusing bottom status lines in dselect, unifying them by removing
     the method or package name and capitalizing. Closes: #9085
   * Check proper error value returned by BZ2_bzerror. Closes: #410605
+  * Exit with an error instead of an assert if a file name is too long when
+    building a .deb package. Closes: #393069
 
   [ Updated dpkg translations ]
   * Romanian (Eddy Petrișor).

+ 3 - 1
dpkg-deb/build.c

@@ -106,7 +106,9 @@ static struct _finfo* getfi(const char* root, int fd) {
       break;
 
     i++;
-    assert(i < MAXFILENAME);
+
+    if (i >= MAXFILENAME)
+      ohshit(_("file name '%.50s...' is too long"), fn + rl + 1);
   }
 
   fi=(struct _finfo*)malloc(sizeof(struct _finfo));