]> git.proxmox.com Git - mirror_iproute2.git/commit
tc_util: detect overflow in get_size
authorOdin Ugedal <odin@ugedal.com>
Thu, 16 Apr 2020 14:08:14 +0000 (16:08 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 20 Apr 2020 16:31:01 +0000 (09:31 -0700)
commite07c57e94e27d2f15bfb9de4db7ca3ab9d9368ed
tree399103e9d03d1ef3fc3216e8ed490e4edbf9959c
parentfe821d64e60cee2abc4347b3f67e8a3d698777a0
tc_util: detect overflow in get_size

This detects overflow during parsing of value using get_size:

eg. running:

$ tc qdisc add dev lo root cake memlimit 11gb

currently gives a memlimit of "3072Mb", while with this patch it errors
with 'illegal value for "memlimit": "11gb"', since memlinit is an
unsigned integer.

Signed-off-by: Odin Ugedal <odin@ugedal.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc/tc_util.c