projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Protect against integer overflow in malloca() calls.
[gnulib.git]
/
lib
/
strcasestr.c
diff --git
a/lib/strcasestr.c
b/lib/strcasestr.c
index
27145dd
..
dfbf925
100644
(file)
--- a/
lib/strcasestr.c
+++ b/
lib/strcasestr.c
@@
-39,7
+39,7
@@
knuth_morris_pratt (const char *haystack, const char *needle,
size_t m = strlen (needle);
/* Allocate the table. */
- size_t *table = (size_t *)
malloca (m *
sizeof (size_t));
+ size_t *table = (size_t *)
nmalloca (m,
sizeof (size_t));
if (table == NULL)
return false;
/* Fill the table.