mirror of
https://github.com/clearml/dropbear
synced 2025-02-07 13:21:15 +00:00
ignore wrapfd_close for unknown
--HG-- branch : fuzz
This commit is contained in:
parent
9f1c8b2f8f
commit
1abd239b9d
@ -44,7 +44,6 @@ void wrapfd_add(int fd, buffer *buf, enum wrapfd_mode mode) {
|
|||||||
assert(wrap_fds[fd].mode == UNUSED);
|
assert(wrap_fds[fd].mode == UNUSED);
|
||||||
assert(buf || mode == RANDOMIN);
|
assert(buf || mode == RANDOMIN);
|
||||||
|
|
||||||
|
|
||||||
wrap_fds[fd].mode = mode;
|
wrap_fds[fd].mode = mode;
|
||||||
wrap_fds[fd].buf = buf;
|
wrap_fds[fd].buf = buf;
|
||||||
wrap_fds[fd].closein = 0;
|
wrap_fds[fd].closein = 0;
|
||||||
@ -73,8 +72,15 @@ void wrapfd_remove(int fd) {
|
|||||||
nused--;
|
nused--;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wrapfd_close(int fd) {
|
int wrapfd_close(int fd) {
|
||||||
wrapfd_remove(fd);
|
if (fd >= 0 && fd <= IOWRAP_MAXFD && wrap_fds[fd].mode != UNUSED)
|
||||||
|
{
|
||||||
|
wrapfd_remove(fd);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return close(fd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int wrapfd_read(int fd, void *out, size_t count) {
|
int wrapfd_read(int fd, void *out, size_t count) {
|
||||||
|
@ -19,5 +19,6 @@ int wrapfd_read(int fd, void *out, size_t count);
|
|||||||
int wrapfd_write(int fd, const void* in, size_t count);
|
int wrapfd_write(int fd, const void* in, size_t count);
|
||||||
int wrapfd_select(int nfds, fd_set *readfds, fd_set *writefds,
|
int wrapfd_select(int nfds, fd_set *readfds, fd_set *writefds,
|
||||||
fd_set *exceptfds, struct timeval *timeout);
|
fd_set *exceptfds, struct timeval *timeout);
|
||||||
|
int wrapfd_close(int fd);
|
||||||
|
|
||||||
#endif // FUZZ_WRAPFD_H
|
#endif // FUZZ_WRAPFD_H
|
||||||
|
Loading…
Reference in New Issue
Block a user