summaryrefslogtreecommitdiff
path: root/iwinfo_lua.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-10-29 10:46:59 +0100
committerJo-Philipp Wich <jow@openwrt.org>2015-10-29 10:46:59 +0100
commit8d5afddf221172c9bb00198b1b67fdbf5deb1b96 (patch)
tree9b78aa551e1417c6598b9fba922db84a1c791577 /iwinfo_lua.c
parentb19476dec2a657cfb87052f013a98ccb9cfb8109 (diff)
downloadiwinfo-8d5afddf221172c9bb00198b1b67fdbf5deb1b96.tar.gz
lua: fix possible out-of-bounds read in iwinfo_L_cryptotable()
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'iwinfo_lua.c')
-rw-r--r--iwinfo_lua.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/iwinfo_lua.c b/iwinfo_lua.c
index 1a91001..2154ecc 100644
--- a/iwinfo_lua.c
+++ b/iwinfo_lua.c
@@ -190,7 +190,7 @@ static void iwinfo_L_cryptotable(lua_State *L, struct iwinfo_crypto_entry *c)
lua_setfield(L, -2, "wpa");
lua_newtable(L);
- for (i = 0, j = 1; i < 8; i++)
+ for (i = 0, j = 1; i < ARRAY_SIZE(IWINFO_CIPHER_NAMES); i++)
{
if (c->pair_ciphers & (1 << i))
{
@@ -201,7 +201,7 @@ static void iwinfo_L_cryptotable(lua_State *L, struct iwinfo_crypto_entry *c)
lua_setfield(L, -2, "pair_ciphers");
lua_newtable(L);
- for (i = 0, j = 1; i < 8; i++)
+ for (i = 0, j = 1; i < ARRAY_SIZE(IWINFO_CIPHER_NAMES); i++)
{
if (c->group_ciphers & (1 << i))
{
@@ -212,7 +212,7 @@ static void iwinfo_L_cryptotable(lua_State *L, struct iwinfo_crypto_entry *c)
lua_setfield(L, -2, "group_ciphers");
lua_newtable(L);
- for (i = 0, j = 1; i < 8; i++)
+ for (i = 0, j = 1; i < ARRAY_SIZE(IWINFO_KMGMT_NAMES); i++)
{
if (c->auth_suites & (1 << i))
{
@@ -223,7 +223,7 @@ static void iwinfo_L_cryptotable(lua_State *L, struct iwinfo_crypto_entry *c)
lua_setfield(L, -2, "auth_suites");
lua_newtable(L);
- for (i = 0, j = 1; i < 8; i++)
+ for (i = 0, j = 1; i < ARRAY_SIZE(IWINFO_AUTH_NAMES); i++)
{
if (c->auth_algs & (1 << i))
{