mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-09 16:01:19 +01:00
Fix coredump in gethostbyaddr() when the returned answer is too large to
fit in the static buffer. This fix causes it to look like there is no data available, which is also wrong but is better than dumping core. PR: bin/10344 Reviewed by: billf Approved by: jkh
This commit is contained in:
parent
528b8853bb
commit
686d0736aa
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=57252
@ -664,6 +664,10 @@ _gethostbydnsaddr(addr, len, af)
|
||||
dprintf("res_query failed (%d)\n", n);
|
||||
return (NULL);
|
||||
}
|
||||
if (n > sizeof buf.buf) {
|
||||
dprintf("static buffer is too small (%d)\n", n);
|
||||
return (NULL);
|
||||
}
|
||||
if (!(hp = gethostanswer(&buf, n, qbuf, T_PTR)))
|
||||
return (NULL); /* h_errno was set by gethostanswer() */
|
||||
#ifdef SUNSECURITY
|
||||
|
Loading…
Reference in New Issue
Block a user