]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix infloop on persistent failing calloc in regex.
authorJim Meyering <meyering@redhat.com>
Mon, 27 Dec 2010 23:19:56 +0000 (18:19 -0500)
committerUlrich Drepper <drepper@gmail.com>
Mon, 27 Dec 2010 23:19:56 +0000 (18:19 -0500)
ChangeLog
NEWS
posix/regexec.c

index e86929eb311795a79ea2e695bbd3ad1479dffbee..31b8a736dc77abd5195653bcda92e659bdda3158 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-12-27  Jim Meyering  <meyering@redhat.com>
+
+       [BZ #12348]
+       * posix/regexec.c (build_trtable): Return failure indication upon
+       calloc failure.  Otherwise, re_search_internal could infloop on OOM.
+
 2010-12-25  Ulrich Drepper  <drepper@gmail.com>
 
        [BZ #12201]
diff --git a/NEWS b/NEWS
index 50705961638b4f8d44c46ca0a1b87193a188079d..3edaf547dafede73a60f225613a84d8171dd602d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes.  2010-12-26
+GNU C Library NEWS -- history of user-visible changes.  2010-12-27
 Copyright (C) 1992-2009, 2010 Free Software Foundation, Inc.
 See the end for copying conditions.
 
@@ -12,7 +12,7 @@ Version 2.13
   3268, 7066, 10085, 10851, 11149, 11611, 11640, 11655, 11701, 11840, 11856,
   11883, 11903, 11904, 11968, 11979, 12005, 12037, 12067, 12077, 12078, 12092,
   12093, 12107, 12108, 12113, 12140, 12159, 12167, 12191, 12194, 12201, 12204,
-  12205, 12207
+  12205, 12207, 12348
 
 * New Linux interfaces: prlimit, prlimit64, fanotify_init, fanotify_mark
 
index 7f7ae3123fab8f6fe150cd982c93e4057da6b970..8d4475cdb984a288d04f7f766e83231834e452e9 100644 (file)
@@ -3373,6 +3373,8 @@ build_trtable (const re_dfa_t *dfa, re_dfastate_t *state)
        {
          state->trtable = (re_dfastate_t **)
            calloc (sizeof (re_dfastate_t *), SBC_MAX);
+         if (BE (state->trtable == NULL, 0))
+           return 0;
          return 1;
        }
       return 0;