From e14ddc74defe8917ad0bb2d2c28c6c5c0079f6ba Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Tue, 6 Jan 2004 23:34:54 +0000 Subject: [PATCH] (scm_aind): Test SCM_CONSP rather than !SCM_NULLP while traversing the args list, fixes segv if an improper list is given. Reported by Rouben Rostamian. --- libguile/unif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libguile/unif.c b/libguile/unif.c index f57cce8ce..e89c62f05 100644 --- a/libguile/unif.c +++ b/libguile/unif.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1997,1998,2000,2001,2002 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1997,1998,2000,2001,2002,2004 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -500,7 +500,7 @@ scm_aind (SCM ra, SCM args, const char *what) scm_error_num_args_subr (what); return pos + (SCM_INUM (args) - s->lbnd) * (s->inc); } - while (k && !SCM_NULLP (args)) + while (k && SCM_CONSP (args)) { ind = SCM_CAR (args); args = SCM_CDR (args);