static TargetFdDataFunc fd_trans_host_to_target_data(int fd)
{
- if (fd < target_fd_max && target_fd_trans[fd]) {
+ if (fd >= 0 && fd < target_fd_max && target_fd_trans[fd]) {
return target_fd_trans[fd]->host_to_target_data;
}
return NULL;
static TargetFdAddrFunc fd_trans_target_to_host_addr(int fd)
{
- if (fd < target_fd_max && target_fd_trans[fd]) {
+ if (fd >= 0 && fd < target_fd_max && target_fd_trans[fd]) {
return target_fd_trans[fd]->target_to_host_addr;
}
return NULL;