mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 00:41:30 +01:00
In in_pcbconnect(), check the return value from in_pcbbind() and
exit on errors. If we don't, in_pcbrehash() is called without a preceeding in_pcbinshash(), causing a crash. There are apparently several conditions that could cause the crash; PR misc/12256 is only one of these. PR: misc/12256
This commit is contained in:
parent
94aa67da3b
commit
5a903f8d73
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=48224
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)in_pcb.c 8.4 (Berkeley) 5/24/95
|
||||
* $Id: in_pcb.c,v 1.49 1999/04/28 11:37:44 phk Exp $
|
||||
* $Id: in_pcb.c,v 1.50 1999/06/17 23:54:50 green Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -458,8 +458,11 @@ in_pcbconnect(inp, nam, p)
|
||||
return (EADDRINUSE);
|
||||
}
|
||||
if (inp->inp_laddr.s_addr == INADDR_ANY) {
|
||||
if (inp->inp_lport == 0)
|
||||
(void)in_pcbbind(inp, (struct sockaddr *)0, p);
|
||||
if (inp->inp_lport == 0) {
|
||||
error = in_pcbbind(inp, (struct sockaddr *)0, p);
|
||||
if (error)
|
||||
return (error);
|
||||
}
|
||||
inp->inp_laddr = ifaddr->sin_addr;
|
||||
}
|
||||
inp->inp_faddr = sin->sin_addr;
|
||||
|
Loading…
Reference in New Issue
Block a user