diff options
author | Miles Bader <miles@gnu.org> | 2006-04-17 08:41:12 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2006-04-17 08:41:12 +0000 |
commit | cfc2051d0ed5a268528a647ab0911a2f5cc451de (patch) | |
tree | cb622fe0b6c1ba8b97314fb80ba2fd8fad60a5a2 /src/process.c | |
parent | ca49cf1703cc20d50653c32ca2f438c8819b78bd (diff) | |
parent | e4a89ccf738861d7b9c4f611185aa0f204c9c208 (diff) | |
download | emacs-cfc2051d0ed5a268528a647ab0911a2f5cc451de.tar.gz emacs-cfc2051d0ed5a268528a647ab0911a2f5cc451de.tar.bz2 emacs-cfc2051d0ed5a268528a647ab0911a2f5cc451de.zip |
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-56
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 204-225)
- Update from CVS
- Sync from erc--emacs--0
- Merge from gnus--rel--5.10
- Improve tq.el.
- Update from CVS: src/puresize.h (PURESIZE_RATIO): Reduce to 10/6.
* gnus--rel--5.10 (patch 81-85)
- Update from CVS
- Merge from emacs--devo--0
Diffstat (limited to 'src/process.c')
-rw-r--r-- | src/process.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/process.c b/src/process.c index eab9daa6bdd..8e4a0d22160 100644 --- a/src/process.c +++ b/src/process.c @@ -2323,7 +2323,11 @@ get_lisp_to_sockaddr_size (address, familyp) } /* Convert an address object (vector or string) to an internal sockaddr. - Format of address has already been validated by size_lisp_to_sockaddr. */ + + The address format has been basically validated by + get_lisp_to_sockaddr_size, but this does not mean FAMILY is valid; + it could have come from user data. So if FAMILY is not valid, + we return after zeroing *SA. */ static void conv_lisp_to_sockaddr (family, address, sa, len) @@ -2337,7 +2341,6 @@ conv_lisp_to_sockaddr (family, address, sa, len) register int i; bzero (sa, len); - sa->sa_family = family; if (VECTORP (address)) { @@ -2349,6 +2352,7 @@ conv_lisp_to_sockaddr (family, address, sa, len) i = XINT (p->contents[--len]); sin->sin_port = htons (i); cp = (unsigned char *)&sin->sin_addr; + sa->sa_family = family; } #ifdef AF_INET6 else if (family == AF_INET6) @@ -2364,9 +2368,10 @@ conv_lisp_to_sockaddr (family, address, sa, len) int j = XFASTINT (p->contents[i]) & 0xffff; ip6[i] = ntohs (j); } - return; + sa->sa_family = family; } #endif + return; } else if (STRINGP (address)) { @@ -2377,6 +2382,7 @@ conv_lisp_to_sockaddr (family, address, sa, len) cp = SDATA (address); for (i = 0; i < sizeof (sockun->sun_path) && *cp; i++) sockun->sun_path[i] = *cp++; + sa->sa_family = family; } #endif return; @@ -6229,6 +6235,8 @@ text to PROCESS after you call this function. */) emacs_close (XINT (XPROCESS (proc)->outfd)); #endif /* not HAVE_SHUTDOWN */ new_outfd = emacs_open (NULL_DEVICE, O_WRONLY, 0); + if (new_outfd < 0) + abort (); old_outfd = XINT (XPROCESS (proc)->outfd); if (!proc_encode_coding_system[new_outfd]) |