aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/utils/nftables/patches/202-datatype-use-mpz_set_str-instead-of-gmp_sscanf.patch
diff options
context:
space:
mode:
authorSteven Barth <cyrus@openwrt.org>2014-12-16 09:28:59 +0000
committerSteven Barth <cyrus@openwrt.org>2014-12-16 09:28:59 +0000
commit5628648f87ff6d0ed86a459d2f10e47ffd2d8471 (patch)
tree7c397162e7b6da46944c068bde60a95e448a420f /package/network/utils/nftables/patches/202-datatype-use-mpz_set_str-instead-of-gmp_sscanf.patch
parentc6c0c275bcfab69111b93ff9b5caa99331ee8653 (diff)
downloadupstream-5628648f87ff6d0ed86a459d2f10e47ffd2d8471.tar.gz
upstream-5628648f87ff6d0ed86a459d2f10e47ffd2d8471.tar.bz2
upstream-5628648f87ff6d0ed86a459d2f10e47ffd2d8471.zip
nftables: bump to release 0.4, cleanup our patches
Signed-off-by: Steven Barth <steven@midlink.org> SVN-Revision: 43730
Diffstat (limited to 'package/network/utils/nftables/patches/202-datatype-use-mpz_set_str-instead-of-gmp_sscanf.patch')
-rw-r--r--package/network/utils/nftables/patches/202-datatype-use-mpz_set_str-instead-of-gmp_sscanf.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/package/network/utils/nftables/patches/202-datatype-use-mpz_set_str-instead-of-gmp_sscanf.patch b/package/network/utils/nftables/patches/202-datatype-use-mpz_set_str-instead-of-gmp_sscanf.patch
new file mode 100644
index 0000000000..4b22ec26e5
--- /dev/null
+++ b/package/network/utils/nftables/patches/202-datatype-use-mpz_set_str-instead-of-gmp_sscanf.patch
@@ -0,0 +1,28 @@
+From 23e8958a5e539f682be4cbdf5196aa2014c7e295 Mon Sep 17 00:00:00 2001
+From: Steven Barth <cyrus@openwrt.org>
+Date: Mon, 15 Dec 2014 14:09:27 +0100
+Subject: [PATCH 2/5] datatype: use mpz_set_str instead of gmp_sscanf
+
+This simplifies the integer parsing logic and restricts it to
+functions being part of the mini-gmp subset.
+
+Signed-off-by: Steven Barth <cyrus@openwrt.org>
+---
+ src/datatype.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+--- a/src/datatype.c
++++ b/src/datatype.c
+@@ -275,11 +275,9 @@ static struct error_record *integer_type
+ struct expr **res)
+ {
+ mpz_t v;
+- int len;
+
+ mpz_init(v);
+- if (gmp_sscanf(sym->identifier, "%Zu%n", v, &len) != 1 ||
+- (int)strlen(sym->identifier) != len) {
++ if (mpz_set_str(v, sym->identifier, 0)) {
+ mpz_clear(v);
+ return error(&sym->location, "Could not parse %s",
+ sym->dtype->desc);