projects
/
GitHub
/
exynos8895
/
android_kernel_samsung_universal8895.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
803b351
)
kconfig: don't allocate n+1 elements in temporary array
author
Yann E. MORIN
<yann.morin.1998@free.fr>
Tue, 16 Jul 2013 18:32:33 +0000
(20:32 +0200)
committer
Yann E. MORIN
<yann.morin.1998@free.fr>
Tue, 16 Jul 2013 18:36:18 +0000
(20:36 +0200)
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>
scripts/kconfig/symbol.c
patch
|
blob
|
blame
|
history
diff --git
a/scripts/kconfig/symbol.c
b/scripts/kconfig/symbol.c
index b664d6ed515ffe27e4a805734a5f51d839078da4..08d4401e646d8b043f1385cb81637ce66ea0184f 100644
(file)
--- a/
scripts/kconfig/symbol.c
+++ b/
scripts/kconfig/symbol.c
@@
-1010,7
+1010,7
@@
struct symbol **sym_re_search(const char *pattern)
continue;
if (regexec(&re, sym->name, 1, match, 0))
continue;
- if (cnt
+ 1
>= size) {
+ if (cnt >= size) {
void *tmp;
size += 16;
tmp = realloc(sym_match_arr, size * sizeof(struct sym_match *));