ufw

Unreachable code in backend_iptables.py, set_rule()

Bug #1927734 reported by paul janssen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ufw
Fix Released
Low
Jamie Strandboge

Bug Description

ufw --version 0.36 and trunk code.

Small one:

I spotted this one in backend_iptables.py, set_rule().
Snippet:
       # bail if we have a bad position
        if position < 0 or position > len(rules):
            err_msg = _("Invalid position '%d'") % (position)
            raise UFWError(err_msg)

        if position > 0 and rule.remove:
            err_msg = _("Cannot specify insert and delete")
            raise UFWError(err_msg)
        if position > len(rules):
            err_msg = _("Cannot insert rule at position '%d'") % position
             raise UFWError(err_msg)

The last then part will never be executed because the condition is already caught by the first if-then.

summary: - Unreachable code in backen_iptables.py, set_rule()
+ Unreachable code in backend_iptables.py, set_rule()
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Thanks for the report! This is now fixed in trunk.

Changed in ufw:
status: New → Fix Committed
importance: Undecided → Low
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

This was fixed in 0.36.2.

Changed in ufw:
assignee: nobody → Jamie Strandboge (jdstrand)
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.