+2021-10-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ xalloc: new function xinmalloc
+ * lib/xmalloc.c (xinmalloc): New function, which is like
+ xnmalloc but for idx_t instead of size_t.
+
2021-10-18 Paul Eggert <eggert@cs.ucla.edu>
regex: fix buffer read overrrun
void *ximalloc (idx_t s)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
_GL_ATTRIBUTE_ALLOC_SIZE ((1)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *xinmalloc (idx_t n, idx_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1, 2)) _GL_ATTRIBUTE_RETURNS_NONNULL;
void *xzalloc (size_t s)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
_GL_ATTRIBUTE_ALLOC_SIZE ((1)) _GL_ATTRIBUTE_RETURNS_NONNULL;
return xreallocarray (NULL, n, s);
}
+void *
+xinmalloc (idx_t n, idx_t s)
+{
+ return xireallocarray (NULL, n, s);
+}
+
/* If P is null, allocate a block of at least *PS bytes; otherwise,
reallocate P so that it contains more than *PS bytes. *PS must be
nonzero unless P is null. Set *PS to the new block's size, and