[vte] [ring] Add safeguards to remove()
- From: Behdad Esfahbod <behdad src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vte] [ring] Add safeguards to remove()
- Date: Thu, 27 Aug 2009 17:44:39 +0000 (UTC)
commit ffcb06a6bc2bf1d66eadf2e708ec444cf612f0c0
Author: Behdad Esfahbod <behdad behdad org>
Date: Tue Aug 25 23:47:07 2009 -0400
[ring] Add safeguards to remove()
src/ring.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/ring.c b/src/ring.c
index dca3052..f92e340 100644
--- a/src/ring.c
+++ b/src/ring.c
@@ -215,6 +215,10 @@ void
_vte_ring_remove(VteRing * ring, long position)
{
long i;
+
+ g_return_if_fail(position >= ring->delta);
+ g_return_if_fail(position < ring->delta + ring->length);
+
_vte_debug_print(VTE_DEBUG_RING, "Removing item at position %ld.\n", position);
_vte_ring_validate(ring);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]