diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2012-03-05 17:52:46 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2012-03-05 17:52:46 +0000 |
commit | ec780171b195b0372965d389b279ffa01bf66400 (patch) | |
tree | c080f78a1a0fe2ff14ce5c4f429baca9ea41ad40 /package | |
parent | 1a1bf7518ac61d7772b18d3a92733178a10cb090 (diff) | |
download | master-187ad058-ec780171b195b0372965d389b279ffa01bf66400.tar.gz master-187ad058-ec780171b195b0372965d389b279ffa01bf66400.tar.bz2 master-187ad058-ec780171b195b0372965d389b279ffa01bf66400.zip |
[package] iwinfo: fix integer overflow in assoclist rate reporting (#11073)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30825 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r-- | package/iwinfo/Makefile | 2 | ||||
-rw-r--r-- | package/iwinfo/src/include/iwinfo.h | 2 | ||||
-rw-r--r-- | package/iwinfo/src/iwinfo_cli.c | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/package/iwinfo/Makefile b/package/iwinfo/Makefile index f74fe2f1f9..db8a3da25f 100644 --- a/package/iwinfo/Makefile +++ b/package/iwinfo/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libiwinfo -PKG_RELEASE:=31 +PKG_RELEASE:=32 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) PKG_CONFIG_DEPENDS := \ diff --git a/package/iwinfo/src/include/iwinfo.h b/package/iwinfo/src/include/iwinfo.h index 9e78bab70e..868c10b359 100644 --- a/package/iwinfo/src/include/iwinfo.h +++ b/package/iwinfo/src/include/iwinfo.h @@ -61,7 +61,7 @@ extern const char *IWINFO_OPMODE_NAMES[]; struct iwinfo_rate_entry { - uint16_t rate; + uint32_t rate; int8_t mcs; uint8_t is_40mhz:1; uint8_t is_short_gi:1; diff --git a/package/iwinfo/src/iwinfo_cli.c b/package/iwinfo/src/iwinfo_cli.c index 0fdb21ec67..7ec5aef95c 100644 --- a/package/iwinfo/src/iwinfo_cli.c +++ b/package/iwinfo/src/iwinfo_cli.c @@ -134,7 +134,8 @@ static char * format_rate(int rate) if (rate <= 0) snprintf(buf, sizeof(buf), "unknown"); else - snprintf(buf, sizeof(buf), "%.1f MBit/s", ((float)rate / 1000.0)); + snprintf(buf, sizeof(buf), "%d.%d MBit/s", + rate / 1000, (rate % 1000) / 100); return buf; } |