From a81fdf3b3ffb2eef80c03d26b67fd00401ea1cc0 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 15 2020 17:41:01 +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;