[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

user/3104: Propolice katch kauth. (Patches and testcase).



On i386 it works because the heap is dirty, on sparc64 it
dosen't work because the heap is clean and loop goes on
forever.

Patch to fix this.

--- kerberosV/src/lib/roken/resolve.c.orig      Fri Feb 28 00:17:59 2003
+++ kerberosV/src/lib/roken/resolve.c   Thu Feb 27 23:18:54 2003
@@ -453,7 +453,7 @@
            headp = &(*tt)->next;
            sum -= (*tt)->u.srv->weight;
            *tt = NULL;
-           while(*ss == NULL)
+           while(ss < ee && *ss == NULL)
                ss++;
        }
     }

This fixes the test case on i386, and reveals another bug on
sparc64.

Testcase:

#include <stdlib.h>

/* Fixed in NetBSD */
/* /usr/src/lib/libc/stdlib/random.c:1.20 */

int
main(int argc, char **argv)
{
    int len = atoi(argv[1]);
    char *foo = malloc(len);
    char *oldfoo;

    oldfoo = initstate(time(NULL), foo, len);

    return 0;
}

Credits go to lha_(_at_)_stacken_(_dot_)_kth_(_dot_)_se, mho_(_at_)_mho_(_dot_)_nu and art_(_at_)__(_dot_)_



Visit your host, monkey.org