mirror of
https://github.com/hufrea/byedpi.git
synced 2024-12-21 22:05:32 +00:00
fix integer overflow and unhandled error
This commit is contained in:
parent
4f22ff6184
commit
663cbf8177
4
conev.h
4
conev.h
@ -68,7 +68,7 @@ struct buffer {
|
||||
struct eval {
|
||||
int fd;
|
||||
int index;
|
||||
unsigned int mod_iter;
|
||||
unsigned long long mod_iter;
|
||||
enum eid type;
|
||||
struct eval *pair;
|
||||
struct buffer buff;
|
||||
@ -93,7 +93,7 @@ struct poolhd {
|
||||
#else
|
||||
struct pollfd *pevents;
|
||||
#endif
|
||||
unsigned int iters;
|
||||
unsigned long long iters;
|
||||
};
|
||||
|
||||
struct poolhd *init_pool(int count);
|
||||
|
4
proxy.c
4
proxy.c
@ -482,7 +482,7 @@ int udp_associate(struct poolhd *pool,
|
||||
return -1;
|
||||
}
|
||||
struct eval *client = add_event(pool, EV_UDP_TUNNEL, cfd, POLLIN);
|
||||
if (!pair) {
|
||||
if (!client) {
|
||||
del_event(pool, pair);
|
||||
close(cfd);
|
||||
return -1;
|
||||
@ -880,7 +880,7 @@ int event_loop(int srvfd)
|
||||
}
|
||||
assert(val->type >= 0
|
||||
&& val->type < sizeof(eid_name)/sizeof(*eid_name));
|
||||
LOG(LOG_L, "new event: fd: %d, evt: %s, mod_iter: %d\n", val->fd, eid_name[val->type], val->mod_iter);
|
||||
LOG(LOG_L, "new event: fd: %d, evt: %s, mod_iter: %llu\n", val->fd, eid_name[val->type], val->mod_iter);
|
||||
|
||||
switch (val->type) {
|
||||
case EV_ACCEPT:
|
||||
|
Loading…
Reference in New Issue
Block a user