summaryrefslogtreecommitdiff
path: root/lib/c-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/c-strcasestr.c
parent666d3eddd79973c9ef06e875a1dc41702bac6443 (diff)
downloadgnulib-bffe05f44cce9d4f948bb1286097cea293a067f6.tar.gz
Protect against integer overflow in malloca() calls.
Diffstat (limited to 'lib/c-strcasestr.c')
-rw-r--r--lib/c-strcasestr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/c-strcasestr.c b/lib/c-strcasestr.c
index 76732d20ff..36b2a9f5ce 100644
--- a/lib/c-strcasestr.c
+++ b/lib/c-strcasestr.c
@@ -37,7 +37,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.