diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-04-26 20:45:18 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-04-26 20:45:18 +0000 |
commit | c51dc068d599e32f06ba83e4f55b2ae6e3529283 (patch) | |
tree | 733360585ba95f09e0d0d2c1cff1a3cb836450be /string/strcoll.c | |
parent | 9243173ab9dddf7dad76c702ae2e5aeca9fbc794 (diff) | |
download | glibc-c51dc068d599e32f06ba83e4f55b2ae6e3529283.tar glibc-c51dc068d599e32f06ba83e4f55b2ae6e3529283.tar.gz glibc-c51dc068d599e32f06ba83e4f55b2ae6e3529283.tar.bz2 glibc-c51dc068d599e32f06ba83e4f55b2ae6e3529283.zip |
Update.
* string/strcoll.c: Fix two memory allocation problems.
* string/Makefile (tests): Add bug-strcoll1.
* string/bug-strcoll1.c: New file.
Diffstat (limited to 'string/strcoll.c')
-rw-r--r-- | string/strcoll.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/string/strcoll.c b/string/strcoll.c index a9ac5a8f01..d88dd860af 100644 --- a/string/strcoll.c +++ b/string/strcoll.c @@ -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; |