firewall3: Fix GCC8 warnings by replacing sprintf with snprintf
[project/firewall3.git] / redirects.c
index 7f9948cd3bb77a3a83b3553615d5e3ef4d677404..6cd09f16143d84d3737c3157e4c3b23b1e280f94 100644 (file)
@@ -466,7 +466,7 @@ set_redirect(struct fw3_ipt_rule *r, struct fw3_port *port)
                if (port->port_min == port->port_max)
                        sprintf(buf, "%u", port->port_min);
                else
-                       sprintf(buf, "%u-%u", port->port_min, port->port_max);
+                       snprintf(buf, sizeof(buf), "%u-%u", port->port_min, port->port_max);
 
                fw3_ipt_rule_addarg(r, false, "--to-ports", buf);
        }