From: Erez Zadok Date: Thu, 30 Jun 2005 14:58:22 +0000 (+0000) Subject: * amd/map.c (get_next_exported_ap): Avoid running off the end of X-Git-Tag: am-utils-6_1_1~31 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=11f676a36577c7e69babbcdcc811260aeecbb843;p=am-utils-6.1.git * amd/map.c (get_next_exported_ap): Avoid running off the end of the exported_ap[] array. Patch from jon+amd-at-spock.org. Fixed bug #301. --- diff --git a/AUTHORS b/AUTHORS index 9829b54..f0f6f69 100644 --- a/AUTHORS +++ b/AUTHORS @@ -395,6 +395,7 @@ AIX. * Jonathan Chen October 22, 2004: patch/fix to move mlock/mlockall/plock code after the fork(). +June 29, 2005: core dump going off end of exported_ap[] array. * David Rage January 17, 2005: prevent Amd from logging 'Read-only filesystem' errors diff --git a/ChangeLog b/ChangeLog index a1eda8b..6b8d4ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-06-30 Erez Zadok + + * amd/map.c (get_next_exported_ap): Avoid running off the end of + the exported_ap[] array. Patch from jon+amd-at-spock.org. Fixed + bug #301. + 2005-06-25 Erez Zadok * Makefile.am (EXTRA_DIST_CONF): distribute new mtab_linux.c. diff --git a/amd/map.c b/amd/map.c index 59c4e5c..ad7fb1e 100644 --- a/amd/map.c +++ b/amd/map.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * - * $Id: map.c,v 1.53 2005/03/18 01:11:33 ezk Exp $ + * $Id: map.c,v 1.54 2005/06/30 14:58:22 ezk Exp $ * */ @@ -122,12 +122,12 @@ am_node * get_next_exported_ap(int *index) { (*index)++; - while (exported_ap[*index] == NULL) { - if (*index >= exported_ap_size) - return NULL; + while (*index < exported_ap_size) { + if (exported_ap[*index] != NULL) + return exported_ap[*index]; (*index)++; } - return exported_ap[*index]; + return NULL; }