summaryrefslogtreecommitdiff
path: root/lib/strcasestr.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2007-12-31 11:53:40 +0100
committerBruno Haible <bruno@clisp.org>2007-12-31 11:53:40 +0100
commitbffe05f44cce9d4f948bb1286097cea293a067f6 (patch)
tree589352d4f73770a805ce105cf945f6832b6c0252 /lib/strcasestr.c
parent666d3eddd79973c9ef06e875a1dc41702bac6443 (diff)
downloadgnulib-bffe05f44cce9d4f948bb1286097cea293a067f6.tar.gz
Protect against integer overflow in malloca() calls.
Diffstat (limited to 'lib/strcasestr.c')
-rw-r--r--lib/strcasestr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/strcasestr.c b/lib/strcasestr.c
index 27145dd37d..dfbf925b79 100644
--- 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.