tc: prio: Perform more strict check on priomap.
Subsystems (2)
PATCH 1/1 tc: prio: Perform more strict check on priomap.
Since band number counts from zero thus band must be little than opt.bands.
--- tc/q_prio.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
tc/q_prio.c +1 -1
@@ -67,7 +67,7 @@ static int prio_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nfprintf (stderr,"Illegal \"priomap\" element\n" );return -1 ; } -if (band > opt.bands) { +if (band >= opt.bands) {fprintf (stderr,"\"priomap\" element is out of bands\n" );return -1 ; }
Signature · 1 line
1.7.1
Stephen Hemminger
AppliedQuoted 12 lines · On Mon, 18 Jun 2012 14:33:38 +0800 Li Wei <[email protected]> wrote:
Since band number counts from zero thus band must be little than opt.bands.
--- tc/q_prio.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)tc/q_prio.c +0
-0
tc/q_prio.c static int prio_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct n · line 73
Quoted 8 lines
tc/q_prio.c +1
-1@@ -67,7 +67,7 @@ static int prio_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nfprintf (stderr,"Illegal \"priomap\" element\n" );return -1 ; } -if (band > opt.bands) { +if (band >= opt.bands) {fprintf (stderr,"\"priomap\" element is out of bands\n" );return -1 ; }
Applied