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.
This commit is contained in:
sperber 2007-01-28 15:13:52 +00:00
parent 3ee7a21884
commit 71a747b4f2
1 changed files with 5 additions and 0 deletions

View File

@ -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;