idx int64 | func_before string | Vulnerability Classification string | vul int64 | func_after string | patch string | CWE ID string | lines_before string | lines_after string |
|---|---|---|---|---|---|---|---|---|
42,800 | iperf_init_test(struct iperf_test *test)
{
struct timeval now;
struct iperf_stream *sp;
if (test->protocol->init) {
if (test->protocol->init(test) < 0)
return -1;
}
/* Init each stream. */
if (gettimeofday(&now, NULL) < 0) {
i_errno = IEINITTEST;
return -1;
}
SLIS... | DoS Exec Code Overflow | 0 | iperf_init_test(struct iperf_test *test)
{
struct timeval now;
struct iperf_stream *sp;
if (test->protocol->init) {
if (test->protocol->init(test) < 0)
return -1;
}
/* Init each stream. */
if (gettimeofday(&now, NULL) < 0) {
i_errno = IEINITTEST;
return -1;
}
SLIS... | @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,801 | iperf_json_finish(struct iperf_test *test)
{
char *str;
/* Include server output */
if (test->json_server_output) {
cJSON_AddItemToObject(test->json_top, "server_output_json", test->json_server_output);
}
if (test->server_output_text) {
cJSON_AddStringToObject(test->json_top, "server_output_text"... | DoS Exec Code Overflow | 0 | iperf_json_finish(struct iperf_test *test)
{
char *str;
/* Include server output */
if (test->json_server_output) {
cJSON_AddItemToObject(test->json_top, "server_output_json", test->json_server_output);
}
if (test->server_output_text) {
cJSON_AddStringToObject(test->json_top, "server_output_text"... | @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,802 | iperf_new_stream(struct iperf_test *test, int s)
{
int i;
struct iperf_stream *sp;
char template[] = "/tmp/iperf3.XXXXXX";
h_errno = 0;
sp = (struct iperf_stream *) malloc(sizeof(struct iperf_stream));
if (!sp) {
i_errno = IECREATESTREAM;
return NULL;
}
memset(sp, 0, s... | DoS Exec Code Overflow | 0 | iperf_new_stream(struct iperf_test *test, int s)
{
int i;
struct iperf_stream *sp;
char template[] = "/tmp/iperf3.XXXXXX";
h_errno = 0;
sp = (struct iperf_stream *) malloc(sizeof(struct iperf_stream));
if (!sp) {
i_errno = IECREATESTREAM;
return NULL;
}
memset(sp, 0, s... | @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,803 | iperf_new_test()
{
struct iperf_test *test;
test = (struct iperf_test *) malloc(sizeof(struct iperf_test));
if (!test) {
i_errno = IENEWTEST;
return NULL;
}
/* initialize everything to zero */
memset(test, 0, sizeof(struct iperf_test));
test->settings = (struct iperf_settin... | DoS Exec Code Overflow | 0 | iperf_new_test()
{
struct iperf_test *test;
test = (struct iperf_test *) malloc(sizeof(struct iperf_test));
if (!test) {
i_errno = IENEWTEST;
return NULL;
}
/* initialize everything to zero */
memset(test, 0, sizeof(struct iperf_test));
test->settings = (struct iperf_settin... | @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,804 | iperf_on_new_stream(struct iperf_stream *sp)
{
connect_msg(sp);
}
| DoS Exec Code Overflow | 0 | iperf_on_new_stream(struct iperf_stream *sp)
{
connect_msg(sp);
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,805 | iperf_on_test_finish(struct iperf_test *test)
{
}
| DoS Exec Code Overflow | 0 | iperf_on_test_finish(struct iperf_test *test)
{
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,806 | iperf_on_test_start(struct iperf_test *test)
{
if (test->json_output) {
cJSON_AddItemToObject(test->json_start, "test_start", iperf_json_printf("protocol: %s num_streams: %d blksize: %d omit: %d duration: %d bytes: %d blocks: %d reverse: %d", test->protocol->name, (int64_t) test->num_streams, (int64_t) test... | DoS Exec Code Overflow | 0 | iperf_on_test_start(struct iperf_test *test)
{
if (test->json_output) {
cJSON_AddItemToObject(test->json_start, "test_start", iperf_json_printf("protocol: %s num_streams: %d blksize: %d omit: %d duration: %d bytes: %d blocks: %d reverse: %d", test->protocol->name, (int64_t) test->num_streams, (int64_t) test... | @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,807 | iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
{
static struct option longopts[] =
{
{"port", required_argument, NULL, 'p'},
{"format", required_argument, NULL, 'f'},
{"interval", required_argument, NULL, 'i'},
{"daemon", no_argument, NULL, 'D'},
{"... | DoS Exec Code Overflow | 0 | iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
{
static struct option longopts[] =
{
{"port", required_argument, NULL, 'p'},
{"format", required_argument, NULL, 'f'},
{"interval", required_argument, NULL, 'i'},
{"daemon", no_argument, NULL, 'D'},
{"... | @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,808 | iperf_print_intermediate(struct iperf_test *test)
{
char ubuf[UNIT_LEN];
char nbuf[UNIT_LEN];
struct iperf_stream *sp = NULL;
struct iperf_interval_results *irp;
iperf_size_t bytes = 0;
double bandwidth;
int retransmits = 0;
double start_time, end_time;
cJSON *json_interval;
cJSO... | DoS Exec Code Overflow | 0 | iperf_print_intermediate(struct iperf_test *test)
{
char ubuf[UNIT_LEN];
char nbuf[UNIT_LEN];
struct iperf_stream *sp = NULL;
struct iperf_interval_results *irp;
iperf_size_t bytes = 0;
double bandwidth;
int retransmits = 0;
double start_time, end_time;
cJSON *json_interval;
cJSO... | @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,809 | iperf_print_results(struct iperf_test *test)
{
cJSON *json_summary_streams = NULL;
cJSON *json_summary_stream = NULL;
int total_retransmits = 0;
int total_packets = 0, lost_packets = 0;
char ubuf[UNIT_LEN];
char nbuf[UNIT_LEN];
struct stat sb;
char sbuf[UNIT_LEN];
struct iperf_strea... | DoS Exec Code Overflow | 0 | iperf_print_results(struct iperf_test *test)
{
cJSON *json_summary_streams = NULL;
cJSON *json_summary_stream = NULL;
int total_retransmits = 0;
int total_packets = 0, lost_packets = 0;
char ubuf[UNIT_LEN];
char nbuf[UNIT_LEN];
struct stat sb;
char sbuf[UNIT_LEN];
struct iperf_strea... | @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,810 | iperf_reset_stats(struct iperf_test *test)
{
struct timeval now;
struct iperf_stream *sp;
struct iperf_stream_result *rp;
test->bytes_sent = 0;
test->blocks_sent = 0;
gettimeofday(&now, NULL);
SLIST_FOREACH(sp, &test->streams, streams) {
sp->omitted_packet_count = sp->packet_count;
sp->ji... | DoS Exec Code Overflow | 0 | iperf_reset_stats(struct iperf_test *test)
{
struct timeval now;
struct iperf_stream *sp;
struct iperf_stream_result *rp;
test->bytes_sent = 0;
test->blocks_sent = 0;
gettimeofday(&now, NULL);
SLIST_FOREACH(sp, &test->streams, streams) {
sp->omitted_packet_count = sp->packet_count;
sp->ji... | @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,811 | iperf_reset_test(struct iperf_test *test)
{
struct iperf_stream *sp;
/* Free streams */
while (!SLIST_EMPTY(&test->streams)) {
sp = SLIST_FIRST(&test->streams);
SLIST_REMOVE_HEAD(&test->streams, streams);
iperf_free_stream(sp);
}
if (test->omit_timer != NULL) {
tmr_cancel(t... | DoS Exec Code Overflow | 0 | iperf_reset_test(struct iperf_test *test)
{
struct iperf_stream *sp;
/* Free streams */
while (!SLIST_EMPTY(&test->streams)) {
sp = SLIST_FIRST(&test->streams);
SLIST_REMOVE_HEAD(&test->streams, streams);
iperf_free_stream(sp);
}
if (test->omit_timer != NULL) {
tmr_cancel(t... | @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,812 | iperf_set_control_socket(struct iperf_test *ipt, int ctrl_sck)
{
ipt->ctrl_sck = ctrl_sck;
}
| DoS Exec Code Overflow | 0 | iperf_set_control_socket(struct iperf_test *ipt, int ctrl_sck)
{
ipt->ctrl_sck = ctrl_sck;
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,813 | iperf_set_test_bind_address(struct iperf_test *ipt, char *bind_address)
{
ipt->bind_address = strdup(bind_address);
}
| DoS Exec Code Overflow | 0 | iperf_set_test_bind_address(struct iperf_test *ipt, char *bind_address)
{
ipt->bind_address = strdup(bind_address);
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,814 | iperf_set_test_blksize(struct iperf_test *ipt, int blksize)
{
ipt->settings->blksize = blksize;
}
| DoS Exec Code Overflow | 0 | iperf_set_test_blksize(struct iperf_test *ipt, int blksize)
{
ipt->settings->blksize = blksize;
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,815 | iperf_set_test_burst(struct iperf_test *ipt, int burst)
{
ipt->settings->burst = burst;
}
| DoS Exec Code Overflow | 0 | iperf_set_test_burst(struct iperf_test *ipt, int burst)
{
ipt->settings->burst = burst;
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,816 | iperf_set_test_duration(struct iperf_test *ipt, int duration)
{
ipt->duration = duration;
}
| DoS Exec Code Overflow | 0 | iperf_set_test_duration(struct iperf_test *ipt, int duration)
{
ipt->duration = duration;
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,817 | iperf_set_test_get_server_output(struct iperf_test *ipt, int get_server_output)
{
ipt->get_server_output = get_server_output;
}
| DoS Exec Code Overflow | 0 | iperf_set_test_get_server_output(struct iperf_test *ipt, int get_server_output)
{
ipt->get_server_output = get_server_output;
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,818 | iperf_set_test_json_output(struct iperf_test *ipt, int json_output)
{
ipt->json_output = json_output;
}
| DoS Exec Code Overflow | 0 | iperf_set_test_json_output(struct iperf_test *ipt, int json_output)
{
ipt->json_output = json_output;
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,819 | iperf_set_test_num_streams(struct iperf_test *ipt, int num_streams)
{
ipt->num_streams = num_streams;
}
| DoS Exec Code Overflow | 0 | iperf_set_test_num_streams(struct iperf_test *ipt, int num_streams)
{
ipt->num_streams = num_streams;
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,820 | iperf_set_test_omit(struct iperf_test *ipt, int omit)
{
ipt->omit = omit;
}
| DoS Exec Code Overflow | 0 | iperf_set_test_omit(struct iperf_test *ipt, int omit)
{
ipt->omit = omit;
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,821 | iperf_set_test_one_off(struct iperf_test *ipt, int one_off)
{
ipt->one_off = one_off;
}
| DoS Exec Code Overflow | 0 | iperf_set_test_one_off(struct iperf_test *ipt, int one_off)
{
ipt->one_off = one_off;
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,822 | iperf_set_test_rate(struct iperf_test *ipt, uint64_t rate)
{
ipt->settings->rate = rate;
}
| DoS Exec Code Overflow | 0 | iperf_set_test_rate(struct iperf_test *ipt, uint64_t rate)
{
ipt->settings->rate = rate;
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,823 | iperf_set_test_reporter_interval(struct iperf_test *ipt, double reporter_interval)
{
ipt->reporter_interval = reporter_interval;
}
| DoS Exec Code Overflow | 0 | iperf_set_test_reporter_interval(struct iperf_test *ipt, double reporter_interval)
{
ipt->reporter_interval = reporter_interval;
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,824 | iperf_set_test_reverse(struct iperf_test *ipt, int reverse)
{
ipt->reverse = reverse;
if (ipt->reverse)
ipt->sender = ! ipt->sender;
check_sender_has_retransmits(ipt);
}
| DoS Exec Code Overflow | 0 | iperf_set_test_reverse(struct iperf_test *ipt, int reverse)
{
ipt->reverse = reverse;
if (ipt->reverse)
ipt->sender = ! ipt->sender;
check_sender_has_retransmits(ipt);
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,825 | iperf_set_test_role(struct iperf_test *ipt, char role)
{
ipt->role = role;
if (role == 'c')
ipt->sender = 1;
else if (role == 's')
ipt->sender = 0;
if (ipt->reverse)
ipt->sender = ! ipt->sender;
check_sender_has_retransmits(ipt);
}
| DoS Exec Code Overflow | 0 | iperf_set_test_role(struct iperf_test *ipt, char role)
{
ipt->role = role;
if (role == 'c')
ipt->sender = 1;
else if (role == 's')
ipt->sender = 0;
if (ipt->reverse)
ipt->sender = ! ipt->sender;
check_sender_has_retransmits(ipt);
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,826 | iperf_set_test_server_hostname(struct iperf_test *ipt, char *server_hostname)
{
ipt->server_hostname = strdup(server_hostname);
}
| DoS Exec Code Overflow | 0 | iperf_set_test_server_hostname(struct iperf_test *ipt, char *server_hostname)
{
ipt->server_hostname = strdup(server_hostname);
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,827 | iperf_set_test_server_port(struct iperf_test *ipt, int server_port)
{
ipt->server_port = server_port;
}
| DoS Exec Code Overflow | 0 | iperf_set_test_server_port(struct iperf_test *ipt, int server_port)
{
ipt->server_port = server_port;
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,828 | iperf_set_test_socket_bufsize(struct iperf_test *ipt, int socket_bufsize)
{
ipt->settings->socket_bufsize = socket_bufsize;
}
| DoS Exec Code Overflow | 0 | iperf_set_test_socket_bufsize(struct iperf_test *ipt, int socket_bufsize)
{
ipt->settings->socket_bufsize = socket_bufsize;
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,829 | iperf_set_test_state(struct iperf_test *ipt, signed char state)
{
ipt->state = state;
}
| DoS Exec Code Overflow | 0 | iperf_set_test_state(struct iperf_test *ipt, signed char state)
{
ipt->state = state;
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,830 | iperf_set_test_unit_format(struct iperf_test *ipt, char unit_format)
{
ipt->settings->unit_format = unit_format;
}
| DoS Exec Code Overflow | 0 | iperf_set_test_unit_format(struct iperf_test *ipt, char unit_format)
{
ipt->settings->unit_format = unit_format;
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,831 | iperf_set_test_zerocopy(struct iperf_test *ipt, int zerocopy)
{
ipt->zerocopy = (zerocopy && has_sendfile());
}
| DoS Exec Code Overflow | 0 | iperf_set_test_zerocopy(struct iperf_test *ipt, int zerocopy)
{
ipt->zerocopy = (zerocopy && has_sendfile());
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,832 | iperf_set_verbose(struct iperf_test *ipt, int verbose)
{
ipt->verbose = verbose;
}
| DoS Exec Code Overflow | 0 | iperf_set_verbose(struct iperf_test *ipt, int verbose)
{
ipt->verbose = verbose;
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,833 | iperf_setaffinity(int affinity)
{
#ifdef linux
cpu_set_t cpu_set;
CPU_ZERO(&cpu_set);
CPU_SET(affinity, &cpu_set);
if (sched_setaffinity(0, sizeof(cpu_set_t), &cpu_set) != 0) {
i_errno = IEAFFINITY;
return -1;
}
return 0;
#else /*linux*/
i_errno = IEAFFINITY;
return -1;
#endif ... | DoS Exec Code Overflow | 0 | iperf_setaffinity(int affinity)
{
#ifdef linux
cpu_set_t cpu_set;
CPU_ZERO(&cpu_set);
CPU_SET(affinity, &cpu_set);
if (sched_setaffinity(0, sizeof(cpu_set_t), &cpu_set) != 0) {
i_errno = IEAFFINITY;
return -1;
}
return 0;
#else /*linux*/
i_errno = IEAFFINITY;
return -1;
#endif ... | @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,834 | mapped_v4_to_regular_v4(char *str)
{
char *prefix = "::ffff:";
int prefix_len;
prefix_len = strlen(prefix);
if (strncmp(str, prefix, prefix_len) == 0) {
int str_len = strlen(str);
memmove(str, str + prefix_len, str_len - prefix_len + 1);
}
}
| DoS Exec Code Overflow | 0 | mapped_v4_to_regular_v4(char *str)
{
char *prefix = "::ffff:";
int prefix_len;
prefix_len = strlen(prefix);
if (strncmp(str, prefix, prefix_len) == 0) {
int str_len = strlen(str);
memmove(str, str + prefix_len, str_len - prefix_len + 1);
}
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,835 | print_interval_results(struct iperf_test *test, struct iperf_stream *sp, cJSON *json_interval_streams)
{
char ubuf[UNIT_LEN];
char nbuf[UNIT_LEN];
char cbuf[UNIT_LEN];
double st = 0., et = 0.;
struct iperf_interval_results *irp = NULL;
double bandwidth, lost_percent;
irp = TAILQ_LAST(&sp->r... | DoS Exec Code Overflow | 0 | print_interval_results(struct iperf_test *test, struct iperf_stream *sp, cJSON *json_interval_streams)
{
char ubuf[UNIT_LEN];
char nbuf[UNIT_LEN];
char cbuf[UNIT_LEN];
double st = 0., et = 0.;
struct iperf_interval_results *irp = NULL;
double bandwidth, lost_percent;
irp = TAILQ_LAST(&sp->r... | @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,836 | set_protocol(struct iperf_test *test, int prot_id)
{
struct protocol *prot = NULL;
SLIST_FOREACH(prot, &test->protocols, protocols) {
if (prot->id == prot_id) {
test->protocol = prot;
check_sender_has_retransmits(test);
return 0;
}
}
i_errno = IEPROTOCOL;
... | DoS Exec Code Overflow | 0 | set_protocol(struct iperf_test *test, int prot_id)
{
struct protocol *prot = NULL;
SLIST_FOREACH(prot, &test->protocols, protocols) {
if (prot->id == prot_id) {
test->protocol = prot;
check_sender_has_retransmits(test);
return 0;
}
}
i_errno = IEPROTOCOL;
... | @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,837 | usage()
{
fputs(usage_shortstr, stderr);
}
| DoS Exec Code Overflow | 0 | usage()
{
fputs(usage_shortstr, stderr);
}
| @@ -523,11 +523,11 @@ iperf_on_connect(struct iperf_test *test)
cJSON_AddStringToObject(test->json_start, "cookie", test->cookie);
if (test->protocol->id == SOCK_STREAM) {
if (test->settings->mss)
- cJSON_AddIntToObject(test->json_start, "tcp_mss", test->settings->mss);
+ cJSON_AddNumberToObject(test... | CWE-119 | null | null |
42,838 | cpu_util(double pcpu[3])
{
static struct timeval last;
static clock_t clast;
static struct rusage rlast;
struct timeval temp;
clock_t ctemp;
struct rusage rtemp;
double timediff;
double userdiff;
double systemdiff;
if (pcpu == NULL) {
gettimeofday(&last, NULL);
c... | DoS Exec Code Overflow | 0 | cpu_util(double pcpu[3])
{
static struct timeval last;
static clock_t clast;
static struct rusage rlast;
struct timeval temp;
clock_t ctemp;
struct rusage rtemp;
double timediff;
double userdiff;
double systemdiff;
if (pcpu == NULL) {
gettimeofday(&last, NULL);
c... | @@ -272,10 +272,10 @@ iperf_json_printf(const char *format, ...)
j = cJSON_CreateBool(va_arg(argp, int));
break;
case 'd':
- j = cJSON_CreateInt(va_arg(argp, int64_t));
+ j = cJSON_CreateNumber(va_arg(argp, int64_t));
break;
case 'f':
- j = cJSON_CreateFloat(va_arg(argp, double));
+ j = cJSON_CreateN... | CWE-119 | null | null |
42,839 | delay(int us)
{
struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = us;
(void) select(1, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, &tv);
return 1;
}
| DoS Exec Code Overflow | 0 | delay(int us)
{
struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = us;
(void) select(1, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, &tv);
return 1;
}
| @@ -272,10 +272,10 @@ iperf_json_printf(const char *format, ...)
j = cJSON_CreateBool(va_arg(argp, int));
break;
case 'd':
- j = cJSON_CreateInt(va_arg(argp, int64_t));
+ j = cJSON_CreateNumber(va_arg(argp, int64_t));
break;
case 'f':
- j = cJSON_CreateFloat(va_arg(argp, double));
+ j = cJSON_CreateN... | CWE-119 | null | null |
42,840 | is_closed(int fd)
{
struct timeval tv;
fd_set readset;
FD_ZERO(&readset);
FD_SET(fd, &readset);
tv.tv_sec = 0;
tv.tv_usec = 0;
if (select(fd+1, &readset, NULL, NULL, &tv) < 0) {
if (errno == EBADF)
return 1;
}
return 0;
}
| DoS Exec Code Overflow | 0 | is_closed(int fd)
{
struct timeval tv;
fd_set readset;
FD_ZERO(&readset);
FD_SET(fd, &readset);
tv.tv_sec = 0;
tv.tv_usec = 0;
if (select(fd+1, &readset, NULL, NULL, &tv) < 0) {
if (errno == EBADF)
return 1;
}
return 0;
}
| @@ -272,10 +272,10 @@ iperf_json_printf(const char *format, ...)
j = cJSON_CreateBool(va_arg(argp, int));
break;
case 'd':
- j = cJSON_CreateInt(va_arg(argp, int64_t));
+ j = cJSON_CreateNumber(va_arg(argp, int64_t));
break;
case 'f':
- j = cJSON_CreateFloat(va_arg(argp, double));
+ j = cJSON_CreateN... | CWE-119 | null | null |
42,841 | make_cookie(char *cookie)
{
static int randomized = 0;
char hostname[500];
struct timeval tv;
char temp[1000];
if ( ! randomized )
srandom((int) time(0) ^ getpid());
/* Generate a string based on hostname, time, randomness, and filler. */
(void) gethostname(hostname, sizeof(hostnam... | DoS Exec Code Overflow | 0 | make_cookie(char *cookie)
{
static int randomized = 0;
char hostname[500];
struct timeval tv;
char temp[1000];
if ( ! randomized )
srandom((int) time(0) ^ getpid());
/* Generate a string based on hostname, time, randomness, and filler. */
(void) gethostname(hostname, sizeof(hostnam... | @@ -272,10 +272,10 @@ iperf_json_printf(const char *format, ...)
j = cJSON_CreateBool(va_arg(argp, int));
break;
case 'd':
- j = cJSON_CreateInt(va_arg(argp, int64_t));
+ j = cJSON_CreateNumber(va_arg(argp, int64_t));
break;
case 'f':
- j = cJSON_CreateFloat(va_arg(argp, double));
+ j = cJSON_CreateN... | CWE-119 | null | null |
42,842 | timeval_diff(struct timeval * tv0, struct timeval * tv1)
{
double time1, time2;
time1 = tv0->tv_sec + (tv0->tv_usec / 1000000.0);
time2 = tv1->tv_sec + (tv1->tv_usec / 1000000.0);
time1 = time1 - time2;
if (time1 < 0)
time1 = -time1;
return time1;
}
| DoS Exec Code Overflow | 0 | timeval_diff(struct timeval * tv0, struct timeval * tv1)
{
double time1, time2;
time1 = tv0->tv_sec + (tv0->tv_usec / 1000000.0);
time2 = tv1->tv_sec + (tv1->tv_usec / 1000000.0);
time1 = time1 - time2;
if (time1 < 0)
time1 = -time1;
return time1;
}
| @@ -272,10 +272,10 @@ iperf_json_printf(const char *format, ...)
j = cJSON_CreateBool(va_arg(argp, int));
break;
case 'd':
- j = cJSON_CreateInt(va_arg(argp, int64_t));
+ j = cJSON_CreateNumber(va_arg(argp, int64_t));
break;
case 'f':
- j = cJSON_CreateFloat(va_arg(argp, double));
+ j = cJSON_CreateN... | CWE-119 | null | null |
42,843 | timeval_to_double(struct timeval * tv)
{
double d;
d = tv->tv_sec + tv->tv_usec / 1000000;
return d;
}
| DoS Exec Code Overflow | 0 | timeval_to_double(struct timeval * tv)
{
double d;
d = tv->tv_sec + tv->tv_usec / 1000000;
return d;
}
| @@ -272,10 +272,10 @@ iperf_json_printf(const char *format, ...)
j = cJSON_CreateBool(va_arg(argp, int));
break;
case 'd':
- j = cJSON_CreateInt(va_arg(argp, int64_t));
+ j = cJSON_CreateNumber(va_arg(argp, int64_t));
break;
case 'f':
- j = cJSON_CreateFloat(va_arg(argp, double));
+ j = cJSON_CreateN... | CWE-119 | null | null |
42,844 | add_value(struct archive_read *a, struct huffman_code *code, int value,
int codebits, int length)
{
int repeatpos, lastnode, bitpos, bit, repeatnode, nextnode;
free(code->table);
code->table = NULL;
if(length > code->maxlength)
code->maxlength = length;
if(length < code->minlength)
code->m... | Exec Code Overflow | 0 | add_value(struct archive_read *a, struct huffman_code *code, int value,
int codebits, int length)
{
int repeatpos, lastnode, bitpos, bit, repeatnode, nextnode;
free(code->table);
code->table = NULL;
if(length > code->maxlength)
code->maxlength = length;
if(length < code->minlength)
code->m... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,845 | archive_read_format_rar_cleanup(struct archive_read *a)
{
struct rar *rar;
rar = (struct rar *)(a->format->data);
free_codes(a);
free(rar->filename);
free(rar->filename_save);
free(rar->dbo);
free(rar->unp_buffer);
free(rar->lzss.window);
__archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context, &g_s... | Exec Code Overflow | 0 | archive_read_format_rar_cleanup(struct archive_read *a)
{
struct rar *rar;
rar = (struct rar *)(a->format->data);
free_codes(a);
free(rar->filename);
free(rar->filename_save);
free(rar->dbo);
free(rar->unp_buffer);
free(rar->lzss.window);
__archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context, &g_s... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,846 | archive_read_format_rar_has_encrypted_entries(struct archive_read *_a)
{
if (_a && _a->format) {
struct rar * rar = (struct rar *)_a->format->data;
if (rar) {
return rar->has_encrypted_entries;
}
}
return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
}
| Exec Code Overflow | 0 | archive_read_format_rar_has_encrypted_entries(struct archive_read *_a)
{
if (_a && _a->format) {
struct rar * rar = (struct rar *)_a->format->data;
if (rar) {
return rar->has_encrypted_entries;
}
}
return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
}
| @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,847 | archive_read_format_rar_options(struct archive_read *a,
const char *key, const char *val)
{
struct rar *rar;
int ret = ARCHIVE_FAILED;
rar = (struct rar *)(a->format->data);
if (strcmp(key, "hdrcharset") == 0) {
if (val == NULL || val[0] == 0)
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
... | Exec Code Overflow | 0 | archive_read_format_rar_options(struct archive_read *a,
const char *key, const char *val)
{
struct rar *rar;
int ret = ARCHIVE_FAILED;
rar = (struct rar *)(a->format->data);
if (strcmp(key, "hdrcharset") == 0) {
if (val == NULL || val[0] == 0)
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,848 | archive_read_format_rar_read_data(struct archive_read *a, const void **buff,
size_t *size, int64_t *offset)
{
struct rar *rar = (struct rar *)(a->format->data);
int ret;
if (rar->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
rar->has_encrypted_entries =... | Exec Code Overflow | 0 | archive_read_format_rar_read_data(struct archive_read *a, const void **buff,
size_t *size, int64_t *offset)
{
struct rar *rar = (struct rar *)(a->format->data);
int ret;
if (rar->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
rar->has_encrypted_entries =... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,849 | archive_read_format_rar_read_data_skip(struct archive_read *a)
{
struct rar *rar;
int64_t bytes_skipped;
int ret;
rar = (struct rar *)(a->format->data);
if (rar->bytes_unconsumed > 0) {
/* Consume as much as the decompressor actually used. */
__archive_read_consume(a, rar->bytes_unconsumed);
... | Exec Code Overflow | 0 | archive_read_format_rar_read_data_skip(struct archive_read *a)
{
struct rar *rar;
int64_t bytes_skipped;
int ret;
rar = (struct rar *)(a->format->data);
if (rar->bytes_unconsumed > 0) {
/* Consume as much as the decompressor actually used. */
__archive_read_consume(a, rar->bytes_unconsumed);
... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,850 | archive_read_format_rar_read_header(struct archive_read *a,
struct archive_entry *entry)
{
const void *h;
const char *p;
struct rar *rar;
size_t skip;
char head_type;
int ret;
unsigned flags;
unsigned long crc32_expected;
a->archive.archive_format = ARCHIVE_FORMAT_... | Exec Code Overflow | 0 | archive_read_format_rar_read_header(struct archive_read *a,
struct archive_entry *entry)
{
const void *h;
const char *p;
struct rar *rar;
size_t skip;
char head_type;
int ret;
unsigned flags;
unsigned long crc32_expected;
a->archive.archive_format = ARCHIVE_FORMAT_... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,851 | archive_read_format_rar_seek_data(struct archive_read *a, int64_t offset,
int whence)
{
int64_t client_offset, ret;
unsigned int i;
struct rar *rar = (struct rar *)(a->format->data);
if (rar->compression_method == COMPRESS_METHOD_STORE)
{
/* Modify the offset for use with SEEK_SET */
switch (when... | Exec Code Overflow | 0 | archive_read_format_rar_seek_data(struct archive_read *a, int64_t offset,
int whence)
{
int64_t client_offset, ret;
unsigned int i;
struct rar *rar = (struct rar *)(a->format->data);
if (rar->compression_method == COMPRESS_METHOD_STORE)
{
/* Modify the offset for use with SEEK_SET */
switch (when... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,852 | archive_read_support_format_rar(struct archive *_a)
{
struct archive_read *a = (struct archive_read *)_a;
struct rar *rar;
int r;
archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
"archive_read_support_format_rar");
rar = (struct rar *)malloc(sizeof(*rar));
if (rar == NU... | Exec Code Overflow | 0 | archive_read_support_format_rar(struct archive *_a)
{
struct archive_read *a = (struct archive_read *)_a;
struct rar *rar;
int r;
archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
"archive_read_support_format_rar");
rar = (struct rar *)malloc(sizeof(*rar));
if (rar == NU... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,853 | archive_read_support_format_rar_capabilities(struct archive_read * a)
{
(void)a; /* UNUSED */
return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA
| ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
}
| Exec Code Overflow | 0 | archive_read_support_format_rar_capabilities(struct archive_read * a)
{
(void)a; /* UNUSED */
return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA
| ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
}
| @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,854 | copy_from_lzss_window(struct archive_read *a, const void **buffer,
int64_t startpos, int length)
{
int windowoffs, firstpart;
struct rar *rar = (struct rar *)(a->format->data);
if (!rar->unp_buffer)
{
if ((rar->unp_buffer = malloc(rar->unp_buffer_size)) == NULL)
{
archive_... | Exec Code Overflow | 0 | copy_from_lzss_window(struct archive_read *a, const void **buffer,
int64_t startpos, int length)
{
int windowoffs, firstpart;
struct rar *rar = (struct rar *)(a->format->data);
if (!rar->unp_buffer)
{
if ((rar->unp_buffer = malloc(rar->unp_buffer_size)) == NULL)
{
archive_... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,855 | create_code(struct archive_read *a, struct huffman_code *code,
unsigned char *lengths, int numsymbols, char maxlength)
{
int i, j, codebits = 0, symbolsleft = numsymbols;
code->numentries = 0;
code->numallocatedentries = 0;
if (new_node(code) < 0) {
archive_set_error(&a->archive, ENOMEM,
... | Exec Code Overflow | 0 | create_code(struct archive_read *a, struct huffman_code *code,
unsigned char *lengths, int numsymbols, char maxlength)
{
int i, j, codebits = 0, symbolsleft = numsymbols;
code->numentries = 0;
code->numallocatedentries = 0;
if (new_node(code) < 0) {
archive_set_error(&a->archive, ENOMEM,
... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,856 | expand(struct archive_read *a, int64_t end)
{
static const unsigned char lengthbases[] =
{ 0, 1, 2, 3, 4, 5, 6,
7, 8, 10, 12, 14, 16, 20,
24, 28, 32, 40, 48, 56, 64,
80, 96, 112, 128, 160, 192, 224 };
static const unsigned char lengthbits[] =
{ 0, 0, 0, 0, 0... | Exec Code Overflow | 0 | expand(struct archive_read *a, int64_t end)
{
static const unsigned char lengthbases[] =
{ 0, 1, 2, 3, 4, 5, 6,
7, 8, 10, 12, 14, 16, 20,
24, 28, 32, 40, 48, 56, 64,
80, 96, 112, 128, 160, 192, 224 };
static const unsigned char lengthbits[] =
{ 0, 0, 0, 0, 0... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,857 | free_codes(struct archive_read *a)
{
struct rar *rar = (struct rar *)(a->format->data);
free(rar->maincode.tree);
free(rar->offsetcode.tree);
free(rar->lowoffsetcode.tree);
free(rar->lengthcode.tree);
free(rar->maincode.table);
free(rar->offsetcode.table);
free(rar->lowoffsetcode.table);
free(rar->len... | Exec Code Overflow | 0 | free_codes(struct archive_read *a)
{
struct rar *rar = (struct rar *)(a->format->data);
free(rar->maincode.tree);
free(rar->offsetcode.tree);
free(rar->lowoffsetcode.tree);
free(rar->lengthcode.tree);
free(rar->maincode.table);
free(rar->offsetcode.table);
free(rar->lowoffsetcode.table);
free(rar->len... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,858 | lzss_current_offset(struct lzss *lzss)
{
return lzss_offset_for_position(lzss, lzss->position);
}
| Exec Code Overflow | 0 | lzss_current_offset(struct lzss *lzss)
{
return lzss_offset_for_position(lzss, lzss->position);
}
| @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,859 | lzss_current_pointer(struct lzss *lzss)
{
return lzss_pointer_for_position(lzss, lzss->position);
}
| Exec Code Overflow | 0 | lzss_current_pointer(struct lzss *lzss)
{
return lzss_pointer_for_position(lzss, lzss->position);
}
| @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,860 | lzss_emit_literal(struct rar *rar, uint8_t literal)
{
*lzss_current_pointer(&rar->lzss) = literal;
rar->lzss.position++;
}
| Exec Code Overflow | 0 | lzss_emit_literal(struct rar *rar, uint8_t literal)
{
*lzss_current_pointer(&rar->lzss) = literal;
rar->lzss.position++;
}
| @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,861 | lzss_emit_match(struct rar *rar, int offset, int length)
{
int dstoffs = lzss_current_offset(&rar->lzss);
int srcoffs = (dstoffs - offset) & lzss_mask(&rar->lzss);
int l, li, remaining;
unsigned char *d, *s;
remaining = length;
while (remaining > 0) {
l = remaining;
if (dstoffs > srcoffs) {
i... | Exec Code Overflow | 0 | lzss_emit_match(struct rar *rar, int offset, int length)
{
int dstoffs = lzss_current_offset(&rar->lzss);
int srcoffs = (dstoffs - offset) & lzss_mask(&rar->lzss);
int l, li, remaining;
unsigned char *d, *s;
remaining = length;
while (remaining > 0) {
l = remaining;
if (dstoffs > srcoffs) {
i... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,862 | lzss_mask(struct lzss *lzss)
{
return lzss->mask;
}
| Exec Code Overflow | 0 | lzss_mask(struct lzss *lzss)
{
return lzss->mask;
}
| @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,863 | lzss_offset_for_position(struct lzss *lzss, int64_t pos)
{
return (int)(pos & lzss->mask);
}
| Exec Code Overflow | 0 | lzss_offset_for_position(struct lzss *lzss, int64_t pos)
{
return (int)(pos & lzss->mask);
}
| @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,864 | lzss_pointer_for_position(struct lzss *lzss, int64_t pos)
{
return &lzss->window[lzss_offset_for_position(lzss, pos)];
}
| Exec Code Overflow | 0 | lzss_pointer_for_position(struct lzss *lzss, int64_t pos)
{
return &lzss->window[lzss_offset_for_position(lzss, pos)];
}
| @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,865 | lzss_position(struct lzss *lzss)
{
return lzss->position;
}
| Exec Code Overflow | 0 | lzss_position(struct lzss *lzss)
{
return lzss->position;
}
| @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,866 | lzss_size(struct lzss *lzss)
{
return lzss->mask + 1;
}
| Exec Code Overflow | 0 | lzss_size(struct lzss *lzss)
{
return lzss->mask + 1;
}
| @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,867 | make_table(struct archive_read *a, struct huffman_code *code)
{
if (code->maxlength < code->minlength || code->maxlength > 10)
code->tablesize = 10;
else
code->tablesize = code->maxlength;
code->table =
(struct huffman_table_entry *)calloc(1, sizeof(*code->table)
* ((size_t)1 << code->tablesize))... | Exec Code Overflow | 0 | make_table(struct archive_read *a, struct huffman_code *code)
{
if (code->maxlength < code->minlength || code->maxlength > 10)
code->tablesize = 10;
else
code->tablesize = code->maxlength;
code->table =
(struct huffman_table_entry *)calloc(1, sizeof(*code->table)
* ((size_t)1 << code->tablesize))... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,868 | make_table_recurse(struct archive_read *a, struct huffman_code *code, int node,
struct huffman_table_entry *table, int depth,
int maxdepth)
{
int currtablesize, i, ret = (ARCHIVE_OK);
if (!code->tree)
{
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
... | Exec Code Overflow | 0 | make_table_recurse(struct archive_read *a, struct huffman_code *code, int node,
struct huffman_table_entry *table, int depth,
int maxdepth)
{
int currtablesize, i, ret = (ARCHIVE_OK);
if (!code->tree)
{
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,869 | new_node(struct huffman_code *code)
{
void *new_tree;
if (code->numallocatedentries == code->numentries) {
int new_num_entries = 256;
if (code->numentries > 0) {
new_num_entries = code->numentries * 2;
}
new_tree = realloc(code->tree, new_num_entries * sizeof(*code->tree));
if (new_tree ... | Exec Code Overflow | 0 | new_node(struct huffman_code *code)
{
void *new_tree;
if (code->numallocatedentries == code->numentries) {
int new_num_entries = 256;
if (code->numentries > 0) {
new_num_entries = code->numentries * 2;
}
new_tree = realloc(code->tree, new_num_entries * sizeof(*code->tree));
if (new_tree ... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,870 | ppmd_free(void *p, void *address)
{
(void)p;
free(address);
}
| Exec Code Overflow | 0 | ppmd_free(void *p, void *address)
{
(void)p;
free(address);
}
| @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,871 | ppmd_read(void *p)
{
struct archive_read *a = ((IByteIn*)p)->a;
struct rar *rar = (struct rar *)(a->format->data);
struct rar_br *br = &(rar->br);
Byte b;
if (!rar_br_read_ahead(a, br, 8))
{
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated RAR file data");
r... | Exec Code Overflow | 0 | ppmd_read(void *p)
{
struct archive_read *a = ((IByteIn*)p)->a;
struct rar *rar = (struct rar *)(a->format->data);
struct rar_br *br = &(rar->br);
Byte b;
if (!rar_br_read_ahead(a, br, 8))
{
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated RAR file data");
r... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,872 | rar_br_fillup(struct archive_read *a, struct rar_br *br)
{
struct rar *rar = (struct rar *)(a->format->data);
int n = CACHE_BITS - br->cache_avail;
for (;;) {
switch (n >> 3) {
case 8:
if (br->avail_in >= 8) {
br->cache_buffer =
((uint64_t)br->next_in[0]) << 56 |
((u... | Exec Code Overflow | 0 | rar_br_fillup(struct archive_read *a, struct rar_br *br)
{
struct rar *rar = (struct rar *)(a->format->data);
int n = CACHE_BITS - br->cache_avail;
for (;;) {
switch (n >> 3) {
case 8:
if (br->avail_in >= 8) {
br->cache_buffer =
((uint64_t)br->next_in[0]) << 56 |
((u... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,873 | rar_br_preparation(struct archive_read *a, struct rar_br *br)
{
struct rar *rar = (struct rar *)(a->format->data);
if (rar->bytes_remaining > 0) {
br->next_in = rar_read_ahead(a, 1, &(br->avail_in));
if (br->next_in == NULL) {
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
... | Exec Code Overflow | 0 | rar_br_preparation(struct archive_read *a, struct rar_br *br)
{
struct rar *rar = (struct rar *)(a->format->data);
if (rar->bytes_remaining > 0) {
br->next_in = rar_read_ahead(a, 1, &(br->avail_in));
if (br->next_in == NULL) {
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,874 | rar_fls(unsigned int word)
{
word |= (word >> 1);
word |= (word >> 2);
word |= (word >> 4);
word |= (word >> 8);
word |= (word >> 16);
return word - (word >> 1);
}
| Exec Code Overflow | 0 | rar_fls(unsigned int word)
{
word |= (word >> 1);
word |= (word >> 2);
word |= (word >> 4);
word |= (word >> 8);
word |= (word >> 16);
return word - (word >> 1);
}
| @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,875 | rar_read_ahead(struct archive_read *a, size_t min, ssize_t *avail)
{
struct rar *rar = (struct rar *)(a->format->data);
const void *h = __archive_read_ahead(a, min, avail);
int ret;
if (avail)
{
if (a->archive.read_data_is_posix_read && *avail > (ssize_t)a->archive.read_data_requested)
*avail = a->a... | Exec Code Overflow | 0 | rar_read_ahead(struct archive_read *a, size_t min, ssize_t *avail)
{
struct rar *rar = (struct rar *)(a->format->data);
const void *h = __archive_read_ahead(a, min, avail);
int ret;
if (avail)
{
if (a->archive.read_data_is_posix_read && *avail > (ssize_t)a->archive.read_data_requested)
*avail = a->a... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,876 | read_data_compressed(struct archive_read *a, const void **buff, size_t *size,
int64_t *offset)
{
struct rar *rar;
int64_t start, end, actualend;
size_t bs;
int ret = (ARCHIVE_OK), sym, code, lzss_offset, length, i;
rar = (struct rar *)(a->format->data);
do {
if (!rar->valid)
retur... | Exec Code Overflow | 0 | read_data_compressed(struct archive_read *a, const void **buff, size_t *size,
int64_t *offset)
{
struct rar *rar;
int64_t start, end, actualend;
size_t bs;
int ret = (ARCHIVE_OK), sym, code, lzss_offset, length, i;
rar = (struct rar *)(a->format->data);
do {
if (!rar->valid)
retur... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,877 | read_data_stored(struct archive_read *a, const void **buff, size_t *size,
int64_t *offset)
{
struct rar *rar;
ssize_t bytes_avail;
rar = (struct rar *)(a->format->data);
if (rar->bytes_remaining == 0 &&
!(rar->main_flags & MHD_VOLUME && rar->file_flags & FHD_SPLIT_AFTER))
{
*buff = N... | Exec Code Overflow | 0 | read_data_stored(struct archive_read *a, const void **buff, size_t *size,
int64_t *offset)
{
struct rar *rar;
ssize_t bytes_avail;
rar = (struct rar *)(a->format->data);
if (rar->bytes_remaining == 0 &&
!(rar->main_flags & MHD_VOLUME && rar->file_flags & FHD_SPLIT_AFTER))
{
*buff = N... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,878 | read_exttime(const char *p, struct rar *rar, const char *endp)
{
unsigned rmode, flags, rem, j, count;
int ttime, i;
struct tm *tm;
time_t t;
long nsec;
if (p + 2 > endp)
return (-1);
flags = archive_le16dec(p);
p += 2;
for (i = 3; i >= 0; i--)
{
t = 0;
if (i == 3)
t = rar->mtime... | Exec Code Overflow | 0 | read_exttime(const char *p, struct rar *rar, const char *endp)
{
unsigned rmode, flags, rem, j, count;
int ttime, i;
struct tm *tm;
time_t t;
long nsec;
if (p + 2 > endp)
return (-1);
flags = archive_le16dec(p);
p += 2;
for (i = 3; i >= 0; i--)
{
t = 0;
if (i == 3)
t = rar->mtime... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,879 | read_header(struct archive_read *a, struct archive_entry *entry,
char head_type)
{
const void *h;
const char *p, *endp;
struct rar *rar;
struct rar_header rar_header;
struct rar_file_header file_header;
int64_t header_size;
unsigned filename_size, end;
char *filename;
char *strp;
char pa... | Exec Code Overflow | 0 | read_header(struct archive_read *a, struct archive_entry *entry,
char head_type)
{
const void *h;
const char *p, *endp;
struct rar *rar;
struct rar_header rar_header;
struct rar_file_header file_header;
int64_t header_size;
unsigned filename_size, end;
char *filename;
char *strp;
char pa... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,880 | read_next_symbol(struct archive_read *a, struct huffman_code *code)
{
unsigned char bit;
unsigned int bits;
int length, value, node;
struct rar *rar;
struct rar_br *br;
if (!code->table)
{
if (make_table(a, code) != (ARCHIVE_OK))
return -1;
}
rar = (struct rar *)(a->format->data);
br = &... | Exec Code Overflow | 0 | read_next_symbol(struct archive_read *a, struct huffman_code *code)
{
unsigned char bit;
unsigned int bits;
int length, value, node;
struct rar *rar;
struct rar_br *br;
if (!code->table)
{
if (make_table(a, code) != (ARCHIVE_OK))
return -1;
}
rar = (struct rar *)(a->format->data);
br = &... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,881 | read_symlink_stored(struct archive_read *a, struct archive_entry *entry,
struct archive_string_conv *sconv)
{
const void *h;
const char *p;
struct rar *rar;
int ret = (ARCHIVE_OK);
rar = (struct rar *)(a->format->data);
if ((h = rar_read_ahead(a, (size_t)rar->packed_size, NULL)) == NULL... | Exec Code Overflow | 0 | read_symlink_stored(struct archive_read *a, struct archive_entry *entry,
struct archive_string_conv *sconv)
{
const void *h;
const char *p;
struct rar *rar;
int ret = (ARCHIVE_OK);
rar = (struct rar *)(a->format->data);
if ((h = rar_read_ahead(a, (size_t)rar->packed_size, NULL)) == NULL... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,882 | skip_sfx(struct archive_read *a)
{
const void *h;
const char *p, *q;
size_t skip, total;
ssize_t bytes, window;
total = 0;
window = 4096;
while (total + window <= (1024 * 128)) {
h = __archive_read_ahead(a, window, &bytes);
if (h == NULL) {
/* Remaining bytes are less than window. */
... | Exec Code Overflow | 0 | skip_sfx(struct archive_read *a)
{
const void *h;
const char *p, *q;
size_t skip, total;
ssize_t bytes, window;
total = 0;
window = 4096;
while (total + window <= (1024 * 128)) {
h = __archive_read_ahead(a, window, &bytes);
if (h == NULL) {
/* Remaining bytes are less than window. */
... | @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a)
rar->range_dec.Stream = &rar->bytein;
__archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
+ if (rar->dictionary_size == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid z... | CWE-119 | null | null |
42,883 | add_option(struct archive_read *a, struct mtree_option **global,
const char *value, size_t len)
{
struct mtree_option *opt;
if ((opt = malloc(sizeof(*opt))) == NULL) {
archive_set_error(&a->archive, errno, "Can't allocate memory");
return (ARCHIVE_FATAL);
}
if ((opt->value = malloc(len + 1)) == NULL) {
f... | Exec Code Overflow | 0 | add_option(struct archive_read *a, struct mtree_option **global,
const char *value, size_t len)
{
struct mtree_option *opt;
if ((opt = malloc(sizeof(*opt))) == NULL) {
archive_set_error(&a->archive, errno, "Can't allocate memory");
return (ARCHIVE_FATAL);
}
if ((opt->value = malloc(len + 1)) == NULL) {
f... | @@ -1385,12 +1385,12 @@ parse_device(dev_t *pdev, struct archive *a, char *val)
"Missing number");
return ARCHIVE_WARN;
}
- numbers[argc++] = (unsigned long)mtree_atol(&p);
- if (argc > MAX_PACK_ARGS) {
+ if (argc >= MAX_PACK_ARGS) {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
... | CWE-119 | null | null |
42,884 | archive_read_format_mtree_options(struct archive_read *a,
const char *key, const char *val)
{
struct mtree *mtree;
mtree = (struct mtree *)(a->format->data);
if (strcmp(key, "checkfs") == 0) {
/* Allows to read information missing from the mtree from the file system */
if (val == NULL || val[0] == 0) {
... | Exec Code Overflow | 0 | archive_read_format_mtree_options(struct archive_read *a,
const char *key, const char *val)
{
struct mtree *mtree;
mtree = (struct mtree *)(a->format->data);
if (strcmp(key, "checkfs") == 0) {
/* Allows to read information missing from the mtree from the file system */
if (val == NULL || val[0] == 0) {
... | @@ -1385,12 +1385,12 @@ parse_device(dev_t *pdev, struct archive *a, char *val)
"Missing number");
return ARCHIVE_WARN;
}
- numbers[argc++] = (unsigned long)mtree_atol(&p);
- if (argc > MAX_PACK_ARGS) {
+ if (argc >= MAX_PACK_ARGS) {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
... | CWE-119 | null | null |
42,885 | archive_read_support_format_mtree(struct archive *_a)
{
struct archive_read *a = (struct archive_read *)_a;
struct mtree *mtree;
int r;
archive_check_magic(_a, ARCHIVE_READ_MAGIC,
ARCHIVE_STATE_NEW, "archive_read_support_format_mtree");
mtree = (struct mtree *)malloc(sizeof(*mtree));
if (mtree == NULL) {
... | Exec Code Overflow | 0 | archive_read_support_format_mtree(struct archive *_a)
{
struct archive_read *a = (struct archive_read *)_a;
struct mtree *mtree;
int r;
archive_check_magic(_a, ARCHIVE_READ_MAGIC,
ARCHIVE_STATE_NEW, "archive_read_support_format_mtree");
mtree = (struct mtree *)malloc(sizeof(*mtree));
if (mtree == NULL) {
... | @@ -1385,12 +1385,12 @@ parse_device(dev_t *pdev, struct archive *a, char *val)
"Missing number");
return ARCHIVE_WARN;
}
- numbers[argc++] = (unsigned long)mtree_atol(&p);
- if (argc > MAX_PACK_ARGS) {
+ if (argc >= MAX_PACK_ARGS) {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
... | CWE-119 | null | null |
42,886 | bid_keycmp(const char *p, const char *key, ssize_t len)
{
int match_len = 0;
while (len > 0 && *p && *key) {
if (*p == *key) {
--len;
++p;
++key;
++match_len;
continue;
}
return (0);/* Not match */
}
if (*key != '\0')
return (0);/* Not match */
/* A following character should be specified ... | Exec Code Overflow | 0 | bid_keycmp(const char *p, const char *key, ssize_t len)
{
int match_len = 0;
while (len > 0 && *p && *key) {
if (*p == *key) {
--len;
++p;
++key;
++match_len;
continue;
}
return (0);/* Not match */
}
if (*key != '\0')
return (0);/* Not match */
/* A following character should be specified ... | @@ -1385,12 +1385,12 @@ parse_device(dev_t *pdev, struct archive *a, char *val)
"Missing number");
return ARCHIVE_WARN;
}
- numbers[argc++] = (unsigned long)mtree_atol(&p);
- if (argc > MAX_PACK_ARGS) {
+ if (argc >= MAX_PACK_ARGS) {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
... | CWE-119 | null | null |
42,887 | bid_keyword(const char *p, ssize_t len)
{
static const char *keys_c[] = {
"content", "contents", "cksum", NULL
};
static const char *keys_df[] = {
"device", "flags", NULL
};
static const char *keys_g[] = {
"gid", "gname", NULL
};
static const char *keys_il[] = {
"ignore", "inode", "link", NULL
};
stat... | Exec Code Overflow | 0 | bid_keyword(const char *p, ssize_t len)
{
static const char *keys_c[] = {
"content", "contents", "cksum", NULL
};
static const char *keys_df[] = {
"device", "flags", NULL
};
static const char *keys_g[] = {
"gid", "gname", NULL
};
static const char *keys_il[] = {
"ignore", "inode", "link", NULL
};
stat... | @@ -1385,12 +1385,12 @@ parse_device(dev_t *pdev, struct archive *a, char *val)
"Missing number");
return ARCHIVE_WARN;
}
- numbers[argc++] = (unsigned long)mtree_atol(&p);
- if (argc > MAX_PACK_ARGS) {
+ if (argc >= MAX_PACK_ARGS) {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
... | CWE-119 | null | null |
42,888 | bid_keyword_list(const char *p, ssize_t len, int unset, int last_is_path)
{
int l;
int keycnt = 0;
while (len > 0 && *p) {
int blank = 0;
/* Test whether there are blank characters in the line. */
while (len >0 && (*p == ' ' || *p == '\t')) {
++p;
--len;
blank = 1;
}
if (*p == '\n' || *p == '\r... | Exec Code Overflow | 0 | bid_keyword_list(const char *p, ssize_t len, int unset, int last_is_path)
{
int l;
int keycnt = 0;
while (len > 0 && *p) {
int blank = 0;
/* Test whether there are blank characters in the line. */
while (len >0 && (*p == ' ' || *p == '\t')) {
++p;
--len;
blank = 1;
}
if (*p == '\n' || *p == '\r... | @@ -1385,12 +1385,12 @@ parse_device(dev_t *pdev, struct archive *a, char *val)
"Missing number");
return ARCHIVE_WARN;
}
- numbers[argc++] = (unsigned long)mtree_atol(&p);
- if (argc > MAX_PACK_ARGS) {
+ if (argc >= MAX_PACK_ARGS) {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
... | CWE-119 | null | null |
42,889 | cleanup(struct archive_read *a)
{
struct mtree *mtree;
struct mtree_entry *p, *q;
mtree = (struct mtree *)(a->format->data);
p = mtree->entries;
while (p != NULL) {
q = p->next;
free(p->name);
free_options(p->options);
free(p);
p = q;
}
archive_string_free(&mtree->line);
archive_string_free(&mtree->... | Exec Code Overflow | 0 | cleanup(struct archive_read *a)
{
struct mtree *mtree;
struct mtree_entry *p, *q;
mtree = (struct mtree *)(a->format->data);
p = mtree->entries;
while (p != NULL) {
q = p->next;
free(p->name);
free_options(p->options);
free(p);
p = q;
}
archive_string_free(&mtree->line);
archive_string_free(&mtree->... | @@ -1385,12 +1385,12 @@ parse_device(dev_t *pdev, struct archive *a, char *val)
"Missing number");
return ARCHIVE_WARN;
}
- numbers[argc++] = (unsigned long)mtree_atol(&p);
- if (argc > MAX_PACK_ARGS) {
+ if (argc >= MAX_PACK_ARGS) {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
... | CWE-119 | null | null |
42,890 | detect_form(struct archive_read *a, int *is_form_d)
{
const char *p;
ssize_t avail, ravail;
ssize_t detected_bytes = 0, len, nl;
int entry_cnt = 0, multiline = 0;
int form_D = 0;/* The archive is generated by `NetBSD mtree -D'
* (In this source we call it `form D') . */
if (is_form_d != NULL)
*is_form_d = 0... | Exec Code Overflow | 0 | detect_form(struct archive_read *a, int *is_form_d)
{
const char *p;
ssize_t avail, ravail;
ssize_t detected_bytes = 0, len, nl;
int entry_cnt = 0, multiline = 0;
int form_D = 0;/* The archive is generated by `NetBSD mtree -D'
* (In this source we call it `form D') . */
if (is_form_d != NULL)
*is_form_d = 0... | @@ -1385,12 +1385,12 @@ parse_device(dev_t *pdev, struct archive *a, char *val)
"Missing number");
return ARCHIVE_WARN;
}
- numbers[argc++] = (unsigned long)mtree_atol(&p);
- if (argc > MAX_PACK_ARGS) {
+ if (argc >= MAX_PACK_ARGS) {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
... | CWE-119 | null | null |
42,891 | free_options(struct mtree_option *head)
{
struct mtree_option *next;
for (; head != NULL; head = next) {
next = head->next;
free(head->value);
free(head);
}
}
| Exec Code Overflow | 0 | free_options(struct mtree_option *head)
{
struct mtree_option *next;
for (; head != NULL; head = next) {
next = head->next;
free(head->value);
free(head);
}
}
| @@ -1385,12 +1385,12 @@ parse_device(dev_t *pdev, struct archive *a, char *val)
"Missing number");
return ARCHIVE_WARN;
}
- numbers[argc++] = (unsigned long)mtree_atol(&p);
- if (argc > MAX_PACK_ARGS) {
+ if (argc >= MAX_PACK_ARGS) {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
... | CWE-119 | null | null |
42,892 | get_line_size(const char *b, ssize_t avail, ssize_t *nlsize)
{
ssize_t len;
len = 0;
while (len < avail) {
switch (*b) {
case '\0':/* Non-ascii character or control character. */
if (nlsize != NULL)
*nlsize = 0;
return (-1);
case '\r':
if (avail-len > 1 && b[1] == '\n') {
if (nlsize != NULL)
... | Exec Code Overflow | 0 | get_line_size(const char *b, ssize_t avail, ssize_t *nlsize)
{
ssize_t len;
len = 0;
while (len < avail) {
switch (*b) {
case '\0':/* Non-ascii character or control character. */
if (nlsize != NULL)
*nlsize = 0;
return (-1);
case '\r':
if (avail-len > 1 && b[1] == '\n') {
if (nlsize != NULL)
... | @@ -1385,12 +1385,12 @@ parse_device(dev_t *pdev, struct archive *a, char *val)
"Missing number");
return ARCHIVE_WARN;
}
- numbers[argc++] = (unsigned long)mtree_atol(&p);
- if (argc > MAX_PACK_ARGS) {
+ if (argc >= MAX_PACK_ARGS) {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
... | CWE-119 | null | null |
42,893 | get_time_t_min(void)
{
#if defined(TIME_T_MIN)
return TIME_T_MIN;
#else
if (((time_t)0) < ((time_t)-1)) {
/* Time_t is unsigned */
return (time_t)0;
} else {
/* Time_t is signed. */
if (sizeof(time_t) == sizeof(int64_t)) {
return (time_t)INT64_MIN;
} else {
return (time_t)INT32_MIN;
}
}
#endif
}
| Exec Code Overflow | 0 | get_time_t_min(void)
{
#if defined(TIME_T_MIN)
return TIME_T_MIN;
#else
if (((time_t)0) < ((time_t)-1)) {
/* Time_t is unsigned */
return (time_t)0;
} else {
/* Time_t is signed. */
if (sizeof(time_t) == sizeof(int64_t)) {
return (time_t)INT64_MIN;
} else {
return (time_t)INT32_MIN;
}
}
#endif
}
| @@ -1385,12 +1385,12 @@ parse_device(dev_t *pdev, struct archive *a, char *val)
"Missing number");
return ARCHIVE_WARN;
}
- numbers[argc++] = (unsigned long)mtree_atol(&p);
- if (argc > MAX_PACK_ARGS) {
+ if (argc >= MAX_PACK_ARGS) {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
... | CWE-119 | null | null |
42,894 | la_strsep(char **sp, const char *sep)
{
char *p, *s;
if (sp == NULL || *sp == NULL || **sp == '\0')
return(NULL);
s = *sp;
p = s + strcspn(s, sep);
if (*p != '\0')
*p++ = '\0';
*sp = p;
return(s);
}
| Exec Code Overflow | 0 | la_strsep(char **sp, const char *sep)
{
char *p, *s;
if (sp == NULL || *sp == NULL || **sp == '\0')
return(NULL);
s = *sp;
p = s + strcspn(s, sep);
if (*p != '\0')
*p++ = '\0';
*sp = p;
return(s);
}
| @@ -1385,12 +1385,12 @@ parse_device(dev_t *pdev, struct archive *a, char *val)
"Missing number");
return ARCHIVE_WARN;
}
- numbers[argc++] = (unsigned long)mtree_atol(&p);
- if (argc > MAX_PACK_ARGS) {
+ if (argc >= MAX_PACK_ARGS) {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
... | CWE-119 | null | null |
42,895 | mtree_atol10(char **p)
{
int64_t l, limit, last_digit_limit;
int base, digit, sign;
base = 10;
if (**p == '-') {
sign = -1;
limit = ((uint64_t)(INT64_MAX) + 1) / base;
last_digit_limit = ((uint64_t)(INT64_MAX) + 1) % base;
++(*p);
} else {
sign = 1;
limit = INT64_MAX / base;
last_digit_limit = INT6... | Exec Code Overflow | 0 | mtree_atol10(char **p)
{
int64_t l, limit, last_digit_limit;
int base, digit, sign;
base = 10;
if (**p == '-') {
sign = -1;
limit = ((uint64_t)(INT64_MAX) + 1) / base;
last_digit_limit = ((uint64_t)(INT64_MAX) + 1) % base;
++(*p);
} else {
sign = 1;
limit = INT64_MAX / base;
last_digit_limit = INT6... | @@ -1385,12 +1385,12 @@ parse_device(dev_t *pdev, struct archive *a, char *val)
"Missing number");
return ARCHIVE_WARN;
}
- numbers[argc++] = (unsigned long)mtree_atol(&p);
- if (argc > MAX_PACK_ARGS) {
+ if (argc >= MAX_PACK_ARGS) {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
... | CWE-119 | null | null |
42,896 | mtree_atol16(char **p)
{
int64_t l, limit, last_digit_limit;
int base, digit, sign;
base = 16;
if (**p == '-') {
sign = -1;
limit = ((uint64_t)(INT64_MAX) + 1) / base;
last_digit_limit = ((uint64_t)(INT64_MAX) + 1) % base;
++(*p);
} else {
sign = 1;
limit = INT64_MAX / base;
last_digit_limit = INT6... | Exec Code Overflow | 0 | mtree_atol16(char **p)
{
int64_t l, limit, last_digit_limit;
int base, digit, sign;
base = 16;
if (**p == '-') {
sign = -1;
limit = ((uint64_t)(INT64_MAX) + 1) / base;
last_digit_limit = ((uint64_t)(INT64_MAX) + 1) % base;
++(*p);
} else {
sign = 1;
limit = INT64_MAX / base;
last_digit_limit = INT6... | @@ -1385,12 +1385,12 @@ parse_device(dev_t *pdev, struct archive *a, char *val)
"Missing number");
return ARCHIVE_WARN;
}
- numbers[argc++] = (unsigned long)mtree_atol(&p);
- if (argc > MAX_PACK_ARGS) {
+ if (argc >= MAX_PACK_ARGS) {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
... | CWE-119 | null | null |
42,897 | mtree_atol8(char **p)
{
int64_t l, limit, last_digit_limit;
int digit, base;
base = 8;
limit = INT64_MAX / base;
last_digit_limit = INT64_MAX % base;
l = 0;
digit = **p - '0';
while (digit >= 0 && digit < base) {
if (l>limit || (l == limit && digit > last_digit_limit)) {
l = INT64_MAX; /* Truncate on ove... | Exec Code Overflow | 0 | mtree_atol8(char **p)
{
int64_t l, limit, last_digit_limit;
int digit, base;
base = 8;
limit = INT64_MAX / base;
last_digit_limit = INT64_MAX % base;
l = 0;
digit = **p - '0';
while (digit >= 0 && digit < base) {
if (l>limit || (l == limit && digit > last_digit_limit)) {
l = INT64_MAX; /* Truncate on ove... | @@ -1385,12 +1385,12 @@ parse_device(dev_t *pdev, struct archive *a, char *val)
"Missing number");
return ARCHIVE_WARN;
}
- numbers[argc++] = (unsigned long)mtree_atol(&p);
- if (argc > MAX_PACK_ARGS) {
+ if (argc >= MAX_PACK_ARGS) {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
... | CWE-119 | null | null |
42,898 | parse_file(struct archive_read *a, struct archive_entry *entry,
struct mtree *mtree, struct mtree_entry *mentry, int *use_next)
{
const char *path;
struct stat st_storage, *st;
struct mtree_entry *mp;
struct archive_entry *sparse_entry;
int r = ARCHIVE_OK, r1, parsed_kws;
mentry->used = 1;
/* Initialize re... | Exec Code Overflow | 0 | parse_file(struct archive_read *a, struct archive_entry *entry,
struct mtree *mtree, struct mtree_entry *mentry, int *use_next)
{
const char *path;
struct stat st_storage, *st;
struct mtree_entry *mp;
struct archive_entry *sparse_entry;
int r = ARCHIVE_OK, r1, parsed_kws;
mentry->used = 1;
/* Initialize re... | @@ -1385,12 +1385,12 @@ parse_device(dev_t *pdev, struct archive *a, char *val)
"Missing number");
return ARCHIVE_WARN;
}
- numbers[argc++] = (unsigned long)mtree_atol(&p);
- if (argc > MAX_PACK_ARGS) {
+ if (argc >= MAX_PACK_ARGS) {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
... | CWE-119 | null | null |
42,899 | parsehex(char c)
{
if (c >= '0' && c <= '9')
return c - '0';
else if (c >= 'a' && c <= 'f')
return c - 'a';
else if (c >= 'A' && c <= 'F')
return c - 'A';
else
return -1;
}
| Exec Code Overflow | 0 | parsehex(char c)
{
if (c >= '0' && c <= '9')
return c - '0';
else if (c >= 'a' && c <= 'f')
return c - 'a';
else if (c >= 'A' && c <= 'F')
return c - 'A';
else
return -1;
}
| @@ -1385,12 +1385,12 @@ parse_device(dev_t *pdev, struct archive *a, char *val)
"Missing number");
return ARCHIVE_WARN;
}
- numbers[argc++] = (unsigned long)mtree_atol(&p);
- if (argc > MAX_PACK_ARGS) {
+ if (argc >= MAX_PACK_ARGS) {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
... | CWE-119 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.