idx int64 | func_before string | Vulnerability Classification string | vul int64 | func_after string | patch string | CWE ID string | lines_before string | lines_after string |
|---|---|---|---|---|---|---|---|---|
8,700 | ksba_ocsp_new (ksba_ocsp_t *r_ocsp)
{
*r_ocsp = xtrycalloc (1, sizeof **r_ocsp);
if (!*r_ocsp)
return gpg_error_from_errno (errno);
return 0;
}
| DoS | 0 | ksba_ocsp_new (ksba_ocsp_t *r_ocsp)
{
*r_ocsp = xtrycalloc (1, sizeof **r_ocsp);
if (!*r_ocsp)
return gpg_error_from_errno (errno);
return 0;
}
| @@ -231,6 +231,8 @@ parse_asntime_into_isotime (unsigned char const **buf, size_t *len,
&& (ti.tag == TYPE_UTC_TIME || ti.tag == TYPE_GENERALIZED_TIME)
&& !ti.is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_INV_BER);
... | CWE-20 | null | null |
8,701 | ksba_ocsp_parse_response (ksba_ocsp_t ocsp,
const unsigned char *msg, size_t msglen,
ksba_ocsp_response_status_t *response_status)
{
gpg_error_t err;
struct ocsp_reqitem_s *ri;
if (!ocsp || !msg || !msglen || !response_status)
return gpg_error (GPG_ERR_INV_... | DoS | 0 | ksba_ocsp_parse_response (ksba_ocsp_t ocsp,
const unsigned char *msg, size_t msglen,
ksba_ocsp_response_status_t *response_status)
{
gpg_error_t err;
struct ocsp_reqitem_s *ri;
if (!ocsp || !msg || !msglen || !response_status)
return gpg_error (GPG_ERR_INV_... | @@ -231,6 +231,8 @@ parse_asntime_into_isotime (unsigned char const **buf, size_t *len,
&& (ti.tag == TYPE_UTC_TIME || ti.tag == TYPE_GENERALIZED_TIME)
&& !ti.is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_INV_BER);
... | CWE-20 | null | null |
8,702 | ksba_ocsp_prepare_request (ksba_ocsp_t ocsp)
{
gpg_error_t err;
struct ocsp_reqitem_s *ri;
unsigned char *p;
const unsigned char *der;
size_t derlen;
ksba_writer_t w1 = NULL;
ksba_writer_t w2 = NULL;
ksba_writer_t w3 = NULL;
ksba_writer_t w4, w5, w6, w7; /* Used as aliases. */
if (!ocsp)
return... | DoS | 0 | ksba_ocsp_prepare_request (ksba_ocsp_t ocsp)
{
gpg_error_t err;
struct ocsp_reqitem_s *ri;
unsigned char *p;
const unsigned char *der;
size_t derlen;
ksba_writer_t w1 = NULL;
ksba_writer_t w2 = NULL;
ksba_writer_t w3 = NULL;
ksba_writer_t w4, w5, w6, w7; /* Used as aliases. */
if (!ocsp)
return... | @@ -231,6 +231,8 @@ parse_asntime_into_isotime (unsigned char const **buf, size_t *len,
&& (ti.tag == TYPE_UTC_TIME || ti.tag == TYPE_GENERALIZED_TIME)
&& !ti.is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_INV_BER);
... | CWE-20 | null | null |
8,703 | ksba_ocsp_set_digest_algo (ksba_ocsp_t ocsp, const char *oid)
{
if (!ocsp || !oid || !*oid)
return gpg_error (GPG_ERR_INV_VALUE);
if (ocsp->digest_oid)
xfree (ocsp->digest_oid);
ocsp->digest_oid = xtrystrdup (oid);
if (!ocsp->digest_oid)
return gpg_error_from_errno (errno);
return 0;
}
| DoS | 0 | ksba_ocsp_set_digest_algo (ksba_ocsp_t ocsp, const char *oid)
{
if (!ocsp || !oid || !*oid)
return gpg_error (GPG_ERR_INV_VALUE);
if (ocsp->digest_oid)
xfree (ocsp->digest_oid);
ocsp->digest_oid = xtrystrdup (oid);
if (!ocsp->digest_oid)
return gpg_error_from_errno (errno);
return 0;
}
| @@ -231,6 +231,8 @@ parse_asntime_into_isotime (unsigned char const **buf, size_t *len,
&& (ti.tag == TYPE_UTC_TIME || ti.tag == TYPE_GENERALIZED_TIME)
&& !ti.is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_INV_BER);
... | CWE-20 | null | null |
8,704 | ksba_ocsp_set_nonce (ksba_ocsp_t ocsp, unsigned char *nonce, size_t noncelen)
{
if (!ocsp)
return 0;
if (!nonce)
return sizeof ocsp->nonce;
if (noncelen > sizeof ocsp->nonce)
noncelen = sizeof ocsp->nonce;
if (noncelen)
{
memcpy (ocsp->nonce, nonce, noncelen);
/* Reset the high bit. ... | DoS | 0 | ksba_ocsp_set_nonce (ksba_ocsp_t ocsp, unsigned char *nonce, size_t noncelen)
{
if (!ocsp)
return 0;
if (!nonce)
return sizeof ocsp->nonce;
if (noncelen > sizeof ocsp->nonce)
noncelen = sizeof ocsp->nonce;
if (noncelen)
{
memcpy (ocsp->nonce, nonce, noncelen);
/* Reset the high bit. ... | @@ -231,6 +231,8 @@ parse_asntime_into_isotime (unsigned char const **buf, size_t *len,
&& (ti.tag == TYPE_UTC_TIME || ti.tag == TYPE_GENERALIZED_TIME)
&& !ti.is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_INV_BER);
... | CWE-20 | null | null |
8,705 | ksba_ocsp_set_requestor (ksba_ocsp_t ocsp, ksba_cert_t cert)
{
(void)ocsp;
(void)cert;
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
}
| DoS | 0 | ksba_ocsp_set_requestor (ksba_ocsp_t ocsp, ksba_cert_t cert)
{
(void)ocsp;
(void)cert;
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
}
| @@ -231,6 +231,8 @@ parse_asntime_into_isotime (unsigned char const **buf, size_t *len,
&& (ti.tag == TYPE_UTC_TIME || ti.tag == TYPE_GENERALIZED_TIME)
&& !ti.is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_INV_BER);
... | CWE-20 | null | null |
8,706 | ksba_ocsp_set_sig_val (ksba_ocsp_t ocsp,
ksba_const_sexp_t sigval)
{
(void)ocsp;
(void)sigval;
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
}
| DoS | 0 | ksba_ocsp_set_sig_val (ksba_ocsp_t ocsp,
ksba_const_sexp_t sigval)
{
(void)ocsp;
(void)sigval;
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
}
| @@ -231,6 +231,8 @@ parse_asntime_into_isotime (unsigned char const **buf, size_t *len,
&& (ti.tag == TYPE_UTC_TIME || ti.tag == TYPE_GENERALIZED_TIME)
&& !ti.is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_INV_BER);
... | CWE-20 | null | null |
8,707 | parse_context_tag (unsigned char const **buf, size_t *len, struct tag_info *ti,
int tag)
{
gpg_error_t err;
err = _ksba_ber_parse_tl (buf, len, ti);
if (err)
;
else if (!(ti->class == CLASS_CONTEXT && ti->tag == tag
&& ti->is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
... | DoS | 0 | parse_context_tag (unsigned char const **buf, size_t *len, struct tag_info *ti,
int tag)
{
gpg_error_t err;
err = _ksba_ber_parse_tl (buf, len, ti);
if (err)
;
else if (!(ti->class == CLASS_CONTEXT && ti->tag == tag
&& ti->is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
... | @@ -231,6 +231,8 @@ parse_asntime_into_isotime (unsigned char const **buf, size_t *len,
&& (ti.tag == TYPE_UTC_TIME || ti.tag == TYPE_GENERALIZED_TIME)
&& !ti.is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_INV_BER);
... | CWE-20 | null | null |
8,708 | parse_enumerated (unsigned char const **buf, size_t *len, struct tag_info *ti,
size_t maxlen)
{
gpg_error_t err;
err = _ksba_ber_parse_tl (buf, len, ti);
if (err)
;
else if (!(ti->class == CLASS_UNIVERSAL && ti->tag == TYPE_ENUMERATED
&& !ti->is_constructed) )
err = gpg_... | DoS | 0 | parse_enumerated (unsigned char const **buf, size_t *len, struct tag_info *ti,
size_t maxlen)
{
gpg_error_t err;
err = _ksba_ber_parse_tl (buf, len, ti);
if (err)
;
else if (!(ti->class == CLASS_UNIVERSAL && ti->tag == TYPE_ENUMERATED
&& !ti->is_constructed) )
err = gpg_... | @@ -231,6 +231,8 @@ parse_asntime_into_isotime (unsigned char const **buf, size_t *len,
&& (ti.tag == TYPE_UTC_TIME || ti.tag == TYPE_GENERALIZED_TIME)
&& !ti.is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_INV_BER);
... | CWE-20 | null | null |
8,709 | parse_integer (unsigned char const **buf, size_t *len, struct tag_info *ti)
{
gpg_error_t err;
err = _ksba_ber_parse_tl (buf, len, ti);
if (err)
;
else if (!(ti->class == CLASS_UNIVERSAL && ti->tag == TYPE_INTEGER
&& !ti->is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
else if (!ti... | DoS | 0 | parse_integer (unsigned char const **buf, size_t *len, struct tag_info *ti)
{
gpg_error_t err;
err = _ksba_ber_parse_tl (buf, len, ti);
if (err)
;
else if (!(ti->class == CLASS_UNIVERSAL && ti->tag == TYPE_INTEGER
&& !ti->is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
else if (!ti... | @@ -231,6 +231,8 @@ parse_asntime_into_isotime (unsigned char const **buf, size_t *len,
&& (ti.tag == TYPE_UTC_TIME || ti.tag == TYPE_GENERALIZED_TIME)
&& !ti.is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_INV_BER);
... | CWE-20 | null | null |
8,710 | parse_octet_string (unsigned char const **buf, size_t *len, struct tag_info *ti)
{
gpg_error_t err;
err= _ksba_ber_parse_tl (buf, len, ti);
if (err)
;
else if (!(ti->class == CLASS_UNIVERSAL && ti->tag == TYPE_OCTET_STRING
&& !ti->is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
else... | DoS | 0 | parse_octet_string (unsigned char const **buf, size_t *len, struct tag_info *ti)
{
gpg_error_t err;
err= _ksba_ber_parse_tl (buf, len, ti);
if (err)
;
else if (!(ti->class == CLASS_UNIVERSAL && ti->tag == TYPE_OCTET_STRING
&& !ti->is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
else... | @@ -231,6 +231,8 @@ parse_asntime_into_isotime (unsigned char const **buf, size_t *len,
&& (ti.tag == TYPE_UTC_TIME || ti.tag == TYPE_GENERALIZED_TIME)
&& !ti.is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_INV_BER);
... | CWE-20 | null | null |
8,711 | parse_optional_boolean (unsigned char const **buf, size_t *len, int *r_bool)
{
gpg_error_t err;
struct tag_info ti;
err = _ksba_ber_parse_tl (buf, len, &ti);
if (err)
;
else if (!ti.length)
err = gpg_error (GPG_ERR_TOO_SHORT);
else if (ti.length > *len)
err = gpg_error (GPG_ERR_BAD_BER);
else... | DoS | 0 | parse_optional_boolean (unsigned char const **buf, size_t *len, int *r_bool)
{
gpg_error_t err;
struct tag_info ti;
err = _ksba_ber_parse_tl (buf, len, &ti);
if (err)
;
else if (!ti.length)
err = gpg_error (GPG_ERR_TOO_SHORT);
else if (ti.length > *len)
err = gpg_error (GPG_ERR_BAD_BER);
else... | @@ -231,6 +231,8 @@ parse_asntime_into_isotime (unsigned char const **buf, size_t *len,
&& (ti.tag == TYPE_UTC_TIME || ti.tag == TYPE_GENERALIZED_TIME)
&& !ti.is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_INV_BER);
... | CWE-20 | null | null |
8,712 | parse_response (ksba_ocsp_t ocsp, const unsigned char *msg, size_t msglen)
{
gpg_error_t err;
struct tag_info ti;
const unsigned char *msgstart;
const unsigned char *endptr;
const char *s;
size_t len;
msgstart = msg;
err = parse_response_status (ocsp, &msg, &msglen, &len);
if (err)
return err;
... | DoS | 0 | parse_response (ksba_ocsp_t ocsp, const unsigned char *msg, size_t msglen)
{
gpg_error_t err;
struct tag_info ti;
const unsigned char *msgstart;
const unsigned char *endptr;
const char *s;
size_t len;
msgstart = msg;
err = parse_response_status (ocsp, &msg, &msglen, &len);
if (err)
return err;
... | @@ -231,6 +231,8 @@ parse_asntime_into_isotime (unsigned char const **buf, size_t *len,
&& (ti.tag == TYPE_UTC_TIME || ti.tag == TYPE_GENERALIZED_TIME)
&& !ti.is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_INV_BER);
... | CWE-20 | null | null |
8,713 | parse_response_extensions (ksba_ocsp_t ocsp,
const unsigned char *data, size_t datalen)
{
gpg_error_t err;
struct tag_info ti;
size_t length;
char *oid = NULL;
assert (!ocsp->response_extensions);
err = parse_sequence (&data, &datalen, &ti);
if (err)
goto leave;
length = t... | DoS | 0 | parse_response_extensions (ksba_ocsp_t ocsp,
const unsigned char *data, size_t datalen)
{
gpg_error_t err;
struct tag_info ti;
size_t length;
char *oid = NULL;
assert (!ocsp->response_extensions);
err = parse_sequence (&data, &datalen, &ti);
if (err)
goto leave;
length = t... | @@ -231,6 +231,8 @@ parse_asntime_into_isotime (unsigned char const **buf, size_t *len,
&& (ti.tag == TYPE_UTC_TIME || ti.tag == TYPE_GENERALIZED_TIME)
&& !ti.is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_INV_BER);
... | CWE-20 | null | null |
8,714 | parse_sequence (unsigned char const **buf, size_t *len, struct tag_info *ti)
{
gpg_error_t err;
err = _ksba_ber_parse_tl (buf, len, ti);
if (err)
;
else if (!(ti->class == CLASS_UNIVERSAL && ti->tag == TYPE_SEQUENCE
&& ti->is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
else if (ti-... | DoS | 0 | parse_sequence (unsigned char const **buf, size_t *len, struct tag_info *ti)
{
gpg_error_t err;
err = _ksba_ber_parse_tl (buf, len, ti);
if (err)
;
else if (!(ti->class == CLASS_UNIVERSAL && ti->tag == TYPE_SEQUENCE
&& ti->is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
else if (ti-... | @@ -231,6 +231,8 @@ parse_asntime_into_isotime (unsigned char const **buf, size_t *len,
&& (ti.tag == TYPE_UTC_TIME || ti.tag == TYPE_GENERALIZED_TIME)
&& !ti.is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_INV_BER);
... | CWE-20 | null | null |
8,715 | parse_single_extensions (struct ocsp_reqitem_s *ri,
const unsigned char *data, size_t datalen)
{
gpg_error_t err;
struct tag_info ti;
size_t length;
char *oid = NULL;
assert (ri && !ri->single_extensions);
err = parse_sequence (&data, &datalen, &ti);
if (err)
goto leave;
le... | DoS | 0 | parse_single_extensions (struct ocsp_reqitem_s *ri,
const unsigned char *data, size_t datalen)
{
gpg_error_t err;
struct tag_info ti;
size_t length;
char *oid = NULL;
assert (ri && !ri->single_extensions);
err = parse_sequence (&data, &datalen, &ti);
if (err)
goto leave;
le... | @@ -231,6 +231,8 @@ parse_asntime_into_isotime (unsigned char const **buf, size_t *len,
&& (ti.tag == TYPE_UTC_TIME || ti.tag == TYPE_GENERALIZED_TIME)
&& !ti.is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_INV_BER);
... | CWE-20 | null | null |
8,716 | parse_single_response (ksba_ocsp_t ocsp,
unsigned char const **data, size_t *datalen)
{
gpg_error_t err;
struct tag_info ti;
const unsigned char *savedata;
const unsigned char *endptr;
size_t savedatalen;
size_t n;
char *oid;
ksba_isotime_t this_update, next_update, revocation_tim... | DoS | 0 | parse_single_response (ksba_ocsp_t ocsp,
unsigned char const **data, size_t *datalen)
{
gpg_error_t err;
struct tag_info ti;
const unsigned char *savedata;
const unsigned char *endptr;
size_t savedatalen;
size_t n;
char *oid;
ksba_isotime_t this_update, next_update, revocation_tim... | @@ -231,6 +231,8 @@ parse_asntime_into_isotime (unsigned char const **buf, size_t *len,
&& (ti.tag == TYPE_UTC_TIME || ti.tag == TYPE_GENERALIZED_TIME)
&& !ti.is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_INV_BER);
... | CWE-20 | null | null |
8,717 | release_ocsp_extensions (struct ocsp_extension_s *ex)
{
while (ex)
{
struct ocsp_extension_s *tmp = ex->next;
xfree (ex);
ex = tmp;
}
}
| DoS | 0 | release_ocsp_extensions (struct ocsp_extension_s *ex)
{
while (ex)
{
struct ocsp_extension_s *tmp = ex->next;
xfree (ex);
ex = tmp;
}
}
| @@ -231,6 +231,8 @@ parse_asntime_into_isotime (unsigned char const **buf, size_t *len,
&& (ti.tag == TYPE_UTC_TIME || ti.tag == TYPE_GENERALIZED_TIME)
&& !ti.is_constructed) )
err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_INV_BER);
... | CWE-20 | null | null |
8,718 | append_quoted (struct stringbuf *sb, const unsigned char *value, size_t length,
int skip)
{
unsigned char tmp[4];
const unsigned char *s = value;
size_t n = 0;
for (;;)
{
for (value = s; n+skip < length; n++, s++)
{
s += skip;
n += skip;
if (*s < '... | DoS | 0 | append_quoted (struct stringbuf *sb, const unsigned char *value, size_t length,
int skip)
{
unsigned char tmp[4];
const unsigned char *s = value;
size_t n = 0;
for (;;)
{
for (value = s; n+skip < length; n++, s++)
{
s += skip;
n += skip;
if (*s < '... | @@ -332,11 +332,8 @@ append_utf8_value (const unsigned char *value, size_t length,
}
else
{
- if (n+nmore > length)
- nmore = length - n; /* Oops, encoding to short */
-
tmp[0] = *s++; n++;
- for (i=1; i <= nmore; i++)
+ for (i=1; n < length && i... | CWE-189 | null | null |
8,719 | static int exif_file_sections_add(image_info_type *ImageInfo, int type, size_t size, uchar *data)
{
file_section *tmp;
int count = ImageInfo->file.count;
tmp = safe_erealloc(ImageInfo->file.list, (count+1), sizeof(file_section), 0);
ImageInfo->file.list = tmp;
ImageInfo->file.list[count].type = 0xF... | DoS Overflow | 0 | static int exif_file_sections_add(image_info_type *ImageInfo, int type, size_t size, uchar *data)
{
file_section *tmp;
int count = ImageInfo->file.count;
tmp = safe_erealloc(ImageInfo->file.list, (count+1), sizeof(file_section), 0);
ImageInfo->file.list = tmp;
ImageInfo->file.list[count].type = 0xF... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,720 | static int exif_file_sections_free(image_info_type *ImageInfo)
{
int i;
if (ImageInfo->file.count) {
for (i=0; i<ImageInfo->file.count; i++) {
EFREE_IF(ImageInfo->file.list[i].data);
}
}
EFREE_IF(ImageInfo->file.list);
ImageInfo->file.count = 0;
return TRUE;
}
| DoS Overflow | 0 | static int exif_file_sections_free(image_info_type *ImageInfo)
{
int i;
if (ImageInfo->file.count) {
for (i=0; i<ImageInfo->file.count; i++) {
EFREE_IF(ImageInfo->file.list[i].data);
}
}
EFREE_IF(ImageInfo->file.list);
ImageInfo->file.count = 0;
return TRUE;
}
| @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,721 | static int exif_file_sections_realloc(image_info_type *ImageInfo, int section_index, size_t size TSRMLS_DC)
{
void *tmp;
/* This is not a malloc/realloc check. It is a plausibility check for the
* function parameters (requirements engineering).
*/
if (section_index >= ImageInfo->file.count) {
EXIF_ERRLOG_FSRE... | DoS Overflow | 0 | static int exif_file_sections_realloc(image_info_type *ImageInfo, int section_index, size_t size TSRMLS_DC)
{
void *tmp;
/* This is not a malloc/realloc check. It is a plausibility check for the
* function parameters (requirements engineering).
*/
if (section_index >= ImageInfo->file.count) {
EXIF_ERRLOG_FSRE... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,722 | static char * exif_get_markername(int marker)
{
switch(marker) {
case 0xC0: return "SOF0";
case 0xC1: return "SOF1";
case 0xC2: return "SOF2";
case 0xC3: return "SOF3";
case 0xC4: return "DHT";
case 0xC5: return "SOF5";
case 0xC6: return "SOF6";
case 0xC7: return "SOF7";
case 0xC9: return "SOF9";
c... | DoS Overflow | 0 | static char * exif_get_markername(int marker)
{
switch(marker) {
case 0xC0: return "SOF0";
case 0xC1: return "SOF1";
case 0xC2: return "SOF2";
case 0xC3: return "SOF3";
case 0xC4: return "DHT";
case 0xC5: return "SOF5";
case 0xC6: return "SOF6";
case 0xC7: return "SOF7";
case 0xC9: return "SOF9";
c... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,723 | static char *exif_get_sectionname(int section)
{
switch(section) {
case SECTION_FILE: return "FILE";
case SECTION_COMPUTED: return "COMPUTED";
case SECTION_ANY_TAG: return "ANY_TAG";
case SECTION_IFD0: return "IFD0";
case SECTION_THUMBNAIL: return "THUMBNAIL";
case SECTION_COMMENT: return "C... | DoS Overflow | 0 | static char *exif_get_sectionname(int section)
{
switch(section) {
case SECTION_FILE: return "FILE";
case SECTION_COMPUTED: return "COMPUTED";
case SECTION_ANY_TAG: return "ANY_TAG";
case SECTION_IFD0: return "IFD0";
case SECTION_THUMBNAIL: return "THUMBNAIL";
case SECTION_COMMENT: return "C... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,724 | static tag_table_type exif_get_tag_table(int section)
{
switch(section) {
case SECTION_FILE: return &tag_table_IFD[0];
case SECTION_COMPUTED: return &tag_table_IFD[0];
case SECTION_ANY_TAG: return &tag_table_IFD[0];
case SECTION_IFD0: return &tag_table_IFD[0];
case SECTION_THUMBNAIL: return &tag... | DoS Overflow | 0 | static tag_table_type exif_get_tag_table(int section)
{
switch(section) {
case SECTION_FILE: return &tag_table_IFD[0];
case SECTION_COMPUTED: return &tag_table_IFD[0];
case SECTION_ANY_TAG: return &tag_table_IFD[0];
case SECTION_IFD0: return &tag_table_IFD[0];
case SECTION_THUMBNAIL: return &tag... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,725 | static char *exif_get_tagformat(int format)
{
switch(format) {
case TAG_FMT_BYTE: return "BYTE";
case TAG_FMT_STRING: return "STRING";
case TAG_FMT_USHORT: return "USHORT";
case TAG_FMT_ULONG: return "ULONG";
case TAG_FMT_URATIONAL: return "URATIONAL";
case TAG_FMT_SBYTE: return "SBYTE";... | DoS Overflow | 0 | static char *exif_get_tagformat(int format)
{
switch(format) {
case TAG_FMT_BYTE: return "BYTE";
case TAG_FMT_STRING: return "STRING";
case TAG_FMT_USHORT: return "USHORT";
case TAG_FMT_ULONG: return "ULONG";
case TAG_FMT_URATIONAL: return "URATIONAL";
case TAG_FMT_SBYTE: return "SBYTE";... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,726 | static char * exif_get_tagname(int tag_num, char *ret, int len, tag_table_type tag_table TSRMLS_DC)
{
int i, t;
char tmp[32];
for (i = 0; (t = tag_table[i].Tag) != TAG_END_OF_LIST; i++) {
if (t == tag_num) {
if (ret && len) {
strlcpy(ret, tag_table[i].Desc, abs(len));
if (len < 0) {
memset(ret + ... | DoS Overflow | 0 | static char * exif_get_tagname(int tag_num, char *ret, int len, tag_table_type tag_table TSRMLS_DC)
{
int i, t;
char tmp[32];
for (i = 0; (t = tag_table[i].Tag) != TAG_END_OF_LIST; i++) {
if (t == tag_num) {
if (ret && len) {
strlcpy(ret, tag_table[i].Desc, abs(len));
if (len < 0) {
memset(ret + ... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,727 | static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel TSRMLS_DC) {
size_t byte_count;
char *value_ptr, *data_ptr;
size_t i;
image_info_value *info_value;
byte_count = php_tiff_bytes_per_format[info_data->format] * info_data->length;
value_ptr = safe_emalloc(max(byte_count, 4), 1,... | DoS Overflow | 0 | static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel TSRMLS_DC) {
size_t byte_count;
char *value_ptr, *data_ptr;
size_t i;
image_info_value *info_value;
byte_count = php_tiff_bytes_per_format[info_data->format] * info_data->length;
value_ptr = safe_emalloc(max(byte_count, 4), 1,... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,728 | static void exif_iif_add_buffer(image_info_type *image_info, int section_index, char *name, int length, char *value TSRMLS_DC)
{
image_info_data *info_data;
image_info_data *list;
if (value) {
list = safe_erealloc(image_info->info_list[section_index].list, (image_info->info_list[section_index].count+1), sizeof(... | DoS Overflow | 0 | static void exif_iif_add_buffer(image_info_type *image_info, int section_index, char *name, int length, char *value TSRMLS_DC)
{
image_info_data *info_data;
image_info_data *list;
if (value) {
list = safe_erealloc(image_info->info_list[section_index].list, (image_info->info_list[section_index].count+1), sizeof(... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,729 | static void exif_iif_add_fmt(image_info_type *image_info, int section_index, char *name TSRMLS_DC, char *value, ...)
{
char *tmp;
va_list arglist;
va_start(arglist, value);
if (value) {
vspprintf(&tmp, 0, value, arglist);
exif_iif_add_str(image_info, section_index, name, tmp TSRMLS_CC);
efree(... | DoS Overflow | 0 | static void exif_iif_add_fmt(image_info_type *image_info, int section_index, char *name TSRMLS_DC, char *value, ...)
{
char *tmp;
va_list arglist;
va_start(arglist, value);
if (value) {
vspprintf(&tmp, 0, value, arglist);
exif_iif_add_str(image_info, section_index, name, tmp TSRMLS_CC);
efree(... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,730 | static void exif_iif_add_int(image_info_type *image_info, int section_index, char *name, int value TSRMLS_DC)
{
image_info_data *info_data;
image_info_data *list;
list = safe_erealloc(image_info->info_list[section_index].list, (image_info->info_list[section_index].count+1), sizeof(image_info_data), 0);
image_inf... | DoS Overflow | 0 | static void exif_iif_add_int(image_info_type *image_info, int section_index, char *name, int value TSRMLS_DC)
{
image_info_data *info_data;
image_info_data *list;
list = safe_erealloc(image_info->info_list[section_index].list, (image_info->info_list[section_index].count+1), sizeof(image_info_data), 0);
image_inf... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,731 | static void exif_iif_add_str(image_info_type *image_info, int section_index, char *name, char *value TSRMLS_DC)
{
image_info_data *info_data;
image_info_data *list;
if (value) {
list = safe_erealloc(image_info->info_list[section_index].list, (image_info->info_list[section_index].count+1), sizeof(image_info_data... | DoS Overflow | 0 | static void exif_iif_add_str(image_info_type *image_info, int section_index, char *name, char *value TSRMLS_DC)
{
image_info_data *info_data;
image_info_data *list;
if (value) {
list = safe_erealloc(image_info->info_list[section_index].list, (image_info->info_list[section_index].count+1), sizeof(image_info_data... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,732 | static void exif_iif_add_tag(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t length, void* value TSRMLS_DC)
{
exif_iif_add_value(image_info, section_index, name, tag, format, (int)length, value, image_info->motorola_intel TSRMLS_CC);
}
| DoS Overflow | 0 | static void exif_iif_add_tag(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t length, void* value TSRMLS_DC)
{
exif_iif_add_value(image_info, section_index, name, tag, format, (int)length, value, image_info->motorola_intel TSRMLS_CC);
}
| @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,733 | static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, int motorola_intel TSRMLS_DC)
{
size_t idex;
void *vptr;
image_info_value *info_value;
image_info_data *info_data;
image_info_data *list;
if (length < 0) {
return;
}
lis... | DoS Overflow | 0 | static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, int motorola_intel TSRMLS_DC)
{
size_t idex;
void *vptr;
image_info_value *info_value;
image_info_data *info_data;
image_info_data *list;
if (length < 0) {
return;
}
lis... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,734 | static void exif_iif_free(image_info_type *image_info, int section_index) {
int i;
void *f; /* faster */
if (image_info->info_list[section_index].count) {
for (i=0; i < image_info->info_list[section_index].count; i++) {
if ((f=image_info->info_list[section_index].list[i].name) != NULL) {
efree(f);
}
... | DoS Overflow | 0 | static void exif_iif_free(image_info_type *image_info, int section_index) {
int i;
void *f; /* faster */
if (image_info->info_list[section_index].count) {
for (i=0; i < image_info->info_list[section_index].count; i++) {
if ((f=image_info->info_list[section_index].list[i].name) != NULL) {
efree(f);
}
... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,735 | static void exif_process_CME (image_info_type *image_info, char *value, size_t length TSRMLS_DC)
{
if (length>3) {
switch(value[2]) {
case 0:
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, length, value TSRMLS_CC);
break;
case 1:
exif_iif_add_tag(ima... | DoS Overflow | 0 | static void exif_process_CME (image_info_type *image_info, char *value, size_t length TSRMLS_DC)
{
if (length>3) {
switch(value[2]) {
case 0:
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, length, value TSRMLS_CC);
break;
case 1:
exif_iif_add_tag(ima... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,736 | static void exif_process_COM (image_info_type *image_info, char *value, size_t length TSRMLS_DC)
{
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length-2, value+2 TSRMLS_CC);
}
| DoS Overflow | 0 | static void exif_process_COM (image_info_type *image_info, char *value, size_t length TSRMLS_DC)
{
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length-2, value+2 TSRMLS_CC);
}
| @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,737 | static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * value_ptr, int value_len, char *offset_base, size_t IFDlength, size_t displacement TSRMLS_DC)
{
int de, i=0, section_index = SECTION_MAKERNOTE;
int NumDirEntries, old_motorola_intel, offset_diff;
const maker_note_type *maker_note;
char *dir... | DoS Overflow | 0 | static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * value_ptr, int value_len, char *offset_base, size_t IFDlength, size_t displacement TSRMLS_DC)
{
int de, i=0, section_index = SECTION_MAKERNOTE;
int NumDirEntries, old_motorola_intel, offset_diff;
const maker_note_type *maker_note;
char *dir... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,738 | static void exif_process_SOFn (uchar *Data, int marker, jpeg_sof_info *result)
{
/* 0xFF SOSn SectLen(2) Bits(1) Height(2) Width(2) Channels(1) 3*Channels (1) */
result->bits_per_sample = Data[2];
result->height = php_jpg_get16(Data+3);
result->width = php_jpg_get16(Data+5);
result->num_compone... | DoS Overflow | 0 | static void exif_process_SOFn (uchar *Data, int marker, jpeg_sof_info *result)
{
/* 0xFF SOSn SectLen(2) Bits(1) Height(2) Width(2) Channels(1) 3*Channels (1) */
result->bits_per_sample = Data[2];
result->height = php_jpg_get16(Data+3);
result->width = php_jpg_get16(Data+5);
result->num_compone... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,739 | static int exif_process_string(char **result, char *value, size_t byte_count TSRMLS_DC) {
/* we cannot use strlcpy - here the problem is that we cannot use strlen to
* determin length of string and we cannot use strlcpy with len=byte_count+1
* because then we might get into an EXCEPTION if we exceed an allocated
... | DoS Overflow | 0 | static int exif_process_string(char **result, char *value, size_t byte_count TSRMLS_DC) {
/* we cannot use strlcpy - here the problem is that we cannot use strlen to
* determin length of string and we cannot use strlcpy with len=byte_count+1
* because then we might get into an EXCEPTION if we exceed an allocated
... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,740 | static int exif_process_string_raw(char **result, char *value, size_t byte_count) {
/* we cannot use strlcpy - here the problem is that we have to copy NUL
* chars up to byte_count, we also have to add a single NUL character to
* force end of string.
*/
if (byte_count) {
(*result) = safe_emalloc(byte_count, 1... | DoS Overflow | 0 | static int exif_process_string_raw(char **result, char *value, size_t byte_count) {
/* we cannot use strlcpy - here the problem is that we have to copy NUL
* chars up to byte_count, we also have to add a single NUL character to
* force end of string.
*/
if (byte_count) {
(*result) = safe_emalloc(byte_count, 1... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,741 | static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_field, int tag, char *szValuePtr, int ByteCount TSRMLS_DC)
{
xp_field->tag = tag;
xp_field->value = NULL;
/* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */
if (zend_multibyte_encodin... | DoS Overflow | 0 | static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_field, int tag, char *szValuePtr, int ByteCount TSRMLS_DC)
{
xp_field->tag = tag;
xp_field->value = NULL;
/* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */
if (zend_multibyte_encodin... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,742 | static void exif_thumbnail_build(image_info_type *ImageInfo TSRMLS_DC) {
size_t new_size, new_move, new_value;
char *new_data;
void *value_ptr;
int i, byte_count;
image_info_list *info_list;
image_info_data *info_data;
#ifdef EXIF_DEBUG
char tag... | DoS Overflow | 0 | static void exif_thumbnail_build(image_info_type *ImageInfo TSRMLS_DC) {
size_t new_size, new_move, new_value;
char *new_data;
void *value_ptr;
int i, byte_count;
image_info_list *info_list;
image_info_data *info_data;
#ifdef EXIF_DEBUG
char tag... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,743 | static void exif_thumbnail_extract(image_info_type *ImageInfo, char *offset, size_t length TSRMLS_DC) {
if (ImageInfo->Thumbnail.data) {
exif_error_docref("exif_read_data#error_mult_thumb" EXIFERR_CC, ImageInfo, E_WARNING, "Multiple possible thumbnails");
return; /* Should not happen */
}
if (!ImageInfo->read_th... | DoS Overflow | 0 | static void exif_thumbnail_extract(image_info_type *ImageInfo, char *offset, size_t length TSRMLS_DC) {
if (ImageInfo->Thumbnail.data) {
exif_error_docref("exif_read_data#error_mult_thumb" EXIFERR_CC, ImageInfo, E_WARNING, "Multiple possible thumbnails");
return; /* Should not happen */
}
if (!ImageInfo->read_th... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,744 | static signed short php_ifd_get16s(void *value, int motorola_intel)
{
return (signed short)php_ifd_get16u(value, motorola_intel);
}
| DoS Overflow | 0 | static signed short php_ifd_get16s(void *value, int motorola_intel)
{
return (signed short)php_ifd_get16u(value, motorola_intel);
}
| @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,745 | static int php_ifd_get32s(void *value, int motorola_intel)
{
if (motorola_intel) {
return (((char *)value)[0] << 24)
| (((uchar *)value)[1] << 16)
| (((uchar *)value)[2] << 8 )
| (((uchar *)value)[3] );
} else {
return (((char *)value)[3] << 24)
| (((uchar *)value)[2] << 16)
| ((... | DoS Overflow | 0 | static int php_ifd_get32s(void *value, int motorola_intel)
{
if (motorola_intel) {
return (((char *)value)[0] << 24)
| (((uchar *)value)[1] << 16)
| (((uchar *)value)[2] << 8 )
| (((uchar *)value)[3] );
} else {
return (((char *)value)[3] << 24)
| (((uchar *)value)[2] << 16)
| ((... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,746 | static unsigned php_ifd_get32u(void *value, int motorola_intel)
{
return (unsigned)php_ifd_get32s(value, motorola_intel) & 0xffffffff;
}
| DoS Overflow | 0 | static unsigned php_ifd_get32u(void *value, int motorola_intel)
{
return (unsigned)php_ifd_get32s(value, motorola_intel) & 0xffffffff;
}
| @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,747 | static void php_ifd_set32u(char *data, size_t value, int motorola_intel)
{
if (motorola_intel) {
data[0] = (value & 0xFF000000) >> 24;
data[1] = (value & 0x00FF0000) >> 16;
data[2] = (value & 0x0000FF00) >> 8;
data[3] = (value & 0x000000FF);
} else {
data[3] = (value & 0xFF000000) >> 24;
data[2] = (value... | DoS Overflow | 0 | static void php_ifd_set32u(char *data, size_t value, int motorola_intel)
{
if (motorola_intel) {
data[0] = (value & 0xFF000000) >> 24;
data[1] = (value & 0x00FF0000) >> 16;
data[2] = (value & 0x0000FF00) >> 8;
data[3] = (value & 0x000000FF);
} else {
data[3] = (value & 0xFF000000) >> 24;
data[2] = (value... | @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,748 | static size_t php_strnlen(char* str, size_t maxlen) {
size_t len = 0;
if (str && maxlen && *str) {
do {
len++;
} while (--maxlen && *(++str));
}
return len;
}
| DoS Overflow | 0 | static size_t php_strnlen(char* str, size_t maxlen) {
size_t len = 0;
if (str && maxlen && *str) {
do {
len++;
} while (--maxlen && *(++str));
}
return len;
}
| @@ -2965,7 +2965,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
... | CWE-119 | null | null |
8,749 | void grapheme_register_constants( INIT_FUNC_ARGS )
{
REGISTER_LONG_CONSTANT("GRAPHEME_EXTR_COUNT", GRAPHEME_EXTRACT_TYPE_COUNT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("GRAPHEME_EXTR_MAXBYTES", GRAPHEME_EXTRACT_TYPE_MAXBYTES, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("GRAPHEME_EXTR_MAXCHARS",... | DoS | 0 | void grapheme_register_constants( INIT_FUNC_ARGS )
{
REGISTER_LONG_CONSTANT("GRAPHEME_EXTR_COUNT", GRAPHEME_EXTRACT_TYPE_COUNT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("GRAPHEME_EXTR_MAXBYTES", GRAPHEME_EXTRACT_TYPE_MAXBYTES, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("GRAPHEME_EXTR_MAXCHARS",... | @@ -112,7 +112,7 @@ PHP_FUNCTION(grapheme_strpos)
int haystack_len, needle_len;
unsigned char *found;
long loffset = 0;
- int32_t offset = 0;
+ int32_t offset = 0, noffset = 0;
int ret_pos;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&hayst... | null | null | null |
8,750 | PHP_FUNCTION(xml_parser_create_ns)
{
php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
| DoS Overflow | 0 | PHP_FUNCTION(xml_parser_create_ns)
{
php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
| @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,751 | PHP_FUNCTION(xml_set_element_handler)
{
xml_parser *parser;
zval *pind, **shdl, **ehdl;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZZ", &pind, &shdl, &ehdl) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
xml_set_handler(&parser->startEl... | DoS Overflow | 0 | PHP_FUNCTION(xml_set_element_handler)
{
xml_parser *parser;
zval *pind, **shdl, **ehdl;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZZ", &pind, &shdl, &ehdl) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
xml_set_handler(&parser->startEl... | @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,752 | PHP_FUNCTION(xml_set_character_data_handler)
{
xml_parser *parser;
zval *pind, **hdl;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZ", &pind, &hdl) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
xml_set_handler(&parser->characterDataHandl... | DoS Overflow | 0 | PHP_FUNCTION(xml_set_character_data_handler)
{
xml_parser *parser;
zval *pind, **hdl;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZ", &pind, &hdl) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
xml_set_handler(&parser->characterDataHandl... | @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,753 | PHP_FUNCTION(xml_set_processing_instruction_handler)
{
xml_parser *parser;
zval *pind, **hdl;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZ", &pind, &hdl) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
xml_set_handler(&parser->processing... | DoS Overflow | 0 | PHP_FUNCTION(xml_set_processing_instruction_handler)
{
xml_parser *parser;
zval *pind, **hdl;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZ", &pind, &hdl) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
xml_set_handler(&parser->processing... | @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,754 | PHP_FUNCTION(xml_set_default_handler)
{
xml_parser *parser;
zval *pind, **hdl;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZ", &pind, &hdl) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
xml_set_handler(&parser->defaultHandler, hdl);
XML... | DoS Overflow | 0 | PHP_FUNCTION(xml_set_default_handler)
{
xml_parser *parser;
zval *pind, **hdl;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZ", &pind, &hdl) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
xml_set_handler(&parser->defaultHandler, hdl);
XML... | @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,755 | PHP_FUNCTION(xml_set_notation_decl_handler)
{
xml_parser *parser;
zval *pind, **hdl;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZ", &pind, &hdl) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
xml_set_handler(&parser->notationDeclHandler,... | DoS Overflow | 0 | PHP_FUNCTION(xml_set_notation_decl_handler)
{
xml_parser *parser;
zval *pind, **hdl;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZ", &pind, &hdl) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
xml_set_handler(&parser->notationDeclHandler,... | @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,756 | PHP_FUNCTION(xml_set_end_namespace_decl_handler)
{
xml_parser *parser;
zval *pind, **hdl;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZ", &pind, &hdl) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
xml_set_handler(&parser->endNamespaceDe... | DoS Overflow | 0 | PHP_FUNCTION(xml_set_end_namespace_decl_handler)
{
xml_parser *parser;
zval *pind, **hdl;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZ", &pind, &hdl) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
xml_set_handler(&parser->endNamespaceDe... | @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,757 | PHP_FUNCTION(xml_parse)
{
xml_parser *parser;
zval *pind;
char *data;
int data_len, ret;
long isFinal = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &pind, &data, &data_len, &isFinal) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser)... | DoS Overflow | 0 | PHP_FUNCTION(xml_parse)
{
xml_parser *parser;
zval *pind;
char *data;
int data_len, ret;
long isFinal = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &pind, &data, &data_len, &isFinal) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser)... | @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,758 | PHP_FUNCTION(xml_get_error_code)
{
xml_parser *parser;
zval *pind;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
RETVAL_LONG((long)XML_GetErrorCode(parser->parser));
}
| DoS Overflow | 0 | PHP_FUNCTION(xml_get_error_code)
{
xml_parser *parser;
zval *pind;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
RETVAL_LONG((long)XML_GetErrorCode(parser->parser));
}
| @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,759 | PHP_FUNCTION(xml_error_string)
{
long code;
char *str;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &code) == FAILURE) {
return;
}
str = (char *)XML_ErrorString((int)code);
if (str) {
RETVAL_STRING(str, 1);
}
}
| DoS Overflow | 0 | PHP_FUNCTION(xml_error_string)
{
long code;
char *str;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &code) == FAILURE) {
return;
}
str = (char *)XML_ErrorString((int)code);
if (str) {
RETVAL_STRING(str, 1);
}
}
| @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,760 | PHP_FUNCTION(xml_get_current_column_number)
{
xml_parser *parser;
zval *pind;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
RETVAL_LONG(XML_GetCurrentColumnNumber(parser->parser));
}
| DoS Overflow | 0 | PHP_FUNCTION(xml_get_current_column_number)
{
xml_parser *parser;
zval *pind;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
RETVAL_LONG(XML_GetCurrentColumnNumber(parser->parser));
}
| @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,761 | PHP_FUNCTION(xml_get_current_byte_index)
{
xml_parser *parser;
zval *pind;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
RETVAL_LONG(XML_GetCurrentByteIndex(parser->parser));
}
| DoS Overflow | 0 | PHP_FUNCTION(xml_get_current_byte_index)
{
xml_parser *parser;
zval *pind;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
RETVAL_LONG(XML_GetCurrentByteIndex(parser->parser));
}
| @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,762 | PHP_FUNCTION(xml_parser_set_option)
{
xml_parser *parser;
zval *pind, **val;
long opt;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlZ", &pind, &opt, &val) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
switch (opt) {
case PHP_XML_OPTIO... | DoS Overflow | 0 | PHP_FUNCTION(xml_parser_set_option)
{
xml_parser *parser;
zval *pind, **val;
long opt;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlZ", &pind, &opt, &val) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
switch (opt) {
case PHP_XML_OPTIO... | @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,763 | PHP_FUNCTION(utf8_encode)
{
char *arg;
XML_Char *encoded;
int arg_len, len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
return;
}
encoded = xml_utf8_encode(arg, arg_len, &len, "ISO-8859-1");
if (encoded == NULL) {
RETURN_FALSE;
}
RETVAL_STRINGL(encoded, len, ... | DoS Overflow | 0 | PHP_FUNCTION(utf8_encode)
{
char *arg;
XML_Char *encoded;
int arg_len, len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
return;
}
encoded = xml_utf8_encode(arg, arg_len, &len, "ISO-8859-1");
if (encoded == NULL) {
RETURN_FALSE;
}
RETVAL_STRINGL(encoded, len, ... | @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,764 | PHP_FUNCTION(utf8_decode)
{
char *arg;
XML_Char *decoded;
int arg_len, len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
return;
}
decoded = xml_utf8_decode(arg, arg_len, &len, "ISO-8859-1");
if (decoded == NULL) {
RETURN_FALSE;
}
RETVAL_STRINGL(decoded, len, ... | DoS Overflow | 0 | PHP_FUNCTION(utf8_decode)
{
char *arg;
XML_Char *decoded;
int arg_len, len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
return;
}
decoded = xml_utf8_decode(arg, arg_len, &len, "ISO-8859-1");
if (decoded == NULL) {
RETURN_FALSE;
}
RETVAL_STRINGL(decoded, len, ... | @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,765 | void _xml_defaultHandler(void *userData, const XML_Char *s, int len)
{
xml_parser *parser = (xml_parser *)userData;
if (parser && parser->defaultHandler) {
zval *retval, *args[2];
args[0] = _xml_resource_zval(parser->index);
args[1] = _xml_xmlchar_zval(s, len, parser->target_encoding);
if ((retval = xml_cal... | DoS Overflow | 0 | void _xml_defaultHandler(void *userData, const XML_Char *s, int len)
{
xml_parser *parser = (xml_parser *)userData;
if (parser && parser->defaultHandler) {
zval *retval, *args[2];
args[0] = _xml_resource_zval(parser->index);
args[1] = _xml_xmlchar_zval(s, len, parser->target_encoding);
if ((retval = xml_cal... | @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,766 | void _xml_endNamespaceDeclHandler(void *userData, const XML_Char *prefix)
{
xml_parser *parser = (xml_parser *)userData;
if (parser && parser->endNamespaceDeclHandler) {
zval *retval, *args[2];
args[0] = _xml_resource_zval(parser->index);
args[1] = _xml_xmlchar_zval(prefix, 0, parser->target_encoding);
if (... | DoS Overflow | 0 | void _xml_endNamespaceDeclHandler(void *userData, const XML_Char *prefix)
{
xml_parser *parser = (xml_parser *)userData;
if (parser && parser->endNamespaceDeclHandler) {
zval *retval, *args[2];
args[0] = _xml_resource_zval(parser->index);
args[1] = _xml_xmlchar_zval(prefix, 0, parser->target_encoding);
if (... | @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,767 | int _xml_externalEntityRefHandler(XML_Parser parserPtr,
const XML_Char *openEntityNames,
const XML_Char *base,
const XML_Char *systemId,
const XML_Char *publicId)
{
xml_parser *parser = XML_GetUserData(parserPtr);
int ret = 0; /* abort if no handler is set (should be config... | DoS Overflow | 0 | int _xml_externalEntityRefHandler(XML_Parser parserPtr,
const XML_Char *openEntityNames,
const XML_Char *base,
const XML_Char *systemId,
const XML_Char *publicId)
{
xml_parser *parser = XML_GetUserData(parserPtr);
int ret = 0; /* abort if no handler is set (should be config... | @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,768 | void _xml_notationDeclHandler(void *userData,
const XML_Char *notationName,
const XML_Char *base,
const XML_Char *systemId,
const XML_Char *publicId)
{
xml_parser *parser = (xml_parser *)userData;
if (parser && parser->notationDeclHandler) {
zval *retval, *args[5];
args[0] = ... | DoS Overflow | 0 | void _xml_notationDeclHandler(void *userData,
const XML_Char *notationName,
const XML_Char *base,
const XML_Char *systemId,
const XML_Char *publicId)
{
xml_parser *parser = (xml_parser *)userData;
if (parser && parser->notationDeclHandler) {
zval *retval, *args[5];
args[0] = ... | @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,769 | void _xml_processingInstructionHandler(void *userData, const XML_Char *target, const XML_Char *data)
{
xml_parser *parser = (xml_parser *)userData;
if (parser && parser->processingInstructionHandler) {
zval *retval, *args[3];
args[0] = _xml_resource_zval(parser->index);
args[1] = _xml_xmlchar_zval(target, 0, ... | DoS Overflow | 0 | void _xml_processingInstructionHandler(void *userData, const XML_Char *target, const XML_Char *data)
{
xml_parser *parser = (xml_parser *)userData;
if (parser && parser->processingInstructionHandler) {
zval *retval, *args[3];
args[0] = _xml_resource_zval(parser->index);
args[1] = _xml_xmlchar_zval(target, 0, ... | @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,770 | void _xml_startNamespaceDeclHandler(void *userData,const XML_Char *prefix, const XML_Char *uri)
{
xml_parser *parser = (xml_parser *)userData;
if (parser && parser->startNamespaceDeclHandler) {
zval *retval, *args[3];
args[0] = _xml_resource_zval(parser->index);
args[1] = _xml_xmlchar_zval(prefix, 0, parser->... | DoS Overflow | 0 | void _xml_startNamespaceDeclHandler(void *userData,const XML_Char *prefix, const XML_Char *uri)
{
xml_parser *parser = (xml_parser *)userData;
if (parser && parser->startNamespaceDeclHandler) {
zval *retval, *args[3];
args[0] = _xml_resource_zval(parser->index);
args[1] = _xml_xmlchar_zval(prefix, 0, parser->... | @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,771 | static int _xml_xmlcharlen(const XML_Char *s)
{
int len = 0;
while (*s) {
len++;
s++;
}
return len;
}
| DoS Overflow | 0 | static int _xml_xmlcharlen(const XML_Char *s)
{
int len = 0;
while (*s) {
len++;
s++;
}
return len;
}
| @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,772 | static void php_xml_free_wrapper(void *ptr)
{
if (ptr != NULL) {
efree(ptr);
}
}
| DoS Overflow | 0 | static void php_xml_free_wrapper(void *ptr)
{
if (ptr != NULL) {
efree(ptr);
}
}
| @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,773 | static void *php_xml_malloc_wrapper(size_t sz)
{
return emalloc(sz);
}
| DoS Overflow | 0 | static void *php_xml_malloc_wrapper(size_t sz)
{
return emalloc(sz);
}
| @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,774 | static void *php_xml_realloc_wrapper(void *ptr, size_t sz)
{
return erealloc(ptr, sz);
}
| DoS Overflow | 0 | static void *php_xml_realloc_wrapper(void *ptr, size_t sz)
{
return erealloc(ptr, sz);
}
| @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,775 | inline static char xml_decode_iso_8859_1(unsigned short c)
{
return (char)(c > 0xff ? '?' : c);
}
| DoS Overflow | 0 | inline static char xml_decode_iso_8859_1(unsigned short c)
{
return (char)(c > 0xff ? '?' : c);
}
| @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,776 | inline static char xml_decode_us_ascii(unsigned short c)
{
return (char)(c > 0x7f ? '?' : c);
}
| DoS Overflow | 0 | inline static char xml_decode_us_ascii(unsigned short c)
{
return (char)(c > 0x7f ? '?' : c);
}
| @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,777 | inline static unsigned short xml_encode_iso_8859_1(unsigned char c)
{
return (unsigned short)c;
}
| DoS Overflow | 0 | inline static unsigned short xml_encode_iso_8859_1(unsigned char c)
{
return (unsigned short)c;
}
| @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,778 | static xml_encoding *xml_get_encoding(const XML_Char *name)
{
xml_encoding *enc = &xml_encodings[0];
while (enc && enc->name) {
if (strcasecmp(name, enc->name) == 0) {
return enc;
}
enc++;
}
return NULL;
}
| DoS Overflow | 0 | static xml_encoding *xml_get_encoding(const XML_Char *name)
{
xml_encoding *enc = &xml_encodings[0];
while (enc && enc->name) {
if (strcasecmp(name, enc->name) == 0) {
return enc;
}
enc++;
}
return NULL;
}
| @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,779 | static void xml_set_handler(zval **handler, zval **data)
{
/* If we have already a handler, release it */
if (*handler) {
zval_ptr_dtor(handler);
}
/* IS_ARRAY might indicate that we're using array($obj, 'method') syntax */
if (Z_TYPE_PP(data) != IS_ARRAY && Z_TYPE_PP(data) != IS_OBJECT) {
convert_to_string_... | DoS Overflow | 0 | static void xml_set_handler(zval **handler, zval **data)
{
/* If we have already a handler, release it */
if (*handler) {
zval_ptr_dtor(handler);
}
/* IS_ARRAY might indicate that we're using array($obj, 'method') syntax */
if (Z_TYPE_PP(data) != IS_ARRAY && Z_TYPE_PP(data) != IS_OBJECT) {
convert_to_string_... | @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,780 | PHPAPI char *xml_utf8_decode(const XML_Char *s, int len, int *newlen, const XML_Char *encoding)
{
size_t pos = 0;
char *newbuf = emalloc(len + 1);
unsigned int c;
char (*decoder)(unsigned short) = NULL;
xml_encoding *enc = xml_get_encoding(encoding);
*newlen = 0;
if (enc) {
decoder = enc->decoding_function;
... | DoS Overflow | 0 | PHPAPI char *xml_utf8_decode(const XML_Char *s, int len, int *newlen, const XML_Char *encoding)
{
size_t pos = 0;
char *newbuf = emalloc(len + 1);
unsigned int c;
char (*decoder)(unsigned short) = NULL;
xml_encoding *enc = xml_get_encoding(encoding);
*newlen = 0;
if (enc) {
decoder = enc->decoding_function;
... | @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,781 | PHPAPI char *xml_utf8_encode(const char *s, int len, int *newlen, const XML_Char *encoding)
{
int pos = len;
char *newbuf;
unsigned int c;
unsigned short (*encoder)(unsigned char) = NULL;
xml_encoding *enc = xml_get_encoding(encoding);
*newlen = 0;
if (enc) {
encoder = enc->encoding_function;
} else {
/* I... | DoS Overflow | 0 | PHPAPI char *xml_utf8_encode(const char *s, int len, int *newlen, const XML_Char *encoding)
{
int pos = len;
char *newbuf;
unsigned int c;
unsigned short (*encoder)(unsigned char) = NULL;
xml_encoding *enc = xml_get_encoding(encoding);
*newlen = 0;
if (enc) {
encoder = enc->encoding_function;
} else {
/* I... | @@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHI... | CWE-119 | null | null |
8,782 | static PHP_GSHUTDOWN_FUNCTION(bcmath)
{
_bc_free_num_ex(&bcmath_globals->_zero_, 1);
_bc_free_num_ex(&bcmath_globals->_one_, 1);
_bc_free_num_ex(&bcmath_globals->_two_, 1);
}
| DoS | 0 | static PHP_GSHUTDOWN_FUNCTION(bcmath)
{
_bc_free_num_ex(&bcmath_globals->_zero_, 1);
_bc_free_num_ex(&bcmath_globals->_one_, 1);
_bc_free_num_ex(&bcmath_globals->_two_, 1);
}
| @@ -201,6 +201,21 @@ static void php_str2num(bc_num *num, char *str TSRMLS_DC)
}
/* }}} */
+/* {{{ split_bc_num
+ Convert to bc_num detecting scale */
+static bc_num split_bc_num(bc_num num) {
+ bc_num newnum;
+ if (num->n_refs >= 1) {
+ return num;
+ }
+ newnum = _bc_new_num... | CWE-20 | null | null |
8,783 | PHP_MINIT_FUNCTION(bcmath)
{
REGISTER_INI_ENTRIES();
return SUCCESS;
}
| DoS | 0 | PHP_MINIT_FUNCTION(bcmath)
{
REGISTER_INI_ENTRIES();
return SUCCESS;
}
| @@ -201,6 +201,21 @@ static void php_str2num(bc_num *num, char *str TSRMLS_DC)
}
/* }}} */
+/* {{{ split_bc_num
+ Convert to bc_num detecting scale */
+static bc_num split_bc_num(bc_num num) {
+ bc_num newnum;
+ if (num->n_refs >= 1) {
+ return num;
+ }
+ newnum = _bc_new_num... | CWE-20 | null | null |
8,784 | PHP_MSHUTDOWN_FUNCTION(bcmath)
{
UNREGISTER_INI_ENTRIES();
return SUCCESS;
}
| DoS | 0 | PHP_MSHUTDOWN_FUNCTION(bcmath)
{
UNREGISTER_INI_ENTRIES();
return SUCCESS;
}
| @@ -201,6 +201,21 @@ static void php_str2num(bc_num *num, char *str TSRMLS_DC)
}
/* }}} */
+/* {{{ split_bc_num
+ Convert to bc_num detecting scale */
+static bc_num split_bc_num(bc_num num) {
+ bc_num newnum;
+ if (num->n_refs >= 1) {
+ return num;
+ }
+ newnum = _bc_new_num... | CWE-20 | null | null |
8,785 | deinit_stringbuf (struct stringbuf *sb)
{
xfree (sb->buf);
sb->buf = NULL;
sb->out_of_core = 1; /* make sure the caller does an init before reuse */
}
| DoS Overflow | 0 | deinit_stringbuf (struct stringbuf *sb)
{
xfree (sb->buf);
sb->buf = NULL;
sb->out_of_core = 1; /* make sure the caller does an init before reuse */
}
| @@ -260,7 +260,7 @@ append_quoted (struct stringbuf *sb, const unsigned char *value, size_t length,
n += skip;
if ( *s < ' ' || *s > 126 )
{
- sprintf (tmp, "\\%02X", *s);
+ snprintf (tmp, sizeof tmp, "\\%02X", *s);
put_stringbuf_mem (sb, tmp, 3);
}
el... | CWE-119 | null | null |
8,786 | get_stringbuf (struct stringbuf *sb)
{
char *p;
if (sb->out_of_core)
{
xfree (sb->buf); sb->buf = NULL;
return NULL;
}
sb->buf[sb->len] = 0;
p = sb->buf;
sb->buf = NULL;
sb->out_of_core = 1; /* make sure the caller does an init before reuse */
return p;
}
| DoS Overflow | 0 | get_stringbuf (struct stringbuf *sb)
{
char *p;
if (sb->out_of_core)
{
xfree (sb->buf); sb->buf = NULL;
return NULL;
}
sb->buf[sb->len] = 0;
p = sb->buf;
sb->buf = NULL;
sb->out_of_core = 1; /* make sure the caller does an init before reuse */
return p;
}
| @@ -260,7 +260,7 @@ append_quoted (struct stringbuf *sb, const unsigned char *value, size_t length,
n += skip;
if ( *s < ' ' || *s > 126 )
{
- sprintf (tmp, "\\%02X", *s);
+ snprintf (tmp, sizeof tmp, "\\%02X", *s);
put_stringbuf_mem (sb, tmp, 3);
}
el... | CWE-119 | null | null |
8,787 | init_stringbuf (struct stringbuf *sb, int initiallen)
{
sb->len = 0;
sb->size = initiallen;
sb->out_of_core = 0;
/* allocate one more, so that get_stringbuf can append a nul */
sb->buf = xtrymalloc (initiallen+1);
if (!sb->buf)
sb->out_of_core = 1;
}
| DoS Overflow | 0 | init_stringbuf (struct stringbuf *sb, int initiallen)
{
sb->len = 0;
sb->size = initiallen;
sb->out_of_core = 0;
/* allocate one more, so that get_stringbuf can append a nul */
sb->buf = xtrymalloc (initiallen+1);
if (!sb->buf)
sb->out_of_core = 1;
}
| @@ -260,7 +260,7 @@ append_quoted (struct stringbuf *sb, const unsigned char *value, size_t length,
n += skip;
if ( *s < ' ' || *s > 126 )
{
- sprintf (tmp, "\\%02X", *s);
+ snprintf (tmp, sizeof tmp, "\\%02X", *s);
put_stringbuf_mem (sb, tmp, 3);
}
el... | CWE-119 | null | null |
8,788 | put_stringbuf (struct stringbuf *sb, const char *text)
{
size_t n = strlen (text);
if (sb->out_of_core)
return;
if (sb->len + n >= sb->size)
{
char *p;
sb->size += n + 100;
p = xtryrealloc (sb->buf, sb->size);
if ( !p)
{
sb->out_of_core = 1;
return;
... | DoS Overflow | 0 | put_stringbuf (struct stringbuf *sb, const char *text)
{
size_t n = strlen (text);
if (sb->out_of_core)
return;
if (sb->len + n >= sb->size)
{
char *p;
sb->size += n + 100;
p = xtryrealloc (sb->buf, sb->size);
if ( !p)
{
sb->out_of_core = 1;
return;
... | @@ -260,7 +260,7 @@ append_quoted (struct stringbuf *sb, const unsigned char *value, size_t length,
n += skip;
if ( *s < ' ' || *s > 126 )
{
- sprintf (tmp, "\\%02X", *s);
+ snprintf (tmp, sizeof tmp, "\\%02X", *s);
put_stringbuf_mem (sb, tmp, 3);
}
el... | CWE-119 | null | null |
8,789 | put_stringbuf_mem_skip (struct stringbuf *sb, const char *text, size_t n,
int skip)
{
char *p;
if (!skip)
{
put_stringbuf_mem (sb, text, n);
return;
}
if (sb->out_of_core)
return;
if (sb->len + n >= sb->size)
{
/* Note: we allocate too much here, but w... | DoS Overflow | 0 | put_stringbuf_mem_skip (struct stringbuf *sb, const char *text, size_t n,
int skip)
{
char *p;
if (!skip)
{
put_stringbuf_mem (sb, text, n);
return;
}
if (sb->out_of_core)
return;
if (sb->len + n >= sb->size)
{
/* Note: we allocate too much here, but w... | @@ -260,7 +260,7 @@ append_quoted (struct stringbuf *sb, const unsigned char *value, size_t length,
n += skip;
if ( *s < ' ' || *s > 126 )
{
- sprintf (tmp, "\\%02X", *s);
+ snprintf (tmp, sizeof tmp, "\\%02X", *s);
put_stringbuf_mem (sb, tmp, 3);
}
el... | CWE-119 | null | null |
8,790 | dump_decoder_state (DECODER_STATE ds)
{
int i;
for (i=0; i < ds->idx; i++)
{
fprintf (stderr," ds stack[%d] (", i);
if (ds->stack[i].node)
_ksba_asn_node_dump (ds->stack[i].node, stderr);
else
fprintf (stderr, "Null");
fprintf (stderr,") %s%d (%d)%s\n",
d... | DoS Overflow | 0 | dump_decoder_state (DECODER_STATE ds)
{
int i;
for (i=0; i < ds->idx; i++)
{
fprintf (stderr," ds stack[%d] (", i);
if (ds->stack[i].node)
_ksba_asn_node_dump (ds->stack[i].node, stderr);
else
fprintf (stderr, "Null");
fprintf (stderr,") %s%d (%d)%s\n",
d... | @@ -1,5 +1,5 @@
/* ber-decoder.c - Basic Encoding Rules Decoder
- * Copyright (C) 2001, 2004, 2006, 2012 g10 Code GmbH
+ * Copyright (C) 2001, 2004, 2006, 2012, 2015 g10 Code GmbH
*
* This file is part of KSBA.
*
@@ -175,26 +175,28 @@ dump_decoder_state (DECODER_STATE ds)
}
/* Push ITEM onto the stack *... | CWE-20 | null | null |
8,791 | new_decoder_state (void)
{
DECODER_STATE ds;
ds = xmalloc (sizeof (*ds) + 99*sizeof(DECODER_STATE_ITEM));
ds->stacksize = 100;
ds->idx = 0;
ds->cur.node = NULL;
ds->cur.went_up = 0;
ds->cur.in_seq_of = 0;
ds->cur.in_any = 0;
ds->cur.again = 0;
ds->cur.next_tag = 0;
ds->cur.length = 0;
ds->cur.n... | DoS Overflow | 0 | new_decoder_state (void)
{
DECODER_STATE ds;
ds = xmalloc (sizeof (*ds) + 99*sizeof(DECODER_STATE_ITEM));
ds->stacksize = 100;
ds->idx = 0;
ds->cur.node = NULL;
ds->cur.went_up = 0;
ds->cur.in_seq_of = 0;
ds->cur.in_any = 0;
ds->cur.again = 0;
ds->cur.next_tag = 0;
ds->cur.length = 0;
ds->cur.n... | @@ -1,5 +1,5 @@
/* ber-decoder.c - Basic Encoding Rules Decoder
- * Copyright (C) 2001, 2004, 2006, 2012 g10 Code GmbH
+ * Copyright (C) 2001, 2004, 2006, 2012, 2015 g10 Code GmbH
*
* This file is part of KSBA.
*
@@ -175,26 +175,28 @@ dump_decoder_state (DECODER_STATE ds)
}
/* Push ITEM onto the stack *... | CWE-20 | null | null |
8,792 | release_decoder_state (DECODER_STATE ds)
{
xfree (ds);
}
| DoS Overflow | 0 | release_decoder_state (DECODER_STATE ds)
{
xfree (ds);
}
| @@ -1,5 +1,5 @@
/* ber-decoder.c - Basic Encoding Rules Decoder
- * Copyright (C) 2001, 2004, 2006, 2012 g10 Code GmbH
+ * Copyright (C) 2001, 2004, 2006, 2012, 2015 g10 Code GmbH
*
* This file is part of KSBA.
*
@@ -175,26 +175,28 @@ dump_decoder_state (DECODER_STATE ds)
}
/* Push ITEM onto the stack *... | CWE-20 | null | null |
8,793 | cff_decoder_prepare( CFF_Decoder* decoder,
CFF_Size size,
FT_UInt glyph_index )
{
CFF_Builder *builder = &decoder->builder;
CFF_Font cff = (CFF_Font)builder->face->extra.data;
CFF_SubFont sub = &cff->top_font;
FT_Error er... | DoS Exec Code Overflow Mem. Corr. | 0 | cff_decoder_prepare( CFF_Decoder* decoder,
CFF_Size size,
FT_UInt glyph_index )
{
CFF_Builder *builder = &decoder->builder;
CFF_Font cff = (CFF_Font)builder->face->extra.data;
CFF_SubFont sub = &cff->top_font;
FT_Error er... | @@ -2455,7 +2455,10 @@
return CFF_Err_Unimplemented_Feature;
}
- decoder->top = args;
+ decoder->top = args;
+
+ if ( decoder->top - stack >= CFF_MAX_OPERANDS )
+ goto Stack_Overflow;
} /* general operator processing */ | CWE-119 | null | null |
8,794 | compress_filter( void *opaque, int control,
IOBUF a, byte *buf, size_t *ret_len)
{
size_t size = *ret_len;
compress_filter_context_t *zfx = opaque;
z_stream *zs = zfx->opaque;
int rc=0;
if( control == IOBUFCTRL_UNDERFLOW ) {
if( !zfx->status ) {
zs = zfx->opaque = xmalloc_clear( sizeof *zs... | DoS | 0 | compress_filter( void *opaque, int control,
IOBUF a, byte *buf, size_t *ret_len)
{
size_t size = *ret_len;
compress_filter_context_t *zfx = opaque;
z_stream *zs = zfx->opaque;
int rc=0;
if( control == IOBUFCTRL_UNDERFLOW ) {
if( !zfx->status ) {
zs = zfx->opaque = xmalloc_clear( sizeof *zs... | @@ -161,7 +161,8 @@ do_uncompress( compress_filter_context_t *zfx, z_stream *zs,
IOBUF a, size_t *ret_len )
{
int zrc;
- int rc=0;
+ int rc = 0;
+ int leave = 0;
size_t n;
int nread, count;
int refill = !zs->avail_in;
@@ -179,13 +180,14 @@ do_uncompress( compress_filter_cont... | CWE-20 | null | null |
8,795 | do_compress( compress_filter_context_t *zfx, z_stream *zs, int flush, IOBUF a )
{
int rc;
int zrc;
unsigned n;
do {
zs->next_out = BYTEF_CAST (zfx->outbuf);
zs->avail_out = zfx->outbufsize;
if( DBG_FILTER )
log_debug("enter deflate: avail_in=%u, avail_out=%u, flush=%d\n",
(unsigned)zs->av... | DoS | 0 | do_compress( compress_filter_context_t *zfx, z_stream *zs, int flush, IOBUF a )
{
int rc;
int zrc;
unsigned n;
do {
zs->next_out = BYTEF_CAST (zfx->outbuf);
zs->avail_out = zfx->outbufsize;
if( DBG_FILTER )
log_debug("enter deflate: avail_in=%u, avail_out=%u, flush=%d\n",
(unsigned)zs->av... | @@ -161,7 +161,8 @@ do_uncompress( compress_filter_context_t *zfx, z_stream *zs,
IOBUF a, size_t *ret_len )
{
int zrc;
- int rc=0;
+ int rc = 0;
+ int leave = 0;
size_t n;
int nread, count;
int refill = !zs->avail_in;
@@ -179,13 +180,14 @@ do_uncompress( compress_filter_cont... | CWE-20 | null | null |
8,796 | handle_compressed( void *procctx, PKT_compressed *cd,
int (*callback)(IOBUF, void *), void *passthru )
{
compress_filter_context_t *cfx;
int rc;
if(check_compress_algo(cd->algorithm))
return G10ERR_COMPR_ALGO;
cfx = xmalloc_clear (sizeof *cfx);
cfx->release = release_context;
cfx->al... | DoS | 0 | handle_compressed( void *procctx, PKT_compressed *cd,
int (*callback)(IOBUF, void *), void *passthru )
{
compress_filter_context_t *cfx;
int rc;
if(check_compress_algo(cd->algorithm))
return G10ERR_COMPR_ALGO;
cfx = xmalloc_clear (sizeof *cfx);
cfx->release = release_context;
cfx->al... | @@ -161,7 +161,8 @@ do_uncompress( compress_filter_context_t *zfx, z_stream *zs,
IOBUF a, size_t *ret_len )
{
int zrc;
- int rc=0;
+ int rc = 0;
+ int leave = 0;
size_t n;
int nread, count;
int refill = !zs->avail_in;
@@ -179,13 +180,14 @@ do_uncompress( compress_filter_cont... | CWE-20 | null | null |
8,797 | init_compress( compress_filter_context_t *zfx, z_stream *zs )
{
int rc;
int level;
#if defined(__riscos__) && defined(USE_ZLIBRISCOS)
static int zlib_initialized = 0;
if (!zlib_initialized)
zlib_initialized = riscos_load_module("ZLib", zlib_path, 1);
#endif
if( opt.compress_level >= 1 && ... | DoS | 0 | init_compress( compress_filter_context_t *zfx, z_stream *zs )
{
int rc;
int level;
#if defined(__riscos__) && defined(USE_ZLIBRISCOS)
static int zlib_initialized = 0;
if (!zlib_initialized)
zlib_initialized = riscos_load_module("ZLib", zlib_path, 1);
#endif
if( opt.compress_level >= 1 && ... | @@ -161,7 +161,8 @@ do_uncompress( compress_filter_context_t *zfx, z_stream *zs,
IOBUF a, size_t *ret_len )
{
int zrc;
- int rc=0;
+ int rc = 0;
+ int leave = 0;
size_t n;
int nread, count;
int refill = !zs->avail_in;
@@ -179,13 +180,14 @@ do_uncompress( compress_filter_cont... | CWE-20 | null | null |
8,798 | init_uncompress( compress_filter_context_t *zfx, z_stream *zs )
{
int rc;
/****************
* PGP uses a windowsize of 13 bits. Using a negative value for
* it forces zlib not to expect a zlib header. This is a
* undocumented feature Peter Gutmann told me about.
*
* We must use 15... | DoS | 0 | init_uncompress( compress_filter_context_t *zfx, z_stream *zs )
{
int rc;
/****************
* PGP uses a windowsize of 13 bits. Using a negative value for
* it forces zlib not to expect a zlib header. This is a
* undocumented feature Peter Gutmann told me about.
*
* We must use 15... | @@ -161,7 +161,8 @@ do_uncompress( compress_filter_context_t *zfx, z_stream *zs,
IOBUF a, size_t *ret_len )
{
int zrc;
- int rc=0;
+ int rc = 0;
+ int leave = 0;
size_t n;
int nread, count;
int refill = !zs->avail_in;
@@ -179,13 +180,14 @@ do_uncompress( compress_filter_cont... | CWE-20 | null | null |
8,799 | push_compress_filter(IOBUF out,compress_filter_context_t *zfx,int algo)
{
push_compress_filter2(out,zfx,algo,0);
}
| DoS | 0 | push_compress_filter(IOBUF out,compress_filter_context_t *zfx,int algo)
{
push_compress_filter2(out,zfx,algo,0);
}
| @@ -161,7 +161,8 @@ do_uncompress( compress_filter_context_t *zfx, z_stream *zs,
IOBUF a, size_t *ret_len )
{
int zrc;
- int rc=0;
+ int rc = 0;
+ int leave = 0;
size_t n;
int nread, count;
int refill = !zs->avail_in;
@@ -179,13 +180,14 @@ do_uncompress( compress_filter_cont... | CWE-20 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.