[arch-commits] Commit in zint/trunk (PKGBUILD prevent-buffer-overflow.patch)

Antonio Rojas arojas at gemini.archlinux.org
Sat Sep 4 11:23:30 UTC 2021


    Date: Saturday, September 4, 2021 @ 11:23:30
  Author: arojas
Revision: 1011087

Update to 2.10.0

Modified:
  zint/trunk/PKGBUILD
Deleted:
  zint/trunk/prevent-buffer-overflow.patch

-------------------------------+
 PKGBUILD                      |   26 +++------
 prevent-buffer-overflow.patch |  107 ----------------------------------------
 2 files changed, 10 insertions(+), 123 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-09-04 11:22:41 UTC (rev 1011086)
+++ PKGBUILD	2021-09-04 11:23:30 UTC (rev 1011087)
@@ -2,28 +2,22 @@
 
 pkgbase=zint
 pkgname=(zint zint-qt)
-pkgver=2.9.1
-pkgrel=2
+pkgver=2.10.0
+pkgrel=1
 pkgdesc='Barcode encoding library supporting over 50 symbologies'
 arch=('x86_64')
 url='http://zint.org.uk/'
 license=('GPL3')
-depends=('hicolor-icon-theme' 'qt5-base')
-makedepends=('cmake' 'ninja' 'qt5-tools')
+makedepends=('cmake' 'ninja' 'qt6-tools')
 source=("https://downloads.sourceforge.net/$pkgbase/$pkgbase-$pkgver-src.tar.gz"
-        'prevent-buffer-overflow.patch'
         'zint-qt.appdata.xml')
-sha256sums=('bd286d863bc60d65a805ec3e46329c5273a13719724803b0ac02e5b5804c596a'
-            '59e6d31aadb8d9c586dc4f450afca8e799f8a1e2907872d7951f0c8455a85f7e'
+sha256sums=('bb97e98a32e140c344e92c8da84a9df413dca16083f2fcdc29791bec77350339'
             '4286c7f56f0ea8fcf8dfa164b3a3fea08a02ad3b5111c6ac63c4d55134b67564')
 
-prepare() {
-  # Fix arbitrary code execution (CVE-2021-27799, FS#70051)
-  patch -d $pkgbase-$pkgver-src -Np1 -i ../prevent-buffer-overflow.patch
-}
-
 build() {
-  cmake -S $pkgbase-$pkgver-src -B build -G Ninja -DCMAKE_INSTALL_PREFIX=/usr
+  # Hack to force Qt6
+  CMAKE_PREFIX_PATH="6.0.0" \
+  cmake -S $pkgbase-$pkgver-src -B build -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DUSE_QT6=ON
   cmake --build build
 }
 
@@ -34,17 +28,17 @@
 
   rm "$pkgdir/usr/bin/zint-qt" \
      "$pkgdir/usr/include/qzint.h" \
-     "$pkgdir/usr/lib/libQZint.so"*
+     "$pkgdir/usr/lib/libQZint"*
 }
 
 package_zint-qt() {
   pkgdesc='Zint Barcode Studio GUI'
-  depends=('hicolor-icon-theme' 'qt5-base' 'zint')
+  depends=('hicolor-icon-theme' 'qt6-tools' 'zint')
 
   DESTDIR="$pkgdir" cmake --install build/backend_qt
   DESTDIR="$pkgdir" cmake --install build/frontend_qt
 
-  install -Dm644 $pkgbase-$pkgver-src/zint.png "$pkgdir/usr/share/icons/hicolor/48x48/apps/zint.png"
+  install -Dm644 $pkgbase-$pkgver-src/zint-qt.png "$pkgdir/usr/share/icons/hicolor/48x48/apps/zint-qt.png"
   install -Dm644 $pkgbase-$pkgver-src/zint-qt.desktop "$pkgdir/usr/share/applications/zint-qt.desktop"
   install -Dm644 zint-qt.appdata.xml "$pkgdir/usr/share/metainfo/zint-qt.appdata.xml"
 }

Deleted: prevent-buffer-overflow.patch
===================================================================
--- prevent-buffer-overflow.patch	2021-09-04 11:22:41 UTC (rev 1011086)
+++ prevent-buffer-overflow.patch	2021-09-04 11:23:30 UTC (rev 1011087)
@@ -1,107 +0,0 @@
-diff -Naur zint-2.9.1-src.orig/backend/composite.c zint-2.9.1-src/backend/composite.c
---- zint-2.9.1-src.orig/backend/composite.c	2020-08-04 15:10:16.000000000 +0200
-+++ zint-2.9.1-src/backend/composite.c	2021-05-30 12:12:34.021736406 +0200
-@@ -65,7 +65,7 @@
- 
- INTERNAL int eanx(struct zint_symbol *symbol, unsigned char source[], int length);
- INTERNAL int ean_128(struct zint_symbol *symbol, unsigned char source[], const size_t length);
--INTERNAL void ean_leading_zeroes(struct zint_symbol *symbol, unsigned char source[], unsigned char local_source[]);
-+INTERNAL int ean_leading_zeroes(struct zint_symbol *symbol, unsigned char source[], unsigned char local_source[]);
- INTERNAL int rss14(struct zint_symbol *symbol, unsigned char source[], int length);
- INTERNAL int rsslimited(struct zint_symbol *symbol, unsigned char source[], int length);
- INTERNAL int rssexpanded(struct zint_symbol *symbol, unsigned char source[], int length);
-@@ -1422,7 +1422,10 @@
-                 int padded_pri_len;
-                 char padded_pri[20];
-                 padded_pri[0] = '\0';
--                ean_leading_zeroes(symbol, (unsigned char *) symbol->primary, (unsigned char *) padded_pri);
-+                if (!ean_leading_zeroes(symbol, (unsigned char *) symbol->primary, (unsigned char *) padded_pri)) {
-+                    strcpy(symbol->errtxt, "448: Input wrong length in linear component");
-+                    return ZINT_ERROR_TOO_LONG;
-+                }
-                 padded_pri_len = strlen(padded_pri);
-                 if (padded_pri_len <= 7) { /* EAN-8 */
-                     cc_width = 3;
-diff -Naur zint-2.9.1-src.orig/backend/upcean.c zint-2.9.1-src/backend/upcean.c
---- zint-2.9.1-src.orig/backend/upcean.c	2020-08-04 15:10:16.000000000 +0200
-+++ zint-2.9.1-src/backend/upcean.c	2021-05-30 12:17:31.795044601 +0200
-@@ -125,7 +125,7 @@
- /* Make a UPC A barcode when we haven't been given the check digit */
- static int upca(struct zint_symbol *symbol, unsigned char source[], char dest[]) {
-     int length;
--    char gtin[15];
-+    char gtin[13];
- 
-     strcpy(gtin, (char*) source);
-     length = strlen(gtin);
-@@ -391,7 +391,7 @@
- static int ean13(struct zint_symbol *symbol, unsigned char source[], char dest[]) {
-     unsigned int length, i, half_way;
-     char parity[6];
--    char gtin[15];
-+    char gtin[14];
- 
-     strcpy(parity, "");
-     strcpy(gtin, (char*) source);
-@@ -569,8 +569,8 @@
- }
- 
- /* Add leading zeroes to EAN and UPC strings */
--INTERNAL void ean_leading_zeroes(struct zint_symbol *symbol, unsigned char source[], unsigned char local_source[]) {
--    unsigned char first_part[20], second_part[20], zfirst_part[20], zsecond_part[20];
-+INTERNAL int ean_leading_zeroes(struct zint_symbol *symbol, unsigned char source[], unsigned char local_source[]) {
-+    unsigned char first_part[14], second_part[6], zfirst_part[14], zsecond_part[6];
-     int with_addon = 0;
-     int first_len = 0, second_len = 0, zfirst_len = 0, zsecond_len = 0, i, h;
- 
-@@ -586,6 +586,9 @@
-             }
-         }
-     }
-+    if (first_len > 13 || second_len > 5) {
-+        return 0;
-+    }
- 
-     ustrcpy(first_part, (unsigned char *) "");
-     ustrcpy(second_part, (unsigned char *) "");
-@@ -598,9 +601,6 @@
-         first_part[i + 1] = '\0';
-     }
- 
--    if (second_len >= 6) { /* Allow 6 (actual max 5) so as to trigger too long error */
--        second_len = 6;
--    }
-     for (i = 0; i < second_len; i++) {
-         second_part[i] = source[i + first_len + 1];
-         second_part[i + 1] = '\0';
-@@ -698,12 +698,13 @@
-         strcat((char*) local_source, "+");
-         strcat((char*) local_source, (char*) zsecond_part);
-     }
-+
-+    return 1; /* Success */
- }
- 
--/* splits string to parts before and after '+' parts */
- INTERNAL int eanx(struct zint_symbol *symbol, unsigned char source[], int src_len) {
--    unsigned char first_part[20] = {0}, second_part[7] = {0}, dest[1000] = {0};
--    unsigned char local_source[20] = {0};
-+    unsigned char first_part[14] = {0}, second_part[6] = {0}, dest[1000] = {0};
-+    unsigned char local_source[20] = {0}; /* Allow 13 + "+" + 5 + 1 */
-     unsigned int latch, reader, writer, with_addon;
-     int error_number, i, plus_count;
-     int addon_gap = 0;
-@@ -743,8 +744,11 @@
-         return ZINT_ERROR_INVALID_DATA;
-     }
- 
--    /* Add leading zeroes */
--    ean_leading_zeroes(symbol, source, local_source);
-+    /* Add leading zeroes, checking max lengths of parts */
-+    if (!ean_leading_zeroes(symbol, source, local_source)) {
-+        strcpy(symbol->errtxt, "294: Input too long");
-+        return ZINT_ERROR_TOO_LONG;
-+    }
- 
-     for (reader = 0; reader < ustrlen(local_source); reader++) {
-         if (local_source[reader] == '+') {



More information about the arch-commits mailing list