From 9da9db71c6a38491703a10b0a9f8e2dcb42f2ea2 Mon Sep 17 00:00:00 2001 From: Packit Date: Sep 09 2020 16:28:23 +0000 Subject: Apply patch 0002-xtables-restore-Fix-parser-feed-from-line-buffer.patch patch_name: 0002-xtables-restore-Fix-parser-feed-from-line-buffer.patch present_in_specfile: true location_in_specfile: 2 --- diff --git a/iptables/tests/shell/testcases/ipt-restore/0010-noflush-new-chain_0 b/iptables/tests/shell/testcases/ipt-restore/0010-noflush-new-chain_0 new file mode 100755 index 0000000..739e684 --- /dev/null +++ b/iptables/tests/shell/testcases/ipt-restore/0010-noflush-new-chain_0 @@ -0,0 +1,10 @@ +#!/bin/sh -e + +# assert input feed from buffer doesn't trip over +# added nul-chars from parsing chain line. + +$XT_MULTI iptables-restore --noflush <error.lineno = ++line; DEBUGP("%s: buffered line %d: '%s'\n", __func__, line, ptr); xtables_restore_parse_line(h, p, &state, ptr); - ptr += strlen(ptr) + 1; + ptr += len + 1; } if (*buffer) { h->error.lineno = ++line;