Pārlūkot izejas kodu

swconfig: fix off-by-one error, causing segfaults on gcc 4.6+ (fixes #9765)

SVN-Revision: 30485
Felix Fietkau 13 gadi atpakaļ
vecāks
revīzija
bc63786fbb
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      package/swconfig/src/swlib.c

+ 1 - 1
package/swconfig/src/swlib.c

@@ -38,7 +38,7 @@
 static struct nl_sock *handle;
 static struct nl_sock *handle;
 static struct nl_cache *cache;
 static struct nl_cache *cache;
 static struct genl_family *family;
 static struct genl_family *family;
-static struct nlattr *tb[SWITCH_ATTR_MAX];
+static struct nlattr *tb[SWITCH_ATTR_MAX + 1];
 static int refcount = 0;
 static int refcount = 0;
 
 
 static struct nla_policy port_policy[] = {
 static struct nla_policy port_policy[] = {