<html>
<head>
<base href="https://bugzilla.netfilter.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - nft crashes in chain_print_declaration()"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1365#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - nft crashes in chain_print_declaration()"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1365">bug 1365</a>
from <span class="vcard"><a class="email" href="mailto:slyfox@inbox.ru" title="Sergei Trofimovich <slyfox@inbox.ru>"> <span class="fn">Sergei Trofimovich</span></a>
</span></b>
<pre>If I add the following asserts to nftables:
--- a/src/rule.c
+++ b/src/rule.c
@@ -1107,6 +1107,8 @@ static void chain_print_declaration(const struct chain
*chain,
nft_print(octx, " # handle %" PRIu64, chain->handle.handle.id);
nft_print(octx, "\n");
if (chain->flags & CHAIN_F_BASECHAIN) {
+ assert(chain);
+ assert(chain->policy);
mpz_export_data(&policy, chain->policy->value,
BYTEORDER_HOST_ENDIAN, sizeof(int));
nft_print(octx, "\t\ttype %s hook %s", chain->type,
those crash as:
$ nft -c -f ./nft.ruleset
table inet filter {
chain prerouting {
nft: ../../../nftables/src/rule.c:1111: chain_print_declaration: Assertion
`chain->policy' failed.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>