From b4dd0a1064a75df7117479ff06c1f63aa2c35001 Mon Sep 17 00:00:00 2001 From: Mike Gran Date: Fri, 22 Feb 2013 07:37:35 -0800 Subject: [PATCH] Fix invalid access of closed guile port If `guile_error' is called after the cfg file has closed, serveez can try to access the filename of a closed port, leading to a segfault. * src/guile.c (guile_error): modified --- src/guile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guile.c b/src/guile.c index a05e3cd..257fde1 100644 --- a/src/guile.c +++ b/src/guile.c @@ -185,7 +185,7 @@ guile_error (char *format, ...) va_list args; /* FIXME: Why is this port undefined in guile exceptions? */ SCM lp = guile_get_current_load_port (); - int lp_valid_p = !SCM_UNBNDP (lp) && SCM_PORTP (lp); + int lp_valid_p = !SCM_UNBNDP (lp) && SCM_OPINPORTP (lp); SCM filename = lp_valid_p ? SCM_FILENAME (lp) : SCM_BOOL_F; char file[1024]; -- 1.7.11.7