]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(__gconv_lookup_cache): Catch one more boundary case and reject it.
authorUlrich Drepper <drepper@redhat.com>
Tue, 24 Jul 2001 18:49:46 +0000 (18:49 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 24 Jul 2001 18:49:46 +0000 (18:49 +0000)
iconv/gconv_cache.c

index 20a30b6fdfc9562ee075ee91d0d5db5884df2b98..79e5dde629ce9b5f324dfa97c6c708de92eef70f 100644 (file)
@@ -324,11 +324,12 @@ __gconv_lookup_cache (const char *toset, const char *fromset,
  try_internal:
   /* See whether we can convert via the INTERNAL charset.  */
   if ((fromidx != 0 && __builtin_expect (from_module->fromname_offset, 1) == 0)
-      || (toidx != 0 && __builtin_expect (to_module->toname_offset, 1) == 0))
+      || (toidx != 0 && __builtin_expect (to_module->toname_offset, 1) == 0)
+      || (fromidx == 0 && toidx == 0))
     /* Not possible.  Nothing we can do.  */
     return __GCONV_NOCONV;
 
-  /* Use the two modules.  */
+  /* We will use up to two modules.  Always allocate room for two.  */
   result = (struct __gconv_step *) malloc (2 * sizeof (struct __gconv_step));
   if (result == NULL)
     return __GCONV_NOMEM;