Update of /cvsroot/squeak/squeak/platforms/unix/plugins/SocketPlugin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7719
Modified Files:
sqUnixSocket.c
Log Message:
Nul-terminate socket option names before looking them up.
Index: sqUnixSocket.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/unix/plugins/SocketPlugin/sqUnixSocket.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** sqUnixSocket.c 3 Apr 2004 10:22:04 -0000 1.14
--- sqUnixSocket.c 12 Jun 2004 01:09:33 -0000 1.15
***************
*** 1,14 ****
/* sqUnixSocket.c -- Unix socket support
*
! * Copyright (C) 1996-2003 Ian Piumarta and other authors/contributors
! * as listed elsewhere in this file.
* All rights reserved.
*
- * You are NOT ALLOWED to distribute modified versions of this file
- * under its original name. If you want to modify it and then make
- * your modifications available publicly, rename the file first.
- *
* This file is part of Unix Squeak.
*
* This file is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
--- 1,14 ----
/* sqUnixSocket.c -- Unix socket support
*
! * Copyright (C) 1996-2004 by Ian Piumarta and other authors/contributors
! * listed elsewhere in this file.
* All rights reserved.
*
* This file is part of Unix Squeak.
*
+ * You are NOT ALLOWED to distribute modified versions of this file
+ * under its original name. If you modify this file then you MUST
+ * rename it before making your modifications available publicly.
+ *
* This file is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
***************
*** 37,41 ****
/* Author: Ian...@in...
*
! * Last edited: 2004-04-02 14:21:17 by piumarta on emilia.local
*
* Support for BSD-style "accept" primitives contributed by:
--- 37,41 ----
/* Author: Ian...@in...
*
! * Last edited: 2004-05-26 23:03:37 by piumarta on LPA-wlan-3-6.external.hpl.hp.com
*
* Support for BSD-style "accept" primitives contributed by:
***************
*** 1248,1257 ****
static socketOption *findOption(char *name, size_t nameSize)
{
! socketOption *opt= 0;
! char buf[32];
! strncpy(buf, name, nameSize);
! for (opt= socketOptions; opt->name != 0; ++opt)
! if (!strcmp(buf, opt->name))
! return opt;
return 0;
}
--- 1248,1261 ----
static socketOption *findOption(char *name, size_t nameSize)
{
! if (nameSize < 32)
! {
! socketOption *opt= 0;
! char buf[32];
! buf[nameSize]= '\0';
! strncpy(buf, name, nameSize);
! for (opt= socketOptions; opt->name != 0; ++opt)
! if (!strcmp(buf, opt->name))
! return opt;
! }
return 0;
}
|