mirror of
https://github.com/hufrea/byedpi.git
synced 2024-12-22 06:15:14 +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 {
|
struct eval {
|
||||||
int fd;
|
int fd;
|
||||||
int index;
|
int index;
|
||||||
unsigned int mod_iter;
|
unsigned long long mod_iter;
|
||||||
enum eid type;
|
enum eid type;
|
||||||
struct eval *pair;
|
struct eval *pair;
|
||||||
struct buffer buff;
|
struct buffer buff;
|
||||||
@ -93,7 +93,7 @@ struct poolhd {
|
|||||||
#else
|
#else
|
||||||
struct pollfd *pevents;
|
struct pollfd *pevents;
|
||||||
#endif
|
#endif
|
||||||
unsigned int iters;
|
unsigned long long iters;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct poolhd *init_pool(int count);
|
struct poolhd *init_pool(int count);
|
||||||
|
4
proxy.c
4
proxy.c
@ -482,7 +482,7 @@ int udp_associate(struct poolhd *pool,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
struct eval *client = add_event(pool, EV_UDP_TUNNEL, cfd, POLLIN);
|
struct eval *client = add_event(pool, EV_UDP_TUNNEL, cfd, POLLIN);
|
||||||
if (!pair) {
|
if (!client) {
|
||||||
del_event(pool, pair);
|
del_event(pool, pair);
|
||||||
close(cfd);
|
close(cfd);
|
||||||
return -1;
|
return -1;
|
||||||
@ -880,7 +880,7 @@ int event_loop(int srvfd)
|
|||||||
}
|
}
|
||||||
assert(val->type >= 0
|
assert(val->type >= 0
|
||||||
&& val->type < sizeof(eid_name)/sizeof(*eid_name));
|
&& 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) {
|
switch (val->type) {
|
||||||
case EV_ACCEPT:
|
case EV_ACCEPT:
|
||||||
|
Loading…
Reference in New Issue
Block a user