mirror of
https://github.com/outbackdingo/nDPId.git
synced 2026-01-27 10:19:45 +00:00
Fixed possible buffer underflow.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
2
dependencies/nDPIsrvd.h
vendored
2
dependencies/nDPIsrvd.h
vendored
@@ -702,7 +702,7 @@ static inline int nDPIsrvd_setup_address(struct nDPIsrvd_address * const address
|
||||
}
|
||||
if (destination[0] == '[')
|
||||
{
|
||||
if (last_colon > destination && *(last_colon - 1) != ']')
|
||||
if (last_colon - destination > 1 && *(last_colon - 1) != ']')
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1516,8 +1516,8 @@ static int mainloop(struct nio * const io)
|
||||
static int setup_event_queue(struct nio * const io)
|
||||
{
|
||||
#ifdef ENABLE_EPOLL
|
||||
if ((nDPIsrvd_options.use_poll == 0 && nio_use_epoll(io, 32) != NIO_SUCCESS)
|
||||
|| (nDPIsrvd_options.use_poll != 0 && nio_use_poll(io, nDPIsrvd_MAX_REMOTE_DESCRIPTORS) != NIO_SUCCESS))
|
||||
if ((nDPIsrvd_options.use_poll == 0 && nio_use_epoll(io, 32) != NIO_SUCCESS) ||
|
||||
(nDPIsrvd_options.use_poll != 0 && nio_use_poll(io, nDPIsrvd_MAX_REMOTE_DESCRIPTORS) != NIO_SUCCESS))
|
||||
#else
|
||||
if (nio_use_poll(io, nDPIsrvd_MAX_REMOTE_DESCRIPTORS) != NIO_SUCCESS)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user