[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
grep branch, master, updated. v2.18-99-g59f3fac
From: |
Paul Eggert |
Subject: |
grep branch, master, updated. v2.18-99-g59f3fac |
Date: |
Thu, 24 Apr 2014 19:50:07 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".
The branch, master has been updated
via 59f3fac48e8b5456f4e0a45dfd99fba38d8b7af5 (commit)
from a9c9f65425ee313b1a24b32bfa3f9fec679bbcc7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=59f3fac48e8b5456f4e0a45dfd99fba38d8b7af5
commit 59f3fac48e8b5456f4e0a45dfd99fba38d8b7af5
Author: Paul Eggert <address@hidden>
Date: Thu Apr 24 12:49:58 2014 -0700
dfa: fix incorrect comment that led to heap overrun
* dfa.c (maybe_realloc): Fix comment to match behavior.
diff --git a/src/dfa.c b/src/dfa.c
index 8fc3d6f..f9938b0 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -624,10 +624,14 @@ equal (charclass const s1, charclass const s2)
return memcmp (s1, s2, sizeof (charclass)) == 0;
}
-/* If needed, reallocate *PTR so that it holds at least NITEMS items.
- The array holds *NALLOC items; *NALLOC is updated on reallocation.
- ITEMSIZE is the size of one item. Avoid O(N**2) behavior on arrays
- growing linearly. */
+/* Ensure that the array addressed by PTR holds at least NITEMS +
+ (PTR || !NITEMS) items. Either return PTR, or reallocate the array
+ and return its new address. Although PTR may be null, the returned
+ value is never null.
+
+ The array holds *NALLOC items; *NALLOC must be zero if PTR is null,
+ and is updated on reallocation. ITEMSIZE is the size of one item.
+ Avoid O(N**2) behavior on arrays growing linearly. */
static void *
maybe_realloc (void *ptr, size_t nitems, size_t *nalloc, size_t itemsize)
{
-----------------------------------------------------------------------
Summary of changes:
src/dfa.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
hooks/post-receive
--
grep
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- grep branch, master, updated. v2.18-99-g59f3fac,
Paul Eggert <=