From 528e1319fd5663bb369fafe371d32d84edf89893 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 1 Nov 2011 22:02:52 +0000 Subject: [PATCH] 3190. [bug] Underflow in error handling in isc_mutexblock_init. [RT #26397] --- CHANGES | 3 +++ lib/isc/mutexblock.c | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 4c2de18b5e..2c9e04499a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +3190. [bug] Underflow in error handling in isc_mutexblock_init. + [RT #26397] + 3189. [test] Added a summary report after system tests. [RT #25517] 3188. [bug] zone.c:zone_refreshkeys() could fail to detach diff --git a/lib/isc/mutexblock.c b/lib/isc/mutexblock.c index d45ad0e1e4..f1952bccdb 100644 --- a/lib/isc/mutexblock.c +++ b/lib/isc/mutexblock.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mutexblock.c,v 1.20 2007/06/19 23:47:17 tbox Exp $ */ +/* $Id: mutexblock.c,v 1.20.814.1 2011/11/01 22:02:52 marka Exp $ */ /*! \file */ @@ -32,10 +32,9 @@ isc_mutexblock_init(isc_mutex_t *block, unsigned int count) { for (i = 0; i < count; i++) { result = isc_mutex_init(&block[i]); if (result != ISC_R_SUCCESS) { - i--; - while (i > 0) { - DESTROYLOCK(&block[i]); + while (i > 0U) { i--; + DESTROYLOCK(&block[i]); } return (result); }