diff options
Diffstat (limited to 'package/network/utils/nftables/patches/203-erec-use-stdio-vasprintf-instead-of-gmp_vasprintf.patch')
-rw-r--r-- | package/network/utils/nftables/patches/203-erec-use-stdio-vasprintf-instead-of-gmp_vasprintf.patch | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/package/network/utils/nftables/patches/203-erec-use-stdio-vasprintf-instead-of-gmp_vasprintf.patch b/package/network/utils/nftables/patches/203-erec-use-stdio-vasprintf-instead-of-gmp_vasprintf.patch deleted file mode 100644 index dc4d965497..0000000000 --- a/package/network/utils/nftables/patches/203-erec-use-stdio-vasprintf-instead-of-gmp_vasprintf.patch +++ /dev/null @@ -1,58 +0,0 @@ -From ee23bda1e4a85243fa02dc712f0f323e366dbf8c Mon Sep 17 00:00:00 2001 -From: Steven Barth <cyrus@openwrt.org> -Date: Mon, 15 Dec 2014 14:14:46 +0100 -Subject: [PATCH 3/5] erec: use stdio vasprintf instead of gmp_vasprintf - -Use stdio's vasprintf instead of gmp_vasprintf which is not part -of the mini-gmp function subset. Furthermore convert the only -gmp-specific user and allow the compiler to verify format-strings. - -Signed-off-by: Steven Barth <cyrus@openwrt.org> ---- - src/erec.c | 6 +++++- - src/evaluate.c | 8 ++++++-- - 2 files changed, 11 insertions(+), 3 deletions(-) - ---- a/src/erec.c -+++ b/src/erec.c -@@ -44,6 +44,7 @@ static void erec_destroy(struct error_re - xfree(erec); - } - -+__attribute__((format(printf, 3, 0))) - struct error_record *erec_vcreate(enum error_record_types type, - const struct location *loc, - const char *fmt, va_list ap) -@@ -55,10 +56,13 @@ struct error_record *erec_vcreate(enum e - erec->num_locations = 0; - erec_add_location(erec, loc); - -- gmp_vasprintf(&erec->msg, fmt, ap); -+ if (vasprintf(&erec->msg, fmt, ap) < 0) -+ erec->msg = NULL; -+ - return erec; - } - -+__attribute__((format(printf, 3, 4))) - struct error_record *erec_create(enum error_record_types type, - const struct location *loc, - const char *fmt, ...) ---- a/src/evaluate.c -+++ b/src/evaluate.c -@@ -232,9 +232,13 @@ static int expr_evaluate_value(struct ev - case TYPE_INTEGER: - mpz_init_bitmask(mask, ctx->ectx.len); - if (mpz_cmp((*expr)->value, mask) > 0) { -+ char *valstr = mpz_get_str(NULL, 10, (*expr)->value); -+ char *rangestr = mpz_get_str(NULL, 10, mask); - expr_error(ctx->msgs, *expr, -- "Value %Zu exceeds valid range 0-%Zu", -- (*expr)->value, mask); -+ "Value %s exceeds valid range 0-%s", -+ valstr, rangestr); -+ free(valstr); -+ free(rangestr); - mpz_clear(mask); - return -1; - } |