when multiplying M by sizeof (size_t).
+2007-12-29 Paul Eggert <eggert@cs.ucla.edu>
+
+ * lib/memmem.c (knuth_morris_pratt): Check for size_t overflow
+ when multiplying M by sizeof (size_t).
+
2007-12-10 Martin Lambers <marlam@marlam.de>
Override getpagesize on mingw.
const char **resultp)
{
/* Allocate the table. */
- size_t *table = (size_t *) malloca (m * sizeof (size_t));
+ size_t *table;
+ if ((size_t) -1 / sizeof (size_t) < m)
+ return false;
+ table = (size_t *) malloca (m * sizeof (size_t));
if (table == NULL)
return false;
/* Fill the table.