idx
int64
func_before
string
Vulnerability Classification
string
vul
int64
func_after
string
patch
string
CWE ID
string
lines_before
string
lines_after
string
10,500
static void ahci_port_write(AHCIState *s, int port, int offset, uint32_t val) { AHCIPortRegs *pr = &s->dev[port].port_regs; DPRINTF(port, "offset: 0x%x val: 0x%x\n", offset, val); switch (offset) { case PORT_LST_ADDR: pr->lst_addr = val; break; case PORT_LST_ADDR_HI...
DoS Exec Code
0
static void ahci_port_write(AHCIState *s, int port, int offset, uint32_t val) { AHCIPortRegs *pr = &s->dev[port].port_regs; DPRINTF(port, "offset: 0x%x val: 0x%x\n", offset, val); switch (offset) { case PORT_LST_ADDR: pr->lst_addr = val; break; case PORT_LST_ADDR_HI...
@@ -910,6 +910,7 @@ static void ncq_err(NCQTransferState *ncq_tfs) ide_state->error = ABRT_ERR; ide_state->status = READY_STAT | ERR_STAT; ncq_tfs->drive->port_regs.scr_err |= (1 << ncq_tfs->tag); + ncq_tfs->used = 0; } static void ncq_finish(NCQTransferState *ncq_tfs)
null
null
null
10,501
static void ahci_unmap_clb_address(AHCIDevice *ad) { dma_memory_unmap(ad->hba->as, ad->lst, 1024, DMA_DIRECTION_FROM_DEVICE, 1024); ad->lst = NULL; }
DoS Exec Code
0
static void ahci_unmap_clb_address(AHCIDevice *ad) { dma_memory_unmap(ad->hba->as, ad->lst, 1024, DMA_DIRECTION_FROM_DEVICE, 1024); ad->lst = NULL; }
@@ -910,6 +910,7 @@ static void ncq_err(NCQTransferState *ncq_tfs) ide_state->error = ABRT_ERR; ide_state->status = READY_STAT | ERR_STAT; ncq_tfs->drive->port_regs.scr_err |= (1 << ncq_tfs->tag); + ncq_tfs->used = 0; } static void ncq_finish(NCQTransferState *ncq_tfs)
null
null
null
10,502
static NOINLINE void attach_option( struct option_set **opt_list, const struct dhcp_optflag *optflag, char *buffer, int length, bool dhcpv6) { IF_NOT_UDHCPC6(bool dhcpv6 = 0;) struct option_set *existing; char *allocated = NULL; if ((optflag->flags & OPTION_TYPE_MASK) == OPTION_BIN) { const char *end; ...
+Info
0
static NOINLINE void attach_option( struct option_set **opt_list, const struct dhcp_optflag *optflag, char *buffer, int length, bool dhcpv6) { IF_NOT_UDHCPC6(bool dhcpv6 = 0;) struct option_set *existing; char *allocated = NULL; if ((optflag->flags & OPTION_TYPE_MASK) == OPTION_BIN) { const char *end; ...
@@ -272,6 +272,15 @@ uint8_t* FAST_FUNC udhcp_get_option(struct dhcp_packet *packet, int code) goto complain; /* complain and return NULL */ if (optionptr[OPT_CODE] == code) { + if (optionptr[OPT_LEN] == 0) { + /* So far no valid option with length 0 known. + * Having this check means that searching +...
CWE-125
null
null
10,503
static char **fill_envp(struct dhcp_packet *packet) { int envc; int i; char **envp, **curr; const char *opt_name; uint8_t *temp; uint8_t overload = 0; #define BITMAP unsigned #define BBITS (sizeof(BITMAP) * 8) #define BMASK(i) (1 << (i & (sizeof(BITMAP) * 8 - 1))) #define FOUND_OPTS(i) (found_opts[(unsigned)i / ...
+Info
0
static char **fill_envp(struct dhcp_packet *packet) { int envc; int i; char **envp, **curr; const char *opt_name; uint8_t *temp; uint8_t overload = 0; #define BITMAP unsigned #define BBITS (sizeof(BITMAP) * 8) #define BMASK(i) (1 << (i & (sizeof(BITMAP) * 8 - 1))) #define FOUND_OPTS(i) (found_opts[(unsigned)i / ...
@@ -1691,7 +1691,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) * They say ISC DHCP client supports this case. */ server_addr = 0; - temp = udhcp_get_option(&packet, DHCP_SERVER_ID); + temp = udhcp_get_option32(&packet, DHCP_SERVER_ID); if (!temp) { bb_error_msg("no server ID, using ...
CWE-125
null
null
10,504
static struct dyn_lease *add_lease( const uint8_t *chaddr, uint32_t yiaddr, leasetime_t leasetime, const char *hostname, int hostname_len) { struct dyn_lease *oldest; /* clean out any old ones */ clear_leases(chaddr, yiaddr); oldest = oldest_expired_lease(); if (oldest) { memset(oldest, 0, sizeof(*oldes...
+Info
0
static struct dyn_lease *add_lease( const uint8_t *chaddr, uint32_t yiaddr, leasetime_t leasetime, const char *hostname, int hostname_len) { struct dyn_lease *oldest; /* clean out any old ones */ clear_leases(chaddr, yiaddr); oldest = oldest_expired_lease(); if (oldest) { memset(oldest, 0, sizeof(*oldes...
@@ -640,7 +640,7 @@ static void add_server_options(struct dhcp_packet *packet) static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; - uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); + uint8_t *lease_time_opt = udhcp_get_option32(...
CWE-125
null
null
10,505
static void add_server_options(struct dhcp_packet *packet) { struct option_set *curr = server_config.options; while (curr) { if (curr->data[OPT_CODE] != DHCP_LEASE_TIME) udhcp_add_binary_option(packet, curr->data); curr = curr->next; } packet->siaddr_nip = server_config.siaddr_nip; if (server_config.snam...
+Info
0
static void add_server_options(struct dhcp_packet *packet) { struct option_set *curr = server_config.options; while (curr) { if (curr->data[OPT_CODE] != DHCP_LEASE_TIME) udhcp_add_binary_option(packet, curr->data); curr = curr->next; } packet->siaddr_nip = server_config.siaddr_nip; if (server_config.snam...
@@ -640,7 +640,7 @@ static void add_server_options(struct dhcp_packet *packet) static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; - uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); + uint8_t *lease_time_opt = udhcp_get_option32(...
CWE-125
null
null
10,506
static void clear_leases(const uint8_t *chaddr, uint32_t yiaddr) { unsigned i; for (i = 0; i < server_config.max_leases; i++) { if ((chaddr && memcmp(g_leases[i].lease_mac, chaddr, 6) == 0) || (yiaddr && g_leases[i].lease_nip == yiaddr) ) { memset(&g_leases[i], 0, sizeof(g_leases[i])); } } }
+Info
0
static void clear_leases(const uint8_t *chaddr, uint32_t yiaddr) { unsigned i; for (i = 0; i < server_config.max_leases; i++) { if ((chaddr && memcmp(g_leases[i].lease_mac, chaddr, 6) == 0) || (yiaddr && g_leases[i].lease_nip == yiaddr) ) { memset(&g_leases[i], 0, sizeof(g_leases[i])); } } }
@@ -640,7 +640,7 @@ static void add_server_options(struct dhcp_packet *packet) static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; - uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); + uint8_t *lease_time_opt = udhcp_get_option32(...
CWE-125
null
null
10,507
static struct dyn_lease *find_lease_by_nip(uint32_t nip) { unsigned i; for (i = 0; i < server_config.max_leases; i++) if (g_leases[i].lease_nip == nip) return &g_leases[i]; return NULL; }
+Info
0
static struct dyn_lease *find_lease_by_nip(uint32_t nip) { unsigned i; for (i = 0; i < server_config.max_leases; i++) if (g_leases[i].lease_nip == nip) return &g_leases[i]; return NULL; }
@@ -640,7 +640,7 @@ static void add_server_options(struct dhcp_packet *packet) static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; - uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); + uint8_t *lease_time_opt = udhcp_get_option32(...
CWE-125
null
null
10,508
static uint32_t get_static_nip_by_mac(struct static_lease *st_lease, void *mac) { while (st_lease) { if (memcmp(st_lease->mac, mac, 6) == 0) return st_lease->nip; st_lease = st_lease->next; } return 0; }
+Info
0
static uint32_t get_static_nip_by_mac(struct static_lease *st_lease, void *mac) { while (st_lease) { if (memcmp(st_lease->mac, mac, 6) == 0) return st_lease->nip; st_lease = st_lease->next; } return 0; }
@@ -640,7 +640,7 @@ static void add_server_options(struct dhcp_packet *packet) static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; - uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); + uint8_t *lease_time_opt = udhcp_get_option32(...
CWE-125
null
null
10,509
static void init_packet(struct dhcp_packet *packet, struct dhcp_packet *oldpacket, char type) { /* Sets op, htype, hlen, cookie fields * and adds DHCP_MESSAGE_TYPE option */ udhcp_init_header(packet, type); packet->xid = oldpacket->xid; memcpy(packet->chaddr, oldpacket->chaddr, sizeof(oldpacket->chaddr)); packe...
+Info
0
static void init_packet(struct dhcp_packet *packet, struct dhcp_packet *oldpacket, char type) { /* Sets op, htype, hlen, cookie fields * and adds DHCP_MESSAGE_TYPE option */ udhcp_init_header(packet, type); packet->xid = oldpacket->xid; memcpy(packet->chaddr, oldpacket->chaddr, sizeof(oldpacket->chaddr)); packe...
@@ -640,7 +640,7 @@ static void add_server_options(struct dhcp_packet *packet) static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; - uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); + uint8_t *lease_time_opt = udhcp_get_option32(...
CWE-125
null
null
10,510
static int is_expired_lease(struct dyn_lease *lease) { return (lease->expires < (leasetime_t) time(NULL)); }
+Info
0
static int is_expired_lease(struct dyn_lease *lease) { return (lease->expires < (leasetime_t) time(NULL)); }
@@ -640,7 +640,7 @@ static void add_server_options(struct dhcp_packet *packet) static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; - uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); + uint8_t *lease_time_opt = udhcp_get_option32(...
CWE-125
null
null
10,511
static void log_static_leases(struct static_lease **st_lease_pp) { struct static_lease *cur; if (dhcp_verbose < 2) return; cur = *st_lease_pp; while (cur) { bb_error_msg("static lease: mac:%02x:%02x:%02x:%02x:%02x:%02x nip:%x", cur->mac[0], cur->mac[1], cur->mac[2], cur->mac[3], cur->mac[4], cur->mac[5]...
+Info
0
static void log_static_leases(struct static_lease **st_lease_pp) { struct static_lease *cur; if (dhcp_verbose < 2) return; cur = *st_lease_pp; while (cur) { bb_error_msg("static lease: mac:%02x:%02x:%02x:%02x:%02x:%02x nip:%x", cur->mac[0], cur->mac[1], cur->mac[2], cur->mac[3], cur->mac[4], cur->mac[5]...
@@ -640,7 +640,7 @@ static void add_server_options(struct dhcp_packet *packet) static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; - uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); + uint8_t *lease_time_opt = udhcp_get_option32(...
CWE-125
null
null
10,512
static int nobody_responds_to_arp(uint32_t nip, const uint8_t *safe_mac, unsigned arpping_ms) { struct in_addr temp; int r; r = arpping(nip, safe_mac, server_config.server_nip, server_config.server_mac, server_config.interface, arpping_ms); if (r) return r; temp.s_addr = nip; bb_error_msg("%s belo...
+Info
0
static int nobody_responds_to_arp(uint32_t nip, const uint8_t *safe_mac, unsigned arpping_ms) { struct in_addr temp; int r; r = arpping(nip, safe_mac, server_config.server_nip, server_config.server_mac, server_config.interface, arpping_ms); if (r) return r; temp.s_addr = nip; bb_error_msg("%s belo...
@@ -640,7 +640,7 @@ static void add_server_options(struct dhcp_packet *packet) static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; - uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); + uint8_t *lease_time_opt = udhcp_get_option32(...
CWE-125
null
null
10,513
static struct dyn_lease *oldest_expired_lease(void) { struct dyn_lease *oldest_lease = NULL; leasetime_t oldest_time = time(NULL); unsigned i; /* Unexpired leases have g_leases[i].expires >= current time * and therefore can't ever match */ for (i = 0; i < server_config.max_leases; i++) { if (g_leases[i].expir...
+Info
0
static struct dyn_lease *oldest_expired_lease(void) { struct dyn_lease *oldest_lease = NULL; leasetime_t oldest_time = time(NULL); unsigned i; /* Unexpired leases have g_leases[i].expires >= current time * and therefore can't ever match */ for (i = 0; i < server_config.max_leases; i++) { if (g_leases[i].expir...
@@ -640,7 +640,7 @@ static void add_server_options(struct dhcp_packet *packet) static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; - uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); + uint8_t *lease_time_opt = udhcp_get_option32(...
CWE-125
null
null
10,514
static NOINLINE void read_config(const char *file) { parser_t *parser; const struct config_keyword *k; unsigned i; char *token[2]; for (i = 0; i < KWS_WITH_DEFAULTS; i++) keywords[i].handler(keywords[i].def, (char*)&server_config + keywords[i].ofs); parser = config_open(file); while (config_read(parser, toke...
+Info
0
static NOINLINE void read_config(const char *file) { parser_t *parser; const struct config_keyword *k; unsigned i; char *token[2]; for (i = 0; i < KWS_WITH_DEFAULTS; i++) keywords[i].handler(keywords[i].def, (char*)&server_config + keywords[i].ofs); parser = config_open(file); while (config_read(parser, toke...
@@ -640,7 +640,7 @@ static void add_server_options(struct dhcp_packet *packet) static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; - uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); + uint8_t *lease_time_opt = udhcp_get_option32(...
CWE-125
null
null
10,515
static NOINLINE void read_leases(const char *file) { struct dyn_lease lease; int64_t written_at, time_passed; int fd; #if defined CONFIG_UDHCP_DEBUG && CONFIG_UDHCP_DEBUG >= 1 unsigned i = 0; #endif fd = open_or_warn(file, O_RDONLY); if (fd < 0) return; if (full_read(fd, &written_at, sizeof(written_at)) != s...
+Info
0
static NOINLINE void read_leases(const char *file) { struct dyn_lease lease; int64_t written_at, time_passed; int fd; #if defined CONFIG_UDHCP_DEBUG && CONFIG_UDHCP_DEBUG >= 1 unsigned i = 0; #endif fd = open_or_warn(file, O_RDONLY); if (fd < 0) return; if (full_read(fd, &written_at, sizeof(written_at)) != s...
@@ -640,7 +640,7 @@ static void add_server_options(struct dhcp_packet *packet) static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; - uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); + uint8_t *lease_time_opt = udhcp_get_option32(...
CWE-125
null
null
10,516
static int FAST_FUNC read_staticlease(const char *const_line, void *arg) { char *line; char *mac_string; char *ip_string; struct ether_addr mac_bytes; /* it's "struct { uint8_t mac[6]; }" */ uint32_t nip; /* Read mac */ line = (char *) const_line; mac_string = strtok_r(line, " \t", &line); if (!mac_string || ...
+Info
0
static int FAST_FUNC read_staticlease(const char *const_line, void *arg) { char *line; char *mac_string; char *ip_string; struct ether_addr mac_bytes; /* it's "struct { uint8_t mac[6]; }" */ uint32_t nip; /* Read mac */ line = (char *) const_line; mac_string = strtok_r(line, " \t", &line); if (!mac_string || ...
@@ -640,7 +640,7 @@ static void add_server_options(struct dhcp_packet *packet) static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; - uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); + uint8_t *lease_time_opt = udhcp_get_option32(...
CWE-125
null
null
10,517
static int FAST_FUNC read_str(const char *line, void *arg) { char **dest = arg; free(*dest); *dest = xstrdup(line); return 1; }
+Info
0
static int FAST_FUNC read_str(const char *line, void *arg) { char **dest = arg; free(*dest); *dest = xstrdup(line); return 1; }
@@ -640,7 +640,7 @@ static void add_server_options(struct dhcp_packet *packet) static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; - uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); + uint8_t *lease_time_opt = udhcp_get_option32(...
CWE-125
null
null
10,518
static NOINLINE void send_NAK(struct dhcp_packet *oldpacket) { struct dhcp_packet packet; init_packet(&packet, oldpacket, DHCPNAK); log1("sending %s", "NAK"); send_packet(&packet, /*force_bcast:*/ 1); }
+Info
0
static NOINLINE void send_NAK(struct dhcp_packet *oldpacket) { struct dhcp_packet packet; init_packet(&packet, oldpacket, DHCPNAK); log1("sending %s", "NAK"); send_packet(&packet, /*force_bcast:*/ 1); }
@@ -640,7 +640,7 @@ static void add_server_options(struct dhcp_packet *packet) static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; - uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); + uint8_t *lease_time_opt = udhcp_get_option32(...
CWE-125
null
null
10,519
static NOINLINE void send_offer(struct dhcp_packet *oldpacket, uint32_t static_lease_nip, struct dyn_lease *lease, uint8_t *requested_ip_opt, unsigned arpping_ms) { struct dhcp_packet packet; uint32_t lease_time_sec; struct in_addr addr; init_packet(&packet, oldpacket, DHCPOFFER); /* If it is a static le...
+Info
0
static NOINLINE void send_offer(struct dhcp_packet *oldpacket, uint32_t static_lease_nip, struct dyn_lease *lease, uint8_t *requested_ip_opt, unsigned arpping_ms) { struct dhcp_packet packet; uint32_t lease_time_sec; struct in_addr addr; init_packet(&packet, oldpacket, DHCPOFFER); /* If it is a static le...
@@ -640,7 +640,7 @@ static void add_server_options(struct dhcp_packet *packet) static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; - uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); + uint8_t *lease_time_opt = udhcp_get_option32(...
CWE-125
null
null
10,520
static void send_packet(struct dhcp_packet *dhcp_pkt, int force_broadcast) { if (dhcp_pkt->gateway_nip) send_packet_to_relay(dhcp_pkt); else send_packet_to_client(dhcp_pkt, force_broadcast); }
+Info
0
static void send_packet(struct dhcp_packet *dhcp_pkt, int force_broadcast) { if (dhcp_pkt->gateway_nip) send_packet_to_relay(dhcp_pkt); else send_packet_to_client(dhcp_pkt, force_broadcast); }
@@ -640,7 +640,7 @@ static void add_server_options(struct dhcp_packet *packet) static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; - uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); + uint8_t *lease_time_opt = udhcp_get_option32(...
CWE-125
null
null
10,521
static void send_packet_to_client(struct dhcp_packet *dhcp_pkt, int force_broadcast) { const uint8_t *chaddr; uint32_t ciaddr; if (force_broadcast || (dhcp_pkt->flags & htons(BROADCAST_FLAG)) || dhcp_pkt->ciaddr == 0 ) { log1("broadcasting packet to client"); ciaddr = INADDR_BROADCAST; chaddr = MAC_BCAS...
+Info
0
static void send_packet_to_client(struct dhcp_packet *dhcp_pkt, int force_broadcast) { const uint8_t *chaddr; uint32_t ciaddr; if (force_broadcast || (dhcp_pkt->flags & htons(BROADCAST_FLAG)) || dhcp_pkt->ciaddr == 0 ) { log1("broadcasting packet to client"); ciaddr = INADDR_BROADCAST; chaddr = MAC_BCAS...
@@ -640,7 +640,7 @@ static void add_server_options(struct dhcp_packet *packet) static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; - uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); + uint8_t *lease_time_opt = udhcp_get_option32(...
CWE-125
null
null
10,522
static void send_packet_to_relay(struct dhcp_packet *dhcp_pkt) { log1("forwarding packet to relay"); udhcp_send_kernel_packet(dhcp_pkt, server_config.server_nip, SERVER_PORT, dhcp_pkt->gateway_nip, SERVER_PORT); }
+Info
0
static void send_packet_to_relay(struct dhcp_packet *dhcp_pkt) { log1("forwarding packet to relay"); udhcp_send_kernel_packet(dhcp_pkt, server_config.server_nip, SERVER_PORT, dhcp_pkt->gateway_nip, SERVER_PORT); }
@@ -640,7 +640,7 @@ static void add_server_options(struct dhcp_packet *packet) static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; - uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); + uint8_t *lease_time_opt = udhcp_get_option32(...
CWE-125
null
null
10,523
static void write_leases(void) { int fd; unsigned i; leasetime_t curr; int64_t written_at; fd = open_or_warn(server_config.lease_file, O_WRONLY|O_CREAT|O_TRUNC); if (fd < 0) return; curr = written_at = time(NULL); written_at = SWAP_BE64(written_at); full_write(fd, &written_at, sizeof(written_at)); for (...
+Info
0
static void write_leases(void) { int fd; unsigned i; leasetime_t curr; int64_t written_at; fd = open_or_warn(server_config.lease_file, O_WRONLY|O_CREAT|O_TRUNC); if (fd < 0) return; curr = written_at = time(NULL); written_at = SWAP_BE64(written_at); full_write(fd, &written_at, sizeof(written_at)); for (...
@@ -640,7 +640,7 @@ static void add_server_options(struct dhcp_packet *packet) static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; - uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); + uint8_t *lease_time_opt = udhcp_get_option32(...
CWE-125
null
null
10,524
static int count_commas(char *s) { int n = 0; while (*s) { if (*s == ',') n ++; s ++; } return n; }
Exec Code Overflow
0
static int count_commas(char *s) { int n = 0; while (*s) { if (*s == ',') n ++; s ++; } return n; }
@@ -89,7 +89,7 @@ xps_begin_opacity(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, if (scb_color_att) { fz_colorspace *colorspace; - float samples[32]; + float samples[FZ_MAX_COLORS]; ...
CWE-119
null
null
10,525
static inline int unhex(int a) { if (a >= 'A' && a <= 'F') return a - 'A' + 0xA; if (a >= 'a' && a <= 'f') return a - 'a' + 0xA; if (a >= '0' && a <= '9') return a - '0'; return 0; }
Exec Code Overflow
0
static inline int unhex(int a) { if (a >= 'A' && a <= 'F') return a - 'A' + 0xA; if (a >= 'a' && a <= 'f') return a - 'a' + 0xA; if (a >= '0' && a <= '9') return a - '0'; return 0; }
@@ -89,7 +89,7 @@ xps_begin_opacity(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, if (scb_color_att) { fz_colorspace *colorspace; - float samples[32]; + float samples[FZ_MAX_COLORS]; ...
CWE-119
null
null
10,526
xps_end_opacity(xps_document *doc, char *base_uri, xps_resource *dict, char *opacity_att, fz_xml *opacity_mask_tag) { if (!opacity_att && !opacity_mask_tag) return; if (doc->opacity_top > 0) doc->opacity_top--; if (opacity_mask_tag) { if (strcmp(fz_xml_tag(opacity_mask_tag), "SolidColorBrush")) fz_pop_c...
Exec Code Overflow
0
xps_end_opacity(xps_document *doc, char *base_uri, xps_resource *dict, char *opacity_att, fz_xml *opacity_mask_tag) { if (!opacity_att && !opacity_mask_tag) return; if (doc->opacity_top > 0) doc->opacity_top--; if (opacity_mask_tag) { if (strcmp(fz_xml_tag(opacity_mask_tag), "SolidColorBrush")) fz_pop_c...
@@ -89,7 +89,7 @@ xps_begin_opacity(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, if (scb_color_att) { fz_colorspace *colorspace; - float samples[32]; + float samples[FZ_MAX_COLORS]; ...
CWE-119
null
null
10,527
xps_parse_element(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, fz_xml *node) { if (doc->cookie && doc->cookie->abort) return; if (!strcmp(fz_xml_tag(node), "Path")) xps_parse_path(doc, ctm, base_uri, dict, node); if (!strcmp(fz_xml_tag(node), "Glyphs")) xps_...
Exec Code Overflow
0
xps_parse_element(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, fz_xml *node) { if (doc->cookie && doc->cookie->abort) return; if (!strcmp(fz_xml_tag(node), "Path")) xps_parse_path(doc, ctm, base_uri, dict, node); if (!strcmp(fz_xml_tag(node), "Glyphs")) xps_...
@@ -89,7 +89,7 @@ xps_begin_opacity(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, if (scb_color_att) { fz_colorspace *colorspace; - float samples[32]; + float samples[FZ_MAX_COLORS]; ...
CWE-119
null
null
10,528
xps_parse_rectangle(xps_document *doc, char *text, fz_rect *rect) { float args[4]; char *s = text; int i; args[0] = 0; args[1] = 0; args[2] = 1; args[3] = 1; for (i = 0; i < 4 && *s; i++) { args[i] = fz_atof(s); while (*s && *s != ',') s++; if (*s == ',') s++; } rect->x0 = args[0]; rect->y0 = a...
Exec Code Overflow
0
xps_parse_rectangle(xps_document *doc, char *text, fz_rect *rect) { float args[4]; char *s = text; int i; args[0] = 0; args[1] = 0; args[2] = 1; args[3] = 1; for (i = 0; i < 4 && *s; i++) { args[i] = fz_atof(s); while (*s && *s != ',') s++; if (*s == ',') s++; } rect->x0 = args[0]; rect->y0 = a...
@@ -89,7 +89,7 @@ xps_begin_opacity(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, if (scb_color_att) { fz_colorspace *colorspace; - float samples[32]; + float samples[FZ_MAX_COLORS]; ...
CWE-119
null
null
10,529
static inline int is_real_num_char(int c) { return (c >= '0' && c <= '9') || c == 'e' || c == 'E' || c == '+' || c == '-' || c == '.'; }
Exec Code Overflow
0
static inline int is_real_num_char(int c) { return (c >= '0' && c <= '9') || c == 'e' || c == 'E' || c == '+' || c == '-' || c == '.'; }
@@ -590,7 +590,7 @@ xps_parse_glyphs(xps_document *doc, const fz_matrix *ctm, if (fill_att) { - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; xps_parse_color(doc, base_uri, fill_att, &colorspace, samples);
CWE-119
null
null
10,530
xps_count_font_encodings(fz_font *font) { FT_Face face = font->ft_face; return face->num_charmaps; }
Exec Code Overflow
0
xps_count_font_encodings(fz_font *font) { FT_Face face = font->ft_face; return face->num_charmaps; }
@@ -590,7 +590,7 @@ xps_parse_glyphs(xps_document *doc, const fz_matrix *ctm, if (fill_att) { - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; xps_parse_color(doc, base_uri, fill_att, &colorspace, samples);
CWE-119
null
null
10,531
xps_deobfuscate_font_resource(xps_document *doc, xps_part *part) { unsigned char buf[33]; unsigned char key[16]; char *p; int i; p = strrchr(part->name, '/'); if (!p) p = part->name; for (i = 0; i < 32 && *p; p++) { if (ishex(*p)) buf[i++] = *p; } buf[i] = 0; if (i != 32) { fz_warn(doc->ctx, "ca...
Exec Code Overflow
0
xps_deobfuscate_font_resource(xps_document *doc, xps_part *part) { unsigned char buf[33]; unsigned char key[16]; char *p; int i; p = strrchr(part->name, '/'); if (!p) p = part->name; for (i = 0; i < 32 && *p; p++) { if (ishex(*p)) buf[i++] = *p; } buf[i] = 0; if (i != 32) { fz_warn(doc->ctx, "ca...
@@ -590,7 +590,7 @@ xps_parse_glyphs(xps_document *doc, const fz_matrix *ctm, if (fill_att) { - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; xps_parse_color(doc, base_uri, fill_att, &colorspace, samples);
CWE-119
null
null
10,532
xps_encode_font_char(fz_font *font, int code) { FT_Face face = font->ft_face; int gid = FT_Get_Char_Index(face, code); if (gid == 0 && face->charmap && face->charmap->platform_id == 3 && face->charmap->encoding_id == 0) gid = FT_Get_Char_Index(face, 0xF000 | code); return gid; }
Exec Code Overflow
0
xps_encode_font_char(fz_font *font, int code) { FT_Face face = font->ft_face; int gid = FT_Get_Char_Index(face, code); if (gid == 0 && face->charmap && face->charmap->platform_id == 3 && face->charmap->encoding_id == 0) gid = FT_Get_Char_Index(face, 0xF000 | code); return gid; }
@@ -590,7 +590,7 @@ xps_parse_glyphs(xps_document *doc, const fz_matrix *ctm, if (fill_att) { - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; xps_parse_color(doc, base_uri, fill_att, &colorspace, samples);
CWE-119
null
null
10,533
xps_identify_font_encoding(fz_font *font, int idx, int *pid, int *eid) { FT_Face face = font->ft_face; *pid = face->charmaps[idx]->platform_id; *eid = face->charmaps[idx]->encoding_id; }
Exec Code Overflow
0
xps_identify_font_encoding(fz_font *font, int idx, int *pid, int *eid) { FT_Face face = font->ft_face; *pid = face->charmaps[idx]->platform_id; *eid = face->charmaps[idx]->encoding_id; }
@@ -590,7 +590,7 @@ xps_parse_glyphs(xps_document *doc, const fz_matrix *ctm, if (fill_att) { - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; xps_parse_color(doc, base_uri, fill_att, &colorspace, samples);
CWE-119
null
null
10,534
xps_lookup_font(xps_document *doc, char *name) { xps_font_cache *cache; for (cache = doc->font_table; cache; cache = cache->next) if (!xps_strcasecmp(cache->name, name)) return fz_keep_font(doc->ctx, cache->font); return NULL; }
Exec Code Overflow
0
xps_lookup_font(xps_document *doc, char *name) { xps_font_cache *cache; for (cache = doc->font_table; cache; cache = cache->next) if (!xps_strcasecmp(cache->name, name)) return fz_keep_font(doc->ctx, cache->font); return NULL; }
@@ -590,7 +590,7 @@ xps_parse_glyphs(xps_document *doc, const fz_matrix *ctm, if (fill_att) { - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; xps_parse_color(doc, base_uri, fill_att, &colorspace, samples);
CWE-119
null
null
10,535
xps_measure_font_glyph(xps_document *doc, fz_font *font, int gid, xps_glyph_metrics *mtx) { int mask = FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM; FT_Face face = font->ft_face; FT_Fixed hadv, vadv; fz_context *ctx = doc->ctx; fz_lock(ctx, FZ_LOCK_FREETYPE); FT_Get_Advance(face, gid, mask, &hadv); FT_Get_Advanc...
Exec Code Overflow
0
xps_measure_font_glyph(xps_document *doc, fz_font *font, int gid, xps_glyph_metrics *mtx) { int mask = FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM; FT_Face face = font->ft_face; FT_Fixed hadv, vadv; fz_context *ctx = doc->ctx; fz_lock(ctx, FZ_LOCK_FREETYPE); FT_Get_Advance(face, gid, mask, &hadv); FT_Get_Advanc...
@@ -590,7 +590,7 @@ xps_parse_glyphs(xps_document *doc, const fz_matrix *ctm, if (fill_att) { - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; xps_parse_color(doc, base_uri, fill_att, &colorspace, samples);
CWE-119
null
null
10,536
xps_parse_cluster_mapping(char *s, int *code_count, int *glyph_count) { if (*s == '(') s = xps_parse_digits(s + 1, code_count); if (*s == ':') s = xps_parse_digits(s + 1, glyph_count); if (*s == ')') s ++; return s; }
Exec Code Overflow
0
xps_parse_cluster_mapping(char *s, int *code_count, int *glyph_count) { if (*s == '(') s = xps_parse_digits(s + 1, code_count); if (*s == ':') s = xps_parse_digits(s + 1, glyph_count); if (*s == ')') s ++; return s; }
@@ -590,7 +590,7 @@ xps_parse_glyphs(xps_document *doc, const fz_matrix *ctm, if (fill_att) { - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; xps_parse_color(doc, base_uri, fill_att, &colorspace, samples);
CWE-119
null
null
10,537
xps_parse_glyph_index(char *s, int *glyph_index) { if (*s >= '0' && *s <= '9') s = xps_parse_digits(s, glyph_index); return s; }
Exec Code Overflow
0
xps_parse_glyph_index(char *s, int *glyph_index) { if (*s >= '0' && *s <= '9') s = xps_parse_digits(s, glyph_index); return s; }
@@ -590,7 +590,7 @@ xps_parse_glyphs(xps_document *doc, const fz_matrix *ctm, if (fill_att) { - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; xps_parse_color(doc, base_uri, fill_att, &colorspace, samples);
CWE-119
null
null
10,538
xps_parse_glyph_metrics(char *s, float *advance, float *uofs, float *vofs) { if (*s == ',') s = xps_parse_real_num(s + 1, advance); if (*s == ',') s = xps_parse_real_num(s + 1, uofs); if (*s == ',') s = xps_parse_real_num(s + 1, vofs); return s; }
Exec Code Overflow
0
xps_parse_glyph_metrics(char *s, float *advance, float *uofs, float *vofs) { if (*s == ',') s = xps_parse_real_num(s + 1, advance); if (*s == ',') s = xps_parse_real_num(s + 1, uofs); if (*s == ',') s = xps_parse_real_num(s + 1, vofs); return s; }
@@ -590,7 +590,7 @@ xps_parse_glyphs(xps_document *doc, const fz_matrix *ctm, if (fill_att) { - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; xps_parse_color(doc, base_uri, fill_att, &colorspace, samples);
CWE-119
null
null
10,539
xps_parse_glyphs_imp(xps_document *doc, const fz_matrix *ctm, fz_font *font, float size, float originx, float originy, int is_sideways, int bidi_level, char *indices, char *unicode) { xps_glyph_metrics mtx; fz_text *text; fz_matrix tm; float e, f; float x = originx; float y = originy; char *us = unicode; cha...
Exec Code Overflow
0
xps_parse_glyphs_imp(xps_document *doc, const fz_matrix *ctm, fz_font *font, float size, float originx, float originy, int is_sideways, int bidi_level, char *indices, char *unicode) { xps_glyph_metrics mtx; fz_text *text; fz_matrix tm; float e, f; float x = originx; float y = originy; char *us = unicode; cha...
@@ -590,7 +590,7 @@ xps_parse_glyphs(xps_document *doc, const fz_matrix *ctm, if (fill_att) { - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; xps_parse_color(doc, base_uri, fill_att, &colorspace, samples);
CWE-119
null
null
10,540
xps_parse_real_num(char *s, float *number) { char buf[64]; char *p = buf; while (is_real_num_char(*s)) *p++ = *s++; *p = 0; if (buf[0]) *number = fz_atof(buf); return s; }
Exec Code Overflow
0
xps_parse_real_num(char *s, float *number) { char buf[64]; char *p = buf; while (is_real_num_char(*s)) *p++ = *s++; *p = 0; if (buf[0]) *number = fz_atof(buf); return s; }
@@ -590,7 +590,7 @@ xps_parse_glyphs(xps_document *doc, const fz_matrix *ctm, if (fill_att) { - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; xps_parse_color(doc, base_uri, fill_att, &colorspace, samples);
CWE-119
null
null
10,541
xps_select_best_font_encoding(xps_document *doc, fz_font *font) { static struct { int pid, eid; } xps_cmap_list[] = { { 3, 10 }, /* Unicode with surrogates */ { 3, 1 }, /* Unicode without surrogates */ { 3, 5 }, /* Wansung */ { 3, 4 }, /* Big5 */ { 3, 3 }, /* Prc */ { 3, 2 }, /* ShiftJis */ { 3, 0...
Exec Code Overflow
0
xps_select_best_font_encoding(xps_document *doc, fz_font *font) { static struct { int pid, eid; } xps_cmap_list[] = { { 3, 10 }, /* Unicode with surrogates */ { 3, 1 }, /* Unicode without surrogates */ { 3, 5 }, /* Wansung */ { 3, 4 }, /* Big5 */ { 3, 3 }, /* Prc */ { 3, 2 }, /* ShiftJis */ { 3, 0...
@@ -590,7 +590,7 @@ xps_parse_glyphs(xps_document *doc, const fz_matrix *ctm, if (fill_att) { - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; xps_parse_color(doc, base_uri, fill_att, &colorspace, samples);
CWE-119
null
null
10,542
xps_select_font_encoding(fz_font *font, int idx) { FT_Face face = font->ft_face; FT_Set_Charmap(face, face->charmaps[idx]); }
Exec Code Overflow
0
xps_select_font_encoding(fz_font *font, int idx) { FT_Face face = font->ft_face; FT_Set_Charmap(face, face->charmaps[idx]); }
@@ -590,7 +590,7 @@ xps_parse_glyphs(xps_document *doc, const fz_matrix *ctm, if (fill_att) { - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; xps_parse_color(doc, base_uri, fill_att, &colorspace, samples);
CWE-119
null
null
10,543
static int cmp_stop(const void *a, const void *b) { const struct stop *astop = a; const struct stop *bstop = b; float diff = astop->offset - bstop->offset; if (diff < 0) return -1; if (diff > 0) return 1; return astop->index - bstop->index; }
Exec Code Overflow
0
static int cmp_stop(const void *a, const void *b) { const struct stop *astop = a; const struct stop *bstop = b; float diff = astop->offset - bstop->offset; if (diff < 0) return -1; if (diff > 0) return 1; return astop->index - bstop->index; }
@@ -39,7 +39,7 @@ xps_parse_gradient_stops(xps_document *doc, char *base_uri, fz_xml *node, struct stop *stops, int maxcount) { fz_colorspace *colorspace; - float sample[8]; + float sample[FZ_MAX_COLORS]; float rgb[3]; int before, after; int count;
CWE-119
null
null
10,544
static inline float lerp(float a, float b, float x) { return a + (b - a) * x; }
Exec Code Overflow
0
static inline float lerp(float a, float b, float x) { return a + (b - a) * x; }
@@ -39,7 +39,7 @@ xps_parse_gradient_stops(xps_document *doc, char *base_uri, fz_xml *node, struct stop *stops, int maxcount) { fz_colorspace *colorspace; - float sample[8]; + float sample[FZ_MAX_COLORS]; float rgb[3]; int before, after; int count;
CWE-119
null
null
10,545
static inline float point_inside_circle(float px, float py, float x, float y, float r) { float dx = px - x; float dy = py - y; return dx * dx + dy * dy <= r * r; }
Exec Code Overflow
0
static inline float point_inside_circle(float px, float py, float x, float y, float r) { float dx = px - x; float dy = py - y; return dx * dx + dy * dy <= r * r; }
@@ -39,7 +39,7 @@ xps_parse_gradient_stops(xps_document *doc, char *base_uri, fz_xml *node, struct stop *stops, int maxcount) { fz_colorspace *colorspace; - float sample[8]; + float sample[FZ_MAX_COLORS]; float rgb[3]; int before, after; int count;
CWE-119
null
null
10,546
xps_draw_linear_gradient(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, struct stop *stops, int count, fz_xml *root, int spread) { float x0, y0, x1, y1; int i, mi, ma; float dx, dy, x, y, k; fz_point p1, p2; fz_matrix inv; fz_rect local_area = *area; char *start_point_att = fz_xml_att(root, "St...
Exec Code Overflow
0
xps_draw_linear_gradient(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, struct stop *stops, int count, fz_xml *root, int spread) { float x0, y0, x1, y1; int i, mi, ma; float dx, dy, x, y, k; fz_point p1, p2; fz_matrix inv; fz_rect local_area = *area; char *start_point_att = fz_xml_att(root, "St...
@@ -39,7 +39,7 @@ xps_parse_gradient_stops(xps_document *doc, char *base_uri, fz_xml *node, struct stop *stops, int maxcount) { fz_colorspace *colorspace; - float sample[8]; + float sample[FZ_MAX_COLORS]; float rgb[3]; int before, after; int count;
CWE-119
null
null
10,547
xps_draw_one_linear_gradient(xps_document *doc, const fz_matrix *ctm, struct stop *stops, int count, int extend, float x0, float y0, float x1, float y1) { fz_shade *shade; /* TODO: this (and the stuff in pdf_shade) should move to res_shade.c */ shade = fz_malloc_struct(doc->ctx, fz_shade); FZ_INIT_STORABLE(shad...
Exec Code Overflow
0
xps_draw_one_linear_gradient(xps_document *doc, const fz_matrix *ctm, struct stop *stops, int count, int extend, float x0, float y0, float x1, float y1) { fz_shade *shade; /* TODO: this (and the stuff in pdf_shade) should move to res_shade.c */ shade = fz_malloc_struct(doc->ctx, fz_shade); FZ_INIT_STORABLE(shad...
@@ -39,7 +39,7 @@ xps_parse_gradient_stops(xps_document *doc, char *base_uri, fz_xml *node, struct stop *stops, int maxcount) { fz_colorspace *colorspace; - float sample[8]; + float sample[FZ_MAX_COLORS]; float rgb[3]; int before, after; int count;
CWE-119
null
null
10,548
xps_draw_radial_gradient(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, struct stop *stops, int count, fz_xml *root, int spread) { float x0, y0, r0; float x1, y1, r1; float xrad = 1; float yrad = 1; float invscale; int i, ma = 1; fz_matrix local_ctm = *ctm; fz_matrix inv; fz_rect local_area = ...
Exec Code Overflow
0
xps_draw_radial_gradient(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, struct stop *stops, int count, fz_xml *root, int spread) { float x0, y0, r0; float x1, y1, r1; float xrad = 1; float yrad = 1; float invscale; int i, ma = 1; fz_matrix local_ctm = *ctm; fz_matrix inv; fz_rect local_area = ...
@@ -39,7 +39,7 @@ xps_parse_gradient_stops(xps_document *doc, char *base_uri, fz_xml *node, struct stop *stops, int maxcount) { fz_colorspace *colorspace; - float sample[8]; + float sample[FZ_MAX_COLORS]; float rgb[3]; int before, after; int count;
CWE-119
null
null
10,549
xps_parse_gradient_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, fz_xml *root, void (*draw)(xps_document *, const fz_matrix*, const fz_rect *, struct stop *, int, fz_xml *, int)) { fz_xml *node; char *opacity_att; char *spread_att; char *transform_att; ...
Exec Code Overflow
0
xps_parse_gradient_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, fz_xml *root, void (*draw)(xps_document *, const fz_matrix*, const fz_rect *, struct stop *, int, fz_xml *, int)) { fz_xml *node; char *opacity_att; char *spread_att; char *transform_att; ...
@@ -39,7 +39,7 @@ xps_parse_gradient_stops(xps_document *doc, char *base_uri, fz_xml *node, struct stop *stops, int maxcount) { fz_colorspace *colorspace; - float sample[8]; + float sample[FZ_MAX_COLORS]; float rgb[3]; int before, after; int count;
CWE-119
null
null
10,550
xps_parse_linear_gradient_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, fz_xml *root) { xps_parse_gradient_brush(doc, ctm, area, base_uri, dict, root, xps_draw_linear_gradient); }
Exec Code Overflow
0
xps_parse_linear_gradient_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, fz_xml *root) { xps_parse_gradient_brush(doc, ctm, area, base_uri, dict, root, xps_draw_linear_gradient); }
@@ -39,7 +39,7 @@ xps_parse_gradient_stops(xps_document *doc, char *base_uri, fz_xml *node, struct stop *stops, int maxcount) { fz_colorspace *colorspace; - float sample[8]; + float sample[FZ_MAX_COLORS]; float rgb[3]; int before, after; int count;
CWE-119
null
null
10,551
xps_parse_radial_gradient_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, fz_xml *root) { xps_parse_gradient_brush(doc, ctm, area, base_uri, dict, root, xps_draw_radial_gradient); }
Exec Code Overflow
0
xps_parse_radial_gradient_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, fz_xml *root) { xps_parse_gradient_brush(doc, ctm, area, base_uri, dict, root, xps_draw_radial_gradient); }
@@ -39,7 +39,7 @@ xps_parse_gradient_stops(xps_document *doc, char *base_uri, fz_xml *node, struct stop *stops, int maxcount) { fz_colorspace *colorspace; - float sample[8]; + float sample[FZ_MAX_COLORS]; float rgb[3]; int before, after; int count;
CWE-119
null
null
10,552
xps_sample_gradient_stops(fz_shade *shade, struct stop *stops, int count) { float offset, d; int i, k; k = 0; for (i = 0; i < 256; i++) { offset = i / 255.0f; while (k + 1 < count && offset > stops[k+1].offset) k++; d = (offset - stops[k].offset) / (stops[k+1].offset - stops[k].offset); shade->functi...
Exec Code Overflow
0
xps_sample_gradient_stops(fz_shade *shade, struct stop *stops, int count) { float offset, d; int i, k; k = 0; for (i = 0; i < 256; i++) { offset = i / 255.0f; while (k + 1 < count && offset > stops[k+1].offset) k++; d = (offset - stops[k].offset) / (stops[k+1].offset - stops[k].offset); shade->functi...
@@ -39,7 +39,7 @@ xps_parse_gradient_stops(xps_document *doc, char *base_uri, fz_xml *node, struct stop *stops, int maxcount) { fz_colorspace *colorspace; - float sample[8]; + float sample[FZ_MAX_COLORS]; float rgb[3]; int before, after; int count;
CWE-119
null
null
10,553
xps_clip(xps_document *doc, const fz_matrix *ctm, xps_resource *dict, char *clip_att, fz_xml *clip_tag) { fz_path *path; int fill_rule = 0; if (clip_att) path = xps_parse_abbreviated_geometry(doc, clip_att, &fill_rule); else if (clip_tag) path = xps_parse_path_geometry(doc, dict, clip_tag, 0, &fill_rule); els...
Exec Code Overflow
0
xps_clip(xps_document *doc, const fz_matrix *ctm, xps_resource *dict, char *clip_att, fz_xml *clip_tag) { fz_path *path; int fill_rule = 0; if (clip_att) path = xps_parse_abbreviated_geometry(doc, clip_att, &fill_rule); else if (clip_tag) path = xps_parse_path_geometry(doc, dict, clip_tag, 0, &fill_rule); els...
@@ -826,7 +826,7 @@ xps_parse_path(xps_document *doc, const fz_matrix *ctm, char *base_uri, xps_reso fz_stroke_state *stroke = NULL; fz_matrix transform; - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; fz_path *path = NULL; fz_path *s...
CWE-119
null
null
10,554
xps_draw_arc(fz_context *doc, fz_path *path, float size_x, float size_y, float rotation_angle, int is_large_arc, int is_clockwise, float point_x, float point_y) { fz_matrix rotmat, revmat; fz_matrix mtx; fz_point pt; float rx, ry; float x1, y1, x2, y2; float x1t, y1t; float cxt, cyt, cx, cy; float t1, t2, t3...
Exec Code Overflow
0
xps_draw_arc(fz_context *doc, fz_path *path, float size_x, float size_y, float rotation_angle, int is_large_arc, int is_clockwise, float point_x, float point_y) { fz_matrix rotmat, revmat; fz_matrix mtx; fz_point pt; float rx, ry; float x1, y1, x2, y2; float x1t, y1t; float cxt, cyt, cx, cy; float t1, t2, t3...
@@ -826,7 +826,7 @@ xps_parse_path(xps_document *doc, const fz_matrix *ctm, char *base_uri, xps_reso fz_stroke_state *stroke = NULL; fz_matrix transform; - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; fz_path *path = NULL; fz_path *s...
CWE-119
null
null
10,555
xps_draw_arc_segment(fz_context *doc, fz_path *path, const fz_matrix *mtx, float th0, float th1, int iscw) { float t, d; fz_point p; while (th1 < th0) th1 += (float)M_PI * 2; d = (float)M_PI / 180; /* 1-degree precision */ if (iscw) { for (t = th0 + d; t < th1 - d/2; t += d) { p.x = cosf(t); p.y = ...
Exec Code Overflow
0
xps_draw_arc_segment(fz_context *doc, fz_path *path, const fz_matrix *mtx, float th0, float th1, int iscw) { float t, d; fz_point p; while (th1 < th0) th1 += (float)M_PI * 2; d = (float)M_PI / 180; /* 1-degree precision */ if (iscw) { for (t = th0 + d; t < th1 - d/2; t += d) { p.x = cosf(t); p.y = ...
@@ -826,7 +826,7 @@ xps_parse_path(xps_document *doc, const fz_matrix *ctm, char *base_uri, xps_reso fz_stroke_state *stroke = NULL; fz_matrix transform; - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; fz_path *path = NULL; fz_path *s...
CWE-119
null
null
10,556
xps_parse_abbreviated_geometry(xps_document *doc, char *geom, int *fill_rule) { fz_path *path; char **args; char **pargs; char *s = geom; fz_point pt; int i, n; int cmd, old; float x1, y1, x2, y2, x3, y3; float smooth_x, smooth_y; /* saved cubic bezier control point for smooth curves */ int reset_smooth; pa...
Exec Code Overflow
0
xps_parse_abbreviated_geometry(xps_document *doc, char *geom, int *fill_rule) { fz_path *path; char **args; char **pargs; char *s = geom; fz_point pt; int i, n; int cmd, old; float x1, y1, x2, y2, x3, y3; float smooth_x, smooth_y; /* saved cubic bezier control point for smooth curves */ int reset_smooth; pa...
@@ -826,7 +826,7 @@ xps_parse_path(xps_document *doc, const fz_matrix *ctm, char *base_uri, xps_reso fz_stroke_state *stroke = NULL; fz_matrix transform; - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; fz_path *path = NULL; fz_path *s...
CWE-119
null
null
10,557
xps_parse_arc_segment(fz_context *doc, fz_path *path, fz_xml *root, int stroking, int *skipped_stroke) { /* ArcSegment pretty much follows the SVG algorithm for converting an * arc in endpoint representation to an arc in centerpoint * representation. Once in centerpoint it can be given to the * graphics library ...
Exec Code Overflow
0
xps_parse_arc_segment(fz_context *doc, fz_path *path, fz_xml *root, int stroking, int *skipped_stroke) { /* ArcSegment pretty much follows the SVG algorithm for converting an * arc in endpoint representation to an arc in centerpoint * representation. Once in centerpoint it can be given to the * graphics library ...
@@ -826,7 +826,7 @@ xps_parse_path(xps_document *doc, const fz_matrix *ctm, char *base_uri, xps_reso fz_stroke_state *stroke = NULL; fz_matrix transform; - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; fz_path *path = NULL; fz_path *s...
CWE-119
null
null
10,558
xps_parse_float_array(char *s, int num, float *x) { int k = 0; if (s == NULL || *s == 0) return NULL; while (*s) { while (*s == 0x0d || *s == '\t' || *s == ' ' || *s == 0x0a) s++; x[k] = (float)strtod(s, &s); while (*s == 0x0d || *s == '\t' || *s == ' ' || *s == 0x0a) s++; if (*s == ',') s++; ...
Exec Code Overflow
0
xps_parse_float_array(char *s, int num, float *x) { int k = 0; if (s == NULL || *s == 0) return NULL; while (*s) { while (*s == 0x0d || *s == '\t' || *s == ' ' || *s == 0x0a) s++; x[k] = (float)strtod(s, &s); while (*s == 0x0d || *s == '\t' || *s == ' ' || *s == 0x0a) s++; if (*s == ',') s++; ...
@@ -826,7 +826,7 @@ xps_parse_path(xps_document *doc, const fz_matrix *ctm, char *base_uri, xps_reso fz_stroke_state *stroke = NULL; fz_matrix transform; - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; fz_path *path = NULL; fz_path *s...
CWE-119
null
null
10,559
xps_parse_line_cap(char *attr) { if (attr) { if (!strcmp(attr, "Flat")) return 0; if (!strcmp(attr, "Round")) return 1; if (!strcmp(attr, "Square")) return 2; if (!strcmp(attr, "Triangle")) return 3; } return 0; }
Exec Code Overflow
0
xps_parse_line_cap(char *attr) { if (attr) { if (!strcmp(attr, "Flat")) return 0; if (!strcmp(attr, "Round")) return 1; if (!strcmp(attr, "Square")) return 2; if (!strcmp(attr, "Triangle")) return 3; } return 0; }
@@ -826,7 +826,7 @@ xps_parse_path(xps_document *doc, const fz_matrix *ctm, char *base_uri, xps_reso fz_stroke_state *stroke = NULL; fz_matrix transform; - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; fz_path *path = NULL; fz_path *s...
CWE-119
null
null
10,560
xps_parse_path_geometry(xps_document *doc, xps_resource *dict, fz_xml *root, int stroking, int *fill_rule) { fz_xml *node; char *figures_att; char *fill_rule_att; char *transform_att; fz_xml *transform_tag = NULL; fz_xml *figures_tag = NULL; /* only used by resource */ fz_matrix transform; fz_path *path; f...
Exec Code Overflow
0
xps_parse_path_geometry(xps_document *doc, xps_resource *dict, fz_xml *root, int stroking, int *fill_rule) { fz_xml *node; char *figures_att; char *fill_rule_att; char *transform_att; fz_xml *transform_tag = NULL; fz_xml *figures_tag = NULL; /* only used by resource */ fz_matrix transform; fz_path *path; f...
@@ -826,7 +826,7 @@ xps_parse_path(xps_document *doc, const fz_matrix *ctm, char *base_uri, xps_reso fz_stroke_state *stroke = NULL; fz_matrix transform; - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; fz_path *path = NULL; fz_path *s...
CWE-119
null
null
10,561
xps_parse_point(char *s_in, float *x, float *y) { char *s_out = s_in; float xy[2]; s_out = xps_parse_float_array(s_out, 2, &xy[0]); *x = xy[0]; *y = xy[1]; return s_out; }
Exec Code Overflow
0
xps_parse_point(char *s_in, float *x, float *y) { char *s_out = s_in; float xy[2]; s_out = xps_parse_float_array(s_out, 2, &xy[0]); *x = xy[0]; *y = xy[1]; return s_out; }
@@ -826,7 +826,7 @@ xps_parse_path(xps_document *doc, const fz_matrix *ctm, char *base_uri, xps_reso fz_stroke_state *stroke = NULL; fz_matrix transform; - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; fz_path *path = NULL; fz_path *s...
CWE-119
null
null
10,562
xps_parse_poly_bezier_segment(fz_context *doc, fz_path *path, fz_xml *root, int stroking, int *skipped_stroke) { char *points_att = fz_xml_att(root, "Points"); char *is_stroked_att = fz_xml_att(root, "IsStroked"); float x[3], y[3]; int is_stroked; char *s; int n; if (!points_att) { fz_warn(doc, "PolyBezierSe...
Exec Code Overflow
0
xps_parse_poly_bezier_segment(fz_context *doc, fz_path *path, fz_xml *root, int stroking, int *skipped_stroke) { char *points_att = fz_xml_att(root, "Points"); char *is_stroked_att = fz_xml_att(root, "IsStroked"); float x[3], y[3]; int is_stroked; char *s; int n; if (!points_att) { fz_warn(doc, "PolyBezierSe...
@@ -826,7 +826,7 @@ xps_parse_path(xps_document *doc, const fz_matrix *ctm, char *base_uri, xps_reso fz_stroke_state *stroke = NULL; fz_matrix transform; - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; fz_path *path = NULL; fz_path *s...
CWE-119
null
null
10,563
xps_parse_poly_quadratic_bezier_segment(fz_context *doc, fz_path *path, fz_xml *root, int stroking, int *skipped_stroke) { char *points_att = fz_xml_att(root, "Points"); char *is_stroked_att = fz_xml_att(root, "IsStroked"); float x[2], y[2]; int is_stroked; fz_point pt; char *s; int n; if (!points_att) { fz...
Exec Code Overflow
0
xps_parse_poly_quadratic_bezier_segment(fz_context *doc, fz_path *path, fz_xml *root, int stroking, int *skipped_stroke) { char *points_att = fz_xml_att(root, "Points"); char *is_stroked_att = fz_xml_att(root, "IsStroked"); float x[2], y[2]; int is_stroked; fz_point pt; char *s; int n; if (!points_att) { fz...
@@ -826,7 +826,7 @@ xps_parse_path(xps_document *doc, const fz_matrix *ctm, char *base_uri, xps_reso fz_stroke_state *stroke = NULL; fz_matrix transform; - float samples[32]; + float samples[FZ_MAX_COLORS]; fz_colorspace *colorspace; fz_path *path = NULL; fz_path *s...
CWE-119
null
null
10,564
PHP_FUNCTION(parse_url) { char *str; int str_len; php_url *resource; long key = -1; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &key) == FAILURE) { return; } resource = php_url_parse_ex(str, str_len); if (resource == NULL) { /* @todo Find a method to determine why php_url_p...
Bypass
0
PHP_FUNCTION(parse_url) { char *str; int str_len; php_url *resource; long key = -1; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &key) == FAILURE) { return; } resource = php_url_parse_ex(str, str_len); if (resource == NULL) { /* @todo Find a method to determine why php_url_p...
@@ -217,28 +217,7 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) goto nohost; } - e = ue; - - if (!(p = memchr(s, '/', (ue - s)))) { - char *query, *fragment; - - query = memchr(s, '?', (ue - s)); - fragment = memchr(s, '#...
CWE-20
null
null
10,565
PHP_FUNCTION(get_headers) { char *url; int url_len; php_stream_context *context; php_stream *stream; zval **prev_val, **hdr = NULL, **h; HashPosition pos; HashTable *hashT; long format = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &url, &url_len, &format) == FAILURE) { return; } context...
Bypass
0
PHP_FUNCTION(get_headers) { char *url; int url_len; php_stream_context *context; php_stream *stream; zval **prev_val, **hdr = NULL, **h; HashPosition pos; HashTable *hashT; long format = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &url, &url_len, &format) == FAILURE) { return; } context...
@@ -217,28 +217,7 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) goto nohost; } - e = ue; - - if (!(p = memchr(s, '/', (ue - s)))) { - char *query, *fragment; - - query = memchr(s, '?', (ue - s)); - fragment = memchr(s, '#...
CWE-20
null
null
10,566
PHPAPI int php_raw_url_decode(char *str, int len) { char *dest = str; char *data = str; while (len--) { if (*data == '%' && len >= 2 && isxdigit((int) *(data + 1)) && isxdigit((int) *(data + 2))) { #ifndef CHARSET_EBCDIC *dest = (char) php_htoi(data + 1); #else *dest = os_toebcdic[(char) php_htoi(data + ...
Bypass
0
PHPAPI int php_raw_url_decode(char *str, int len) { char *dest = str; char *data = str; while (len--) { if (*data == '%' && len >= 2 && isxdigit((int) *(data + 1)) && isxdigit((int) *(data + 2))) { #ifndef CHARSET_EBCDIC *dest = (char) php_htoi(data + 1); #else *dest = os_toebcdic[(char) php_htoi(data + ...
@@ -217,28 +217,7 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) goto nohost; } - e = ue; - - if (!(p = memchr(s, '/', (ue - s)))) { - char *query, *fragment; - - query = memchr(s, '?', (ue - s)); - fragment = memchr(s, '#...
CWE-20
null
null
10,567
static gboolean lxterminal_socket_accept_client(GIOChannel * source, GIOCondition condition, LXTermWindow * lxtermwin) { if (condition & G_IO_IN) { /* Accept the new connection. */ int fd = accept(g_io_channel_unix_get_fd(source), NULL, NULL); if (fd < 0) g_warning("Accept fa...
DoS Bypass
0
static gboolean lxterminal_socket_accept_client(GIOChannel * source, GIOCondition condition, LXTermWindow * lxtermwin) { if (condition & G_IO_IN) { /* Accept the new connection. */ int fd = accept(g_io_channel_unix_get_fd(source), NULL, NULL); if (fd < 0) g_warning("Accept fa...
@@ -140,7 +140,8 @@ gboolean lxterminal_socket_initialize(LXTermWindow * lxtermwin, gint argc, gchar * This function returns TRUE if this process should keep running and FALSE if it should exit. */ /* Formulate the path for the Unix domain socket. */ - gchar * socket_path = g_strdup_printf("/tmp/.lxterm...
CWE-284
null
null
10,568
static gboolean lxterminal_socket_read_channel(GIOChannel * gio, GIOCondition condition, LXTermWindow * lxtermwin) { /* Read message. */ gchar * msg = NULL; gsize len = 0; GError * err = NULL; GIOStatus ret = g_io_channel_read_to_end(gio, &msg, &len, &err); if (ret == G_IO_STATUS_ERROR) { ...
DoS Bypass
0
static gboolean lxterminal_socket_read_channel(GIOChannel * gio, GIOCondition condition, LXTermWindow * lxtermwin) { /* Read message. */ gchar * msg = NULL; gsize len = 0; GError * err = NULL; GIOStatus ret = g_io_channel_read_to_end(gio, &msg, &len, &err); if (ret == G_IO_STATUS_ERROR) { ...
@@ -140,7 +140,8 @@ gboolean lxterminal_socket_initialize(LXTermWindow * lxtermwin, gint argc, gchar * This function returns TRUE if this process should keep running and FALSE if it should exit. */ /* Formulate the path for the Unix domain socket. */ - gchar * socket_path = g_strdup_printf("/tmp/.lxterm...
CWE-284
null
null
10,569
inline bool HasScripting() { return (NPNFuncs.version >= NPVERS_HAS_NPRUNTIME_SCRIPTING); }
+Info
0
inline bool HasScripting() { return (NPNFuncs.version >= NPVERS_HAS_NPRUNTIME_SCRIPTING); }
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,570
NPP_GetMIMEDescription(void) { return const_cast<char *>(MIME_TYPES_DESCRIPTION); }
+Info
0
NPP_GetMIMEDescription(void) { return const_cast<char *>(MIME_TYPES_DESCRIPTION); }
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,571
NS_DestroyPluginInstance(nsPluginInstanceBase* aPlugin) { delete static_cast<gnash::nsPluginInstance *> (aPlugin); }
+Info
0
NS_DestroyPluginInstance(nsPluginInstanceBase* aPlugin) { delete static_cast<gnash::nsPluginInstance *> (aPlugin); }
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,572
NS_NewPluginInstance(nsPluginCreateData * aCreateDataStruct) { if(!aCreateDataStruct) { return NULL; } return new gnash::nsPluginInstance(aCreateDataStruct); }
+Info
0
NS_NewPluginInstance(nsPluginCreateData * aCreateDataStruct) { if(!aCreateDataStruct) { return NULL; } return new gnash::nsPluginInstance(aCreateDataStruct); }
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,573
NS_PluginInitialize() { if ( gnash::plugInitialized ) { gnash::log_debug("NS_PluginInitialize called, but ignored (we already initialized)"); return NPERR_NO_ERROR; } gnash::log_debug("NS_PluginInitialize call ---------------------------"); NPError err = NPERR_NO_ERROR; NPBool su...
+Info
0
NS_PluginInitialize() { if ( gnash::plugInitialized ) { gnash::log_debug("NS_PluginInitialize called, but ignored (we already initialized)"); return NPERR_NO_ERROR; } gnash::log_debug("NS_PluginInitialize call ---------------------------"); NPError err = NPERR_NO_ERROR; NPBool su...
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,574
NS_PluginShutdown() { #if 0 if (!plugInitialized) { gnash::log_debug("Plugin already shut down"); return; } plugInitialized = FALSE; #endif }
+Info
0
NS_PluginShutdown() { #if 0 if (!plugInitialized) { gnash::log_debug("Plugin already shut down"); return; } plugInitialized = FALSE; #endif }
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,575
nsPluginInstance::NewStream(NPMIMEType /*type*/, NPStream* stream, NPBool /*seekable*/, uint16_t* /*stype*/) { if (_childpid) { return NPERR_GENERIC_ERROR; } _swf_url = stream->url; if (!_swf_url.empty() && _window) { return startProc(); } return NP...
+Info
0
nsPluginInstance::NewStream(NPMIMEType /*type*/, NPStream* stream, NPBool /*seekable*/, uint16_t* /*stype*/) { if (_childpid) { return NPERR_GENERIC_ERROR; } _swf_url = stream->url; if (!_swf_url.empty() && _window) { return startProc(); } return NP...
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,576
nsPluginInstance::SetWindow(NPWindow* aWindow) { if(!aWindow) { gnash::log_error(std::string(__FUNCTION__) + ": ERROR: Window handle was bogus!"); return NPERR_INVALID_PARAM; #if 0 } else { gnash::log_debug("%s: X origin = %d, Y Origin = %d, Width = %d," " Height = %d, Window...
+Info
0
nsPluginInstance::SetWindow(NPWindow* aWindow) { if(!aWindow) { gnash::log_error(std::string(__FUNCTION__) + ": ERROR: Window handle was bogus!"); return NPERR_INVALID_PARAM; #if 0 } else { gnash::log_debug("%s: X origin = %d, Y Origin = %d, Width = %d," " Height = %d, Window...
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,577
nsPluginInstance::WriteReady(NPStream* /* stream */ ) { if ( _streamfd != -1 ) { return 1024; } else { return 0; } }
+Info
0
nsPluginInstance::WriteReady(NPStream* /* stream */ ) { if ( _streamfd != -1 ) { return 1024; } else { return 0; } }
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,578
cleanup_childpid(gpointer data) { int* pid = static_cast<int*>(data); int status; int rv = waitpid(*pid, &status, WNOHANG); if (rv <= 0) { kill(*pid, SIGKILL); waitpid(*pid, &status, 0); } gnash::log_debug("Child process exited with status %s", status); delete pid; ...
+Info
0
cleanup_childpid(gpointer data) { int* pid = static_cast<int*>(data); int status; int rv = waitpid(*pid, &status, WNOHANG); if (rv <= 0) { kill(*pid, SIGKILL); waitpid(*pid, &status, 0); } gnash::log_debug("Child process exited with status %s", status); delete pid; ...
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,579
close_fds(const int (& except)[N]) { int numfailed = 0, closed = 0; for (int anfd = fileno(stderr)+1; numfailed < 10; anfd++) { if (std::find(except, except+N, anfd) != except+N) { continue; } if (close(anfd) < 0) { numfailed++; } else { numfai...
+Info
0
close_fds(const int (& except)[N]) { int numfailed = 0, closed = 0; for (int anfd = fileno(stderr)+1; numfailed < 10; anfd++) { if (std::find(except, except+N, anfd) != except+N) { continue; } if (close(anfd) < 0) { numfailed++; } else { numfai...
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,580
create_standalone_launcher(const std::string& page_url, const std::string& swf_url, const std::map<std::string, std::string>& params) { #ifdef CREATE_STANDALONE_GNASH_LAUNCHER if (!createSaLauncher) { return; } std::ofstream saLauncher; std::stringstream ss; stat...
+Info
0
create_standalone_launcher(const std::string& page_url, const std::string& swf_url, const std::map<std::string, std::string>& params) { #ifdef CREATE_STANDALONE_GNASH_LAUNCHER if (!createSaLauncher) { return; } std::ofstream saLauncher; std::stringstream ss; stat...
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,581
nsPluginInstance::getCmdLine(int hostfd, int controlfd) { std::vector<std::string> arg_vec; std::string cmd = getGnashExecutable(); if (cmd.empty()) { gnash::log_error("Failed to locate the Gnash executable!"); return arg_vec; } arg_vec.push_back(cmd); arg_vec.push_back("-u"); ...
+Info
0
nsPluginInstance::getCmdLine(int hostfd, int controlfd) { std::vector<std::string> arg_vec; std::string cmd = getGnashExecutable(); if (cmd.empty()) { gnash::log_error("Failed to locate the Gnash executable!"); return arg_vec; } arg_vec.push_back(cmd); arg_vec.push_back("-u"); ...
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,582
nsPluginInstance::getCurrentPageURL() const { return getDocumentProp("baseURI"); }
+Info
0
nsPluginInstance::getCurrentPageURL() const { return getDocumentProp("baseURI"); }
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,583
nsPluginInstance::getDocumentProp(const std::string& propname) const { std::string rv; if (!HasScripting()) { LOG_ONCE( gnash::log_debug("Browser doesn't support scripting") ); return rv; } NPObject* windowobj; NPError err = NPN_GetValue(_instance, NPNVWindowNPObject, &windowobj); ...
+Info
0
nsPluginInstance::getDocumentProp(const std::string& propname) const { std::string rv; if (!HasScripting()) { LOG_ONCE( gnash::log_debug("Browser doesn't support scripting") ); return rv; } NPObject* windowobj; NPError err = NPN_GetValue(_instance, NPNVWindowNPObject, &windowobj); ...
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,584
getGnashExecutable() { std::string procname; bool process_found = false; struct stat procstats; char *gnash_env = std::getenv("GNASH_PLAYER"); if (gnash_env) { procname = gnash_env; process_found = (0 == stat(procname.c_str(), &procstats)); if (!process_found) { ...
+Info
0
getGnashExecutable() { std::string procname; bool process_found = false; struct stat procstats; char *gnash_env = std::getenv("GNASH_PLAYER"); if (gnash_env) { procname = gnash_env; process_found = (0 == stat(procname.c_str(), &procstats)); if (!process_found) { ...
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,585
nsPluginInstance::handlePlayerRequests(GIOChannel* iochan, GIOCondition cond) { if ( cond & G_IO_HUP ) { gnash::log_debug("Player control socket hang up"); return false; } assert(cond & G_IO_IN); gnash::log_debug("Checking player requests on FD #%d", g_io_channel_unix_ge...
+Info
0
nsPluginInstance::handlePlayerRequests(GIOChannel* iochan, GIOCondition cond) { if ( cond & G_IO_HUP ) { gnash::log_debug("Player control socket hang up"); return false; } assert(cond & G_IO_IN); gnash::log_debug("Checking player requests on FD #%d", g_io_channel_unix_ge...
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,586
nsPluginInstance::nsPluginInstance(nsPluginCreateData* data) : nsPluginInstanceBase(), _instance(data->instance), _window(0), _width(0), _height(0), _streamfd(-1), _childpid(0), _filefd(-1), _name(), _scriptObject(0) { for (size_t i=0, n=data->argc; i<n; ++i) { s...
+Info
0
nsPluginInstance::nsPluginInstance(nsPluginCreateData* data) : nsPluginInstanceBase(), _instance(data->instance), _window(0), _width(0), _height(0), _streamfd(-1), _childpid(0), _filefd(-1), _name(), _scriptObject(0) { for (size_t i=0, n=data->argc; i<n; ++i) { s...
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,587
processLog_debug(const boost::format& fmt) { std::cout << "DEBUG: " << fmt.str() << std::endl; }
+Info
0
processLog_debug(const boost::format& fmt) { std::cout << "DEBUG: " << fmt.str() << std::endl; }
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,588
processLog_debug(const boost::format& /* fmt */) { /* do nothing */ }
+Info
0
processLog_debug(const boost::format& /* fmt */) { /* do nothing */ }
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,589
processLog_trace(const boost::format& fmt) { std::cout << "TRACE: " << fmt.str() << std::endl; }
+Info
0
processLog_trace(const boost::format& fmt) { std::cout << "TRACE: " << fmt.str() << std::endl; }
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,590
processLog_trace(const boost::format& /* fmt */) { /* do nothing */ }
+Info
0
processLog_trace(const boost::format& /* fmt */) { /* do nothing */ }
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,591
remove_handler(GIOChannel*, GIOCondition, gpointer) { return FALSE; }
+Info
0
remove_handler(GIOChannel*, GIOCondition, gpointer) { return FALSE; }
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,592
nsPluginInstance::setupProxy(const std::string& url) { #if NPAPI_VERSION != 190 if (!NPNFuncs.getvalueforurl) return; #endif char *proxy = 0; uint32_t length = 0; #if NPAPI_VERSION != 190 NPN_GetValueForURL(_instance, NPNURLVProxy, url.c_str(), &proxy, &length); #endif if (!p...
+Info
0
nsPluginInstance::setupProxy(const std::string& url) { #if NPAPI_VERSION != 190 if (!NPNFuncs.getvalueforurl) return; #endif char *proxy = 0; uint32_t length = 0; #if NPAPI_VERSION != 190 NPN_GetValueForURL(_instance, NPNURLVProxy, url.c_str(), &proxy, &length); #endif if (!p...
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,593
nsPluginInstance::startProc() { int p2c_pipe[2]; int c2p_pipe[2]; int p2c_controlpipe[2]; int ret = socketpair(AF_UNIX, SOCK_STREAM, 0, p2c_pipe); if (ret == -1) { gnash::log_error("socketpair(p2c) failed: %s", strerror(errno)); return NPERR_GENERIC_ERROR; } _streamfd = p2c...
+Info
0
nsPluginInstance::startProc() { int p2c_pipe[2]; int c2p_pipe[2]; int p2c_controlpipe[2]; int ret = socketpair(AF_UNIX, SOCK_STREAM, 0, p2c_pipe); if (ret == -1) { gnash::log_error("socketpair(p2c) failed: %s", strerror(errno)); return NPERR_GENERIC_ERROR; } _streamfd = p2c...
@@ -1108,6 +1108,7 @@ nsPluginInstance::setupCookies(const std::string& pageurl) ss << "/tmp/gnash-cookies." << getpid(); cookiefile.open(ss.str().c_str(), std::ios::out | std::ios::trunc); + chmod (ss.str().c_str(), 0600); // Firefox provides cookies in the following format: //
CWE-264
null
null
10,594
FT_Create_Class_cff_field_handlers( FT_Library library, CFF_Field_Handler** output_class ) { CFF_Field_Handler* clazz = NULL; FT_Error error; FT_Memory memory = library->memory; int i = 0; #undef CFF_FIELD #define CFF_FIELD(...
Overflow
0
FT_Create_Class_cff_field_handlers( FT_Library library, CFF_Field_Handler** output_class ) { CFF_Field_Handler* clazz = NULL; FT_Error error; FT_Memory memory = library->memory; int i = 0; #undef CFF_FIELD #define CFF_FIELD(...
@@ -1422,13 +1422,17 @@ /* and look for it in our current list. */ FT_UInt code; - FT_UInt num_args = (FT_UInt) - ( parser->top - parser->stack ); + FT_UInt num_...
CWE-787
null
null
10,595
FT_Destroy_Class_cff_field_handlers( FT_Library library, CFF_Field_Handler* clazz ) { FT_Memory memory = library->memory; if ( clazz ) FT_FREE( clazz ); }
Overflow
0
FT_Destroy_Class_cff_field_handlers( FT_Library library, CFF_Field_Handler* clazz ) { FT_Memory memory = library->memory; if ( clazz ) FT_FREE( clazz ); }
@@ -1422,13 +1422,17 @@ /* and look for it in our current list. */ FT_UInt code; - FT_UInt num_args = (FT_UInt) - ( parser->top - parser->stack ); + FT_UInt num_...
CWE-787
null
null
10,596
cff_parse_cid_ros( CFF_Parser parser ) { CFF_FontRecDict dict = (CFF_FontRecDict)parser->object; FT_Byte** data = parser->stack; FT_Error error; error = FT_ERR( Stack_Underflow ); if ( parser->top >= parser->stack + 3 ) { dict->cid_registry = (FT_UInt)cff_parse_num(...
Overflow
0
cff_parse_cid_ros( CFF_Parser parser ) { CFF_FontRecDict dict = (CFF_FontRecDict)parser->object; FT_Byte** data = parser->stack; FT_Error error; error = FT_ERR( Stack_Underflow ); if ( parser->top >= parser->stack + 3 ) { dict->cid_registry = (FT_UInt)cff_parse_num(...
@@ -1422,13 +1422,17 @@ /* and look for it in our current list. */ FT_UInt code; - FT_UInt num_args = (FT_UInt) - ( parser->top - parser->stack ); + FT_UInt num_...
CWE-787
null
null
10,597
cff_parse_fixed( CFF_Parser parser, FT_Byte** d ) { return do_fixed( parser, d, 0 ); }
Overflow
0
cff_parse_fixed( CFF_Parser parser, FT_Byte** d ) { return do_fixed( parser, d, 0 ); }
@@ -1422,13 +1422,17 @@ /* and look for it in our current list. */ FT_UInt code; - FT_UInt num_args = (FT_UInt) - ( parser->top - parser->stack ); + FT_UInt num_...
CWE-787
null
null
10,598
cff_parse_fixed_scaled( CFF_Parser parser, FT_Byte** d, FT_Long scaling ) { return do_fixed( parser, d, scaling ); }
Overflow
0
cff_parse_fixed_scaled( CFF_Parser parser, FT_Byte** d, FT_Long scaling ) { return do_fixed( parser, d, scaling ); }
@@ -1422,13 +1422,17 @@ /* and look for it in our current list. */ FT_UInt code; - FT_UInt num_args = (FT_UInt) - ( parser->top - parser->stack ); + FT_UInt num_...
CWE-787
null
null
10,599
cff_parse_font_bbox( CFF_Parser parser ) { CFF_FontRecDict dict = (CFF_FontRecDict)parser->object; FT_BBox* bbox = &dict->font_bbox; FT_Byte** data = parser->stack; FT_Error error; error = FT_ERR( Stack_Underflow ); if ( parser->top >= parser->stack + 4 ) { ...
Overflow
0
cff_parse_font_bbox( CFF_Parser parser ) { CFF_FontRecDict dict = (CFF_FontRecDict)parser->object; FT_BBox* bbox = &dict->font_bbox; FT_Byte** data = parser->stack; FT_Error error; error = FT_ERR( Stack_Underflow ); if ( parser->top >= parser->stack + 4 ) { ...
@@ -1422,13 +1422,17 @@ /* and look for it in our current list. */ FT_UInt code; - FT_UInt num_args = (FT_UInt) - ( parser->top - parser->stack ); + FT_UInt num_...
CWE-787
null
null