Skip to content

iptables: return error from ListById when chain has no matching rule#136

Open
c-tonneslan wants to merge 1 commit into
coreos:mainfrom
c-tonneslan:fix/listbyid-empty-chain
Open

iptables: return error from ListById when chain has no matching rule#136
c-tonneslan wants to merge 1 commit into
coreos:mainfrom
c-tonneslan:fix/listbyid-empty-chain

Conversation

@c-tonneslan
Copy link
Copy Markdown

Closes #130.

`executeList` returns an empty slice when the chain has no rule at the given id, but `ListById` indexed `rule[0]` unconditionally and panicked with index-out-of-range. Surface a descriptive error instead so callers can handle the case.

executeList returns an empty slice when the chain has no rule at the
given id, but ListById indexed rule[0] unconditionally and panicked
with index-out-of-range. Return a descriptive error instead so callers
can recover.

Closes coreos#130

Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ListById function panicked when no rules in target chain

1 participant