From 71a747b4f2e2d7253ab1a5127b9d49f33f84aab5 Mon Sep 17 00:00:00 2001 From: sperber Date: Sun, 28 Jan 2007 15:13:52 +0000 Subject: [PATCH] Bug fix submitted by Taylor Campbell: Since `s48_extract_unsigned_integer' may cause a garbage collection, because it calls back to Scheme, the extraction of the host and port in the internet address case must be GC-protected, around line 110. A patch to fix this is attached. --- scsh/network1.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scsh/network1.c b/scsh/network1.c index 948167d..6ac0a11 100644 --- a/scsh/network1.c +++ b/scsh/network1.c @@ -107,9 +107,14 @@ s48_value scheme_connect(s48_value sock, s48_value family, s48_value scheme_name { struct sockaddr_in name; + S48_DECLARE_GC_PROTECT (1); + S48_GC_PROTECT_1 (scheme_name); + u_long addr= htonl(s48_extract_unsigned_integer (S48_CAR (scheme_name))); u_short port= htons(s48_extract_fixnum (S48_CDR (scheme_name))); + S48_GC_UNPROTECT (); + memset(&name, 0, sizeof(name)); name.sin_family=AF_INET;