1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00
* string/strcoll.c: Fix two memory allocation problems.
	* string/Makefile (tests): Add bug-strcoll1.
	* string/bug-strcoll1.c: New file.
This commit is contained in:
Ulrich Drepper
2001-04-26 20:45:18 +00:00
parent 9243173ab9
commit c51dc068d5
4 changed files with 33 additions and 4 deletions

View File

@ -154,7 +154,7 @@ STRCOLL (s1, s2, l)
if (s1len + s2len >= 16384)
{
idx1arr = (int32_t *) malloc ((s1len + s2len) * (sizeof (int32_t) + 1));
idx2arr = &idx1arr[s2len];
idx2arr = &idx1arr[s1len];
rule1arr = (unsigned char *) &idx2arr[s2len];
rule2arr = &rule1arr[s1len];
@ -173,7 +173,7 @@ STRCOLL (s1, s2, l)
try_stack:
idx1arr = (int32_t *) alloca (s1len * sizeof (int32_t));
idx2arr = (int32_t *) alloca (s2len * sizeof (int32_t));
rule1arr = (unsigned char *) alloca (s2len);
rule1arr = (unsigned char *) alloca (s1len);
rule2arr = (unsigned char *) alloca (s2len);
}
@ -422,7 +422,7 @@ STRCOLL (s1, s2, l)
{
/* No sequence at all or just one. */
if (idx1cnt == idx1max)
/* Note that seq2len is still zero. */
/* Note that seq1len is still zero. */
break;
backw1_stop = ~0ul;