testing/mblaze: overwrite CFLAGS

Also include a patch for an off-by-one error causing an access to
uninitialized memory which results in a crash when compiled with -Os.
This commit is contained in:
Sören Tempel 2017-08-21 20:09:46 +02:00
parent 08b8673f6d
commit 8a7e358d47
2 changed files with 35 additions and 4 deletions

View File

@ -0,0 +1,29 @@
From 6f99ef55a8bd75d99882078b50e3c7665106c514 Mon Sep 17 00:00:00 2001
From: Leah Neukirchen <leah@vuxu.org>
Date: Mon, 21 Aug 2017 19:40:00 +0200
Subject: [PATCH] mgenmid: printb36: fix off-by-one
Closes #73.
---
mgenmid.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mgenmid.c b/mgenmid.c
index 36aa8c8..655df95 100644
--- a/mgenmid.c
+++ b/mgenmid.c
@@ -21,9 +21,10 @@ printb36(uint64_t x)
char outbuf[16];
char *o = outbuf + sizeof outbuf;
- *o = 0;
+ *--o = 0;
do { *--o = base36[x % 36]; } while (x /= 36);
+
fputs(o, stdout);
}
--
2.14.1

View File

@ -2,7 +2,7 @@
# Maintainer:
pkgname=mblaze
pkgver=0.2
pkgrel=0
pkgrel=1
pkgdesc="Unix utilities to deal with Maildir"
url="https://github.com/chneukirchen/mblaze"
arch="all"
@ -13,11 +13,12 @@ makedepends=""
install=""
subpackages="$pkgname-doc"
options="!check"
source="https://github.com/chneukirchen/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz"
source="https://github.com/chneukirchen/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz
0001-mgenmid-printb36-fix-off-by-one.patch"
builddir="$srcdir/$pkgname-$pkgver"
build() {
make -C "$builddir"
make CFLAGS="$CFLAGS" -C "$builddir"
}
package() {
@ -30,4 +31,5 @@ package() {
"$pkgdir"/usr/share/doc/$pkgname/
}
sha512sums="7bbe8285cd1453e5b79e0b4af7ef38e0a4d24aa3317530480be2a89554cae0afa47f18e159ee976930dcea95fd92e07ab534a57c98f8cef42c37f5dce709fa12 mblaze-0.2.tar.gz"
sha512sums="7bbe8285cd1453e5b79e0b4af7ef38e0a4d24aa3317530480be2a89554cae0afa47f18e159ee976930dcea95fd92e07ab534a57c98f8cef42c37f5dce709fa12 mblaze-0.2.tar.gz
4e4b6f870daf28cee16f3a2d7830ad92635ec071385157e0a9edb97019c1ecc84055f25d6d8432daa225bbecb69d11415568d289be29e5d1dd8922dcc1c619ac 0001-mgenmid-printb36-fix-off-by-one.patch"