From c51dc068d599e32f06ba83e4f55b2ae6e3529283 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 26 Apr 2001 20:45:18 +0000 Subject: Update. * string/strcoll.c: Fix two memory allocation problems. * string/Makefile (tests): Add bug-strcoll1. * string/bug-strcoll1.c: New file. --- string/strcoll.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'string/strcoll.c') 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; -- cgit v1.2.1