mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Check return value of dup(), it could be -1 when the system is running
out of file descriptors for instance. Found with: Coverity Prevent(tm) CID: 6084 MFC after: 1 month
This commit is contained in:
parent
af8ec89da4
commit
c38fa7e016
1 changed files with 8 additions and 1 deletions
|
|
@ -312,7 +312,14 @@ unpack(int in, int out, char *pre, size_t prelen, off_t *bytes_in)
|
|||
{
|
||||
unpack_descriptor_t unpackd;
|
||||
|
||||
unpack_parse_header(dup(in), dup(out), pre, prelen, bytes_in, &unpackd);
|
||||
in = dup(in);
|
||||
if (in == -1)
|
||||
maybe_err("dup");
|
||||
out = dup(out);
|
||||
if (out == -1)
|
||||
maybe_err("dup");
|
||||
|
||||
unpack_parse_header(in, out, pre, prelen, bytes_in, &unpackd);
|
||||
unpack_decode(&unpackd, bytes_in);
|
||||
unpack_descriptor_fini(&unpackd);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue