idx
int64
func_before
string
Vulnerability Classification
string
vul
int64
func_after
string
patch
string
CWE ID
string
lines_before
string
lines_after
string
34,600
static void oz_hcd_shutdown(struct usb_hcd *hcd) { }
DoS Exec Code
0
static void oz_hcd_shutdown(struct usb_hcd *hcd) { }
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,601
static int oz_hcd_start(struct usb_hcd *hcd) { hcd->power_budget = 200; hcd->state = HC_STATE_RUNNING; hcd->uses_new_polling = 1; return 0; }
DoS Exec Code
0
static int oz_hcd_start(struct usb_hcd *hcd) { hcd->power_budget = 200; hcd->state = HC_STATE_RUNNING; hcd->uses_new_polling = 1; return 0; }
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,602
static void oz_hcd_stop(struct usb_hcd *hcd) { }
DoS Exec Code
0
static void oz_hcd_stop(struct usb_hcd *hcd) { }
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,603
void oz_hcd_term(void) { msleep(OZ_HUB_DEBOUNCE_TIMEOUT); tasklet_kill(&g_urb_process_tasklet); tasklet_kill(&g_urb_cancel_tasklet); platform_device_unregister(g_plat_dev); platform_driver_unregister(&g_oz_plat_drv); oz_dbg(ON, "Pending urbs:%d\n", atomic_read(&g_pending_urbs)); kmem_cache_destroy(oz_urb_link_ca...
DoS Exec Code
0
void oz_hcd_term(void) { msleep(OZ_HUB_DEBOUNCE_TIMEOUT); tasklet_kill(&g_urb_process_tasklet); tasklet_kill(&g_urb_cancel_tasklet); platform_device_unregister(g_plat_dev); platform_driver_unregister(&g_oz_plat_drv); oz_dbg(ON, "Pending urbs:%d\n", atomic_read(&g_pending_urbs)); kmem_cache_destroy(oz_urb_link_ca...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,604
static int oz_plat_probe(struct platform_device *dev) { int i; int err; struct usb_hcd *hcd; struct oz_hcd *ozhcd; hcd = usb_create_hcd(&g_oz_hc_drv, &dev->dev, dev_name(&dev->dev)); if (hcd == NULL) { oz_dbg(ON, "Failed to created hcd object OK\n"); return -ENOMEM; } ozhcd = oz_hcd_private(hcd); memset(o...
DoS Exec Code
0
static int oz_plat_probe(struct platform_device *dev) { int i; int err; struct usb_hcd *hcd; struct oz_hcd *ozhcd; hcd = usb_create_hcd(&g_oz_hc_drv, &dev->dev, dev_name(&dev->dev)); if (hcd == NULL) { oz_dbg(ON, "Failed to created hcd object OK\n"); return -ENOMEM; } ozhcd = oz_hcd_private(hcd); memset(o...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,605
static int oz_plat_resume(struct platform_device *dev) { return 0; }
DoS Exec Code
0
static int oz_plat_resume(struct platform_device *dev) { return 0; }
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,606
static void oz_process_ep0_urb(struct oz_hcd *ozhcd, struct urb *urb, gfp_t mem_flags) { struct usb_ctrlrequest *setup; unsigned windex; unsigned wvalue; unsigned wlength; void *hpd; u8 req_id; int rc = 0; unsigned complete = 0; int port_ix = -1; struct oz_port *port = NULL; oz_dbg(URB, "[%s]:(%p)\n", __...
DoS Exec Code
0
static void oz_process_ep0_urb(struct oz_hcd *ozhcd, struct urb *urb, gfp_t mem_flags) { struct usb_ctrlrequest *setup; unsigned windex; unsigned wvalue; unsigned wlength; void *hpd; u8 req_id; int rc = 0; unsigned complete = 0; int port_ix = -1; struct oz_port *port = NULL; oz_dbg(URB, "[%s]:(%p)\n", __...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,607
static struct oz_urb_link *oz_remove_urb(struct oz_endpoint *ep, struct urb *urb) { struct oz_urb_link *urbl; if (unlikely(ep == NULL)) return NULL; list_for_each_entry(urbl, &ep->urb_list, link) { if (urbl->urb == urb) { list_del_init(&urbl->link); if (usb_pipeisoc(urb->pipe)) { ep->credit -= ur...
DoS Exec Code
0
static struct oz_urb_link *oz_remove_urb(struct oz_endpoint *ep, struct urb *urb) { struct oz_urb_link *urbl; if (unlikely(ep == NULL)) return NULL; list_for_each_entry(urbl, &ep->urb_list, link) { if (urbl->urb == urb) { list_del_init(&urbl->link); if (usb_pipeisoc(urb->pipe)) { ep->credit -= ur...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,608
static int oz_set_port_feature(struct usb_hcd *hcd, u16 wvalue, u16 windex) { struct oz_port *port; u8 port_id = (u8)windex; struct oz_hcd *ozhcd = oz_hcd_private(hcd); unsigned set_bits = 0; unsigned clear_bits = 0; if ((port_id < 1) || (port_id > OZ_NB_PORTS)) return -EPIPE; port = &ozhcd->ports[port_id-1];...
DoS Exec Code
0
static int oz_set_port_feature(struct usb_hcd *hcd, u16 wvalue, u16 windex) { struct oz_port *port; u8 port_id = (u8)windex; struct oz_hcd *ozhcd = oz_hcd_private(hcd); unsigned set_bits = 0; unsigned clear_bits = 0; if ((port_id < 1) || (port_id > OZ_NB_PORTS)) return -EPIPE; port = &ozhcd->ports[port_id-1];...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,609
static void oz_urb_cancel(struct oz_port *port, u8 ep_num, struct urb *urb) { struct oz_urb_link *urbl = NULL; struct list_head *e; struct oz_hcd *ozhcd; unsigned long irq_state; u8 ix; if (port == NULL) { oz_dbg(ON, "%s: ERROR: (%p) port is null\n", __func__, urb); return; } ozhcd = port->ozhcd; if (ozhc...
DoS Exec Code
0
static void oz_urb_cancel(struct oz_port *port, u8 ep_num, struct urb *urb) { struct oz_urb_link *urbl = NULL; struct list_head *e; struct oz_hcd *ozhcd; unsigned long irq_state; u8 ix; if (port == NULL) { oz_dbg(ON, "%s: ERROR: (%p) port is null\n", __func__, urb); return; } ozhcd = port->ozhcd; if (ozhc...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,610
static void oz_urb_cancel_tasklet(unsigned long unused) { unsigned long irq_state; struct urb *urb; struct oz_urb_link *urbl, *n; struct oz_hcd *ozhcd = oz_hcd_claim(); if (ozhcd == NULL) return; spin_lock_irqsave(&g_tasklet_lock, irq_state); list_for_each_entry_safe(urbl, n, &ozhcd->urb_cancel_list, link) { ...
DoS Exec Code
0
static void oz_urb_cancel_tasklet(unsigned long unused) { unsigned long irq_state; struct urb *urb; struct oz_urb_link *urbl, *n; struct oz_hcd *ozhcd = oz_hcd_claim(); if (ozhcd == NULL) return; spin_lock_irqsave(&g_tasklet_lock, irq_state); list_for_each_entry_safe(urbl, n, &ozhcd->urb_cancel_list, link) { ...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,611
static int oz_urb_process(struct oz_hcd *ozhcd, struct urb *urb) { int rc = 0; struct oz_port *port = urb->hcpriv; u8 ep_addr; /* When we are paranoid we keep a list of urbs which we check against * before handing one back. This is just for debugging during * development and should be turned off in the release...
DoS Exec Code
0
static int oz_urb_process(struct oz_hcd *ozhcd, struct urb *urb) { int rc = 0; struct oz_port *port = urb->hcpriv; u8 ep_addr; /* When we are paranoid we keep a list of urbs which we check against * before handing one back. This is just for debugging during * development and should be turned off in the release...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,612
static void oz_urb_process_tasklet(unsigned long unused) { unsigned long irq_state; struct urb *urb; struct oz_hcd *ozhcd = oz_hcd_claim(); struct oz_urb_link *urbl, *n; int rc = 0; if (ozhcd == NULL) return; /* This is called from a tasklet so is in softirq context but the urb * list is filled from any con...
DoS Exec Code
0
static void oz_urb_process_tasklet(unsigned long unused) { unsigned long irq_state; struct urb *urb; struct oz_hcd *ozhcd = oz_hcd_claim(); struct oz_urb_link *urbl, *n; int rc = 0; if (ozhcd == NULL) return; /* This is called from a tasklet so is in softirq context but the urb * list is filled from any con...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,613
static inline int oz_usb_get_frame_number(void) { return atomic_inc_return(&g_usb_frame_number); }
DoS Exec Code
0
static inline int oz_usb_get_frame_number(void) { return atomic_inc_return(&g_usb_frame_number); }
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,614
static byte cencrypt(byte plain) { byte cipher; /* Thanks to Tom Kacvinsky <tjk@ams.org> who reported that lenIV == -1 means unencrypted charstrings. */ if (lenIV < 0) return plain; cipher = (byte)(plain ^ (cr >> 8)); cr = (uint16_t)((cipher + cr) * c1 + c2); return cipher; }
DoS Exec Code Overflow
0
static byte cencrypt(byte plain) { byte cipher; /* Thanks to Tom Kacvinsky <tjk@ams.org> who reported that lenIV == -1 means unencrypted charstrings. */ if (lenIV < 0) return plain; cipher = (byte)(plain ^ (cr >> 8)); cr = (uint16_t)((cipher + cr) * c1 + c2); return cipher; }
@@ -66,6 +66,7 @@ #include <errno.h> #include <lcdf/clp.h> #include "t1lib.h" +#include "t1asmhelp.h" #define LINESIZE 512 @@ -90,10 +91,6 @@ static int in_eexec = 0; /* need to add 1 as space for \0 */ static char line[LINESIZE + 1]; -/* lenIV and charstring start command */ -static int lenIV = 4; -static ...
CWE-119
null
null
34,615
static void charstring_byte(int v) { byte b = (byte)(v & 0xff); if (charstring_bp - charstring_buf == charstring_bufsiz) { charstring_bufsiz *= 2; if (!(charstring_buf = (byte *) realloc(charstring_buf, charstring_bufsiz))) fatal_error("out of memory"); charstring_bp = charstring_buf + charstring_...
DoS Exec Code Overflow
0
static void charstring_byte(int v) { byte b = (byte)(v & 0xff); if (charstring_bp - charstring_buf == charstring_bufsiz) { charstring_bufsiz *= 2; if (!(charstring_buf = (byte *) realloc(charstring_buf, charstring_bufsiz))) fatal_error("out of memory"); charstring_bp = charstring_buf + charstring_...
@@ -66,6 +66,7 @@ #include <errno.h> #include <lcdf/clp.h> #include "t1lib.h" +#include "t1asmhelp.h" #define LINESIZE 512 @@ -90,10 +91,6 @@ static int in_eexec = 0; /* need to add 1 as space for \0 */ static char line[LINESIZE + 1]; -/* lenIV and charstring start command */ -static int lenIV = 4; -static ...
CWE-119
null
null
34,616
static void charstring_end(void) { byte *bp; sprintf(line, "%d ", (int) (charstring_bp - charstring_buf)); eexec_string(line); sprintf(line, "%s ", cs_start); eexec_string(line); for (bp = charstring_buf; bp < charstring_bp; bp++) eexec_byte(*bp); }
DoS Exec Code Overflow
0
static void charstring_end(void) { byte *bp; sprintf(line, "%d ", (int) (charstring_bp - charstring_buf)); eexec_string(line); sprintf(line, "%s ", cs_start); eexec_string(line); for (bp = charstring_buf; bp < charstring_bp; bp++) eexec_byte(*bp); }
@@ -66,6 +66,7 @@ #include <errno.h> #include <lcdf/clp.h> #include "t1lib.h" +#include "t1asmhelp.h" #define LINESIZE 512 @@ -90,10 +91,6 @@ static int in_eexec = 0; /* need to add 1 as space for \0 */ static char line[LINESIZE + 1]; -/* lenIV and charstring start command */ -static int lenIV = 4; -static ...
CWE-119
null
null
34,617
static void charstring_int(int num) { int x; if (num >= -107 && num <= 107) { charstring_byte(num + 139); } else if (num >= 108 && num <= 1131) { x = num - 108; charstring_byte(x / 256 + 247); charstring_byte(x % 256); } else if (num >= -1131 && num <= -108) { x = abs(num) - 108; charst...
DoS Exec Code Overflow
0
static void charstring_int(int num) { int x; if (num >= -107 && num <= 107) { charstring_byte(num + 139); } else if (num >= 108 && num <= 1131) { x = num - 108; charstring_byte(x / 256 + 247); charstring_byte(x % 256); } else if (num >= -1131 && num <= -108) { x = abs(num) - 108; charst...
@@ -66,6 +66,7 @@ #include <errno.h> #include <lcdf/clp.h> #include "t1lib.h" +#include "t1asmhelp.h" #define LINESIZE 512 @@ -90,10 +91,6 @@ static int in_eexec = 0; /* need to add 1 as space for \0 */ static char line[LINESIZE + 1]; -/* lenIV and charstring start command */ -static int lenIV = 4; -static ...
CWE-119
null
null
34,618
static void charstring_start(void) { int i; if (!charstring_buf) { charstring_bufsiz = 65536; if (!(charstring_buf = (byte *) malloc(charstring_bufsiz))) fatal_error("out of memory"); } charstring_bp = charstring_buf; cr = 4330; for (i = 0; i < lenIV; i++) *charstring_bp++ = cencrypt((by...
DoS Exec Code Overflow
0
static void charstring_start(void) { int i; if (!charstring_buf) { charstring_bufsiz = 65536; if (!(charstring_buf = (byte *) malloc(charstring_bufsiz))) fatal_error("out of memory"); } charstring_bp = charstring_buf; cr = 4330; for (i = 0; i < lenIV; i++) *charstring_bp++ = cencrypt((by...
@@ -66,6 +66,7 @@ #include <errno.h> #include <lcdf/clp.h> #include "t1lib.h" +#include "t1asmhelp.h" #define LINESIZE 512 @@ -90,10 +91,6 @@ static int in_eexec = 0; /* need to add 1 as space for \0 */ static char line[LINESIZE + 1]; -/* lenIV and charstring start command */ -static int lenIV = 4; -static ...
CWE-119
null
null
34,619
static byte eencrypt(byte plain) { byte cipher; cipher = (byte)(plain ^ (er >> 8)); er = (uint16_t)((cipher + er) * c1 + c2); return cipher; }
DoS Exec Code Overflow
0
static byte eencrypt(byte plain) { byte cipher; cipher = (byte)(plain ^ (er >> 8)); er = (uint16_t)((cipher + er) * c1 + c2); return cipher; }
@@ -66,6 +66,7 @@ #include <errno.h> #include <lcdf/clp.h> #include "t1lib.h" +#include "t1asmhelp.h" #define LINESIZE 512 @@ -90,10 +91,6 @@ static int in_eexec = 0; /* need to add 1 as space for \0 */ static char line[LINESIZE + 1]; -/* lenIV and charstring start command */ -static int lenIV = 4; -static ...
CWE-119
null
null
34,620
static void eexec_byte(byte b) { if (in_eexec) output_byte(eencrypt(b)); else output_byte(b); }
DoS Exec Code Overflow
0
static void eexec_byte(byte b) { if (in_eexec) output_byte(eencrypt(b)); else output_byte(b); }
@@ -66,6 +66,7 @@ #include <errno.h> #include <lcdf/clp.h> #include "t1lib.h" +#include "t1asmhelp.h" #define LINESIZE 512 @@ -90,10 +91,6 @@ static int in_eexec = 0; /* need to add 1 as space for \0 */ static char line[LINESIZE + 1]; -/* lenIV and charstring start command */ -static int lenIV = 4; -static ...
CWE-119
null
null
34,621
static void eexec_end(void) { int i, j; if (!pfb) putc('\n', ofp); else if (w.blocktyp != PFB_ASCII) { pfb_writer_output_block(&w); w.blocktyp = PFB_ASCII; } in_eexec = active = 0; for (i = 0; i < 8; i++) { for (j = 0; j < 64; j++) eexec_byte('0'); eexec_byte('\n'); } }
DoS Exec Code Overflow
0
static void eexec_end(void) { int i, j; if (!pfb) putc('\n', ofp); else if (w.blocktyp != PFB_ASCII) { pfb_writer_output_block(&w); w.blocktyp = PFB_ASCII; } in_eexec = active = 0; for (i = 0; i < 8; i++) { for (j = 0; j < 64; j++) eexec_byte('0'); eexec_byte('\n'); } }
@@ -66,6 +66,7 @@ #include <errno.h> #include <lcdf/clp.h> #include "t1lib.h" +#include "t1asmhelp.h" #define LINESIZE 512 @@ -90,10 +91,6 @@ static int in_eexec = 0; /* need to add 1 as space for \0 */ static char line[LINESIZE + 1]; -/* lenIV and charstring start command */ -static int lenIV = 4; -static ...
CWE-119
null
null
34,622
static void eexec_start(char *string) { eexec_string("currentfile eexec\n"); if (pfb && w.blocktyp != PFB_BINARY) { pfb_writer_output_block(&w); w.blocktyp = PFB_BINARY; } in_eexec = 1; er = 55665; eexec_byte(0); eexec_byte(0); eexec_byte(0); eexec_byte(0); eexec_string(string); }
DoS Exec Code Overflow
0
static void eexec_start(char *string) { eexec_string("currentfile eexec\n"); if (pfb && w.blocktyp != PFB_BINARY) { pfb_writer_output_block(&w); w.blocktyp = PFB_BINARY; } in_eexec = 1; er = 55665; eexec_byte(0); eexec_byte(0); eexec_byte(0); eexec_byte(0); eexec_string(string); }
@@ -66,6 +66,7 @@ #include <errno.h> #include <lcdf/clp.h> #include "t1lib.h" +#include "t1asmhelp.h" #define LINESIZE 512 @@ -90,10 +91,6 @@ static int in_eexec = 0; /* need to add 1 as space for \0 */ static char line[LINESIZE + 1]; -/* lenIV and charstring start command */ -static int lenIV = 4; -static ...
CWE-119
null
null
34,623
static void eexec_string(const char *string) { while (*string) eexec_byte(*string++); }
DoS Exec Code Overflow
0
static void eexec_string(const char *string) { while (*string) eexec_byte(*string++); }
@@ -66,6 +66,7 @@ #include <errno.h> #include <lcdf/clp.h> #include "t1lib.h" +#include "t1asmhelp.h" #define LINESIZE 512 @@ -90,10 +91,6 @@ static int in_eexec = 0; /* need to add 1 as space for \0 */ static char line[LINESIZE + 1]; -/* lenIV and charstring start command */ -static int lenIV = 4; -static ...
CWE-119
null
null
34,624
error(const char *message, ...) { va_list val; va_start(val, message); fprintf(stderr, "%s: ", program_name); vfprintf(stderr, message, val); putc('\n', stderr); va_end(val); }
DoS Exec Code Overflow
0
error(const char *message, ...) { va_list val; va_start(val, message); fprintf(stderr, "%s: ", program_name); vfprintf(stderr, message, val); putc('\n', stderr); va_end(val); }
@@ -66,6 +66,7 @@ #include <errno.h> #include <lcdf/clp.h> #include "t1lib.h" +#include "t1asmhelp.h" #define LINESIZE 512 @@ -90,10 +91,6 @@ static int in_eexec = 0; /* need to add 1 as space for \0 */ static char line[LINESIZE + 1]; -/* lenIV and charstring start command */ -static int lenIV = 4; -static ...
CWE-119
null
null
34,625
fatal_error(const char *message, ...) { va_list val; va_start(val, message); fprintf(stderr, "%s: ", program_name); vfprintf(stderr, message, val); putc('\n', stderr); va_end(val); exit(1); }
DoS Exec Code Overflow
0
fatal_error(const char *message, ...) { va_list val; va_start(val, message); fprintf(stderr, "%s: ", program_name); vfprintf(stderr, message, val); putc('\n', stderr); va_end(val); exit(1); }
@@ -66,6 +66,7 @@ #include <errno.h> #include <lcdf/clp.h> #include "t1lib.h" +#include "t1asmhelp.h" #define LINESIZE 512 @@ -90,10 +91,6 @@ static int in_eexec = 0; /* need to add 1 as space for \0 */ static char line[LINESIZE + 1]; -/* lenIV and charstring start command */ -static int lenIV = 4; -static ...
CWE-119
null
null
34,626
static void get_charstring_token(void) { int c = getc(ifp); while (isspace(c)) c = getc(ifp); if (c == '%') { while (c != EOF && c != '\r' && c != '\n') c = getc(ifp); get_charstring_token(); } else if (c == '}') { line[0] = '}';
DoS Exec Code Overflow
0
static void get_charstring_token(void) { int c = getc(ifp); while (isspace(c)) c = getc(ifp); if (c == '%') { while (c != EOF && c != '\r' && c != '\n') c = getc(ifp); get_charstring_token(); } else if (c == '}') { line[0] = '}';
@@ -66,6 +66,7 @@ #include <errno.h> #include <lcdf/clp.h> #include "t1lib.h" +#include "t1asmhelp.h" #define LINESIZE 512 @@ -90,10 +91,6 @@ static int in_eexec = 0; /* need to add 1 as space for \0 */ static char line[LINESIZE + 1]; -/* lenIV and charstring start command */ -static int lenIV = 4; -static ...
CWE-119
null
null
34,627
CLASS DCRaw() { order=0; /* Suppress valgrind error. */ shot_select=0, multi_out=0, aber[0] = aber[1] = aber[2] = aber[3] = 1; gamm[0] = 0.45, gamm[1] = 4.5, gamm[2] = gamm[3] = gamm[4] = gamm[5] = 0; bright=1, user_mul[0] = user_mul[1] = user_mul[2] = user_mul[3] = 0; threshold=0, half_size=0, four_color_rgb=0, docume...
DoS Overflow
0
CLASS DCRaw() { order=0; /* Suppress valgrind error. */ shot_select=0, multi_out=0, aber[0] = aber[1] = aber[2] = aber[3] = 1; gamm[0] = 0.45, gamm[1] = 4.5, gamm[2] = gamm[3] = gamm[4] = gamm[5] = 0; bright=1, user_mul[0] = user_mul[1] = user_mul[2] = user_mul[3] = 0; threshold=0, half_size=0, four_color_rgb=0, docume...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,628
void CLASS adobe_coeff (const char *make, const char *model) { static const struct { const char *prefix; short black, maximum, trans[12]; } table[] = { { "AGFAPHOTO DC-833m", 0, 0, /* DJC */ { 11438,-3762,-1115,-2409,9914,2497,-1227,2295,5300 } }, { "Apple QuickTake", 0, 0, /* DJC */ { 21392,-565...
DoS Overflow
0
void CLASS adobe_coeff (const char *make, const char *model) { static const struct { const char *prefix; short black, maximum, trans[12]; } table[] = { { "AGFAPHOTO DC-833m", 0, 0, /* DJC */ { 11438,-3762,-1115,-2409,9914,2497,-1227,2295,5300 } }, { "Apple QuickTake", 0, 0, /* DJC */ { 21392,-565...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,629
void CLASS adobe_dng_load_raw_lj() { unsigned save, trow=0, tcol=0, jwide, jrow, jcol, row, col; struct jhead jh; ushort *rp; while (trow < raw_height) { save = ftell(ifp); if (tile_length < INT_MAX) fseek (ifp, get4(), SEEK_SET); if (!ljpeg_start (&jh, 0)) break; jwide = jh.wide; if ...
DoS Overflow
0
void CLASS adobe_dng_load_raw_lj() { unsigned save, trow=0, tcol=0, jwide, jrow, jcol, row, col; struct jhead jh; ushort *rp; while (trow < raw_height) { save = ftell(ifp); if (tile_length < INT_MAX) fseek (ifp, get4(), SEEK_SET); if (!ljpeg_start (&jh, 0)) break; jwide = jh.wide; if ...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,630
void CLASS adobe_dng_load_raw_nc() { ushort *pixel, *rp; unsigned row, col; pixel = (ushort *) calloc (raw_width * tiff_samples, sizeof *pixel); merror (pixel, "adobe_dng_load_raw_nc()"); for (row=0; row < raw_height; row++) { if (tiff_bps == 16) read_shorts (pixel, raw_width * tiff_samples); e...
DoS Overflow
0
void CLASS adobe_dng_load_raw_nc() { ushort *pixel, *rp; unsigned row, col; pixel = (ushort *) calloc (raw_width * tiff_samples, sizeof *pixel); merror (pixel, "adobe_dng_load_raw_nc()"); for (row=0; row < raw_height; row++) { if (tiff_bps == 16) read_shorts (pixel, raw_width * tiff_samples); e...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,631
void CLASS ahd_interpolate() { int i, j, k, top, left, row, col, tr, tc, c, d, val, hm[2]; ushort (*pix)[4], (*rix)[3]; static const int dir[4] = { -1, 1, -TS, TS }; unsigned ldiff[2][4], abdiff[2][4], leps, abeps; float r, cbrt[0x10000], xyz[3], xyz_cam[3][4]; ushort (*rgb)[TS][TS][3]; short (*lab)[TS][...
DoS Overflow
0
void CLASS ahd_interpolate() { int i, j, k, top, left, row, col, tr, tc, c, d, val, hm[2]; ushort (*pix)[4], (*rix)[3]; static const int dir[4] = { -1, 1, -TS, TS }; unsigned ldiff[2][4], abdiff[2][4], leps, abeps; float r, cbrt[0x10000], xyz[3], xyz_cam[3][4]; ushort (*rgb)[TS][TS][3]; short (*lab)[TS][...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,632
void CLASS apply_profile (const char *input, const char *output) { char *prof; cmsHPROFILE hInProfile=0, hOutProfile=0; cmsHTRANSFORM hTransform; FILE *fp; unsigned size; if (strcmp (input, "embed")) hInProfile = cmsOpenProfileFromFile (input, "r"); else if (profile_length) { prof = (char *) mall...
DoS Overflow
0
void CLASS apply_profile (const char *input, const char *output) { char *prof; cmsHPROFILE hInProfile=0, hOutProfile=0; cmsHTRANSFORM hTransform; FILE *fp; unsigned size; if (strcmp (input, "embed")) hInProfile = cmsOpenProfileFromFile (input, "r"); else if (profile_length) { prof = (char *) mall...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,633
void CLASS apply_tiff() { int max_samp=0, raw=-1, thm=-1, i; struct jhead jh; thumb_misc = 16; if (thumb_offset) { fseek (ifp, thumb_offset, SEEK_SET); if (ljpeg_start (&jh, 1)) { thumb_misc = jh.bits; thumb_width = jh.wide; thumb_height = jh.high; } } for (i=0; i < (int) t...
DoS Overflow
0
void CLASS apply_tiff() { int max_samp=0, raw=-1, thm=-1, i; struct jhead jh; thumb_misc = 16; if (thumb_offset) { fseek (ifp, thumb_offset, SEEK_SET); if (ljpeg_start (&jh, 1)) { thumb_misc = jh.bits; thumb_width = jh.wide; thumb_height = jh.high; } } for (i=0; i < (int) t...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,634
void CLASS bad_pixels (const char *cfname) { FILE *fp=0; char *fname, *cp, line[128]; int len, time, row, col, r, c, rad, tot, n, fixed=0; if (!filters) return; if (cfname) fp = fopen (cfname, "r"); else { for (len=32 ; ; len *= 2) { fname = (char *) malloc (len); if (!fname) return; ...
DoS Overflow
0
void CLASS bad_pixels (const char *cfname) { FILE *fp=0; char *fname, *cp, line[128]; int len, time, row, col, r, c, rad, tot, n, fixed=0; if (!filters) return; if (cfname) fp = fopen (cfname, "r"); else { for (len=32 ; ; len *= 2) { fname = (char *) malloc (len); if (!fname) return; ...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,635
int CLASS bayer (unsigned row, unsigned col) { return (row < height && col < width) ? BAYER(row,col) : 0; }
DoS Overflow
0
int CLASS bayer (unsigned row, unsigned col) { return (row < height && col < width) ? BAYER(row,col) : 0; }
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,636
void CLASS blend_highlights() { int clip=INT_MAX, row, col, c, i, j; static const float trans[2][4][4] = { { { 1,1,1 }, { 1.7320508,-1.7320508,0 }, { -1,-1,2 } }, { { 1,1,1,1 }, { 1,-1,1,-1 }, { 1,1,-1,-1 }, { 1,-1,-1,1 } } }; static const float itrans[2][4][4] = { { { 1,0.8660254,-0.5 }, { 1,-0.8660254,-...
DoS Overflow
0
void CLASS blend_highlights() { int clip=INT_MAX, row, col, c, i, j; static const float trans[2][4][4] = { { { 1,1,1 }, { 1.7320508,-1.7320508,0 }, { -1,-1,2 } }, { { 1,1,1,1 }, { 1,-1,1,-1 }, { 1,1,-1,-1 }, { 1,-1,-1,1 } } }; static const float itrans[2][4][4] = { { { 1,0.8660254,-0.5 }, { 1,-0.8660254,-...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,637
void CLASS border_interpolate (int border) { int row, col, y, x, f, c, sum[8]; for (row=0; row < height; row++) for (col=0; col < width; col++) { if (col==border && row >= border && row < height-border) col = width-border; memset (sum, 0, sizeof sum); for (y=row-1; y != row+2; y++) for (x=c...
DoS Overflow
0
void CLASS border_interpolate (int border) { int row, col, y, x, f, c, sum[8]; for (row=0; row < height; row++) for (col=0; col < width; col++) { if (col==border && row >= border && row < height-border) col = width-border; memset (sum, 0, sizeof sum); for (y=row-1; y != row+2; y++) for (x=c...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,638
void CLASS cam_xyz_coeff (double cam_xyz[4][3]) { double cam_rgb[4][3], inverse[4][3], num; int i, j, k; for (i=0; i < colors; i++) /* Multiply out XYZ colorspace */ for (j=0; j < 3; j++) for (cam_rgb[i][j] = k=0; k < 3; k++) cam_rgb[i][j] += cam_xyz[i][k] * xyz_rgb[k][j]; for (i=0; i < colors; i+...
DoS Overflow
0
void CLASS cam_xyz_coeff (double cam_xyz[4][3]) { double cam_rgb[4][3], inverse[4][3], num; int i, j, k; for (i=0; i < colors; i++) /* Multiply out XYZ colorspace */ for (j=0; j < 3; j++) for (cam_rgb[i][j] = k=0; k < 3; k++) cam_rgb[i][j] += cam_xyz[i][k] * xyz_rgb[k][j]; for (i=0; i < colors; i+...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,639
void CLASS canon_600_auto_wb() { int mar, row, col, i, j, st, count[] = { 0,0 }; int test[8], total[2][8], ratio[2][2], stat[2]; memset (&total, 0, sizeof total); i = canon_ev + 0.5; if (i < 10) mar = 150; else if (i > 12) mar = 20; else mar = 280 - 20 * i; if (flash_used) mar = 80; for (row=14;...
DoS Overflow
0
void CLASS canon_600_auto_wb() { int mar, row, col, i, j, st, count[] = { 0,0 }; int test[8], total[2][8], ratio[2][2], stat[2]; memset (&total, 0, sizeof total); i = canon_ev + 0.5; if (i < 10) mar = 150; else if (i > 12) mar = 20; else mar = 280 - 20 * i; if (flash_used) mar = 80; for (row=14;...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,640
void CLASS canon_600_coeff() { static const short table[6][12] = { { -190,702,-1878,2390, 1861,-1349,905,-393, -432,944,2617,-2105 }, { -1203,1715,-1136,1648, 1388,-876,267,245, -1641,2153,3921,-3409 }, { -615,1127,-1563,2075, 1437,-925,509,3, -756,1268,2519,-2007 }, { -190,702,-1886,2398, ...
DoS Overflow
0
void CLASS canon_600_coeff() { static const short table[6][12] = { { -190,702,-1878,2390, 1861,-1349,905,-393, -432,944,2617,-2105 }, { -1203,1715,-1136,1648, 1388,-876,267,245, -1641,2153,3921,-3409 }, { -615,1127,-1563,2075, 1437,-925,509,3, -756,1268,2519,-2007 }, { -190,702,-1886,2398, ...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,641
void CLASS canon_600_fixed_wb (int temp) { static const short mul[4][5] = { { 667, 358,397,565,452 }, { 731, 390,367,499,517 }, { 1119, 396,348,448,537 }, { 1399, 485,431,508,688 } }; int lo, hi, i; float frac=0; for (lo=4; --lo; ) if (*mul[lo] <= temp) break; for (hi=0; hi < 3; hi++) ...
DoS Overflow
0
void CLASS canon_600_fixed_wb (int temp) { static const short mul[4][5] = { { 667, 358,397,565,452 }, { 731, 390,367,499,517 }, { 1119, 396,348,448,537 }, { 1399, 485,431,508,688 } }; int lo, hi, i; float frac=0; for (lo=4; --lo; ) if (*mul[lo] <= temp) break; for (hi=0; hi < 3; hi++) ...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,642
void CLASS canon_600_load_raw() { uchar data[1120], *dp; ushort pixel[896], *pix; int irow, row, col, val; static const short mul[4][2] = { { 1141,1145 }, { 1128,1109 }, { 1178,1149 }, { 1128,1109 } }; for (irow=row=0; irow < height; irow++) { if ((int)fread (data, 1, raw_width*5/4, ifp) < raw_width*5...
DoS Overflow
0
void CLASS canon_600_load_raw() { uchar data[1120], *dp; ushort pixel[896], *pix; int irow, row, col, val; static const short mul[4][2] = { { 1141,1145 }, { 1128,1109 }, { 1178,1149 }, { 1128,1109 } }; for (irow=row=0; irow < height; irow++) { if ((int)fread (data, 1, raw_width*5/4, ifp) < raw_width*5...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,643
void CLASS canon_compressed_load_raw() { ushort *pixel, *prow, *huff[2]; int nblocks, lowbits, i, c, row, r, col, save, val; unsigned irow, icol; int block, diffbuf[64], leaf, len, diff, carry=0, pnum=0, base[2]; crw_init_tables (tiff_compress, huff); pixel = (ushort *) calloc (raw_width*8, sizeof *pixel);...
DoS Overflow
0
void CLASS canon_compressed_load_raw() { ushort *pixel, *prow, *huff[2]; int nblocks, lowbits, i, c, row, r, col, save, val; unsigned irow, icol; int block, diffbuf[64], leaf, len, diff, carry=0, pnum=0, base[2]; crw_init_tables (tiff_compress, huff); pixel = (ushort *) calloc (raw_width*8, sizeof *pixel);...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,644
int CLASS canon_has_lowbits() { uchar test[0x4000]; int ret=1, i; fseek (ifp, 0, SEEK_SET); fread (test, 1, sizeof test, ifp); for (i=540; i < (int) sizeof test - 1; i++) if (test[i] == 0xff) { if (test[i+1]) return 1; ret=0; } return ret; }
DoS Overflow
0
int CLASS canon_has_lowbits() { uchar test[0x4000]; int ret=1, i; fseek (ifp, 0, SEEK_SET); fread (test, 1, sizeof test, ifp); for (i=540; i < (int) sizeof test - 1; i++) if (test[i] == 0xff) { if (test[i+1]) return 1; ret=0; } return ret; }
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,645
int CLASS canon_s2is() { unsigned row; for (row=0; row < 100; row++) { fseek (ifp, row*3340 + 3284, SEEK_SET); if (getc(ifp) > 15) return 1; } return 0; }
DoS Overflow
0
int CLASS canon_s2is() { unsigned row; for (row=0; row < 100; row++) { fseek (ifp, row*3340 + 3284, SEEK_SET); if (getc(ifp) > 15) return 1; } return 0; }
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,646
void CLASS canon_sraw_load_raw() { struct jhead jh; short *rp=0, (*ip)[4]; int jwide, slice, scol, ecol, row, col, jrow=0, jcol=0, pix[3], c; int v[3]={0,0,0}, ver, hue; char *cp; if (!ljpeg_start (&jh, 0)) return; jwide = (jh.wide >>= 1) * jh.clrs; for (ecol=slice=0; slice <= cr2_slice[0]; slice++) {...
DoS Overflow
0
void CLASS canon_sraw_load_raw() { struct jhead jh; short *rp=0, (*ip)[4]; int jwide, slice, scol, ecol, row, col, jrow=0, jcol=0, pix[3], c; int v[3]={0,0,0}, ver, hue; char *cp; if (!ljpeg_start (&jh, 0)) return; jwide = (jh.wide >>= 1) * jh.clrs; for (ecol=slice=0; slice <= cr2_slice[0]; slice++) {...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,647
void CLASS ciff_block_1030() { static const ushort key[] = { 0x410, 0x45f3 }; int i, bpp, row, col, vbits=0; unsigned long bitbuf=0; if ((get2(),get4()) != 0x80008 || !get4()) return; bpp = get2(); if (bpp != 10 && bpp != 12) return; for (i=row=0; row < 8; row++) for (col=0; col < 8; col++) { i...
DoS Overflow
0
void CLASS ciff_block_1030() { static const ushort key[] = { 0x410, 0x45f3 }; int i, bpp, row, col, vbits=0; unsigned long bitbuf=0; if ((get2(),get4()) != 0x80008 || !get4()) return; bpp = get2(); if (bpp != 10 && bpp != 12) return; for (i=row=0; row < 8; row++) for (col=0; col < 8; col++) { i...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,648
void CLASS colorcheck() { #define NSQ 24 int cut[NSQ][4]; // you must set these static const double gmb_xyY[NSQ][3] = { { 0.400, 0.350, 10.1 }, // Dark Skin { 0.377, 0.345, 35.8 }, // Light Skin { 0.247, 0.251, 19.3 }, // Blue Sky { 0.337, 0.422, 13.3 }, // Foliage { 0.265, 0.240, 24.3 }, ...
DoS Overflow
0
void CLASS colorcheck() { #define NSQ 24 int cut[NSQ][4]; // you must set these static const double gmb_xyY[NSQ][3] = { { 0.400, 0.350, 10.1 }, // Dark Skin { 0.377, 0.345, 35.8 }, // Light Skin { 0.247, 0.251, 19.3 }, // Blue Sky { 0.337, 0.422, 13.3 }, // Foliage { 0.265, 0.240, 24.3 }, ...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,649
void CLASS convert_to_rgb() { int row, col, c, i, j, k; ushort *img; float out[3], out_cam[3][4]; double num, inverse[3][3]; static const double xyzd50_srgb[3][3] = { { 0.436083, 0.385083, 0.143055 }, { 0.222507, 0.716888, 0.060608 }, { 0.013930, 0.097097, 0.714022 } }; static const double rgb_rgb...
DoS Overflow
0
void CLASS convert_to_rgb() { int row, col, c, i, j, k; ushort *img; float out[3], out_cam[3][4]; double num, inverse[3][3]; static const double xyzd50_srgb[3][3] = { { 0.436083, 0.385083, 0.143055 }, { 0.222507, 0.716888, 0.060608 }, { 0.013930, 0.097097, 0.714022 } }; static const double rgb_rgb...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,650
void CLASS crw_init_tables (unsigned table, ushort *huff[2]) { static const uchar first_tree[3][29] = { { 0,1,4,2,3,1,2,0,0,0,0,0,0,0,0,0, 0x04,0x03,0x05,0x06,0x02,0x07,0x01,0x08,0x09,0x00,0x0a,0x0b,0xff }, { 0,2,2,3,1,1,1,1,2,0,0,0,0,0,0,0, 0x03,0x02,0x04,0x01,0x05,0x00,0x06,0x07,0x09,0x08,0x0a,...
DoS Overflow
0
void CLASS crw_init_tables (unsigned table, ushort *huff[2]) { static const uchar first_tree[3][29] = { { 0,1,4,2,3,1,2,0,0,0,0,0,0,0,0,0, 0x04,0x03,0x05,0x06,0x02,0x07,0x01,0x08,0x09,0x00,0x0a,0x0b,0xff }, { 0,2,2,3,1,1,1,1,2,0,0,0,0,0,0,0, 0x03,0x02,0x04,0x01,0x05,0x00,0x06,0x07,0x09,0x08,0x0a,...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,651
void CLASS dcraw_message(int code, const char *format, ...) { if (verbose || code!=DCRAW_VERBOSE) { va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); } }
DoS Overflow
0
void CLASS dcraw_message(int code, const char *format, ...) { if (verbose || code!=DCRAW_VERBOSE) { va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); } }
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,652
void CLASS derror() { if (!data_error) { dcraw_message (DCRAW_WARNING, "%s: ", ifname_display); if (feof(ifp)) dcraw_message (DCRAW_WARNING,_("Unexpected end of file\n")); else #ifdef HAVE_FSEEKO dcraw_message (DCRAW_WARNING,_("Corrupt data near 0x%llx\n"), (INT64) ftello(ifp)); #else ...
DoS Overflow
0
void CLASS derror() { if (!data_error) { dcraw_message (DCRAW_WARNING, "%s: ", ifname_display); if (feof(ifp)) dcraw_message (DCRAW_WARNING,_("Unexpected end of file\n")); else #ifdef HAVE_FSEEKO dcraw_message (DCRAW_WARNING,_("Corrupt data near 0x%llx\n"), (INT64) ftello(ifp)); #else ...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,653
void CLASS eight_bit_load_raw() { uchar *pixel; unsigned row, col, val, lblack=0; pixel = (uchar *) calloc (raw_width, sizeof *pixel); merror (pixel, "eight_bit_load_raw()"); fseek (ifp, top_margin*raw_width, SEEK_CUR); for (row=0; row < height; row++) { if (fread (pixel, 1, raw_width, ifp) < raw_width...
DoS Overflow
0
void CLASS eight_bit_load_raw() { uchar *pixel; unsigned row, col, val, lblack=0; pixel = (uchar *) calloc (raw_width, sizeof *pixel); merror (pixel, "eight_bit_load_raw()"); fseek (ifp, top_margin*raw_width, SEEK_CUR); for (row=0; row < height; row++) { if (fread (pixel, 1, raw_width, ifp) < raw_width...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,654
int CLASS fc (int row, int col) { static const char filter[16][16] = { { 2,1,1,3,2,3,2,0,3,2,3,0,1,2,1,0 }, { 0,3,0,2,0,1,3,1,0,1,1,2,0,3,3,2 }, { 2,3,3,2,3,1,1,3,3,1,2,1,2,0,0,3 }, { 0,1,0,1,0,2,0,2,2,0,3,0,1,3,2,1 }, { 3,1,1,2,0,1,0,2,1,3,1,3,0,1,3,0 }, { 2,0,0,3,3,2,3,1,2,0,2,0,3,2,2,1 }, ...
DoS Overflow
0
int CLASS fc (int row, int col) { static const char filter[16][16] = { { 2,1,1,3,2,3,2,0,3,2,3,0,1,2,1,0 }, { 0,3,0,2,0,1,3,1,0,1,1,2,0,3,3,2 }, { 2,3,3,2,3,1,1,3,3,1,2,1,2,0,0,3 }, { 0,1,0,1,0,2,0,2,2,0,3,0,1,3,2,1 }, { 3,1,1,2,0,1,0,2,1,3,1,3,0,1,3,0 }, { 2,0,0,3,3,2,3,1,2,0,2,0,3,2,2,1 }, ...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,655
char *CLASS fgets(char *s, int size, FILE *stream) { char *str = ::fgets(s, size, stream); if (str == NULL) { if (eofCount < 10) dcraw_message(DCRAW_VERBOSE, "%s: fgets returned NULL\n", ifname_display); if (eofCount == 10) dcraw_message(DCRAW_VERBOSE,...
DoS Overflow
0
char *CLASS fgets(char *s, int size, FILE *stream) { char *str = ::fgets(s, size, stream); if (str == NULL) { if (eofCount < 10) dcraw_message(DCRAW_VERBOSE, "%s: fgets returned NULL\n", ifname_display); if (eofCount == 10) dcraw_message(DCRAW_VERBOSE,...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,656
void CLASS fill_holes (int holes) { int row, col, val[4]; for (row=2; row < height-2; row++) { if (!HOLE(row)) continue; for (col=1; col < width-1; col+=4) { val[0] = BAYER(row-1,col-1); val[1] = BAYER(row-1,col+1); val[2] = BAYER(row+1,col-1); val[3] = BAYER(row+1,col+1); BAY...
DoS Overflow
0
void CLASS fill_holes (int holes) { int row, col, val[4]; for (row=2; row < height-2; row++) { if (!HOLE(row)) continue; for (col=1; col < width-1; col+=4) { val[0] = BAYER(row-1,col-1); val[1] = BAYER(row-1,col+1); val[2] = BAYER(row+1,col-1); val[3] = BAYER(row+1,col+1); BAY...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,657
int CLASS flip_index (int row, int col) { if (flip & 4) SWAP(row,col); if (flip & 2) row = iheight - 1 - row; if (flip & 1) col = iwidth - 1 - col; return row * iwidth + col; }
DoS Overflow
0
int CLASS flip_index (int row, int col) { if (flip & 4) SWAP(row,col); if (flip & 2) row = iheight - 1 - row; if (flip & 1) col = iwidth - 1 - col; return row * iwidth + col; }
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,658
int CLASS foveon_apply_curve (short *curve, int i) { if (abs(i) >= curve[0]) return 0; return i < 0 ? -curve[1-i] : curve[1+i]; }
DoS Overflow
0
int CLASS foveon_apply_curve (short *curve, int i) { if (abs(i) >= curve[0]) return 0; return i < 0 ? -curve[1-i] : curve[1+i]; }
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,659
float CLASS foveon_avg (short *pix, int range[2], float cfilt) { int i; float val, min=FLT_MAX, max=-FLT_MAX, sum=0; for (i=range[0]; i <= range[1]; i++) { sum += val = pix[i*4] + (pix[i*4]-pix[(i-1)*4]) * cfilt; if (min > val) min = val; if (max < val) max = val; } if (range[1] - range[0] == 1) ...
DoS Overflow
0
float CLASS foveon_avg (short *pix, int range[2], float cfilt) { int i; float val, min=FLT_MAX, max=-FLT_MAX, sum=0; for (i=range[0]; i <= range[1]; i++) { sum += val = pix[i*4] + (pix[i*4]-pix[(i-1)*4]) * cfilt; if (min > val) min = val; if (max < val) max = val; } if (range[1] - range[0] == 1) ...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,660
void * CLASS foveon_camf_matrix (unsigned dim[3], const char *name) { unsigned i, idx, type, ndim, size, *mat; char *pos, *cp, *dp; double dsize; for (idx=0; idx < meta_length; idx += sget4(pos+8)) { pos = meta_data + idx; if (strncmp (pos, "CMb", 3)) break; if (pos[3] != 'M') continue; if (str...
DoS Overflow
0
void * CLASS foveon_camf_matrix (unsigned dim[3], const char *name) { unsigned i, idx, type, ndim, size, *mat; char *pos, *cp, *dp; double dsize; for (idx=0; idx < meta_length; idx += sget4(pos+8)) { pos = meta_data + idx; if (strncmp (pos, "CMb", 3)) break; if (pos[3] != 'M') continue; if (str...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,661
const char * CLASS foveon_camf_param (const char *block, const char *param) { unsigned idx, num; char *pos, *cp, *dp; for (idx=0; idx < meta_length; idx += sget4(pos+8)) { pos = meta_data + idx; if (strncmp (pos, "CMb", 3)) break; if (pos[3] != 'P') continue; if (strcmp (block, pos+sget4(pos+12))...
DoS Overflow
0
const char * CLASS foveon_camf_param (const char *block, const char *param) { unsigned idx, num; char *pos, *cp, *dp; for (idx=0; idx < meta_length; idx += sget4(pos+8)) { pos = meta_data + idx; if (strncmp (pos, "CMb", 3)) break; if (pos[3] != 'P') continue; if (strcmp (block, pos+sget4(pos+12))...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,662
int CLASS foveon_fixed (void *ptr, int size, const char *name) { void *dp; unsigned dim[3]; dp = foveon_camf_matrix (dim, name); if (!dp) return 0; memcpy (ptr, dp, size*4); free (dp); return 1; }
DoS Overflow
0
int CLASS foveon_fixed (void *ptr, int size, const char *name) { void *dp; unsigned dim[3]; dp = foveon_camf_matrix (dim, name); if (!dp) return 0; memcpy (ptr, dp, size*4); free (dp); return 1; }
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,663
char * CLASS foveon_gets (int offset, char *str, int len) { int i; fseek (ifp, offset, SEEK_SET); for (i=0; i < len-1; i++) if ((str[i] = get2()) == 0) break; str[i] = 0; return str; }
DoS Overflow
0
char * CLASS foveon_gets (int offset, char *str, int len) { int i; fseek (ifp, offset, SEEK_SET); for (i=0; i < len-1; i++) if ((str[i] = get2()) == 0) break; str[i] = 0; return str; }
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,664
void CLASS foveon_load_raw() { struct decode *dindex; short diff[1024]; unsigned bitbuf=0; int pred[3], fixed, row, col, bit=-1, c, i; fixed = get4(); read_shorts ((ushort *) diff, 1024); if (!fixed) foveon_decoder (1024, 0); for (row=0; row < height; row++) { memset (pred, 0, sizeof pred); if...
DoS Overflow
0
void CLASS foveon_load_raw() { struct decode *dindex; short diff[1024]; unsigned bitbuf=0; int pred[3], fixed, row, col, bit=-1, c, i; fixed = get4(); read_shorts ((ushort *) diff, 1024); if (!fixed) foveon_decoder (1024, 0); for (row=0; row < height; row++) { memset (pred, 0, sizeof pred); if...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,665
short * CLASS foveon_make_curve (double max, double mul, double filt) { short *curve; unsigned i, size; double x; if (!filt) filt = 0.8; size = 4*M_PI*max / filt; if (size == UINT_MAX) size--; curve = (short *) calloc (size+1, sizeof *curve); merror (curve, "foveon_make_curve()"); curve[0] = size; ...
DoS Overflow
0
short * CLASS foveon_make_curve (double max, double mul, double filt) { short *curve; unsigned i, size; double x; if (!filt) filt = 0.8; size = 4*M_PI*max / filt; if (size == UINT_MAX) size--; curve = (short *) calloc (size+1, sizeof *curve); merror (curve, "foveon_make_curve()"); curve[0] = size; ...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,666
void CLASS foveon_make_curves (short **curvep, float dq[3], float div[3], float filt) { double mul[3], max=0; int c; FORC3 mul[c] = dq[c]/div[c]; FORC3 if (max < mul[c]) max = mul[c]; FORC3 curvep[c] = foveon_make_curve (max, mul[c], filt); }
DoS Overflow
0
void CLASS foveon_make_curves (short **curvep, float dq[3], float div[3], float filt) { double mul[3], max=0; int c; FORC3 mul[c] = dq[c]/div[c]; FORC3 if (max < mul[c]) max = mul[c]; FORC3 curvep[c] = foveon_make_curve (max, mul[c], filt); }
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,667
void CLASS foveon_thumb() { int bwide; unsigned row, col, bitbuf=0, bit=1, c, i; char *buf; struct decode *dindex; short pred[3]; bwide = get4(); fprintf (ofp, "P6\n%d %d\n255\n", thumb_width, thumb_height); if (bwide > 0) { if (bwide < thumb_width*3) return; buf = (char *) malloc (bwide); ...
DoS Overflow
0
void CLASS foveon_thumb() { int bwide; unsigned row, col, bitbuf=0, bit=1, c, i; char *buf; struct decode *dindex; short pred[3]; bwide = get4(); fprintf (ofp, "P6\n%d %d\n255\n", thumb_width, thumb_height); if (bwide > 0) { if (bwide < thumb_width*3) return; buf = (char *) malloc (bwide); ...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,668
size_t CLASS fread(void *ptr, size_t size, size_t nmemb, FILE *stream) { size_t num = ::fread(ptr, size, nmemb, stream); if ( num != nmemb ) { if (eofCount < 10) dcraw_message(DCRAW_VERBOSE, "%s: fread %d != %d\n", ifname_display, num, nmemb); if (eofCount == 10) ...
DoS Overflow
0
size_t CLASS fread(void *ptr, size_t size, size_t nmemb, FILE *stream) { size_t num = ::fread(ptr, size, nmemb, stream); if ( num != nmemb ) { if (eofCount < 10) dcraw_message(DCRAW_VERBOSE, "%s: fread %d != %d\n", ifname_display, num, nmemb); if (eofCount == 10) ...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,669
int CLASS fscanf(FILE *stream, const char *format, void *ptr) { int count = ::fscanf(stream, format, ptr); if ( count != 1 ) dcraw_message(DCRAW_WARNING, "%s: fscanf %d != 1\n", ifname_display, count); return 1; }
DoS Overflow
0
int CLASS fscanf(FILE *stream, const char *format, void *ptr) { int count = ::fscanf(stream, format, ptr); if ( count != 1 ) dcraw_message(DCRAW_WARNING, "%s: fscanf %d != 1\n", ifname_display, count); return 1; }
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,670
void CLASS fuji_load_raw() { ushort *pixel; int wide, row, col, r, c; fseek (ifp, (top_margin*raw_width + left_margin) * 2, SEEK_CUR); wide = fuji_width << !fuji_layout; pixel = (ushort *) calloc (wide, sizeof *pixel); merror (pixel, "fuji_load_raw()"); for (row=0; row < raw_height; row++) { read_sho...
DoS Overflow
0
void CLASS fuji_load_raw() { ushort *pixel; int wide, row, col, r, c; fseek (ifp, (top_margin*raw_width + left_margin) * 2, SEEK_CUR); wide = fuji_width << !fuji_layout; pixel = (ushort *) calloc (wide, sizeof *pixel); merror (pixel, "fuji_load_raw()"); for (row=0; row < raw_height; row++) { read_sho...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,671
size_t CLASS fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) { size_t num = ::fwrite(ptr, size, nmemb, stream); if ( num != nmemb ) dcraw_message(DCRAW_WARNING, "%s: fwrite %d != %d\n", ifname_display, num, nmemb); return num; }
DoS Overflow
0
size_t CLASS fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) { size_t num = ::fwrite(ptr, size, nmemb, stream); if ( num != nmemb ) dcraw_message(DCRAW_WARNING, "%s: fwrite %d != %d\n", ifname_display, num, nmemb); return num; }
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,672
void CLASS gamma_curve (double pwr, double ts, int mode, int imax) { int i; double g[6], bnd[2]={0,0}, r; g[0] = pwr; g[1] = ts; g[2] = g[3] = g[4] = 0; bnd[g[1] >= 1] = 1; if (g[1] && (g[1]-1)*(g[0]-1) <= 0) { for (i=0; i < 48; i++) { g[2] = (bnd[0] + bnd[1])/2; if (g[0]) bnd[(pow(g[2]/g...
DoS Overflow
0
void CLASS gamma_curve (double pwr, double ts, int mode, int imax) { int i; double g[6], bnd[2]={0,0}, r; g[0] = pwr; g[1] = ts; g[2] = g[3] = g[4] = 0; bnd[g[1] >= 1] = 1; if (g[1] && (g[1]-1)*(g[0]-1) <= 0) { for (i=0; i < 48; i++) { g[2] = (bnd[0] + bnd[1])/2; if (g[0]) bnd[(pow(g[2]/g...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,673
ushort CLASS get2() { uchar str[2] = { 0xff,0xff }; fread (str, 1, 2, ifp); return sget2(str); }
DoS Overflow
0
ushort CLASS get2() { uchar str[2] = { 0xff,0xff }; fread (str, 1, 2, ifp); return sget2(str); }
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,674
unsigned CLASS get4() { uchar str[4] = { 0xff,0xff,0xff,0xff }; fread (str, 1, 4, ifp); return sget4(str); }
DoS Overflow
0
unsigned CLASS get4() { uchar str[4] = { 0xff,0xff,0xff,0xff }; fread (str, 1, 4, ifp); return sget4(str); }
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,675
unsigned CLASS getbithuff (int nbits, ushort *huff) { int c; if (nbits == -1) return bitbuf = vbits = reset = 0; if (nbits == 0 || vbits < 0) return 0; while (!reset && vbits < nbits && (c = fgetc(ifp)) != EOF && !(reset = zero_after_ff && c == 0xff && fgetc(ifp))) { bitbuf = (bitbuf << 8) + (uchar...
DoS Overflow
0
unsigned CLASS getbithuff (int nbits, ushort *huff) { int c; if (nbits == -1) return bitbuf = vbits = reset = 0; if (nbits == 0 || vbits < 0) return 0; while (!reset && vbits < nbits && (c = fgetc(ifp)) != EOF && !(reset = zero_after_ff && c == 0xff && fgetc(ifp))) { bitbuf = (bitbuf << 8) + (uchar...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,676
unsigned CLASS getint (int type) { return type == 3 ? get2() : get4(); }
DoS Overflow
0
unsigned CLASS getint (int type) { return type == 3 ? get2() : get4(); }
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,677
double CLASS getreal (int type) { union { char c[8]; double d; } u; int i, rev; switch (type) { case 3: return (unsigned short) get2(); case 4: return (unsigned int) get4(); case 5: u.d = (unsigned int) get4(); return u.d / (unsigned int) get4(); case 8: return (signed short) get2(); c...
DoS Overflow
0
double CLASS getreal (int type) { union { char c[8]; double d; } u; int i, rev; switch (type) { case 3: return (unsigned short) get2(); case 4: return (unsigned int) get4(); case 5: u.d = (unsigned int) get4(); return u.d / (unsigned int) get4(); case 8: return (signed short) get2(); c...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,678
short CLASS guess_byte_order (int words) { uchar test[4][2]; int t=2, msb; double diff, sum[2] = {0,0}; fread (test[0], 2, 2, ifp); for (words-=2; words--; ) { fread (test[t], 2, 1, ifp); for (msb=0; msb < 2; msb++) { diff = (test[t^2][msb] << 8 | test[t^2][!msb]) - (test[t ][msb] << 8 | t...
DoS Overflow
0
short CLASS guess_byte_order (int words) { uchar test[4][2]; int t=2, msb; double diff, sum[2] = {0,0}; fread (test[0], 2, 2, ifp); for (words-=2; words--; ) { fread (test[t], 2, 1, ifp); for (msb=0; msb < 2; msb++) { diff = (test[t^2][msb] << 8 | test[t^2][!msb]) - (test[t ][msb] << 8 | t...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,679
void CLASS hasselblad_load_raw() { struct jhead jh; int row, col, pred[2], len[2], diff, c; if (!ljpeg_start (&jh, 0)) return; order = 0x4949; ph1_bits(-1); for (row=-top_margin; row < height; row++) { pred[0] = pred[1] = 0x8000 + load_flags; for (col=-left_margin; col < raw_width-left_margin; col+...
DoS Overflow
0
void CLASS hasselblad_load_raw() { struct jhead jh; int row, col, pred[2], len[2], diff, c; if (!ljpeg_start (&jh, 0)) return; order = 0x4949; ph1_bits(-1); for (row=-top_margin; row < height; row++) { pred[0] = pred[1] = 0x8000 + load_flags; for (col=-left_margin; col < raw_width-left_margin; col+...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,680
void CLASS ifpProgress(unsigned readCount) { /* We don't use this in Rawstudio */ #if 0 ifpReadCount += readCount; if (ifpSize==0) return; unsigned newStepProgress = STEPS * ifpReadCount / ifpSize; if (newStepProgress > ifpStepProgress) { #ifdef DCRAW_NOMAIN if (ifpStepProgress) progress(PROGRESS_...
DoS Overflow
0
void CLASS ifpProgress(unsigned readCount) { /* We don't use this in Rawstudio */ #if 0 ifpReadCount += readCount; if (ifpSize==0) return; unsigned newStepProgress = STEPS * ifpReadCount / ifpSize; if (newStepProgress > ifpStepProgress) { #ifdef DCRAW_NOMAIN if (ifpStepProgress) progress(PROGRESS_...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,681
void CLASS imacon_full_load_raw() { int row, col; for (row=0; row < height; row++) for (col=0; col < width; col++) read_shorts (image[row*width+col], 3); }
DoS Overflow
0
void CLASS imacon_full_load_raw() { int row, col; for (row=0; row < height; row++) for (col=0; col < width; col++) read_shorts (image[row*width+col], 3); }
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,682
void CLASS jpeg_thumb() { char *thumb; ushort exif[5]; struct tiff_hdr th; thumb = (char *) malloc (thumb_length); merror (thumb, "jpeg_thumb()"); fread (thumb, 1, thumb_length, ifp); fputc (0xff, ofp); fputc (0xd8, ofp); if (strcmp (thumb+6, "Exif")) { memcpy (exif, "\xff\xe1 Exif\0\0", 10); ...
DoS Overflow
0
void CLASS jpeg_thumb() { char *thumb; ushort exif[5]; struct tiff_hdr th; thumb = (char *) malloc (thumb_length); merror (thumb, "jpeg_thumb()"); fread (thumb, 1, thumb_length, ifp); fputc (0xff, ofp); fputc (0xd8, ofp); if (strcmp (thumb+6, "Exif")) { memcpy (exif, "\xff\xe1 Exif\0\0", 10); ...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,683
int CLASS kodak_65000_decode (short *out, int bsize) { uchar c, blen[768]; ushort raw[6]; INT64 bitbuf=0; int save, bits=0, i, j, len, diff; save = ftell(ifp); bsize = (bsize + 3) & -4; for (i=0; i < bsize; i+=2) { c = fgetc(ifp); if ((blen[i ] = c & 15) > 12 || (blen[i+1] = c >> 4) > 12 ) { ...
DoS Overflow
0
int CLASS kodak_65000_decode (short *out, int bsize) { uchar c, blen[768]; ushort raw[6]; INT64 bitbuf=0; int save, bits=0, i, j, len, diff; save = ftell(ifp); bsize = (bsize + 3) & -4; for (i=0; i < bsize; i+=2) { c = fgetc(ifp); if ((blen[i ] = c & 15) > 12 || (blen[i+1] = c >> 4) > 12 ) { ...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,684
void CLASS kodak_65000_load_raw() { short buf[256]; int row, col, len, pred[2], ret, i; for (row=0; row < height; row++) for (col=0; col < width; col+=256) { pred[0] = pred[1] = 0; len = MIN (256, width-col); ret = kodak_65000_decode (buf, len); for (i=0; i < len; i++) if ((BAYER(row...
DoS Overflow
0
void CLASS kodak_65000_load_raw() { short buf[256]; int row, col, len, pred[2], ret, i; for (row=0; row < height; row++) for (col=0; col < width; col+=256) { pred[0] = pred[1] = 0; len = MIN (256, width-col); ret = kodak_65000_decode (buf, len); for (i=0; i < len; i++) if ((BAYER(row...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,685
void CLASS kodak_jpeg_load_raw() {}
DoS Overflow
0
void CLASS kodak_jpeg_load_raw() {}
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,686
void CLASS kodak_jpeg_load_raw() { struct jpeg_decompress_struct cinfo; struct jpeg_error_mgr jerr; JSAMPARRAY buf; JSAMPLE (*pixel)[3]; int row, col; cinfo.err = jpeg_std_error (&jerr); cinfo.client_data = this; jpeg_create_decompress (&cinfo); jpeg_stdio_src (&cinfo, ifp); cinfo.src->fill_input_b...
DoS Overflow
0
void CLASS kodak_jpeg_load_raw() { struct jpeg_decompress_struct cinfo; struct jpeg_error_mgr jerr; JSAMPARRAY buf; JSAMPLE (*pixel)[3]; int row, col; cinfo.err = jpeg_std_error (&jerr); cinfo.client_data = this; jpeg_create_decompress (&cinfo); jpeg_stdio_src (&cinfo, ifp); cinfo.src->fill_input_b...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,687
void CLASS kodak_rgb_load_raw() { short buf[768], *bp; int row, col, len, c, i, rgb[3]; ushort *ip=image[0]; for (row=0; row < height; row++) for (col=0; col < width; col+=256) { len = MIN (256, width-col); kodak_65000_decode (buf, len*3); memset (rgb, 0, sizeof rgb); for (bp=buf, i...
DoS Overflow
0
void CLASS kodak_rgb_load_raw() { short buf[768], *bp; int row, col, len, c, i, rgb[3]; ushort *ip=image[0]; for (row=0; row < height; row++) for (col=0; col < width; col+=256) { len = MIN (256, width-col); kodak_65000_decode (buf, len*3); memset (rgb, 0, sizeof rgb); for (bp=buf, i...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,688
void CLASS kodak_ycbcr_load_raw() { short buf[384], *bp; int row, col, len, c, i, j, k, y[2][2], cb, cr, rgb[3]; ushort *ip; for (row=0; row < height; row+=2) for (col=0; col < width; col+=128) { len = MIN (128, width-col); kodak_65000_decode (buf, len*3); y[0][1] = y[1][1] = cb = cr = 0;...
DoS Overflow
0
void CLASS kodak_ycbcr_load_raw() { short buf[384], *bp; int row, col, len, c, i, j, k, y[2][2], cb, cr, rgb[3]; ushort *ip; for (row=0; row < height; row+=2) for (col=0; col < width; col+=128) { len = MIN (128, width-col); kodak_65000_decode (buf, len*3); y[0][1] = y[1][1] = cb = cr = 0;...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,689
void CLASS kodak_yrgb_load_raw() { uchar *pixel; int row, col, y, cb, cr, rgb[3], c; pixel = (uchar *) calloc (raw_width, 3*sizeof *pixel); merror (pixel, "kodak_yrgb_load_raw()"); for (row=0; row < height; row++) { if (~row & 1) if (fread (pixel, raw_width, 3, ifp) < 3) derror(); for (col=0; c...
DoS Overflow
0
void CLASS kodak_yrgb_load_raw() { uchar *pixel; int row, col, y, cb, cr, rgb[3], c; pixel = (uchar *) calloc (raw_width, 3*sizeof *pixel); merror (pixel, "kodak_yrgb_load_raw()"); for (row=0; row < height; row++) { if (~row & 1) if (fread (pixel, raw_width, 3, ifp) < 3) derror(); for (col=0; c...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,690
void CLASS layer_thumb() { unsigned i; int c; char *thumb, map[][4] = { "012","102" }; colors = thumb_misc >> 5 & 7; thumb_length = thumb_width*thumb_height; thumb = (char *) calloc (colors, thumb_length); merror (thumb, "layer_thumb()"); fprintf (ofp, "P%d\n%d %d\n255\n", 5 + (colors >> 1), thumb_wid...
DoS Overflow
0
void CLASS layer_thumb() { unsigned i; int c; char *thumb, map[][4] = { "012","102" }; colors = thumb_misc >> 5 & 7; thumb_length = thumb_width*thumb_height; thumb = (char *) calloc (colors, thumb_length); merror (thumb, "layer_thumb()"); fprintf (ofp, "P%d\n%d %d\n255\n", 5 + (colors >> 1), thumb_wid...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,691
void CLASS leaf_hdr_load_raw() { ushort *pixel; unsigned tile=0, r, c, row, col; pixel = (ushort *) calloc (raw_width, sizeof *pixel); merror (pixel, "leaf_hdr_load_raw()"); FORC(tiff_samples) for (r=0; r < raw_height; r++) { if (r % tile_length == 0) { fseek (ifp, data_offset + 4*tile++, SEEK_SET...
DoS Overflow
0
void CLASS leaf_hdr_load_raw() { ushort *pixel; unsigned tile=0, r, c, row, col; pixel = (ushort *) calloc (raw_width, sizeof *pixel); merror (pixel, "leaf_hdr_load_raw()"); FORC(tiff_samples) for (r=0; r < raw_height; r++) { if (r % tile_length == 0) { fseek (ifp, data_offset + 4*tile++, SEEK_SET...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,692
void CLASS lin_interpolate() { int code[16][16][32], *ip, sum[4]; int c, i, x, y, row, col, shift, color; ushort *pix; dcraw_message (DCRAW_VERBOSE,_("Bilinear interpolation...\n")); border_interpolate(1); for (row=0; row < 16; row++) for (col=0; col < 16; col++) { ip = code[row][col]; mem...
DoS Overflow
0
void CLASS lin_interpolate() { int code[16][16][32], *ip, sum[4]; int c, i, x, y, row, col, shift, color; ushort *pix; dcraw_message (DCRAW_VERBOSE,_("Bilinear interpolation...\n")); border_interpolate(1); for (row=0; row < 16; row++) for (col=0; col < 16; col++) { ip = code[row][col]; mem...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,693
int CLASS ljpeg_diff (ushort *huff) { int len, diff; len = gethuff(huff); if (len == 16 && (!dng_version || dng_version >= 0x1010000)) return -32768; diff = getbits(len); if ((diff & (1 << (len-1))) == 0) diff -= (1 << len) - 1; return diff; }
DoS Overflow
0
int CLASS ljpeg_diff (ushort *huff) { int len, diff; len = gethuff(huff); if (len == 16 && (!dng_version || dng_version >= 0x1010000)) return -32768; diff = getbits(len); if ((diff & (1 << (len-1))) == 0) diff -= (1 << len) - 1; return diff; }
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,694
void CLASS ljpeg_end (struct jhead *jh) { int c; FORC4 if (jh->free[c]) free (jh->free[c]); free (jh->row); }
DoS Overflow
0
void CLASS ljpeg_end (struct jhead *jh) { int c; FORC4 if (jh->free[c]) free (jh->free[c]); free (jh->row); }
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,695
ushort * CLASS ljpeg_row (int jrow, struct jhead *jh) { int col, c, diff, pred, spred=0; ushort mark=0, *row[3]; if (jrow * jh->wide % jh->restart == 0) { FORC(6) jh->vpred[c] = 1 << (jh->bits-1); if (jrow) { fseek (ifp, -2, SEEK_CUR); do mark = (mark << 8) + (c = fgetc(ifp)); while (c ...
DoS Overflow
0
ushort * CLASS ljpeg_row (int jrow, struct jhead *jh) { int col, c, diff, pred, spred=0; ushort mark=0, *row[3]; if (jrow * jh->wide % jh->restart == 0) { FORC(6) jh->vpred[c] = 1 << (jh->bits-1); if (jrow) { fseek (ifp, -2, SEEK_CUR); do mark = (mark << 8) + (c = fgetc(ifp)); while (c ...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,696
void CLASS lossless_jpeg_load_raw() { int jwide, jrow, jcol, val, jidx, c, i, j, row=0, col=0; struct jhead jh; int min=INT_MAX; ushort *rp; if (!ljpeg_start (&jh, 0)) return; jwide = jh.wide * jh.clrs; for (jrow=0; jrow < jh.high; jrow++) { rp = ljpeg_row (jrow, &jh); if (load_flags & 1) ...
DoS Overflow
0
void CLASS lossless_jpeg_load_raw() { int jwide, jrow, jcol, val, jidx, c, i, j, row=0, col=0; struct jhead jh; int min=INT_MAX; ushort *rp; if (!ljpeg_start (&jh, 0)) return; jwide = jh.wide * jh.clrs; for (jrow=0; jrow < jh.high; jrow++) { rp = ljpeg_row (jrow, &jh); if (load_flags & 1) ...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,697
int CLASS main (int argc, const char **argv) { static int arg, status=0; static int timestamp_only=0, thumbnail_only=0, identify_only=0; static int user_qual=-1, user_black=-1, user_sat=-1, user_flip=-1; static int use_fuji_rotate=1, write_to_stdout=0, quality, i, c; static const char *sp, *bpfile=0, *dark_fr...
DoS Overflow
0
int CLASS main (int argc, const char **argv) { static int arg, status=0; static int timestamp_only=0, thumbnail_only=0, identify_only=0; static int user_qual=-1, user_black=-1, user_sat=-1, user_flip=-1; static int use_fuji_rotate=1, write_to_stdout=0, quality, i, c; static const char *sp, *bpfile=0, *dark_fr...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,698
ushort * CLASS make_decoder (const uchar *source) { return make_decoder_ref (&source); }
DoS Overflow
0
ushort * CLASS make_decoder (const uchar *source) { return make_decoder_ref (&source); }
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null
34,699
ushort * CLASS make_decoder_ref (const uchar **source) { int max, len, h, i, j; const uchar *count; ushort *huff; count = (*source += 16) - 17; for (max=16; max && !count[max]; max--); huff = (ushort *) calloc (1 + (1 << max), sizeof *huff); merror (huff, "make_decoder()"); huff[0] = max; for (h=len=...
DoS Overflow
0
ushort * CLASS make_decoder_ref (const uchar **source) { int max, len, h, i, j; const uchar *count; ushort *huff; count = (*source += 16) - 17; for (max=16; max && !count[max]; max--); huff = (ushort *) calloc (1 + (1 << max), sizeof *huff); merror (huff, "make_decoder()"); huff[0] = max; for (h=len=...
@@ -890,7 +890,8 @@ struct jhead { int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int c, tag, len; + int c, tag; + ushort len; uchar data[0x10000]; const uchar *dp;
CWE-189
null
null