idx int64 | func_before string | Vulnerability Classification string | vul int64 | func_after string | patch string | CWE ID string | lines_before string | lines_after string |
|---|---|---|---|---|---|---|---|---|
100 | static void add_assoc_asn1_string(zval * val, char * key, ASN1_STRING * str) /* {{{ */
{
add_assoc_stringl(val, key, (char *)str->data, str->length, 1);
}
/* }}} */
| DoS Exec Code Overflow Mem. Corr. | 0 | static void add_assoc_asn1_string(zval * val, char * key, ASN1_STRING * str) /* {{{ */
{
add_assoc_stringl(val, key, (char *)str->data, str->length, 1);
}
/* }}} */
| @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
101 | static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int shortname TSRMLS_DC) /* {{{ */
{
zval *subitem, *subentries;
int i, j = -1, last = -1, obj_cnt = 0;
char *sname;
int nid;
X509_NAME_ENTRY * ne;
ASN1_STRING * str = NULL;
ASN1_OBJECT * obj;
if (key != NULL) {
MAKE_STD_ZVAL(subitem)... | DoS Exec Code Overflow Mem. Corr. | 0 | static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int shortname TSRMLS_DC) /* {{{ */
{
zval *subitem, *subentries;
int i, j = -1, last = -1, obj_cnt = 0;
char *sname;
int nid;
X509_NAME_ENTRY * ne;
ASN1_STRING * str = NULL;
ASN1_OBJECT * obj;
if (key != NULL) {
MAKE_STD_ZVAL(subitem)... | @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
102 | static int add_oid_section(struct php_x509_request * req TSRMLS_DC) /* {{{ */
{
char * str;
STACK_OF(CONF_VALUE) * sktmp;
CONF_VALUE * cnf;
int i;
str = CONF_get_string(req->req_config, NULL, "oid_section");
if (str == NULL) {
return SUCCESS;
}
sktmp = CONF_get_section(req->req_config, str);
if (sktmp == NU... | DoS Exec Code Overflow Mem. Corr. | 0 | static int add_oid_section(struct php_x509_request * req TSRMLS_DC) /* {{{ */
{
char * str;
STACK_OF(CONF_VALUE) * sktmp;
CONF_VALUE * cnf;
int i;
str = CONF_get_string(req->req_config, NULL, "oid_section");
if (str == NULL) {
return SUCCESS;
}
sktmp = CONF_get_section(req->req_config, str);
if (sktmp == NU... | @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
103 | static int check_cert(X509_STORE *ctx, X509 *x, STACK_OF(X509) *untrustedchain, int purpose)
{
int ret=0;
X509_STORE_CTX *csc;
TSRMLS_FETCH();
csc = X509_STORE_CTX_new();
if (csc == NULL) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, "memory allocation failure");
return 0;
}
X509_STORE_CTX_init(csc, ctx, x, u... | DoS Exec Code Overflow Mem. Corr. | 0 | static int check_cert(X509_STORE *ctx, X509 *x, STACK_OF(X509) *untrustedchain, int purpose)
{
int ret=0;
X509_STORE_CTX *csc;
TSRMLS_FETCH();
csc = X509_STORE_CTX_new();
if (csc == NULL) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, "memory allocation failure");
return 0;
}
X509_STORE_CTX_init(csc, ctx, x, u... | @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
104 | static STACK_OF(X509) * load_all_certs_from_file(char *certfile)
{
STACK_OF(X509_INFO) *sk=NULL;
STACK_OF(X509) *stack=NULL, *ret=NULL;
BIO *in=NULL;
X509_INFO *xi;
TSRMLS_FETCH();
if(!(stack = sk_X509_new_null())) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, "memory allocation failure");
goto end;
}
if (p... | DoS Exec Code Overflow Mem. Corr. | 0 | static STACK_OF(X509) * load_all_certs_from_file(char *certfile)
{
STACK_OF(X509_INFO) *sk=NULL;
STACK_OF(X509) *stack=NULL, *ret=NULL;
BIO *in=NULL;
X509_INFO *xi;
TSRMLS_FETCH();
if(!(stack = sk_X509_new_null())) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, "memory allocation failure");
goto end;
}
if (p... | @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
105 | static void openssl_add_method(const OBJ_NAME *name, void *arg) /* {{{ */
{
if (name->alias == 0) {
add_next_index_string((zval*)arg, (char*)name->name, 1);
}
}
/* }}} */
| DoS Exec Code Overflow Mem. Corr. | 0 | static void openssl_add_method(const OBJ_NAME *name, void *arg) /* {{{ */
{
if (name->alias == 0) {
add_next_index_string((zval*)arg, (char*)name->name, 1);
}
}
/* }}} */
| @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
106 | static void openssl_add_method_or_alias(const OBJ_NAME *name, void *arg) /* {{{ */
{
add_next_index_string((zval*)arg, (char*)name->name, 1);
}
/* }}} */
| DoS Exec Code Overflow Mem. Corr. | 0 | static void openssl_add_method_or_alias(const OBJ_NAME *name, void *arg) /* {{{ */
{
add_next_index_string((zval*)arg, (char*)name->name, 1);
}
/* }}} */
| @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
107 | static int openssl_x509v3_subjectAltName(BIO *bio, X509_EXTENSION *extension)
{
GENERAL_NAMES *names;
const X509V3_EXT_METHOD *method = NULL;
long i, length, num;
const unsigned char *p;
method = X509V3_EXT_get(extension);
if (method == NULL) {
return -1;
}
p = extension->value->data;
length = extension->v... | DoS Exec Code Overflow Mem. Corr. | 0 | static int openssl_x509v3_subjectAltName(BIO *bio, X509_EXTENSION *extension)
{
GENERAL_NAMES *names;
const X509V3_EXT_METHOD *method = NULL;
long i, length, num;
const unsigned char *p;
method = X509V3_EXT_get(extension);
if (method == NULL) {
return -1;
}
p = extension->value->data;
length = extension->v... | @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
108 | static STACK_OF(X509) * php_array_to_X509_sk(zval ** zcerts TSRMLS_DC) /* {{{ */
{
HashPosition hpos;
zval ** zcertval;
STACK_OF(X509) * sk = NULL;
X509 * cert;
long certresource;
sk = sk_X509_new_null();
/* get certs */
if (Z_TYPE_PP(zcerts) == IS_ARRAY) {
zend_hash_internal_pointer_reset_ex(HASH_OF(... | DoS Exec Code Overflow Mem. Corr. | 0 | static STACK_OF(X509) * php_array_to_X509_sk(zval ** zcerts TSRMLS_DC) /* {{{ */
{
HashPosition hpos;
zval ** zcertval;
STACK_OF(X509) * sk = NULL;
X509 * cert;
long certresource;
sk = sk_X509_new_null();
/* get certs */
if (Z_TYPE_PP(zcerts) == IS_ARRAY) {
zend_hash_internal_pointer_reset_ex(HASH_OF(... | @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
109 | static void php_csr_free(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
X509_REQ * csr = (X509_REQ*)rsrc->ptr;
X509_REQ_free(csr);
}
| DoS Exec Code Overflow Mem. Corr. | 0 | static void php_csr_free(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
X509_REQ * csr = (X509_REQ*)rsrc->ptr;
X509_REQ_free(csr);
}
| @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
110 | static inline int php_openssl_config_check_syntax(const char * section_label, const char * config_filename, const char * section, LHASH_OF(CONF_VALUE) * config TSRMLS_DC) /* {{{ */
#else
static inline int php_openssl_config_check_syntax(const char * section_label, const char * config_filename, const char * section, LHA... | DoS Exec Code Overflow Mem. Corr. | 0 | static inline int php_openssl_config_check_syntax(const char * section_label, const char * config_filename, const char * section, LHASH_OF(CONF_VALUE) * config TSRMLS_DC) /* {{{ */
#else
static inline int php_openssl_config_check_syntax(const char * section_label, const char * config_filename, const char * section, LHA... | @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
111 | static X509_REQ * php_openssl_csr_from_zval(zval ** val, int makeresource, long * resourceval TSRMLS_DC)
{
X509_REQ * csr = NULL;
char * filename = NULL;
BIO * in;
if (resourceval) {
*resourceval = -1;
}
if (Z_TYPE_PP(val) == IS_RESOURCE) {
void * what;
int type;
what = zend_fetch_resource(val TSRMLS_C... | DoS Exec Code Overflow Mem. Corr. | 0 | static X509_REQ * php_openssl_csr_from_zval(zval ** val, int makeresource, long * resourceval TSRMLS_DC)
{
X509_REQ * csr = NULL;
char * filename = NULL;
BIO * in;
if (resourceval) {
*resourceval = -1;
}
if (Z_TYPE_PP(val) == IS_RESOURCE) {
void * what;
int type;
what = zend_fetch_resource(val TSRMLS_C... | @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
112 | static void php_openssl_dispose_config(struct php_x509_request * req TSRMLS_DC) /* {{{ */
{
if (req->priv_key) {
EVP_PKEY_free(req->priv_key);
req->priv_key = NULL;
}
if (req->global_config) {
CONF_free(req->global_config);
req->global_config = NULL;
}
if (req->req_config) {
CONF_free(req->req_config);
... | DoS Exec Code Overflow Mem. Corr. | 0 | static void php_openssl_dispose_config(struct php_x509_request * req TSRMLS_DC) /* {{{ */
{
if (req->priv_key) {
EVP_PKEY_free(req->priv_key);
req->priv_key = NULL;
}
if (req->global_config) {
CONF_free(req->global_config);
req->global_config = NULL;
}
if (req->req_config) {
CONF_free(req->req_config);
... | @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
113 | static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req TSRMLS_DC)
{
char * randfile = NULL;
int egdsocket, seeded;
EVP_PKEY * return_val = NULL;
if (req->priv_key_bits < MIN_KEY_LENGTH) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "private key length is too short; it needs to be at le... | DoS Exec Code Overflow Mem. Corr. | 0 | static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req TSRMLS_DC)
{
char * randfile = NULL;
int egdsocket, seeded;
EVP_PKEY * return_val = NULL;
if (req->priv_key_bits < MIN_KEY_LENGTH) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "private key length is too short; it needs to be at le... | @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
114 | static const EVP_CIPHER * php_openssl_get_evp_cipher_from_algo(long algo) { /* {{{ */
switch (algo) {
#ifndef OPENSSL_NO_RC2
case PHP_OPENSSL_CIPHER_RC2_40:
return EVP_rc2_40_cbc();
break;
case PHP_OPENSSL_CIPHER_RC2_64:
return EVP_rc2_64_cbc();
break;
case PHP_OPENSSL_CIPHER_RC2_128:
return EVP_r... | DoS Exec Code Overflow Mem. Corr. | 0 | static const EVP_CIPHER * php_openssl_get_evp_cipher_from_algo(long algo) { /* {{{ */
switch (algo) {
#ifndef OPENSSL_NO_RC2
case PHP_OPENSSL_CIPHER_RC2_40:
return EVP_rc2_40_cbc();
break;
case PHP_OPENSSL_CIPHER_RC2_64:
return EVP_rc2_64_cbc();
break;
case PHP_OPENSSL_CIPHER_RC2_128:
return EVP_r... | @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
115 | static EVP_MD * php_openssl_get_evp_md_from_algo(long algo) { /* {{{ */
EVP_MD *mdtype;
switch (algo) {
case OPENSSL_ALGO_SHA1:
mdtype = (EVP_MD *) EVP_sha1();
break;
case OPENSSL_ALGO_MD5:
mdtype = (EVP_MD *) EVP_md5();
break;
case OPENSSL_ALGO_MD4:
mdtype = (EVP_MD *) EVP_md4();
break;
#ifd... | DoS Exec Code Overflow Mem. Corr. | 0 | static EVP_MD * php_openssl_get_evp_md_from_algo(long algo) { /* {{{ */
EVP_MD *mdtype;
switch (algo) {
case OPENSSL_ALGO_SHA1:
mdtype = (EVP_MD *) EVP_sha1();
break;
case OPENSSL_ALGO_MD5:
mdtype = (EVP_MD *) EVP_md5();
break;
case OPENSSL_ALGO_MD4:
mdtype = (EVP_MD *) EVP_md4();
break;
#ifd... | @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
116 | static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded) /* {{{ */
{
char buffer[MAXPATHLEN];
TSRMLS_FETCH();
*egdsocket = 0;
*seeded = 0;
if (file == NULL) {
file = RAND_file_name(buffer, sizeof(buffer));
} else if (RAND_egd(file) > 0) {
/* if the given filename is an EGD sock... | DoS Exec Code Overflow Mem. Corr. | 0 | static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded) /* {{{ */
{
char buffer[MAXPATHLEN];
TSRMLS_FETCH();
*egdsocket = 0;
*seeded = 0;
if (file == NULL) {
file = RAND_file_name(buffer, sizeof(buffer));
} else if (RAND_egd(file) > 0) {
/* if the given filename is an EGD sock... | @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
117 | static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, zval * dn, zval * attribs TSRMLS_DC)
{
STACK_OF(CONF_VALUE) * dn_sk, *attr_sk = NULL;
char * str, *dn_sect, *attr_sect;
dn_sect = CONF_get_string(req->req_config, req->section_name, "distinguished_name");
if (dn_sect == NULL) {
return... | DoS Exec Code Overflow Mem. Corr. | 0 | static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, zval * dn, zval * attribs TSRMLS_DC)
{
STACK_OF(CONF_VALUE) * dn_sk, *attr_sk = NULL;
char * str, *dn_sect, *attr_sect;
dn_sect = CONF_get_string(req->req_config, req->section_name, "distinguished_name");
if (dn_sect == NULL) {
return... | @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
118 | static int php_openssl_write_rand_file(const char * file, int egdsocket, int seeded) /* {{{ */
{
char buffer[MAXPATHLEN];
TSRMLS_FETCH();
if (egdsocket || !seeded) {
/* if we did not manage to read the seed file, we should not write
* a low-entropy seed file back */
return FAILURE;
}
if (file == NULL) {
... | DoS Exec Code Overflow Mem. Corr. | 0 | static int php_openssl_write_rand_file(const char * file, int egdsocket, int seeded) /* {{{ */
{
char buffer[MAXPATHLEN];
TSRMLS_FETCH();
if (egdsocket || !seeded) {
/* if we did not manage to read the seed file, we should not write
* a low-entropy seed file back */
return FAILURE;
}
if (file == NULL) {
... | @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
119 | static X509 * php_openssl_x509_from_zval(zval ** val, int makeresource, long * resourceval TSRMLS_DC)
{
X509 *cert = NULL;
if (resourceval) {
*resourceval = -1;
}
if (Z_TYPE_PP(val) == IS_RESOURCE) {
/* is it an x509 resource ? */
void * what;
int type;
what = zend_fetch_resource(val TSRMLS_CC, -1, "Ope... | DoS Exec Code Overflow Mem. Corr. | 0 | static X509 * php_openssl_x509_from_zval(zval ** val, int makeresource, long * resourceval TSRMLS_DC)
{
X509 *cert = NULL;
if (resourceval) {
*resourceval = -1;
}
if (Z_TYPE_PP(val) == IS_RESOURCE) {
/* is it an x509 resource ? */
void * what;
int type;
what = zend_fetch_resource(val TSRMLS_CC, -1, "Ope... | @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
120 | static void php_pkey_free(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
EVP_PKEY *pkey = (EVP_PKEY *)rsrc->ptr;
assert(pkey != NULL);
EVP_PKEY_free(pkey);
}
| DoS Exec Code Overflow Mem. Corr. | 0 | static void php_pkey_free(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
EVP_PKEY *pkey = (EVP_PKEY *)rsrc->ptr;
assert(pkey != NULL);
EVP_PKEY_free(pkey);
}
| @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
121 | static void php_x509_free(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
X509 *x509 = (X509 *)rsrc->ptr;
X509_free(x509);
}
| DoS Exec Code Overflow Mem. Corr. | 0 | static void php_x509_free(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
X509 *x509 = (X509 *)rsrc->ptr;
X509_free(x509);
}
| @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
122 | static X509_STORE * setup_verify(zval * calist TSRMLS_DC)
{
X509_STORE *store;
X509_LOOKUP * dir_lookup, * file_lookup;
HashPosition pos;
int ndirs = 0, nfiles = 0;
store = X509_STORE_new();
if (store == NULL) {
return NULL;
}
if (calist && (Z_TYPE_P(calist) == IS_ARRAY)) {
zend_hash_internal_pointer_res... | DoS Exec Code Overflow Mem. Corr. | 0 | static X509_STORE * setup_verify(zval * calist TSRMLS_DC)
{
X509_STORE *store;
X509_LOOKUP * dir_lookup, * file_lookup;
HashPosition pos;
int ndirs = 0, nfiles = 0;
store = X509_STORE_new();
if (store == NULL) {
return NULL;
}
if (calist && (Z_TYPE_P(calist) == IS_ARRAY)) {
zend_hash_internal_pointer_res... | @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
123 | static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) /* {{{ */
{
php_stream *stream;
SSL *ssl;
X509 *err_cert;
int err, depth, ret;
zval **val;
ret = preverify_ok;
/* determine the status for the current cert */
err_cert = X509_STORE_CTX_get_current_cert(ctx);
err = X509_STORE_CTX_get_error(ctx)... | DoS Exec Code Overflow Mem. Corr. | 0 | static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) /* {{{ */
{
php_stream *stream;
SSL *ssl;
X509 *err_cert;
int err, depth, ret;
zval **val;
ret = preverify_ok;
/* determine the status for the current cert */
err_cert = X509_STORE_CTX_get_current_cert(ctx);
err = X509_STORE_CTX_get_error(ctx)... | @@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ ... | CWE-119 | null | null |
124 | gnutls_session_get_data2 (gnutls_session_t session, gnutls_datum_t * data)
{
int ret;
if (data == NULL)
{
return GNUTLS_E_INVALID_REQUEST;
}
if (session->internals.resumable == RESUME_FALSE)
return GNUTLS_E_INVALID_SESSION;
ret = _gnutls_session_pack (session, data);
if (ret < 0)
{
... | DoS Overflow | 0 | gnutls_session_get_data2 (gnutls_session_t session, gnutls_datum_t * data)
{
int ret;
if (data == NULL)
{
return GNUTLS_E_INVALID_REQUEST;
}
if (session->internals.resumable == RESUME_FALSE)
return GNUTLS_E_INVALID_SESSION;
ret = _gnutls_session_pack (session, data);
if (ret < 0)
{
... | @@ -63,13 +63,13 @@ gnutls_session_get_data (gnutls_session_t session,
gnutls_assert ();
return ret;
}
- *session_data_size = psession.size;
if (psession.size > *session_data_size)
{
ret = GNUTLS_E_SHORT_MEMORY_BUFFER;
goto error;
}
+ *session_data_size = psession.size;... | CWE-119 | null | null |
125 | gnutls_session_get_id (gnutls_session_t session,
void *session_id, size_t * session_id_size)
{
size_t given_session_id_size = *session_id_size;
*session_id_size = session->security_parameters.session_id_size;
/* just return the session size */
if (session_id == NULL)
{
return ... | DoS Overflow | 0 | gnutls_session_get_id (gnutls_session_t session,
void *session_id, size_t * session_id_size)
{
size_t given_session_id_size = *session_id_size;
*session_id_size = session->security_parameters.session_id_size;
/* just return the session size */
if (session_id == NULL)
{
return ... | @@ -63,13 +63,13 @@ gnutls_session_get_data (gnutls_session_t session,
gnutls_assert ();
return ret;
}
- *session_data_size = psession.size;
if (psession.size > *session_data_size)
{
ret = GNUTLS_E_SHORT_MEMORY_BUFFER;
goto error;
}
+ *session_data_size = psession.size;... | CWE-119 | null | null |
126 | gnutls_session_set_data (gnutls_session_t session,
const void *session_data, size_t session_data_size)
{
int ret;
gnutls_datum_t psession;
psession.data = (opaque *) session_data;
psession.size = session_data_size;
if (session_data == NULL || session_data_size == 0)
{
gnut... | DoS Overflow | 0 | gnutls_session_set_data (gnutls_session_t session,
const void *session_data, size_t session_data_size)
{
int ret;
gnutls_datum_t psession;
psession.data = (opaque *) session_data;
psession.size = session_data_size;
if (session_data == NULL || session_data_size == 0)
{
gnut... | @@ -63,13 +63,13 @@ gnutls_session_get_data (gnutls_session_t session,
gnutls_assert ();
return ret;
}
- *session_data_size = psession.size;
if (psession.size > *session_data_size)
{
ret = GNUTLS_E_SHORT_MEMORY_BUFFER;
goto error;
}
+ *session_data_size = psession.size;... | CWE-119 | null | null |
127 | static int phar_compare_dir_name(const void *a, const void *b TSRMLS_DC) /* {{{ */
{
Bucket *f;
Bucket *s;
int result;
f = *((Bucket **) a);
s = *((Bucket **) b);
result = zend_binary_strcmp(f->arKey, f->nKeyLength, s->arKey, s->nKeyLength);
if (result < 0) {
return -1;
} else if (result > 0) {
return 1;... | DoS | 0 | static int phar_compare_dir_name(const void *a, const void *b TSRMLS_DC) /* {{{ */
{
Bucket *f;
Bucket *s;
int result;
f = *((Bucket **) a);
s = *((Bucket **) b);
result = zend_binary_strcmp(f->arKey, f->nKeyLength, s->arKey, s->nKeyLength);
if (result < 0) {
return -1;
} else if (result > 0) {
return 1;... | @@ -207,7 +207,7 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC)
zend_hash_internal_pointer_reset(manifest);
while (FAILURE != zend_hash_has_more_elements(manifest)) {
- if (HASH_KEY_IS_STRING != zend_hash_get_current_key_ex(manifest, &key, &keylen, &u... | CWE-189 | null | null |
128 | static int phar_dir_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
{
HashTable *data = (HashTable *)stream->abstract;
if (data && data->arBuckets) {
zend_hash_destroy(data);
data->arBuckets = 0;
FREE_HASHTABLE(data);
stream->abstract = NULL;
}
return 0;
}
/* }}} */
| DoS | 0 | static int phar_dir_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
{
HashTable *data = (HashTable *)stream->abstract;
if (data && data->arBuckets) {
zend_hash_destroy(data);
data->arBuckets = 0;
FREE_HASHTABLE(data);
stream->abstract = NULL;
}
return 0;
}
/* }}} */
| @@ -207,7 +207,7 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC)
zend_hash_internal_pointer_reset(manifest);
while (FAILURE != zend_hash_has_more_elements(manifest)) {
- if (HASH_KEY_IS_STRING != zend_hash_get_current_key_ex(manifest, &key, &keylen, &u... | CWE-189 | null | null |
129 | static int phar_dir_flush(php_stream *stream TSRMLS_DC) /* {{{ */
{
return EOF;
}
/* }}} */
| DoS | 0 | static int phar_dir_flush(php_stream *stream TSRMLS_DC) /* {{{ */
{
return EOF;
}
/* }}} */
| @@ -207,7 +207,7 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC)
zend_hash_internal_pointer_reset(manifest);
while (FAILURE != zend_hash_has_more_elements(manifest)) {
- if (HASH_KEY_IS_STRING != zend_hash_get_current_key_ex(manifest, &key, &keylen, &u... | CWE-189 | null | null |
130 | static size_t phar_dir_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
{
size_t to_read;
HashTable *data = (HashTable *)stream->abstract;
phar_zstr key;
char *str_key;
uint keylen;
ulong unused;
if (FAILURE == zend_hash_has_more_elements(data)) {
return 0;
}
if (HASH_KEY_NON_EXISTENT ... | DoS | 0 | static size_t phar_dir_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
{
size_t to_read;
HashTable *data = (HashTable *)stream->abstract;
phar_zstr key;
char *str_key;
uint keylen;
ulong unused;
if (FAILURE == zend_hash_has_more_elements(data)) {
return 0;
}
if (HASH_KEY_NON_EXISTENT ... | @@ -207,7 +207,7 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC)
zend_hash_internal_pointer_reset(manifest);
while (FAILURE != zend_hash_has_more_elements(manifest)) {
- if (HASH_KEY_IS_STRING != zend_hash_get_current_key_ex(manifest, &key, &keylen, &u... | CWE-189 | null | null |
131 | static int phar_dir_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC) /* {{{ */
{
HashTable *data = (HashTable *)stream->abstract;
if (!data) {
return -1;
}
if (whence == SEEK_END) {
whence = SEEK_SET;
offset = zend_hash_num_elements(data) + offset;
}
if (whence == SEEK_SET) ... | DoS | 0 | static int phar_dir_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC) /* {{{ */
{
HashTable *data = (HashTable *)stream->abstract;
if (!data) {
return -1;
}
if (whence == SEEK_END) {
whence = SEEK_SET;
offset = zend_hash_num_elements(data) + offset;
}
if (whence == SEEK_SET) ... | @@ -207,7 +207,7 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC)
zend_hash_internal_pointer_reset(manifest);
while (FAILURE != zend_hash_has_more_elements(manifest)) {
- if (HASH_KEY_IS_STRING != zend_hash_get_current_key_ex(manifest, &key, &keylen, &u... | CWE-189 | null | null |
132 | static size_t phar_dir_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
{
return 0;
}
/* }}} */
| DoS | 0 | static size_t phar_dir_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
{
return 0;
}
/* }}} */
| @@ -207,7 +207,7 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC)
zend_hash_internal_pointer_reset(manifest);
while (FAILURE != zend_hash_has_more_elements(manifest)) {
- if (HASH_KEY_IS_STRING != zend_hash_get_current_key_ex(manifest, &key, &keylen, &u... | CWE-189 | null | null |
133 | int phar_wrapper_mkdir(php_stream_wrapper *wrapper, char *url_from, int mode, int options, php_stream_context *context TSRMLS_DC) /* {{{ */
{
phar_entry_info entry, *e;
phar_archive_data *phar = NULL;
char *error, *arch, *entry2;
int arch_len, entry_len;
php_url *resource = NULL;
uint host_len;
/* pre-readonly ... | DoS | 0 | int phar_wrapper_mkdir(php_stream_wrapper *wrapper, char *url_from, int mode, int options, php_stream_context *context TSRMLS_DC) /* {{{ */
{
phar_entry_info entry, *e;
phar_archive_data *phar = NULL;
char *error, *arch, *entry2;
int arch_len, entry_len;
php_url *resource = NULL;
uint host_len;
/* pre-readonly ... | @@ -207,7 +207,7 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC)
zend_hash_internal_pointer_reset(manifest);
while (FAILURE != zend_hash_has_more_elements(manifest)) {
- if (HASH_KEY_IS_STRING != zend_hash_get_current_key_ex(manifest, &key, &keylen, &u... | CWE-189 | null | null |
134 | php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */
{
php_url *resource = NULL;
php_stream *ret;
char *internal_file, *error, *str_key;
phar_zstr key;
uint keylen;
ulong unused;
phar_ar... | DoS | 0 | php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */
{
php_url *resource = NULL;
php_stream *ret;
char *internal_file, *error, *str_key;
phar_zstr key;
uint keylen;
ulong unused;
phar_ar... | @@ -207,7 +207,7 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC)
zend_hash_internal_pointer_reset(manifest);
while (FAILURE != zend_hash_has_more_elements(manifest)) {
- if (HASH_KEY_IS_STRING != zend_hash_get_current_key_ex(manifest, &key, &keylen, &u... | CWE-189 | null | null |
135 | int phar_wrapper_rmdir(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC) /* {{{ */
{
phar_entry_info *entry;
phar_archive_data *phar = NULL;
char *error, *arch, *entry2;
int arch_len, entry_len;
php_url *resource = NULL;
uint host_len;
phar_zstr key;
char *str_key;
uin... | DoS | 0 | int phar_wrapper_rmdir(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC) /* {{{ */
{
phar_entry_info *entry;
phar_archive_data *phar = NULL;
char *error, *arch, *entry2;
int arch_len, entry_len;
php_url *resource = NULL;
uint host_len;
phar_zstr key;
char *str_key;
uin... | @@ -207,7 +207,7 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC)
zend_hash_internal_pointer_reset(manifest);
while (FAILURE != zend_hash_has_more_elements(manifest)) {
- if (HASH_KEY_IS_STRING != zend_hash_get_current_key_ex(manifest, &key, &keylen, &u... | CWE-189 | null | null |
136 | char * phar_compress_filter(phar_entry_info * entry, int return_unknown) /* {{{ */
{
switch (entry->flags & PHAR_ENT_COMPRESSION_MASK) {
case PHAR_ENT_COMPRESSED_GZ:
return "zlib.deflate";
case PHAR_ENT_COMPRESSED_BZ2:
return "bzip2.compress";
default:
return return_unknown ? "unknown" : NULL;
}
}
/* }}} */
| DoS | 0 | char * phar_compress_filter(phar_entry_info * entry, int return_unknown) /* {{{ */
{
switch (entry->flags & PHAR_ENT_COMPRESSION_MASK) {
case PHAR_ENT_COMPRESSED_GZ:
return "zlib.deflate";
case PHAR_ENT_COMPRESSED_BZ2:
return "bzip2.compress";
default:
return return_unknown ? "unknown" : NULL;
}
}
/* }}} */
| @@ -1977,7 +1977,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
while ((s = zend_memrchr(filename, '/', filename_len))) {
filename_len = s - filename;
- if (FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len))... | CWE-189 | null | null |
137 | static void phar_copy_cached_phar(phar_archive_data **pphar TSRMLS_DC) /* {{{ */
{
phar_archive_data *phar;
HashTable newmanifest;
char *fname;
phar_archive_object **objphar;
phar = (phar_archive_data *) emalloc(sizeof(phar_archive_data));
*phar = **pphar;
phar->is_persistent = 0;
fname = phar->fname;
phar->f... | DoS | 0 | static void phar_copy_cached_phar(phar_archive_data **pphar TSRMLS_DC) /* {{{ */
{
phar_archive_data *phar;
HashTable newmanifest;
char *fname;
phar_archive_object **objphar;
phar = (phar_archive_data *) emalloc(sizeof(phar_archive_data));
*phar = **pphar;
phar->is_persistent = 0;
fname = phar->fname;
phar->f... | @@ -1977,7 +1977,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
while ((s = zend_memrchr(filename, '/', filename_len))) {
filename_len = s - filename;
- if (FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len))... | CWE-189 | null | null |
138 | int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **error TSRMLS_DC) /* {{{ */
{
phar_entry_info *link;
if (FAILURE == phar_open_entry_fp(source, error, 1 TSRMLS_CC)) {
return FAILURE;
}
if (dest->link) {
efree(dest->link);
dest->link = NULL;
dest->tar_type = (dest->is_tar ? TAR_... | DoS | 0 | int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **error TSRMLS_DC) /* {{{ */
{
phar_entry_info *link;
if (FAILURE == phar_open_entry_fp(source, error, 1 TSRMLS_CC)) {
return FAILURE;
}
if (dest->link) {
efree(dest->link);
dest->link = NULL;
dest->tar_type = (dest->is_tar ? TAR_... | @@ -1977,7 +1977,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
while ((s = zend_memrchr(filename, '/', filename_len))) {
filename_len = s - filename;
- if (FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len))... | CWE-189 | null | null |
139 | int phar_copy_on_write(phar_archive_data **pphar TSRMLS_DC) /* {{{ */
{
phar_archive_data **newpphar, *newphar = NULL;
if (SUCCESS != zend_hash_add(&(PHAR_GLOBALS->phar_fname_map), (*pphar)->fname, (*pphar)->fname_len, (void *)&newphar, sizeof(phar_archive_data *), (void **)&newpphar)) {
return FAILURE;
}
*newp... | DoS | 0 | int phar_copy_on_write(phar_archive_data **pphar TSRMLS_DC) /* {{{ */
{
phar_archive_data **newpphar, *newphar = NULL;
if (SUCCESS != zend_hash_add(&(PHAR_GLOBALS->phar_fname_map), (*pphar)->fname, (*pphar)->fname_len, (void *)&newphar, sizeof(phar_archive_data *), (void **)&newpphar)) {
return FAILURE;
}
*newp... | @@ -1977,7 +1977,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
while ((s = zend_memrchr(filename, '/', filename_len))) {
filename_len = s - filename;
- if (FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len))... | CWE-189 | null | null |
140 | int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signature, int *signature_length, char **error TSRMLS_DC) /* {{{ */
{
unsigned char buf[1024];
int sig_len;
php_stream_rewind(fp);
if (phar->signature) {
efree(phar->signature);
phar->signature = NULL;
}
switch(phar->sig_flags) {
#if... | DoS | 0 | int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signature, int *signature_length, char **error TSRMLS_DC) /* {{{ */
{
unsigned char buf[1024];
int sig_len;
php_stream_rewind(fp);
if (phar->signature) {
efree(phar->signature);
phar->signature = NULL;
}
switch(phar->sig_flags) {
#if... | @@ -1977,7 +1977,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
while ((s = zend_memrchr(filename, '/', filename_len))) {
filename_len = s - filename;
- if (FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len))... | CWE-189 | null | null |
141 | int phar_create_writeable_entry(phar_archive_data *phar, phar_entry_info *entry, char **error TSRMLS_DC) /* {{{ */
{
if (entry->fp_type == PHAR_MOD) {
/* already newly created, truncate */
php_stream_truncate_set_size(entry->fp, 0);
entry->old_flags = entry->flags;
entry->is_modified = 1;
phar->is_modified ... | DoS | 0 | int phar_create_writeable_entry(phar_archive_data *phar, phar_entry_info *entry, char **error TSRMLS_DC) /* {{{ */
{
if (entry->fp_type == PHAR_MOD) {
/* already newly created, truncate */
php_stream_truncate_set_size(entry->fp, 0);
entry->old_flags = entry->flags;
entry->is_modified = 1;
phar->is_modified ... | @@ -1977,7 +1977,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
while ((s = zend_memrchr(filename, '/', filename_len))) {
filename_len = s - filename;
- if (FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len))... | CWE-189 | null | null |
142 | int phar_free_alias(phar_archive_data *phar, char *alias, int alias_len TSRMLS_DC) /* {{{ */
{
if (phar->refcount || phar->is_persistent) {
return FAILURE;
}
/* this archive has no open references, so emit an E_STRICT and remove it */
if (zend_hash_del(&(PHAR_GLOBALS->phar_fname_map), phar->fname, phar->fname_le... | DoS | 0 | int phar_free_alias(phar_archive_data *phar, char *alias, int alias_len TSRMLS_DC) /* {{{ */
{
if (phar->refcount || phar->is_persistent) {
return FAILURE;
}
/* this archive has no open references, so emit an E_STRICT and remove it */
if (zend_hash_del(&(PHAR_GLOBALS->phar_fname_map), phar->fname, phar->fname_le... | @@ -1977,7 +1977,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
while ((s = zend_memrchr(filename, '/', filename_len))) {
filename_len = s - filename;
- if (FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len))... | CWE-189 | null | null |
143 | int phar_get_archive(phar_archive_data **archive, char *fname, int fname_len, char *alias, int alias_len, char **error TSRMLS_DC) /* {{{ */
{
phar_archive_data *fd, **fd_ptr;
char *my_realpath, *save;
int save_len;
ulong fhash, ahash = 0;
phar_request_initialize(TSRMLS_C);
if (error) {
*error = NULL;
}
*ar... | DoS | 0 | int phar_get_archive(phar_archive_data **archive, char *fname, int fname_len, char *alias, int alias_len, char **error TSRMLS_DC) /* {{{ */
{
phar_archive_data *fd, **fd_ptr;
char *my_realpath, *save;
int save_len;
ulong fhash, ahash = 0;
phar_request_initialize(TSRMLS_C);
if (error) {
*error = NULL;
}
*ar... | @@ -1977,7 +1977,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
while ((s = zend_memrchr(filename, '/', filename_len))) {
filename_len = s - filename;
- if (FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len))... | CWE-189 | null | null |
144 | php_stream *phar_get_efp(phar_entry_info *entry, int follow_links TSRMLS_DC) /* {{{ */
{
if (follow_links && entry->link) {
phar_entry_info *link_entry = phar_get_link_source(entry TSRMLS_CC);
if (link_entry && link_entry != entry) {
return phar_get_efp(link_entry, 1 TSRMLS_CC);
}
}
if (phar_get_fp_type(e... | DoS | 0 | php_stream *phar_get_efp(phar_entry_info *entry, int follow_links TSRMLS_DC) /* {{{ */
{
if (follow_links && entry->link) {
phar_entry_info *link_entry = phar_get_link_source(entry TSRMLS_CC);
if (link_entry && link_entry != entry) {
return phar_get_efp(link_entry, 1 TSRMLS_CC);
}
}
if (phar_get_fp_type(e... | @@ -1977,7 +1977,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
while ((s = zend_memrchr(filename, '/', filename_len))) {
filename_len = s - filename;
- if (FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len))... | CWE-189 | null | null |
145 | int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char *path, int path_len, char *mode, char allow_dir, char **error, int security TSRMLS_DC) /* {{{ */
{
phar_archive_data *phar;
phar_entry_info *entry;
int for_write = mode[0] != 'r' || mode[1] == '+';
int for_append = mode[0] == 'a';
int... | DoS | 0 | int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char *path, int path_len, char *mode, char allow_dir, char **error, int security TSRMLS_DC) /* {{{ */
{
phar_archive_data *phar;
phar_entry_info *entry;
int for_write = mode[0] != 'r' || mode[1] == '+';
int for_append = mode[0] == 'a';
int... | @@ -1977,7 +1977,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
while ((s = zend_memrchr(filename, '/', filename_len))) {
filename_len = s - filename;
- if (FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len))... | CWE-189 | null | null |
146 | phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, int path_len, char **error, int security TSRMLS_DC) /* {{{ */
{
return phar_get_entry_info_dir(phar, path, path_len, 0, error, security TSRMLS_CC);
}
/* }}} */
| DoS | 0 | phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, int path_len, char **error, int security TSRMLS_DC) /* {{{ */
{
return phar_get_entry_info_dir(phar, path, path_len, 0, error, security TSRMLS_CC);
}
/* }}} */
| @@ -1977,7 +1977,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
while ((s = zend_memrchr(filename, '/', filename_len))) {
filename_len = s - filename;
- if (FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len))... | CWE-189 | null | null |
147 | phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, int path_len, char dir, char **error, int security TSRMLS_DC) /* {{{ */
{
const char *pcr_error;
phar_entry_info *entry;
int is_dir;
#ifdef PHP_WIN32
phar_unixify_path_separators(path, path_len);
#endif
is_dir = (path_len && (path[path... | DoS | 0 | phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, int path_len, char dir, char **error, int security TSRMLS_DC) /* {{{ */
{
const char *pcr_error;
phar_entry_info *entry;
int is_dir;
#ifdef PHP_WIN32
phar_unixify_path_separators(path, path_len);
#endif
is_dir = (path_len && (path[path... | @@ -1977,7 +1977,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
while ((s = zend_memrchr(filename, '/', filename_len))) {
filename_len = s - filename;
- if (FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len))... | CWE-189 | null | null |
148 | static char *phar_get_link_location(phar_entry_info *entry TSRMLS_DC) /* {{{ */
{
char *p, *ret = NULL;
if (!entry->link) {
return NULL;
}
if (entry->link[0] == '/') {
return estrdup(entry->link + 1);
}
p = strrchr(entry->filename, '/');
if (p) {
*p = '\0';
spprintf(&ret, 0, "%s/%s", entry->filename, ent... | DoS | 0 | static char *phar_get_link_location(phar_entry_info *entry TSRMLS_DC) /* {{{ */
{
char *p, *ret = NULL;
if (!entry->link) {
return NULL;
}
if (entry->link[0] == '/') {
return estrdup(entry->link + 1);
}
p = strrchr(entry->filename, '/');
if (p) {
*p = '\0';
spprintf(&ret, 0, "%s/%s", entry->filename, ent... | @@ -1977,7 +1977,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
while ((s = zend_memrchr(filename, '/', filename_len))) {
filename_len = s - filename;
- if (FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len))... | CWE-189 | null | null |
149 | phar_entry_info *phar_get_link_source(phar_entry_info *entry TSRMLS_DC) /* {{{ */
{
phar_entry_info *link_entry;
char *link;
if (!entry->link) {
return entry;
}
link = phar_get_link_location(entry TSRMLS_CC);
if (SUCCESS == zend_hash_find(&(entry->phar->manifest), entry->link, strlen(entry->link), (void **)&l... | DoS | 0 | phar_entry_info *phar_get_link_source(phar_entry_info *entry TSRMLS_DC) /* {{{ */
{
phar_entry_info *link_entry;
char *link;
if (!entry->link) {
return entry;
}
link = phar_get_link_location(entry TSRMLS_CC);
if (SUCCESS == zend_hash_find(&(entry->phar->manifest), entry->link, strlen(entry->link), (void **)&l... | @@ -1977,7 +1977,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
while ((s = zend_memrchr(filename, '/', filename_len))) {
filename_len = s - filename;
- if (FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len))... | CWE-189 | null | null |
150 | static int phar_hex_str(const char *digest, size_t digest_len, char **signature TSRMLS_DC) /* {{{ */
{
int pos = -1;
size_t len = 0;
*signature = (char*)safe_pemalloc(digest_len, 2, 1, PHAR_G(persist));
for (; len < digest_len; ++len) {
(*signature)[++pos] = hexChars[((const unsigned char *)digest)[len] >> 4];
... | DoS | 0 | static int phar_hex_str(const char *digest, size_t digest_len, char **signature TSRMLS_DC) /* {{{ */
{
int pos = -1;
size_t len = 0;
*signature = (char*)safe_pemalloc(digest_len, 2, 1, PHAR_G(persist));
for (; len < digest_len; ++len) {
(*signature)[++pos] = hexChars[((const unsigned char *)digest)[len] >> 4];
... | @@ -1977,7 +1977,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
while ((s = zend_memrchr(filename, '/', filename_len))) {
filename_len = s - filename;
- if (FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len))... | CWE-189 | null | null |
151 | int phar_open_archive_fp(phar_archive_data *phar TSRMLS_DC) /* {{{ */
{
if (phar_get_pharfp(phar TSRMLS_CC)) {
return SUCCESS;
}
if (php_check_open_basedir(phar->fname TSRMLS_CC)) {
return FAILURE;
}
phar_set_pharfp(phar, php_stream_open_wrapper(phar->fname, "rb", IGNORE_URL|STREAM_MUST_SEEK|0, NULL) TSRMLS_... | DoS | 0 | int phar_open_archive_fp(phar_archive_data *phar TSRMLS_DC) /* {{{ */
{
if (phar_get_pharfp(phar TSRMLS_CC)) {
return SUCCESS;
}
if (php_check_open_basedir(phar->fname TSRMLS_CC)) {
return FAILURE;
}
phar_set_pharfp(phar, php_stream_open_wrapper(phar->fname, "rb", IGNORE_URL|STREAM_MUST_SEEK|0, NULL) TSRMLS_... | @@ -1977,7 +1977,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
while ((s = zend_memrchr(filename, '/', filename_len))) {
filename_len = s - filename;
- if (FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len))... | CWE-189 | null | null |
152 | phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, char **error TSRMLS_DC) /* {{{ */
{
if (error) {
*error = NULL;
}
/* seek to start of internal file and read it */
if (FAILURE == phar_open_entry_fp(entry, error, 1 TSRMLS_CC)) {
return NULL;
}
if (-1 == phar_seek_efp(entry, 0, S... | DoS | 0 | phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, char **error TSRMLS_DC) /* {{{ */
{
if (error) {
*error = NULL;
}
/* seek to start of internal file and read it */
if (FAILURE == phar_open_entry_fp(entry, error, 1 TSRMLS_CC)) {
return NULL;
}
if (-1 == phar_seek_efp(entry, 0, S... | @@ -1977,7 +1977,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
while ((s = zend_memrchr(filename, '/', filename_len))) {
filename_len = s - filename;
- if (FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len))... | CWE-189 | null | null |
153 | int phar_seek_efp(phar_entry_info *entry, off_t offset, int whence, off_t position, int follow_links TSRMLS_DC) /* {{{ */
{
php_stream *fp = phar_get_efp(entry, follow_links TSRMLS_CC);
off_t temp, eoffset;
if (!fp) {
return -1;
}
if (follow_links) {
phar_entry_info *t;
t = phar_get_link_source(entry TSRML... | DoS | 0 | int phar_seek_efp(phar_entry_info *entry, off_t offset, int whence, off_t position, int follow_links TSRMLS_DC) /* {{{ */
{
php_stream *fp = phar_get_efp(entry, follow_links TSRMLS_CC);
off_t temp, eoffset;
if (!fp) {
return -1;
}
if (follow_links) {
phar_entry_info *t;
t = phar_get_link_source(entry TSRML... | @@ -1977,7 +1977,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
while ((s = zend_memrchr(filename, '/', filename_len))) {
filename_len = s - filename;
- if (FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len))... | CWE-189 | null | null |
154 | static int phar_update_cached_entry(void *data, void *argument) /* {{{ */
{
phar_entry_info *entry = (phar_entry_info *)data;
TSRMLS_FETCH();
entry->phar = (phar_archive_data *)argument;
if (entry->link) {
entry->link = estrdup(entry->link);
}
if (entry->tmp) {
entry->tmp = estrdup(entry->tmp);
}
entry-... | DoS | 0 | static int phar_update_cached_entry(void *data, void *argument) /* {{{ */
{
phar_entry_info *entry = (phar_entry_info *)data;
TSRMLS_FETCH();
entry->phar = (phar_archive_data *)argument;
if (entry->link) {
entry->link = estrdup(entry->link);
}
if (entry->tmp) {
entry->tmp = estrdup(entry->tmp);
}
entry-... | @@ -1977,7 +1977,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
while ((s = zend_memrchr(filename, '/', filename_len))) {
filename_len = s - filename;
- if (FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len))... | CWE-189 | null | null |
155 | delelement (struct fileinfo *f, struct fileinfo **start)
{
struct fileinfo *prev = f->prev;
struct fileinfo *next = f->next;
xfree (f->name);
xfree (f->linkto);
xfree (f);
if (next)
next->prev = prev;
if (prev)
prev->next = next;
else
*start = next;
return next;
}
| +Info | 0 | delelement (struct fileinfo *f, struct fileinfo **start)
{
struct fileinfo *prev = f->prev;
struct fileinfo *next = f->next;
xfree (f->name);
xfree (f->linkto);
xfree (f);
if (next)
next->prev = prev;
if (prev)
prev->next = next;
else
*start = next;
return next;
}
| @@ -252,7 +252,6 @@ getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
char *respline, *tms;
const char *user, *passwd, *tmrate;
int cmd = con->cmd;
- bool pasv_mode_open = false;
wgint expected_bytes = 0;
bool got_expected_bytes = false;
bool rest_failed = false;
@@ -883,13 +882,19 ... | CWE-200 | null | null |
156 | freefileinfo (struct fileinfo *f)
{
while (f)
{
struct fileinfo *next = f->next;
xfree (f->name);
if (f->linkto)
xfree (f->linkto);
xfree (f);
f = next;
}
}
| +Info | 0 | freefileinfo (struct fileinfo *f)
{
while (f)
{
struct fileinfo *next = f->next;
xfree (f->name);
if (f->linkto)
xfree (f->linkto);
xfree (f);
f = next;
}
}
| @@ -252,7 +252,6 @@ getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
char *respline, *tms;
const char *user, *passwd, *tmrate;
int cmd = con->cmd;
- bool pasv_mode_open = false;
wgint expected_bytes = 0;
bool got_expected_bytes = false;
bool rest_failed = false;
@@ -883,13 +882,19 ... | CWE-200 | null | null |
157 | ftp_do_pasv (int csock, ip_address *addr, int *port)
{
uerr_t err;
/* We need to determine the address family and need to call
getpeername, so while we're at it, store the address to ADDR.
ftp_pasv and ftp_lpsv can simply override it. */
if (!socket_ip_address (csock, addr, ENDPOINT_PEER))
abort (... | +Info | 0 | ftp_do_pasv (int csock, ip_address *addr, int *port)
{
uerr_t err;
/* We need to determine the address family and need to call
getpeername, so while we're at it, store the address to ADDR.
ftp_pasv and ftp_lpsv can simply override it. */
if (!socket_ip_address (csock, addr, ENDPOINT_PEER))
abort (... | @@ -252,7 +252,6 @@ getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
char *respline, *tms;
const char *user, *passwd, *tmrate;
int cmd = con->cmd;
- bool pasv_mode_open = false;
wgint expected_bytes = 0;
bool got_expected_bytes = false;
bool rest_failed = false;
@@ -883,13 +882,19 ... | CWE-200 | null | null |
158 | ftp_do_pasv (int csock, ip_address *addr, int *port)
{
if (!opt.server_response)
logputs (LOG_VERBOSE, "==> PASV ... ");
return ftp_pasv (csock, addr, port);
}
| +Info | 0 | ftp_do_pasv (int csock, ip_address *addr, int *port)
{
if (!opt.server_response)
logputs (LOG_VERBOSE, "==> PASV ... ");
return ftp_pasv (csock, addr, port);
}
| @@ -252,7 +252,6 @@ getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
char *respline, *tms;
const char *user, *passwd, *tmrate;
int cmd = con->cmd;
- bool pasv_mode_open = false;
wgint expected_bytes = 0;
bool got_expected_bytes = false;
bool rest_failed = false;
@@ -883,13 +882,19 ... | CWE-200 | null | null |
159 | ftp_expected_bytes (const char *s)
{
wgint res;
while (1)
{
while (*s && *s != '(')
++s;
if (!*s)
return 0;
++s; /* skip the '(' */
res = str_to_wgint (s, (char **) &s, 10);
if (!*s)
return 0;
while (*s && c_isspace (*s))
... | +Info | 0 | ftp_expected_bytes (const char *s)
{
wgint res;
while (1)
{
while (*s && *s != '(')
++s;
if (!*s)
return 0;
++s; /* skip the '(' */
res = str_to_wgint (s, (char **) &s, 10);
if (!*s)
return 0;
while (*s && c_isspace (*s))
... | @@ -252,7 +252,6 @@ getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
char *respline, *tms;
const char *user, *passwd, *tmrate;
int cmd = con->cmd;
- bool pasv_mode_open = false;
wgint expected_bytes = 0;
bool got_expected_bytes = false;
bool rest_failed = false;
@@ -883,13 +882,19 ... | CWE-200 | null | null |
160 | ftp_get_listing (struct url *u, ccon *con, struct fileinfo **f)
{
uerr_t err;
char *uf; /* url file name */
char *lf; /* list file name */
char *old_target = con->target;
con->st &= ~ON_YOUR_OWN;
con->cmd |= (DO_LIST | LEAVE_PENDING);
con->cmd &= ~DO_RETR;
/* Fi... | +Info | 0 | ftp_get_listing (struct url *u, ccon *con, struct fileinfo **f)
{
uerr_t err;
char *uf; /* url file name */
char *lf; /* list file name */
char *old_target = con->target;
con->st &= ~ON_YOUR_OWN;
con->cmd |= (DO_LIST | LEAVE_PENDING);
con->cmd &= ~DO_RETR;
/* Fi... | @@ -252,7 +252,6 @@ getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
char *respline, *tms;
const char *user, *passwd, *tmrate;
int cmd = con->cmd;
- bool pasv_mode_open = false;
wgint expected_bytes = 0;
bool got_expected_bytes = false;
bool rest_failed = false;
@@ -883,13 +882,19 ... | CWE-200 | null | null |
161 | ftp_loop (struct url *u, char **local_file, int *dt, struct url *proxy,
bool recursive, bool glob)
{
ccon con; /* FTP connection */
uerr_t res;
*dt = 0;
xzero (con);
con.csock = -1;
con.st = ON_YOUR_OWN;
con.rs = ST_UNIX;
con.id = NULL;
con.proxy = proxy;
/* If the ... | +Info | 0 | ftp_loop (struct url *u, char **local_file, int *dt, struct url *proxy,
bool recursive, bool glob)
{
ccon con; /* FTP connection */
uerr_t res;
*dt = 0;
xzero (con);
con.csock = -1;
con.st = ON_YOUR_OWN;
con.rs = ST_UNIX;
con.id = NULL;
con.proxy = proxy;
/* If the ... | @@ -252,7 +252,6 @@ getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
char *respline, *tms;
const char *user, *passwd, *tmrate;
int cmd = con->cmd;
- bool pasv_mode_open = false;
wgint expected_bytes = 0;
bool got_expected_bytes = false;
bool rest_failed = false;
@@ -883,13 +882,19 ... | CWE-200 | null | null |
162 | ftp_retrieve_dirs (struct url *u, struct fileinfo *f, ccon *con)
{
char *container = NULL;
int container_size = 0;
for (; f; f = f->next)
{
int size;
char *odir, *newdir;
if (opt.quota && total_downloaded_bytes > opt.quota)
break;
if (f->type != FT_DIRECTORY)
continue... | +Info | 0 | ftp_retrieve_dirs (struct url *u, struct fileinfo *f, ccon *con)
{
char *container = NULL;
int container_size = 0;
for (; f; f = f->next)
{
int size;
char *odir, *newdir;
if (opt.quota && total_downloaded_bytes > opt.quota)
break;
if (f->type != FT_DIRECTORY)
continue... | @@ -252,7 +252,6 @@ getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
char *respline, *tms;
const char *user, *passwd, *tmrate;
int cmd = con->cmd;
- bool pasv_mode_open = false;
wgint expected_bytes = 0;
bool got_expected_bytes = false;
bool rest_failed = false;
@@ -883,13 +882,19 ... | CWE-200 | null | null |
163 | ftp_retrieve_glob (struct url *u, ccon *con, int action)
{
struct fileinfo *f, *start;
uerr_t res;
con->cmd |= LEAVE_PENDING;
res = ftp_get_listing (u, con, &start);
if (res != RETROK)
return res;
/* First: weed out that do not conform the global rules given in
opt.accepts and opt.rejects. */
... | +Info | 0 | ftp_retrieve_glob (struct url *u, ccon *con, int action)
{
struct fileinfo *f, *start;
uerr_t res;
con->cmd |= LEAVE_PENDING;
res = ftp_get_listing (u, con, &start);
if (res != RETROK)
return res;
/* First: weed out that do not conform the global rules given in
opt.accepts and opt.rejects. */
... | @@ -252,7 +252,6 @@ getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
char *respline, *tms;
const char *user, *passwd, *tmrate;
int cmd = con->cmd;
- bool pasv_mode_open = false;
wgint expected_bytes = 0;
bool got_expected_bytes = false;
bool rest_failed = false;
@@ -883,13 +882,19 ... | CWE-200 | null | null |
164 | ftp_retrieve_list (struct url *u, struct fileinfo *f, ccon *con)
{
static int depth = 0;
uerr_t err;
struct fileinfo *orig;
wgint local_size;
time_t tml;
bool dlthis; /* Download this (file). */
const char *actual_target = NULL;
bool force_full_retrieve = false;
/* Increase the depth. */
++depth;
... | +Info | 0 | ftp_retrieve_list (struct url *u, struct fileinfo *f, ccon *con)
{
static int depth = 0;
uerr_t err;
struct fileinfo *orig;
wgint local_size;
time_t tml;
bool dlthis; /* Download this (file). */
const char *actual_target = NULL;
bool force_full_retrieve = false;
/* Increase the depth. */
++depth;
... | @@ -252,7 +252,6 @@ getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
char *respline, *tms;
const char *user, *passwd, *tmrate;
int cmd = con->cmd;
- bool pasv_mode_open = false;
wgint expected_bytes = 0;
bool got_expected_bytes = false;
bool rest_failed = false;
@@ -883,13 +882,19 ... | CWE-200 | null | null |
165 | has_insecure_name_p (const char *s)
{
if (*s == '/')
return true;
if (strstr (s, "../") != 0)
return true;
return false;
}
| +Info | 0 | has_insecure_name_p (const char *s)
{
if (*s == '/')
return true;
if (strstr (s, "../") != 0)
return true;
return false;
}
| @@ -252,7 +252,6 @@ getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
char *respline, *tms;
const char *user, *passwd, *tmrate;
int cmd = con->cmd;
- bool pasv_mode_open = false;
wgint expected_bytes = 0;
bool got_expected_bytes = false;
bool rest_failed = false;
@@ -883,13 +882,19 ... | CWE-200 | null | null |
166 | is_invalid_entry (struct fileinfo *f)
{
struct fileinfo *cur = f;
char *f_name = f->name;
/* If the node we're currently checking has a duplicate later, we eliminate
* the current node and leave the next one intact. */
while (cur->next)
{
cur = cur->next;
if (strcmp(f_name, cur->name) == 0)
... | +Info | 0 | is_invalid_entry (struct fileinfo *f)
{
struct fileinfo *cur = f;
char *f_name = f->name;
/* If the node we're currently checking has a duplicate later, we eliminate
* the current node and leave the next one intact. */
while (cur->next)
{
cur = cur->next;
if (strcmp(f_name, cur->name) == 0)
... | @@ -252,7 +252,6 @@ getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
char *respline, *tms;
const char *user, *passwd, *tmrate;
int cmd = con->cmd;
- bool pasv_mode_open = false;
wgint expected_bytes = 0;
bool got_expected_bytes = false;
bool rest_failed = false;
@@ -883,13 +882,19 ... | CWE-200 | null | null |
167 | print_length (wgint size, wgint start, bool authoritative)
{
logprintf (LOG_VERBOSE, _("Length: %s"), number_to_static_string (size));
if (size >= 1024)
logprintf (LOG_VERBOSE, " (%s)", human_readable (size, 10, 1));
if (start > 0)
{
if (size - start >= 1024)
logprintf (LOG_VERBOSE, _(", %s ... | +Info | 0 | print_length (wgint size, wgint start, bool authoritative)
{
logprintf (LOG_VERBOSE, _("Length: %s"), number_to_static_string (size));
if (size >= 1024)
logprintf (LOG_VERBOSE, " (%s)", human_readable (size, 10, 1));
if (start > 0)
{
if (size - start >= 1024)
logprintf (LOG_VERBOSE, _(", %s ... | @@ -252,7 +252,6 @@ getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
char *respline, *tms;
const char *user, *passwd, *tmrate;
int cmd = con->cmd;
- bool pasv_mode_open = false;
wgint expected_bytes = 0;
bool got_expected_bytes = false;
bool rest_failed = false;
@@ -883,13 +882,19 ... | CWE-200 | null | null |
168 | attr_count (void)
{
return attrhash->count;
}
| DoS | 0 | attr_count (void)
{
return attrhash->count;
}
| @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
169 | attr_show_all (struct vty *vty)
{
hash_iterate (attrhash,
(void (*)(struct hash_backet *, void *))
attr_show_all_iterator,
vty);
}
| DoS | 0 | attr_show_all (struct vty *vty)
{
hash_iterate (attrhash,
(void (*)(struct hash_backet *, void *))
attr_show_all_iterator,
vty);
}
| @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
170 | attr_show_all_iterator (struct hash_backet *backet, struct vty *vty)
{
struct attr *attr = backet->data;
vty_out (vty, "attr[%ld] nexthop %s%s", attr->refcnt,
inet_ntoa (attr->nexthop), VTY_NEWLINE);
}
| DoS | 0 | attr_show_all_iterator (struct hash_backet *backet, struct vty *vty)
{
struct attr *attr = backet->data;
vty_out (vty, "attr[%ld] nexthop %s%s", attr->refcnt,
inet_ntoa (attr->nexthop), VTY_NEWLINE);
}
| @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
171 | attr_unknown_count (void)
{
return transit_hash->count;
}
| DoS | 0 | attr_unknown_count (void)
{
return transit_hash->count;
}
| @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
172 | attrhash_finish (void)
{
hash_free (attrhash);
attrhash = NULL;
}
| DoS | 0 | attrhash_finish (void)
{
hash_free (attrhash);
attrhash = NULL;
}
| @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
173 | attrhash_init (void)
{
attrhash = hash_create (attrhash_key_make, attrhash_cmp);
}
| DoS | 0 | attrhash_init (void)
{
attrhash = hash_create (attrhash_key_make, attrhash_cmp);
}
| @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
174 | attrhash_key_make (void *p)
{
const struct attr * attr = (struct attr *) p;
uint32_t key = 0;
#define MIX(val) key = jhash_1word(val, key)
MIX(attr->origin);
MIX(attr->nexthop.s_addr);
MIX(attr->med);
MIX(attr->local_pref);
key += attr->origin;
key += attr->nexthop.s_addr;
key += attr->med;
key +=... | DoS | 0 | attrhash_key_make (void *p)
{
const struct attr * attr = (struct attr *) p;
uint32_t key = 0;
#define MIX(val) key = jhash_1word(val, key)
MIX(attr->origin);
MIX(attr->nexthop.s_addr);
MIX(attr->med);
MIX(attr->local_pref);
key += attr->origin;
key += attr->nexthop.s_addr;
key += attr->med;
key +=... | @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
175 | bgp_attr_aggregator (struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
int wantedlen = 6;
struct attr_extra *attre = bgp_attr_extra_get (attr);
/* peer with AS4 will send 4 Byte AS, peer without wil... | DoS | 0 | bgp_attr_aggregator (struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
int wantedlen = 6;
struct attr_extra *attre = bgp_attr_extra_get (attr);
/* peer with AS4 will send 4 Byte AS, peer without wil... | @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
176 | bgp_attr_as4_aggregator (struct bgp_attr_parser_args *args,
as_t *as4_aggregator_as,
struct in_addr *as4_aggregator_addr)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
if (length != 8)
{
zlog (peer->l... | DoS | 0 | bgp_attr_as4_aggregator (struct bgp_attr_parser_args *args,
as_t *as4_aggregator_as,
struct in_addr *as4_aggregator_addr)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
if (length != 8)
{
zlog (peer->l... | @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
177 | bgp_attr_as4_path (struct bgp_attr_parser_args *args, struct aspath **as4_path)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
*as4_path = aspath_parse (peer->ibuf, length, 1);
/* In case of IBGP, length will be zero. */
if (!*as4_p... | DoS | 0 | bgp_attr_as4_path (struct bgp_attr_parser_args *args, struct aspath **as4_path)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
*as4_path = aspath_parse (peer->ibuf, length, 1);
/* In case of IBGP, length will be zero. */
if (!*as4_p... | @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
178 | bgp_attr_aspath (struct bgp_attr_parser_args *args)
{
struct attr *const attr = args->attr;
struct peer *const peer = args->peer;
const bgp_size_t length = args->length;
/*
* peer with AS4 => will get 4Byte ASnums
* otherwise, will get 16 Bit
*/
attr->aspath = aspath_parse (peer->ibuf, length,
... | DoS | 0 | bgp_attr_aspath (struct bgp_attr_parser_args *args)
{
struct attr *const attr = args->attr;
struct peer *const peer = args->peer;
const bgp_size_t length = args->length;
/*
* peer with AS4 => will get 4Byte ASnums
* otherwise, will get 16 Bit
*/
attr->aspath = aspath_parse (peer->ibuf, length,
... | @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
179 | bgp_attr_aspath_check (struct peer *const peer, struct attr *const attr)
{
/* These checks were part of bgp_attr_aspath, but with
* as4 we should to check aspath things when
* aspath synthesizing with as4_path has already taken place.
* Otherwise we check ASPATH and use the synthesized thing, and that is
... | DoS | 0 | bgp_attr_aspath_check (struct peer *const peer, struct attr *const attr)
{
/* These checks were part of bgp_attr_aspath, but with
* as4 we should to check aspath things when
* aspath synthesizing with as4_path has already taken place.
* Otherwise we check ASPATH and use the synthesized thing, and that is
... | @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
180 | bgp_attr_atomic (struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
/* Length check. */
if (length != 0)
{
zlog (peer->log, LOG_ERR, "ATOMIC_AGGREGATE attribute length isn't 0 [%u]",
... | DoS | 0 | bgp_attr_atomic (struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
/* Length check. */
if (length != 0)
{
zlog (peer->log, LOG_ERR, "ATOMIC_AGGREGATE attribute length isn't 0 [%u]",
... | @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
181 | bgp_attr_check (struct peer *peer, struct attr *attr)
{
u_char type = 0;
if (! CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_ORIGIN)))
type = BGP_ATTR_ORIGIN;
if (! CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_AS_PATH)))
type = BGP_ATTR_AS_PATH;
if (! CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP... | DoS | 0 | bgp_attr_check (struct peer *peer, struct attr *attr)
{
u_char type = 0;
if (! CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_ORIGIN)))
type = BGP_ATTR_ORIGIN;
if (! CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_AS_PATH)))
type = BGP_ATTR_AS_PATH;
if (! CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP... | @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
182 | bgp_attr_cluster_list (struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
/* Check length. */
if (length % 4)
{
zlog (peer->log, LOG_ERR, "Bad cluster list length %d", length);
return bgp... | DoS | 0 | bgp_attr_cluster_list (struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
/* Check length. */
if (length % 4)
{
zlog (peer->log, LOG_ERR, "Bad cluster list length %d", length);
return bgp... | @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
183 | bgp_attr_default_intern (u_char origin)
{
struct attr attr;
struct attr *new;
memset (&attr, 0, sizeof (struct attr));
bgp_attr_extra_get (&attr);
bgp_attr_default_set(&attr, origin);
new = bgp_attr_intern (&attr);
bgp_attr_extra_free (&attr);
aspath_unintern (&new->aspath);
return new;
}
| DoS | 0 | bgp_attr_default_intern (u_char origin)
{
struct attr attr;
struct attr *new;
memset (&attr, 0, sizeof (struct attr));
bgp_attr_extra_get (&attr);
bgp_attr_default_set(&attr, origin);
new = bgp_attr_intern (&attr);
bgp_attr_extra_free (&attr);
aspath_unintern (&new->aspath);
return new;
}
| @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
184 | bgp_attr_dup (struct attr *new, struct attr *orig)
{
*new = *orig;
if (orig->extra)
{
new->extra = bgp_attr_extra_new();
*new->extra = *orig->extra;
}
}
| DoS | 0 | bgp_attr_dup (struct attr *new, struct attr *orig)
{
*new = *orig;
if (orig->extra)
{
new->extra = bgp_attr_extra_new();
*new->extra = *orig->extra;
}
}
| @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
185 | bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
if (length == 0)
{
if (attr->extra)
attr->extra->ecommunity = NULL;
/* Empty extcomm doesn't seem to b... | DoS | 0 | bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
if (length == 0)
{
if (attr->extra)
attr->extra->ecommunity = NULL;
/* Empty extcomm doesn't seem to b... | @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
186 | bgp_attr_extra_free (struct attr *attr)
{
if (attr->extra)
{
XFREE (MTYPE_ATTR_EXTRA, attr->extra);
attr->extra = NULL;
}
}
| DoS | 0 | bgp_attr_extra_free (struct attr *attr)
{
if (attr->extra)
{
XFREE (MTYPE_ATTR_EXTRA, attr->extra);
attr->extra = NULL;
}
}
| @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
187 | bgp_attr_extra_get (struct attr *attr)
{
if (!attr->extra)
attr->extra = bgp_attr_extra_new();
return attr->extra;
}
| DoS | 0 | bgp_attr_extra_get (struct attr *attr)
{
if (!attr->extra)
attr->extra = bgp_attr_extra_new();
return attr->extra;
}
| @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
188 | bgp_attr_extra_new (void)
{
return XCALLOC (MTYPE_ATTR_EXTRA, sizeof (struct attr_extra));
}
| DoS | 0 | bgp_attr_extra_new (void)
{
return XCALLOC (MTYPE_ATTR_EXTRA, sizeof (struct attr_extra));
}
| @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
189 | bgp_attr_finish (void)
{
aspath_finish ();
attrhash_finish ();
community_finish ();
ecommunity_finish ();
cluster_finish ();
transit_finish ();
}
| DoS | 0 | bgp_attr_finish (void)
{
aspath_finish ();
attrhash_finish ();
community_finish ();
ecommunity_finish ();
cluster_finish ();
transit_finish ();
}
| @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
190 | bgp_attr_flag_invalid (struct bgp_attr_parser_args *args)
{
u_int8_t mask = BGP_ATTR_FLAG_EXTLEN;
const u_int8_t flags = args->flags;
const u_int8_t attr_code = args->type;
struct peer *const peer = args->peer;
/* there may be attributes we don't know about */
if (attr_code > attr_flags_values_max)
... | DoS | 0 | bgp_attr_flag_invalid (struct bgp_attr_parser_args *args)
{
u_int8_t mask = BGP_ATTR_FLAG_EXTLEN;
const u_int8_t flags = args->flags;
const u_int8_t attr_code = args->type;
struct peer *const peer = args->peer;
/* there may be attributes we don't know about */
if (attr_code > attr_flags_values_max)
... | @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
191 | bgp_attr_hash_alloc (void *p)
{
struct attr * val = (struct attr *) p;
struct attr *attr;
attr = XMALLOC (MTYPE_ATTR, sizeof (struct attr));
*attr = *val;
if (val->extra)
{
attr->extra = bgp_attr_extra_new ();
*attr->extra = *val->extra;
}
attr->refcnt = 0;
return attr;
}
| DoS | 0 | bgp_attr_hash_alloc (void *p)
{
struct attr * val = (struct attr *) p;
struct attr *attr;
attr = XMALLOC (MTYPE_ATTR, sizeof (struct attr));
*attr = *val;
if (val->extra)
{
attr->extra = bgp_attr_extra_new ();
*attr->extra = *val->extra;
}
attr->refcnt = 0;
return attr;
}
| @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
192 | bgp_attr_init (void)
{
aspath_init ();
attrhash_init ();
community_init ();
ecommunity_init ();
cluster_init ();
transit_init ();
}
| DoS | 0 | bgp_attr_init (void)
{
aspath_init ();
attrhash_init ();
community_init ();
ecommunity_init ();
cluster_init ();
transit_init ();
}
| @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
193 | bgp_attr_intern (struct attr *attr)
{
struct attr *find;
/* Intern referenced strucutre. */
if (attr->aspath)
{
if (! attr->aspath->refcnt)
attr->aspath = aspath_intern (attr->aspath);
else
attr->aspath->refcnt++;
}
if (attr->community)
{
if (! attr->community->refcnt)
attr->co... | DoS | 0 | bgp_attr_intern (struct attr *attr)
{
struct attr *find;
/* Intern referenced strucutre. */
if (attr->aspath)
{
if (! attr->aspath->refcnt)
attr->aspath = aspath_intern (attr->aspath);
else
attr->aspath->refcnt++;
}
if (attr->community)
{
if (! attr->community->refcnt)
attr->co... | @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
194 | bgp_attr_local_pref (struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
/* Length check. */
if (length != 4)
{
zlog (peer->log, LOG_ERR, "LOCAL_PREF attribute length isn't 4 [%u]",
length)... | DoS | 0 | bgp_attr_local_pref (struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
/* Length check. */
if (length != 4)
{
zlog (peer->log, LOG_ERR, "LOCAL_PREF attribute length isn't 4 [%u]",
length)... | @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
195 | bgp_attr_malformed (struct bgp_attr_parser_args *args, u_char subcode,
bgp_size_t length)
{
struct peer *const peer = args->peer;
const u_int8_t flags = args->flags;
/* startp and length must be special-cased, as whether or not to
* send the attribute data with the NOTIFY depends on the er... | DoS | 0 | bgp_attr_malformed (struct bgp_attr_parser_args *args, u_char subcode,
bgp_size_t length)
{
struct peer *const peer = args->peer;
const u_int8_t flags = args->flags;
/* startp and length must be special-cased, as whether or not to
* send the attribute data with the NOTIFY depends on the er... | @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
196 | bgp_attr_med (struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
/* Length check. */
if (length != 4)
{
zlog (peer->log, LOG_ERR,
"MED attribute length isn't four [%d]", length);
re... | DoS | 0 | bgp_attr_med (struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
/* Length check. */
if (length != 4)
{
zlog (peer->log, LOG_ERR,
"MED attribute length isn't four [%d]", length);
re... | @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
197 | bgp_attr_munge_as4_attrs (struct peer *const peer,
struct attr *const attr,
struct aspath *as4_path, as_t as4_aggregator,
struct in_addr *as4_aggregator_addr)
{
int ignore_as4_path = 0;
struct aspath *newpath;
struct attr_extra *attre =... | DoS | 0 | bgp_attr_munge_as4_attrs (struct peer *const peer,
struct attr *const attr,
struct aspath *as4_path, as_t as4_aggregator,
struct in_addr *as4_aggregator_addr)
{
int ignore_as4_path = 0;
struct aspath *newpath;
struct attr_extra *attre =... | @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
198 | bgp_attr_origin (struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
/* If any recognized attribute has Attribute Length that conflicts
with the expected length (based on the attribute type code), then
... | DoS | 0 | bgp_attr_origin (struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
/* If any recognized attribute has Attribute Length that conflicts
with the expected length (based on the attribute type code), then
... | @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
199 | bgp_attr_parse (struct peer *peer, struct attr *attr, bgp_size_t size,
struct bgp_nlri *mp_update, struct bgp_nlri *mp_withdraw)
{
int ret;
u_char flag = 0;
u_char type = 0;
bgp_size_t length;
u_char *startp, *endp;
u_char *attr_endp;
u_char seen[BGP_ATTR_BITMAP_SIZE];
/* we need the as4_path only unt... | DoS | 0 | bgp_attr_parse (struct peer *peer, struct attr *attr, bgp_size_t size,
struct bgp_nlri *mp_update, struct bgp_nlri *mp_withdraw)
{
int ret;
u_char flag = 0;
u_char type = 0;
bgp_size_t length;
u_char *startp, *endp;
u_char *attr_endp;
u_char seen[BGP_ATTR_BITMAP_SIZE];
/* we need the as4_path only unt... | @@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_attr_parser_args *args)
static bgp_attr_parse_ret_t
bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
- bgp_size_t total;
+ bgp_size_t total = args->total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->pee... | null | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.