aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
authorYann E. MORIN <yann.morin.1998@free.fr>2013-07-16 14:32:33 -0400
committerYann E. MORIN <yann.morin.1998@free.fr>2013-07-16 14:36:18 -0400
commit1407f97aeda5720d6327d69f6058537c0fd469e3 (patch)
treee16cffe6b08d38c18db57ef46e96c757c0690f75 /scripts/kconfig
parent803b3519880f255563d8590c1f5870398b9a4ea0 (diff)
kconfig: don't allocate n+1 elements in temporary array
The temporary array that stores the search results is not NULL-terminated, so there is no reason to allocate n+1 elements. Reported-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Jean Delvare <jdelvare@suse.de>
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/symbol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index b664d6ed515f..08d4401e646d 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -1010,7 +1010,7 @@ struct symbol **sym_re_search(const char *pattern)
1010 continue; 1010 continue;
1011 if (regexec(&re, sym->name, 1, match, 0)) 1011 if (regexec(&re, sym->name, 1, match, 0))
1012 continue; 1012 continue;
1013 if (cnt + 1 >= size) { 1013 if (cnt >= size) {
1014 void *tmp; 1014 void *tmp;
1015 size += 16; 1015 size += 16;
1016 tmp = realloc(sym_match_arr, size * sizeof(struct sym_match *)); 1016 tmp = realloc(sym_match_arr, size * sizeof(struct sym_match *));