Fix signed/unsigned problems when looking for telnet IAC.
This commit is contained in:
parent
321b2ff260
commit
3ee549e2e3
@ -47,7 +47,7 @@ int accept_connection(modem_config *cfg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int parse_ip_data(modem_config *cfg, char *data, int len)
|
||||
int parse_ip_data(modem_config *cfg, unsigned char *data, int len)
|
||||
{
|
||||
// I'm going to cheat and assume it comes in chunks.
|
||||
int i = 0;
|
||||
@ -114,7 +114,7 @@ int parse_ip_data(modem_config *cfg, char *data, int len)
|
||||
}
|
||||
}
|
||||
else {
|
||||
mdm_write(cfg, data, len);
|
||||
mdm_write(cfg, (char *) data, len);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -163,7 +163,7 @@ void *ip_thread(void *arg)
|
||||
LOG(LOG_DEBUG, "Read %d bytes from socket", res);
|
||||
buf[res] = 0;
|
||||
log_trace(TRACE_IP_IN, buf, res);
|
||||
parse_ip_data(cfg, buf, res);
|
||||
parse_ip_data(cfg, (unsigned char *) buf, res);
|
||||
}
|
||||
}
|
||||
if (FD_ISSET(cfg->data.cp[1][0], &readfs)) { // pipe
|
||||
|
@ -16,5 +16,5 @@
|
||||
#define MSG_NOTIFY 'N'
|
||||
|
||||
int accept_connection(modem_config *);
|
||||
int parse_ip_data(modem_config *cfg, char *data, int len);
|
||||
int parse_ip_data(modem_config *cfg, unsigned char *data, int len);
|
||||
void *run_bridge(void *arg);
|
||||
|
@ -53,7 +53,7 @@ int get_nvt_cmd_response(int action, int type)
|
||||
return rc;
|
||||
}
|
||||
|
||||
int parse_nvt_subcommand(int fd, nvt_vars *vars, char *data, int len, int speed)
|
||||
int parse_nvt_subcommand(int fd, nvt_vars *vars, unsigned char *data, int len, int speed)
|
||||
{
|
||||
// overflow issue, again...
|
||||
nvtOption opt = data[2];
|
||||
|
@ -49,7 +49,7 @@ typedef struct nvt_vars {
|
||||
} nvt_vars;
|
||||
|
||||
extern int get_nvt_cmd_response(int action, int type);
|
||||
extern int parse_nvt_subcommand(int fd, nvt_vars *vars, char *data, int len, int speed);
|
||||
extern int parse_nvt_subcommand(int fd, nvt_vars *vars, unsigned char *data, int len, int speed);
|
||||
extern int parse_nvt_command(int fd, nvt_vars *vars, nvtCommand action, nvtOption opt, int parity);
|
||||
extern int nvt_init_config(nvt_vars *vars);
|
||||
extern int send_nvt_command(int fd, nvt_vars *vars, char action, int opt);
|
||||
|
Loading…
x
Reference in New Issue
Block a user