idx int64 | func_before string | Vulnerability Classification string | vul int64 | func_after string | patch string | CWE ID string | lines_before string | lines_after string |
|---|---|---|---|---|---|---|---|---|
3,700 | PHP_FUNCTION(openssl_pkey_get_details)
{
zval *key;
EVP_PKEY *pkey;
BIO *out;
unsigned int pbio_len;
char *pbio;
long ktype;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &key) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(pkey, EVP_PKEY *, &key, -1, "OpenSSL key", le_key);
if (!pkey) {
RETURN_... | null | 0 | PHP_FUNCTION(openssl_pkey_get_details)
{
zval *key;
EVP_PKEY *pkey;
BIO *out;
unsigned int pbio_len;
char *pbio;
long ktype;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &key) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(pkey, EVP_PKEY *, &key, -1, "OpenSSL key", le_key);
if (!pkey) {
RETURN_... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,701 | PHP_FUNCTION(openssl_pbkdf2)
{
long key_length = 0, iterations = 0;
char *password; int password_len;
char *salt; int salt_len;
char *method; int method_len = 0;
unsigned char *out_buffer;
const EVP_MD *digest;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssll|s",
&password, &password_len,
&sa... | null | 0 | PHP_FUNCTION(openssl_pbkdf2)
{
long key_length = 0, iterations = 0;
char *password; int password_len;
char *salt; int salt_len;
char *method; int method_len = 0;
unsigned char *out_buffer;
const EVP_MD *digest;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssll|s",
&password, &password_len,
&sa... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,702 | PHP_FUNCTION(openssl_pkcs7_verify)
{
X509_STORE * store = NULL;
zval * cainfo = NULL;
STACK_OF(X509) *signers= NULL;
STACK_OF(X509) *others = NULL;
PKCS7 * p7 = NULL;
BIO * in = NULL, * datain = NULL, * dataout = NULL;
long flags = 0;
char * filename; int filename_len;
char * extracerts = NULL; int extracerts_... | null | 0 | PHP_FUNCTION(openssl_pkcs7_verify)
{
X509_STORE * store = NULL;
zval * cainfo = NULL;
STACK_OF(X509) *signers= NULL;
STACK_OF(X509) *others = NULL;
PKCS7 * p7 = NULL;
BIO * in = NULL, * datain = NULL, * dataout = NULL;
long flags = 0;
char * filename; int filename_len;
char * extracerts = NULL; int extracerts_... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,703 | PHP_FUNCTION(openssl_pkcs7_encrypt)
{
zval ** zrecipcerts, * zheaders = NULL;
STACK_OF(X509) * recipcerts = NULL;
BIO * infile = NULL, * outfile = NULL;
long flags = 0;
PKCS7 * p7 = NULL;
HashPosition hpos;
zval ** zcertval;
X509 * cert;
const EVP_CIPHER *cipher = NULL;
long cipherid = PHP_OPENSSL_CIPHER_DEFA... | null | 0 | PHP_FUNCTION(openssl_pkcs7_encrypt)
{
zval ** zrecipcerts, * zheaders = NULL;
STACK_OF(X509) * recipcerts = NULL;
BIO * infile = NULL, * outfile = NULL;
long flags = 0;
PKCS7 * p7 = NULL;
HashPosition hpos;
zval ** zcertval;
X509 * cert;
const EVP_CIPHER *cipher = NULL;
long cipherid = PHP_OPENSSL_CIPHER_DEFA... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,704 | PHP_FUNCTION(openssl_pkcs7_sign)
{
zval ** zcert, ** zprivkey, * zheaders;
zval ** hval;
X509 * cert = NULL;
EVP_PKEY * privkey = NULL;
long flags = PKCS7_DETACHED;
PKCS7 * p7 = NULL;
BIO * infile = NULL, * outfile = NULL;
STACK_OF(X509) *others = NULL;
long certresource = -1, keyresource = -1;
ulong intindex... | null | 0 | PHP_FUNCTION(openssl_pkcs7_sign)
{
zval ** zcert, ** zprivkey, * zheaders;
zval ** hval;
X509 * cert = NULL;
EVP_PKEY * privkey = NULL;
long flags = PKCS7_DETACHED;
PKCS7 * p7 = NULL;
BIO * infile = NULL, * outfile = NULL;
STACK_OF(X509) *others = NULL;
long certresource = -1, keyresource = -1;
ulong intindex... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,705 | PHP_FUNCTION(openssl_pkcs7_decrypt)
{
zval ** recipcert, ** recipkey = NULL;
X509 * cert = NULL;
EVP_PKEY * key = NULL;
long certresval, keyresval;
BIO * in = NULL, * out = NULL, * datain = NULL;
PKCS7 * p7 = NULL;
char * infilename; int infilename_len;
char * outfilename; int outfilename_len;
if (zend_parse_... | null | 0 | PHP_FUNCTION(openssl_pkcs7_decrypt)
{
zval ** recipcert, ** recipkey = NULL;
X509 * cert = NULL;
EVP_PKEY * key = NULL;
long certresval, keyresval;
BIO * in = NULL, * out = NULL, * datain = NULL;
PKCS7 * p7 = NULL;
char * infilename; int infilename_len;
char * outfilename; int outfilename_len;
if (zend_parse_... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,706 | PHP_FUNCTION(openssl_open)
{
zval **privkey, *opendata;
EVP_PKEY *pkey;
int len1, len2;
unsigned char *buf;
long keyresource = -1;
EVP_CIPHER_CTX ctx;
char * data; int data_len;
char * ekey; int ekey_len;
char *method =NULL;
int method_len = 0;
const EVP_CIPHER *cipher;
if (zend_parse_parameters(ZEND_NUM_A... | null | 0 | PHP_FUNCTION(openssl_open)
{
zval **privkey, *opendata;
EVP_PKEY *pkey;
int len1, len2;
unsigned char *buf;
long keyresource = -1;
EVP_CIPHER_CTX ctx;
char * data; int data_len;
char * ekey; int ekey_len;
char *method =NULL;
int method_len = 0;
const EVP_CIPHER *cipher;
if (zend_parse_parameters(ZEND_NUM_A... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,707 | PHP_FUNCTION(openssl_encrypt)
{
long options = 0;
char *data, *method, *password, *iv = "";
int data_len, method_len, password_len, iv_len = 0, max_iv_len;
const EVP_CIPHER *cipher_type;
EVP_CIPHER_CTX cipher_ctx;
int i=0, outlen, keylen;
unsigned char *outbuf, *key;
zend_bool free_iv;
if (zend_parse_paramete... | null | 0 | PHP_FUNCTION(openssl_encrypt)
{
long options = 0;
char *data, *method, *password, *iv = "";
int data_len, method_len, password_len, iv_len = 0, max_iv_len;
const EVP_CIPHER *cipher_type;
EVP_CIPHER_CTX cipher_ctx;
int i=0, outlen, keylen;
unsigned char *outbuf, *key;
zend_bool free_iv;
if (zend_parse_paramete... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,708 | PHP_FUNCTION(openssl_decrypt)
{
long options = 0;
char *data, *method, *password, *iv = "";
int data_len, method_len, password_len, iv_len = 0;
const EVP_CIPHER *cipher_type;
EVP_CIPHER_CTX cipher_ctx;
int i, outlen, keylen;
unsigned char *outbuf, *key;
int base64_str_len;
char *base64_str = NULL;
zend_bool f... | null | 0 | PHP_FUNCTION(openssl_decrypt)
{
long options = 0;
char *data, *method, *password, *iv = "";
int data_len, method_len, password_len, iv_len = 0;
const EVP_CIPHER *cipher_type;
EVP_CIPHER_CTX cipher_ctx;
int i, outlen, keylen;
unsigned char *outbuf, *key;
int base64_str_len;
char *base64_str = NULL;
zend_bool f... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,709 | PHP_MINIT_FUNCTION(openssl)
{
char * config_filename;
le_key = zend_register_list_destructors_ex(php_pkey_free, NULL, "OpenSSL key", module_number);
le_x509 = zend_register_list_destructors_ex(php_x509_free, NULL, "OpenSSL X.509", module_number);
le_csr = zend_register_list_destructors_ex(php_csr_free, NULL, "Open... | null | 0 | PHP_MINIT_FUNCTION(openssl)
{
char * config_filename;
le_key = zend_register_list_destructors_ex(php_pkey_free, NULL, "OpenSSL key", module_number);
le_x509 = zend_register_list_destructors_ex(php_x509_free, NULL, "OpenSSL X.509", module_number);
le_csr = zend_register_list_destructors_ex(php_csr_free, NULL, "Open... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,710 | PHP_MSHUTDOWN_FUNCTION(openssl)
{
EVP_cleanup();
#if OPENSSL_VERSION_NUMBER >= 0x00090805f
/* prevent accessing locking callback from unloaded extension */
CRYPTO_set_locking_callback(NULL);
/* free allocated error strings */
ERR_free_strings();
#endif
php_unregister_url_stream_wrapper("https" TSRMLS_CC);
php_... | null | 0 | PHP_MSHUTDOWN_FUNCTION(openssl)
{
EVP_cleanup();
#if OPENSSL_VERSION_NUMBER >= 0x00090805f
/* prevent accessing locking callback from unloaded extension */
CRYPTO_set_locking_callback(NULL);
/* free allocated error strings */
ERR_free_strings();
#endif
php_unregister_url_stream_wrapper("https" TSRMLS_CC);
php_... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,711 | static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int shortname TSRMLS_DC) /* {{{ */
{
zval **data;
zval *subitem, *subentries;
int i;
char *sname;
int nid;
X509_NAME_ENTRY * ne;
ASN1_STRING * str = NULL;
ASN1_OBJECT * obj;
if (key != NULL) {
MAKE_STD_ZVAL(subitem);
array_init(sub... | null | 0 | static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int shortname TSRMLS_DC) /* {{{ */
{
zval **data;
zval *subitem, *subentries;
int i;
char *sname;
int nid;
X509_NAME_ENTRY * ne;
ASN1_STRING * str = NULL;
ASN1_OBJECT * obj;
if (key != NULL) {
MAKE_STD_ZVAL(subitem);
array_init(sub... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,712 | 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... | null | 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... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,713 | int openssl_spki_cleanup(const char *src, char *dest)
{
int removed=0;
while (*src) {
if (*src!='\n'&&*src!='\r') {
*dest++=*src;
} else {
++removed;
}
++src;
}
*dest=0;
return removed;
}
| null | 0 | int openssl_spki_cleanup(const char *src, char *dest)
{
int removed=0;
while (*src) {
if (*src!='\n'&&*src!='\r') {
*dest++=*src;
} else {
++removed;
}
++src;
}
*dest=0;
return removed;
}
| @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,714 | 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... | null | 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... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,715 | static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char * passphrase, int makeresource, long * resourceval TSRMLS_DC)
{
EVP_PKEY * key = NULL;
X509 * cert = NULL;
int free_cert = 0;
long cert_res = -1;
char * filename = NULL;
zval tmp;
Z_TYPE(tmp) = IS_NULL;
#define TMP_CLEAN \
if (Z_TYP... | null | 0 | static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char * passphrase, int makeresource, long * resourceval TSRMLS_DC)
{
EVP_PKEY * key = NULL;
X509 * cert = NULL;
int free_cert = 0;
long cert_res = -1;
char * filename = NULL;
zval tmp;
Z_TYPE(tmp) = IS_NULL;
#define TMP_CLEAN \
if (Z_TYP... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,716 | 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... | null | 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... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,717 | static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC)
{
assert(pkey != NULL);
switch (pkey->type) {
#ifndef NO_RSA
case EVP_PKEY_RSA:
case EVP_PKEY_RSA2:
assert(pkey->pkey.rsa != NULL);
if (pkey->pkey.rsa != NULL && (NULL == pkey->pkey.rsa->p || NULL == pkey->pkey.rsa->q)) {
return 0;
}
... | null | 0 | static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC)
{
assert(pkey != NULL);
switch (pkey->type) {
#ifndef NO_RSA
case EVP_PKEY_RSA:
case EVP_PKEY_RSA2:
assert(pkey->pkey.rsa != NULL);
if (pkey->pkey.rsa != NULL && (NULL == pkey->pkey.rsa->p || NULL == pkey->pkey.rsa->q)) {
return 0;
}
... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,718 | static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded TSRMLS_DC) /* {{{ */
{
char buffer[MAXPATHLEN];
*egdsocket = 0;
*seeded = 0;
if (file == NULL) {
file = RAND_file_name(buffer, sizeof(buffer));
#ifdef HAVE_RAND_EGD
} else if (RAND_egd(file) > 0) {
/* if the given filename i... | null | 0 | static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded TSRMLS_DC) /* {{{ */
{
char buffer[MAXPATHLEN];
*egdsocket = 0;
*seeded = 0;
if (file == NULL) {
file = RAND_file_name(buffer, sizeof(buffer));
#ifdef HAVE_RAND_EGD
} else if (RAND_egd(file) > 0) {
/* if the given filename i... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,719 | 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... | null | 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... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,720 | inline static int php_openssl_open_base_dir_chk(char *filename TSRMLS_DC)
{
if (php_check_open_basedir(filename TSRMLS_CC)) {
return -1;
}
return 0;
}
| null | 0 | inline static int php_openssl_open_base_dir_chk(char *filename TSRMLS_DC)
{
if (php_check_open_basedir(filename TSRMLS_CC)) {
return -1;
}
return 0;
}
| @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,721 | static int php_openssl_parse_config(struct php_x509_request * req, zval * optional_args TSRMLS_DC) /* {{{ */
{
char * str;
zval ** item;
SET_OPTIONAL_STRING_ARG("config", req->config_filename, default_ssl_conf_filename);
SET_OPTIONAL_STRING_ARG("config_section_name", req->section_name, "req");
req->global_config ... | null | 0 | static int php_openssl_parse_config(struct php_x509_request * req, zval * optional_args TSRMLS_DC) /* {{{ */
{
char * str;
zval ** item;
SET_OPTIONAL_STRING_ARG("config", req->config_filename, default_ssl_conf_filename);
SET_OPTIONAL_STRING_ARG("config_section_name", req->section_name, "req");
req->global_config ... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,722 | zend_bool php_openssl_pkey_init_dh(DH *dh)
{
if (!dh->p || !dh->g) {
return 0;
}
if (dh->pub_key) {
return 1;
}
PHP_OPENSSL_RAND_ADD_TIME();
if (!DH_generate_key(dh)) {
return 0;
}
/* all good */
return 1;
}
| null | 0 | zend_bool php_openssl_pkey_init_dh(DH *dh)
{
if (!dh->p || !dh->g) {
return 0;
}
if (dh->pub_key) {
return 1;
}
PHP_OPENSSL_RAND_ADD_TIME();
if (!DH_generate_key(dh)) {
return 0;
}
/* all good */
return 1;
}
| @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,723 | zend_bool php_openssl_pkey_init_dsa(DSA *dsa)
{
if (!dsa->p || !dsa->q || !dsa->g) {
return 0;
}
if (dsa->priv_key || dsa->pub_key) {
return 1;
}
PHP_OPENSSL_RAND_ADD_TIME();
if (!DSA_generate_key(dsa)) {
return 0;
}
/* if BN_mod_exp return -1, then DSA_generate_key succeed for failed key
* so we need t... | null | 0 | zend_bool php_openssl_pkey_init_dsa(DSA *dsa)
{
if (!dsa->p || !dsa->q || !dsa->g) {
return 0;
}
if (dsa->priv_key || dsa->pub_key) {
return 1;
}
PHP_OPENSSL_RAND_ADD_TIME();
if (!DSA_generate_key(dsa)) {
return 0;
}
/* if BN_mod_exp return -1, then DSA_generate_key succeed for failed key
* so we need t... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,724 | 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) {
... | null | 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) {
... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,725 | int php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_bool raw, char **out, int *out_len TSRMLS_DC)
{
unsigned char md[EVP_MAX_MD_SIZE];
const EVP_MD *mdtype;
unsigned int n;
if (!(mdtype = EVP_get_digestbyname(method))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm")... | null | 0 | int php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_bool raw, char **out, int *out_len TSRMLS_DC)
{
unsigned char md[EVP_MAX_MD_SIZE];
const EVP_MD *mdtype;
unsigned int n;
if (!(mdtype = EVP_get_digestbyname(method))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm")... | @@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
EVP_CIPHER_CTX_cleanup(&ctx);
- if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
+ if (EVP_Se... | CWE-754 | null | null |
3,726 | PHP_MINFO_FUNCTION(wddx)
{
php_info_print_table_start();
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
php_info_print_table_header(2, "WDDX Support", "enabled" );
php_info_print_table_row(2, "WDDX Session Serializer", "enabled" );
#else
php_info_print_table_row(2, "WDDX Support", "enabled" );
#endif
php_inf... | null | 0 | PHP_MINFO_FUNCTION(wddx)
{
php_info_print_table_start();
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
php_info_print_table_header(2, "WDDX Support", "enabled" );
php_info_print_table_row(2, "WDDX Session Serializer", "enabled" );
#else
php_info_print_table_row(2, "WDDX Support", "enabled" );
#endif
php_inf... | @@ -799,22 +799,19 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
} else if (!strcmp(name, EL_BOOLEAN)) {
int i;
+ ALLOC_ZVAL(ent.data);
+ INIT_PZVAL(ent.data);
+ Z_TYPE_P(ent.data) = IS_BOOL;
+ ent.ty... | CWE-502 | null | null |
3,727 | PHP_MINIT_FUNCTION(wddx)
{
le_wddx = zend_register_list_destructors_ex(release_wddx_packet_rsrc, NULL, "wddx", module_number);
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
php_session_register_serializer("wddx",
PS_SERIALIZER_ENCODE_NAME(wddx),
PS_SERIALIZER_DECODE_NAME(wddx));
#endif
ret... | null | 0 | PHP_MINIT_FUNCTION(wddx)
{
le_wddx = zend_register_list_destructors_ex(release_wddx_packet_rsrc, NULL, "wddx", module_number);
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
php_session_register_serializer("wddx",
PS_SERIALIZER_ENCODE_NAME(wddx),
PS_SERIALIZER_DECODE_NAME(wddx));
#endif
ret... | @@ -799,22 +799,19 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
} else if (!strcmp(name, EL_BOOLEAN)) {
int i;
+ ALLOC_ZVAL(ent.data);
+ INIT_PZVAL(ent.data);
+ Z_TYPE_P(ent.data) = IS_BOOL;
+ ent.ty... | CWE-502 | null | null |
3,728 | static void php_wddx_add_var(wddx_packet *packet, zval *name_var)
{
zval **val;
HashTable *target_hash;
TSRMLS_FETCH();
if (Z_TYPE_P(name_var) == IS_STRING) {
if (!EG(active_symbol_table)) {
zend_rebuild_symbol_table(TSRMLS_C);
}
if (zend_hash_find(EG(active_symbol_table), Z_STRVAL_P(name_var),
Z_S... | null | 0 | static void php_wddx_add_var(wddx_packet *packet, zval *name_var)
{
zval **val;
HashTable *target_hash;
TSRMLS_FETCH();
if (Z_TYPE_P(name_var) == IS_STRING) {
if (!EG(active_symbol_table)) {
zend_rebuild_symbol_table(TSRMLS_C);
}
if (zend_hash_find(EG(active_symbol_table), Z_STRVAL_P(name_var),
Z_S... | @@ -799,22 +799,19 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
} else if (!strcmp(name, EL_BOOLEAN)) {
int i;
+ ALLOC_ZVAL(ent.data);
+ INIT_PZVAL(ent.data);
+ Z_TYPE_P(ent.data) = IS_BOOL;
+ ent.ty... | CWE-502 | null | null |
3,729 | void php_wddx_packet_end(wddx_packet *packet)
{
php_wddx_add_chunk_static(packet, WDDX_DATA_E);
php_wddx_add_chunk_static(packet, WDDX_PACKET_E);
}
| null | 0 | void php_wddx_packet_end(wddx_packet *packet)
{
php_wddx_add_chunk_static(packet, WDDX_DATA_E);
php_wddx_add_chunk_static(packet, WDDX_PACKET_E);
}
| @@ -799,22 +799,19 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
} else if (!strcmp(name, EL_BOOLEAN)) {
int i;
+ ALLOC_ZVAL(ent.data);
+ INIT_PZVAL(ent.data);
+ Z_TYPE_P(ent.data) = IS_BOOL;
+ ent.ty... | CWE-502 | null | null |
3,730 | static void php_wddx_serialize_array(wddx_packet *packet, zval *arr)
{
zval **ent;
char *key;
uint key_len;
int is_struct = 0, ent_type;
ulong idx;
HashTable *target_hash;
char tmp_buf[WDDX_BUF_LEN];
ulong ind = 0;
int type;
TSRMLS_FETCH();
target_hash = HASH_OF(arr);
for (zend_hash_internal_pointer_reset... | null | 0 | static void php_wddx_serialize_array(wddx_packet *packet, zval *arr)
{
zval **ent;
char *key;
uint key_len;
int is_struct = 0, ent_type;
ulong idx;
HashTable *target_hash;
char tmp_buf[WDDX_BUF_LEN];
ulong ind = 0;
int type;
TSRMLS_FETCH();
target_hash = HASH_OF(arr);
for (zend_hash_internal_pointer_reset... | @@ -799,22 +799,19 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
} else if (!strcmp(name, EL_BOOLEAN)) {
int i;
+ ALLOC_ZVAL(ent.data);
+ INIT_PZVAL(ent.data);
+ Z_TYPE_P(ent.data) = IS_BOOL;
+ ent.ty... | CWE-502 | null | null |
3,731 | static void php_wddx_serialize_number(wddx_packet *packet, zval *var)
{
char tmp_buf[WDDX_BUF_LEN];
zval tmp;
tmp = *var;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
snprintf(tmp_buf, sizeof(tmp_buf), WDDX_NUMBER, Z_STRVAL(tmp));
zval_dtor(&tmp);
php_wddx_add_chunk(packet, tmp_buf);
}
| null | 0 | static void php_wddx_serialize_number(wddx_packet *packet, zval *var)
{
char tmp_buf[WDDX_BUF_LEN];
zval tmp;
tmp = *var;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
snprintf(tmp_buf, sizeof(tmp_buf), WDDX_NUMBER, Z_STRVAL(tmp));
zval_dtor(&tmp);
php_wddx_add_chunk(packet, tmp_buf);
}
| @@ -799,22 +799,19 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
} else if (!strcmp(name, EL_BOOLEAN)) {
int i;
+ ALLOC_ZVAL(ent.data);
+ INIT_PZVAL(ent.data);
+ Z_TYPE_P(ent.data) = IS_BOOL;
+ ent.ty... | CWE-502 | null | null |
3,732 | static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
{
/* OBJECTS_FIXME */
zval **ent, *fname, **varname;
zval *retval = NULL;
const char *key;
ulong idx;
char tmp_buf[WDDX_BUF_LEN];
HashTable *objhash, *sleephash;
zend_class_entry *ce;
PHP_CLASS_ATTRIBUTES;
TSRMLS_FETCH();
PHP_SET_CLASS_ATT... | null | 0 | static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
{
/* OBJECTS_FIXME */
zval **ent, *fname, **varname;
zval *retval = NULL;
const char *key;
ulong idx;
char tmp_buf[WDDX_BUF_LEN];
HashTable *objhash, *sleephash;
zend_class_entry *ce;
PHP_CLASS_ATTRIBUTES;
TSRMLS_FETCH();
PHP_SET_CLASS_ATT... | @@ -799,22 +799,19 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
} else if (!strcmp(name, EL_BOOLEAN)) {
int i;
+ ALLOC_ZVAL(ent.data);
+ INIT_PZVAL(ent.data);
+ Z_TYPE_P(ent.data) = IS_BOOL;
+ ent.ty... | CWE-502 | null | null |
3,733 | void php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name, int name_len TSRMLS_DC)
{
HashTable *ht;
if (name) {
size_t name_esc_len;
char *tmp_buf, *name_esc;
name_esc = php_escape_html_entities(name, name_len, &name_esc_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
tmp_buf = emalloc(name_esc_len + size... | null | 0 | void php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name, int name_len TSRMLS_DC)
{
HashTable *ht;
if (name) {
size_t name_esc_len;
char *tmp_buf, *name_esc;
name_esc = php_escape_html_entities(name, name_len, &name_esc_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
tmp_buf = emalloc(name_esc_len + size... | @@ -799,22 +799,19 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
} else if (!strcmp(name, EL_BOOLEAN)) {
int i;
+ ALLOC_ZVAL(ent.data);
+ INIT_PZVAL(ent.data);
+ Z_TYPE_P(ent.data) = IS_BOOL;
+ ent.ty... | CWE-502 | null | null |
3,734 | static void release_wddx_packet_rsrc(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
smart_str *str = (smart_str *)rsrc->ptr;
smart_str_free(str);
efree(str);
}
| null | 0 | static void release_wddx_packet_rsrc(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
smart_str *str = (smart_str *)rsrc->ptr;
smart_str_free(str);
efree(str);
}
| @@ -799,22 +799,19 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
} else if (!strcmp(name, EL_BOOLEAN)) {
int i;
+ ALLOC_ZVAL(ent.data);
+ INIT_PZVAL(ent.data);
+ Z_TYPE_P(ent.data) = IS_BOOL;
+ ent.ty... | CWE-502 | null | null |
3,735 | static int wddx_stack_destroy(wddx_stack *stack)
{
register int i;
if (stack->elements) {
for (i = 0; i < stack->top; i++) {
if (((st_entry *)stack->elements[i])->data
&& ((st_entry *)stack->elements[i])->type != ST_FIELD) {
zval_ptr_dtor(&((st_entry *)stack->elements[i])->data);
}
if (((st_entry... | null | 0 | static int wddx_stack_destroy(wddx_stack *stack)
{
register int i;
if (stack->elements) {
for (i = 0; i < stack->top; i++) {
if (((st_entry *)stack->elements[i])->data
&& ((st_entry *)stack->elements[i])->type != ST_FIELD) {
zval_ptr_dtor(&((st_entry *)stack->elements[i])->data);
}
if (((st_entry... | @@ -799,22 +799,19 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
} else if (!strcmp(name, EL_BOOLEAN)) {
int i;
+ ALLOC_ZVAL(ent.data);
+ INIT_PZVAL(ent.data);
+ Z_TYPE_P(ent.data) = IS_BOOL;
+ ent.ty... | CWE-502 | null | null |
3,736 | static int wddx_stack_init(wddx_stack *stack)
{
stack->top = 0;
stack->elements = (void **) safe_emalloc(sizeof(void **), STACK_BLOCK_SIZE, 0);
stack->max = STACK_BLOCK_SIZE;
stack->varname = NULL;
stack->done = 0;
return SUCCESS;
}
| null | 0 | static int wddx_stack_init(wddx_stack *stack)
{
stack->top = 0;
stack->elements = (void **) safe_emalloc(sizeof(void **), STACK_BLOCK_SIZE, 0);
stack->max = STACK_BLOCK_SIZE;
stack->varname = NULL;
stack->done = 0;
return SUCCESS;
}
| @@ -799,22 +799,19 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
} else if (!strcmp(name, EL_BOOLEAN)) {
int i;
+ ALLOC_ZVAL(ent.data);
+ INIT_PZVAL(ent.data);
+ Z_TYPE_P(ent.data) = IS_BOOL;
+ ent.ty... | CWE-502 | null | null |
3,737 | static int wddx_stack_is_empty(wddx_stack *stack)
{
if (stack->top == 0) {
return 1;
} else {
return 0;
}
}
| null | 0 | static int wddx_stack_is_empty(wddx_stack *stack)
{
if (stack->top == 0) {
return 1;
} else {
return 0;
}
}
| @@ -799,22 +799,19 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
} else if (!strcmp(name, EL_BOOLEAN)) {
int i;
+ ALLOC_ZVAL(ent.data);
+ INIT_PZVAL(ent.data);
+ Z_TYPE_P(ent.data) = IS_BOOL;
+ ent.ty... | CWE-502 | null | null |
3,738 | static int wddx_stack_push(wddx_stack *stack, void *element, int size)
{
if (stack->top >= stack->max) { /* we need to allocate more memory */
stack->elements = (void **) erealloc(stack->elements,
(sizeof(void **) * (stack->max += STACK_BLOCK_SIZE)));
}
stack->elements[stack->top] = (void *) emalloc(size);... | null | 0 | static int wddx_stack_push(wddx_stack *stack, void *element, int size)
{
if (stack->top >= stack->max) { /* we need to allocate more memory */
stack->elements = (void **) erealloc(stack->elements,
(sizeof(void **) * (stack->max += STACK_BLOCK_SIZE)));
}
stack->elements[stack->top] = (void *) emalloc(size);... | @@ -799,22 +799,19 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
} else if (!strcmp(name, EL_BOOLEAN)) {
int i;
+ ALLOC_ZVAL(ent.data);
+ INIT_PZVAL(ent.data);
+ Z_TYPE_P(ent.data) = IS_BOOL;
+ ent.ty... | CWE-502 | null | null |
3,739 | static int wddx_stack_top(wddx_stack *stack, void **element)
{
if (stack->top > 0) {
*element = stack->elements[stack->top - 1];
return SUCCESS;
} else {
*element = NULL;
return FAILURE;
}
}
| null | 0 | static int wddx_stack_top(wddx_stack *stack, void **element)
{
if (stack->top > 0) {
*element = stack->elements[stack->top - 1];
return SUCCESS;
} else {
*element = NULL;
return FAILURE;
}
}
| @@ -799,22 +799,19 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
} else if (!strcmp(name, EL_BOOLEAN)) {
int i;
+ ALLOC_ZVAL(ent.data);
+ INIT_PZVAL(ent.data);
+ Z_TYPE_P(ent.data) = IS_BOOL;
+ ent.ty... | CWE-502 | null | null |
3,740 | account_type_from_pwent (struct passwd *pwent)
{
struct group *grp;
gint i;
if (pwent->pw_uid == 0) {
g_debug ("user is root so account type is administrator");
return ACCOUNT_TYPE_ADMINISTRATOR;
}
grp = getgrnam (ADMIN_GROUP);
if (grp ==... | Dir. Trav. | 0 | account_type_from_pwent (struct passwd *pwent)
{
struct group *grp;
gint i;
if (pwent->pw_uid == 0) {
g_debug ("user is root so account type is administrator");
return ACCOUNT_TYPE_ADMINISTRATOR;
}
grp = getgrnam (ADMIN_GROUP);
if (grp ==... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,741 | become_user (gpointer data)
{
struct passwd *pw = data;
if (pw == NULL ||
initgroups (pw->pw_name, pw->pw_gid) != 0 ||
setgid (pw->pw_gid) != 0 ||
setuid (pw->pw_uid) != 0) {
exit (1);
}
}
| Dir. Trav. | 0 | become_user (gpointer data)
{
struct passwd *pw = data;
if (pw == NULL ||
initgroups (pw->pw_name, pw->pw_gid) != 0 ||
setgid (pw->pw_gid) != 0 ||
setuid (pw->pw_uid) != 0) {
exit (1);
}
}
| @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,742 | on_user_changed_timeout (User *user)
{
user->changed_timeout_id = 0;
accounts_user_emit_changed (ACCOUNTS_USER (user));
return G_SOURCE_REMOVE;
}
| Dir. Trav. | 0 | on_user_changed_timeout (User *user)
{
user->changed_timeout_id = 0;
accounts_user_emit_changed (ACCOUNTS_USER (user));
return G_SOURCE_REMOVE;
}
| @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,743 | on_user_property_notify (User *user)
{
if (user->changed_timeout_id != 0)
return;
user->changed_timeout_id = g_timeout_add (250, (GSourceFunc) on_user_changed_timeout, user);
}
| Dir. Trav. | 0 | on_user_property_notify (User *user)
{
if (user->changed_timeout_id != 0)
return;
user->changed_timeout_id = g_timeout_add (250, (GSourceFunc) on_user_changed_timeout, user);
}
| @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,744 | save_extra_data (User *user)
{
g_autofree gchar *data = NULL;
g_autofree gchar *filename = NULL;
g_autoptr(GError) error = NULL;
user_save_to_keyfile (user, user->keyfile);
data = g_key_file_to_data (user->keyfile, NULL, &error);
if (data == NULL) {
g_wa... | Dir. Trav. | 0 | save_extra_data (User *user)
{
g_autofree gchar *data = NULL;
g_autofree gchar *filename = NULL;
g_autoptr(GError) error = NULL;
user_save_to_keyfile (user, user->keyfile);
data = g_key_file_to_data (user->keyfile, NULL, &error);
if (data == NULL) {
g_wa... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,745 | throw_error (GDBusMethodInvocation *context,
gint error_code,
const gchar *format,
...)
{
va_list args;
g_autofree gchar *message = NULL;
va_start (args, format);
message = g_strdup_vprintf (format, args);
va_end... | Dir. Trav. | 0 | throw_error (GDBusMethodInvocation *context,
gint error_code,
const gchar *format,
...)
{
va_list args;
g_autofree gchar *message = NULL;
va_start (args, format);
message = g_strdup_vprintf (format, args);
va_end... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,746 | user_change_email_authorized_cb (Daemon *daemon,
User *user,
GDBusMethodInvocation *context,
gpointer data)
{
gchar *email = data;
if (g_strcmp0 (accounts_us... | Dir. Trav. | 0 | user_change_email_authorized_cb (Daemon *daemon,
User *user,
GDBusMethodInvocation *context,
gpointer data)
{
gchar *email = data;
if (g_strcmp0 (accounts_us... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,747 | user_change_language_authorized_cb (Daemon *daemon,
User *user,
GDBusMethodInvocation *context,
gpointer data)
{
gchar *language = data;
if (g_strcm... | Dir. Trav. | 0 | user_change_language_authorized_cb (Daemon *daemon,
User *user,
GDBusMethodInvocation *context,
gpointer data)
{
gchar *language = data;
if (g_strcm... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,748 | user_change_location_authorized_cb (Daemon *daemon,
User *user,
GDBusMethodInvocation *context,
gpointer data)
{
gchar *location = data;
if (g_strcm... | Dir. Trav. | 0 | user_change_location_authorized_cb (Daemon *daemon,
User *user,
GDBusMethodInvocation *context,
gpointer data)
{
gchar *location = data;
if (g_strcm... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,749 | user_change_shell_authorized_cb (Daemon *daemon,
User *user,
GDBusMethodInvocation *context,
gpointer data)
{
gchar *shell = data;
g_autoptr(GError) error = N... | Dir. Trav. | 0 | user_change_shell_authorized_cb (Daemon *daemon,
User *user,
GDBusMethodInvocation *context,
gpointer data)
{
gchar *shell = data;
g_autoptr(GError) error = N... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,750 | user_change_user_name_authorized_cb (Daemon *daemon,
User *user,
GDBusMethodInvocation *context,
gpointer data)
{
gchar *name = data;
gchar *old_n... | Dir. Trav. | 0 | user_change_user_name_authorized_cb (Daemon *daemon,
User *user,
GDBusMethodInvocation *context,
gpointer data)
{
gchar *name = data;
gchar *old_n... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,751 | user_change_x_session_authorized_cb (Daemon *daemon,
User *user,
GDBusMethodInvocation *context,
gpointer data)
{
gchar *x_session = data;
if (g_... | Dir. Trav. | 0 | user_change_x_session_authorized_cb (Daemon *daemon,
User *user,
GDBusMethodInvocation *context,
gpointer data)
{
gchar *x_session = data;
if (g_... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,752 | user_changed (User *user)
{
accounts_user_emit_changed (ACCOUNTS_USER (user));
}
| Dir. Trav. | 0 | user_changed (User *user)
{
accounts_user_emit_changed (ACCOUNTS_USER (user));
}
| @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,753 | user_extension_authentication_done (Daemon *daemon,
User *user,
GDBusMethodInvocation *invocation,
gpointer user_data)
{
GDBusInterfaceInfo *interface = user_... | Dir. Trav. | 0 | user_extension_authentication_done (Daemon *daemon,
User *user,
GDBusMethodInvocation *invocation,
gpointer user_data)
{
GDBusInterfaceInfo *interface = user_... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,754 | user_extension_get_all_properties (User *user,
Daemon *daemon,
GDBusInterfaceInfo *interface,
GDBusMethodInvocation *invocation)
{
GVariantBuilder builder;
gint i;
... | Dir. Trav. | 0 | user_extension_get_all_properties (User *user,
Daemon *daemon,
GDBusInterfaceInfo *interface,
GDBusMethodInvocation *invocation)
{
GVariantBuilder builder;
gint i;
... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,755 | user_extension_get_property (User *user,
Daemon *daemon,
GDBusInterfaceInfo *interface,
GDBusMethodInvocation *invocation)
{
const GDBusPropertyInfo *property = g_dbus_method_invocation_get_... | Dir. Trav. | 0 | user_extension_get_property (User *user,
Daemon *daemon,
GDBusInterfaceInfo *interface,
GDBusMethodInvocation *invocation)
{
const GDBusPropertyInfo *property = g_dbus_method_invocation_get_... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,756 | user_extension_method_call (GDBusConnection *connection,
const gchar *sender,
const gchar *object_path,
const gchar *interface_name,
const gchar *method_name,
... | Dir. Trav. | 0 | user_extension_method_call (GDBusConnection *connection,
const gchar *sender,
const gchar *object_path,
const gchar *interface_name,
const gchar *method_name,
... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,757 | user_extension_set_property (User *user,
Daemon *daemon,
GDBusInterfaceInfo *interface,
GDBusMethodInvocation *invocation)
{
const GDBusPropertyInfo *property = g_dbus_method_invocation_get_... | Dir. Trav. | 0 | user_extension_set_property (User *user,
Daemon *daemon,
GDBusInterfaceInfo *interface,
GDBusMethodInvocation *invocation)
{
const GDBusPropertyInfo *property = g_dbus_method_invocation_get_... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,758 | user_get_cached (User *user)
{
return user->cached;
}
| Dir. Trav. | 0 | user_get_cached (User *user)
{
return user->cached;
}
| @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,759 | user_get_local_account (User *user)
{
return accounts_user_get_local_account (ACCOUNTS_USER (user));;
}
| Dir. Trav. | 0 | user_get_local_account (User *user)
{
return accounts_user_get_local_account (ACCOUNTS_USER (user));;
}
| @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,760 | user_get_object_path (User *user)
{
return g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (user));
}
| Dir. Trav. | 0 | user_get_object_path (User *user)
{
return g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (user));
}
| @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,761 | user_get_password_expiration_policy (AccountsUser *auser,
GDBusMethodInvocation *context)
{
User *user = (User*)auser;
int uid;
const gchar *action_id;
if (!get_caller_uid (context, &uid)) {
throw_error (context, ERROR_FAILED... | Dir. Trav. | 0 | user_get_password_expiration_policy (AccountsUser *auser,
GDBusMethodInvocation *context)
{
User *user = (User*)auser;
int uid;
const gchar *action_id;
if (!get_caller_uid (context, &uid)) {
throw_error (context, ERROR_FAILED... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,762 | user_get_password_expiration_policy_authorized_cb (Daemon *daemon,
User *user,
GDBusMethodInvocation *context,
gpointer d... | Dir. Trav. | 0 | user_get_password_expiration_policy_authorized_cb (Daemon *daemon,
User *user,
GDBusMethodInvocation *context,
gpointer d... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,763 | user_get_shell(User *user)
{
return accounts_user_get_shell (ACCOUNTS_USER (user));
}
| Dir. Trav. | 0 | user_get_shell(User *user)
{
return accounts_user_get_shell (ACCOUNTS_USER (user));
}
| @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,764 | user_get_system_account (User *user)
{
return accounts_user_get_system_account (ACCOUNTS_USER (user));
}
| Dir. Trav. | 0 | user_get_system_account (User *user)
{
return accounts_user_get_system_account (ACCOUNTS_USER (user));
}
| @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,765 | user_get_uid (User *user)
{
return accounts_user_get_uid (ACCOUNTS_USER (user));
}
| Dir. Trav. | 0 | user_get_uid (User *user)
{
return accounts_user_get_uid (ACCOUNTS_USER (user));
}
| @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,766 | user_get_user_name (User *user)
{
return accounts_user_get_user_name (ACCOUNTS_USER (user));
}
| Dir. Trav. | 0 | user_get_user_name (User *user)
{
return accounts_user_get_user_name (ACCOUNTS_USER (user));
}
| @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,767 | user_new (Daemon *daemon,
uid_t uid)
{
User *user;
user = g_object_new (TYPE_USER, NULL);
user->daemon = daemon;
accounts_user_set_uid (ACCOUNTS_USER (user), uid);
return user;
}
| Dir. Trav. | 0 | user_new (Daemon *daemon,
uid_t uid)
{
User *user;
user = g_object_new (TYPE_USER, NULL);
user->daemon = daemon;
accounts_user_set_uid (ACCOUNTS_USER (user), uid);
return user;
}
| @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,768 | user_register (User *user)
{
g_autoptr(GError) error = NULL;
g_autofree gchar *object_path = NULL;
user->system_bus_connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
if (user->system_bus_connection == NULL) {
if (error != NULL)
g_crit... | Dir. Trav. | 0 | user_register (User *user)
{
g_autoptr(GError) error = NULL;
g_autofree gchar *object_path = NULL;
user->system_bus_connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
if (user->system_bus_connection == NULL) {
if (error != NULL)
g_crit... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,769 | user_register_extensions (User *user)
{
static const GDBusInterfaceVTable vtable = {
user_extension_method_call,
NULL /* get_property */,
NULL /* set_property */
};
GHashTable *extensions;
GHashTableIter iter;
gpointer iface;
... | Dir. Trav. | 0 | user_register_extensions (User *user)
{
static const GDBusInterfaceVTable vtable = {
user_extension_method_call,
NULL /* get_property */,
NULL /* set_property */
};
GHashTable *extensions;
GHashTableIter iter;
gpointer iface;
... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,770 | user_reset_icon_file (User *user)
{
const char *icon_file;
gboolean icon_is_default;
const char *home_dir;
icon_file = accounts_user_get_icon_file (ACCOUNTS_USER (user));
if (icon_file == NULL || g_strcmp0 (icon_file, user->default_icon_file) == 0) {
icon_is_... | Dir. Trav. | 0 | user_reset_icon_file (User *user)
{
const char *icon_file;
gboolean icon_is_default;
const char *home_dir;
icon_file = accounts_user_get_icon_file (ACCOUNTS_USER (user));
if (icon_file == NULL || g_strcmp0 (icon_file, user->default_icon_file) == 0) {
icon_is_... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,771 | user_set_email (AccountsUser *auser,
GDBusMethodInvocation *context,
const gchar *email)
{
User *user = (User*)auser;
int uid;
const gchar *action_id;
if (!get_caller_uid (context, &uid)) {
throw_error (context, ERROR_FA... | Dir. Trav. | 0 | user_set_email (AccountsUser *auser,
GDBusMethodInvocation *context,
const gchar *email)
{
User *user = (User*)auser;
int uid;
const gchar *action_id;
if (!get_caller_uid (context, &uid)) {
throw_error (context, ERROR_FA... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,772 | user_set_language (AccountsUser *auser,
GDBusMethodInvocation *context,
const gchar *language)
{
User *user = (User*)auser;
int uid;
const gchar *action_id;
if (!get_caller_uid (context, &uid)) {
throw_error (conte... | Dir. Trav. | 0 | user_set_language (AccountsUser *auser,
GDBusMethodInvocation *context,
const gchar *language)
{
User *user = (User*)auser;
int uid;
const gchar *action_id;
if (!get_caller_uid (context, &uid)) {
throw_error (conte... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,773 | user_set_location (AccountsUser *auser,
GDBusMethodInvocation *context,
const gchar *location)
{
User *user = (User*)auser;
int uid;
const gchar *action_id;
if (!get_caller_uid (context, &uid)) {
throw_error (conte... | Dir. Trav. | 0 | user_set_location (AccountsUser *auser,
GDBusMethodInvocation *context,
const gchar *location)
{
User *user = (User*)auser;
int uid;
const gchar *action_id;
if (!get_caller_uid (context, &uid)) {
throw_error (conte... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,774 | user_set_real_name (AccountsUser *auser,
GDBusMethodInvocation *context,
const gchar *real_name)
{
User *user = (User*)auser;
int uid;
const gchar *action_id;
if (!get_caller_uid (context, &uid)) {
throw_error (c... | Dir. Trav. | 0 | user_set_real_name (AccountsUser *auser,
GDBusMethodInvocation *context,
const gchar *real_name)
{
User *user = (User*)auser;
int uid;
const gchar *action_id;
if (!get_caller_uid (context, &uid)) {
throw_error (c... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,775 | user_set_shell (AccountsUser *auser,
GDBusMethodInvocation *context,
const gchar *shell)
{
User *user = (User*)auser;
daemon_local_check_auth (user->daemon,
user,
"org.freedesktop.account... | Dir. Trav. | 0 | user_set_shell (AccountsUser *auser,
GDBusMethodInvocation *context,
const gchar *shell)
{
User *user = (User*)auser;
daemon_local_check_auth (user->daemon,
user,
"org.freedesktop.account... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,776 | user_set_user_name (AccountsUser *auser,
GDBusMethodInvocation *context,
const gchar *user_name)
{
User *user = (User*)auser;
daemon_local_check_auth (user->daemon,
user,
"org.fre... | Dir. Trav. | 0 | user_set_user_name (AccountsUser *auser,
GDBusMethodInvocation *context,
const gchar *user_name)
{
User *user = (User*)auser;
daemon_local_check_auth (user->daemon,
user,
"org.fre... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,777 | user_set_x_session (AccountsUser *auser,
GDBusMethodInvocation *context,
const gchar *x_session)
{
User *user = (User*)auser;
int uid;
const gchar *action_id;
if (!get_caller_uid (context, &uid)) {
throw_error (c... | Dir. Trav. | 0 | user_set_x_session (AccountsUser *auser,
GDBusMethodInvocation *context,
const gchar *x_session)
{
User *user = (User*)auser;
int uid;
const gchar *action_id;
if (!get_caller_uid (context, &uid)) {
throw_error (c... | @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,778 | user_update_local_account_property (User *user,
gboolean local)
{
accounts_user_set_local_account (ACCOUNTS_USER (user), local);
}
| Dir. Trav. | 0 | user_update_local_account_property (User *user,
gboolean local)
{
accounts_user_set_local_account (ACCOUNTS_USER (user), local);
}
| @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,779 | user_update_system_account_property (User *user,
gboolean system)
{
accounts_user_set_system_account (ACCOUNTS_USER (user), system);
}
| Dir. Trav. | 0 | user_update_system_account_property (User *user,
gboolean system)
{
accounts_user_set_system_account (ACCOUNTS_USER (user), system);
}
| @@ -1334,6 +1334,14 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
}
file = g_file_new_for_path (filename);
+ g_clear_pointer (&filename, g_free);
+
+ /* Canonicalize path so we can call g_str_has_prefix on it
+ * below without concern for ../ path compo... | CWE-22 | null | null |
3,780 | g_ucs4_to_utf8 (const gunichar * str,
glong len,
glong * items_read, glong * items_written)
{
gint result_length;
gchar *result = NULL;
gchar *p;
gint i;
result_length = 0;
for (i = 0; len < 0 || i < len; i++)
{
if (!str[i])
break;
if (str[i] >= 0x80000000)
goto err_out;
resul... | Overflow | 0 | g_ucs4_to_utf8 (const gunichar * str,
glong len,
glong * items_read, glong * items_written)
{
gint result_length;
gchar *result = NULL;
gchar *p;
gint i;
result_length = 0;
for (i = 0; len < 0 || i < len; i++)
{
if (!str[i])
break;
if (str[i] >= 0x80000000)
goto err_out;
resul... | @@ -1002,6 +1002,8 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
return g_unichar_to_utf8 (c, outbuf);
}
+#include <unistr.h>
+
/**
* stringprep_utf8_to_ucs4:
* @str: a UTF-8 encoded string
@@ -1010,9 +1012,10 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
* @items_written: location to... | CWE-119 | null | null |
3,781 | g_unichar_to_utf8 (gunichar c, gchar * outbuf)
{
/* If this gets modified, also update the copy in g_string_insert_unichar() */
guint len = 0;
int first;
int i;
if (c < 0x80)
{
first = 0;
len = 1;
}
else if (c < 0x800)
{
first = 0xc0;
len = 2;
}
else if (c < 0x1000... | Overflow | 0 | g_unichar_to_utf8 (gunichar c, gchar * outbuf)
{
/* If this gets modified, also update the copy in g_string_insert_unichar() */
guint len = 0;
int first;
int i;
if (c < 0x80)
{
first = 0;
len = 1;
}
else if (c < 0x800)
{
first = 0xc0;
len = 2;
}
else if (c < 0x1000... | @@ -1002,6 +1002,8 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
return g_unichar_to_utf8 (c, outbuf);
}
+#include <unistr.h>
+
/**
* stringprep_utf8_to_ucs4:
* @str: a UTF-8 encoded string
@@ -1010,9 +1012,10 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
* @items_written: location to... | CWE-119 | null | null |
3,782 | g_unicode_canonical_ordering (gunichar * string, gsize len)
{
gsize i;
int swap = 1;
while (swap)
{
int last;
swap = 0;
last = COMBINING_CLASS (string[0]);
for (i = 0; i < len - 1; ++i)
{
int next = COMBINING_CLASS (string[i + 1]);
if (next != 0 && last > next)
{
gs... | Overflow | 0 | g_unicode_canonical_ordering (gunichar * string, gsize len)
{
gsize i;
int swap = 1;
while (swap)
{
int last;
swap = 0;
last = COMBINING_CLASS (string[0]);
for (i = 0; i < len - 1; ++i)
{
int next = COMBINING_CLASS (string[i + 1]);
if (next != 0 && last > next)
{
gs... | @@ -1002,6 +1002,8 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
return g_unichar_to_utf8 (c, outbuf);
}
+#include <unistr.h>
+
/**
* stringprep_utf8_to_ucs4:
* @str: a UTF-8 encoded string
@@ -1010,9 +1012,10 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
* @items_written: location to... | CWE-119 | null | null |
3,783 | g_utf8_normalize (const gchar * str, gssize len, GNormalizeMode mode)
{
gunichar *result_wc = _g_utf8_normalize_wc (str, len, mode);
gchar *result;
result = g_ucs4_to_utf8 (result_wc, -1, NULL, NULL);
g_free (result_wc);
return result;
}
| Overflow | 0 | g_utf8_normalize (const gchar * str, gssize len, GNormalizeMode mode)
{
gunichar *result_wc = _g_utf8_normalize_wc (str, len, mode);
gchar *result;
result = g_ucs4_to_utf8 (result_wc, -1, NULL, NULL);
g_free (result_wc);
return result;
}
| @@ -1002,6 +1002,8 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
return g_unichar_to_utf8 (c, outbuf);
}
+#include <unistr.h>
+
/**
* stringprep_utf8_to_ucs4:
* @str: a UTF-8 encoded string
@@ -1010,9 +1012,10 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
* @items_written: location to... | CWE-119 | null | null |
3,784 | g_utf8_strlen (const gchar * p, gssize max)
{
glong len = 0;
const gchar *start = p;
g_return_val_if_fail (p != NULL || max == 0, 0);
if (max < 0)
{
while (*p)
{
p = g_utf8_next_char (p);
++len;
}
}
else
{
if (max == 0 || !*p)
return 0;
p = g_utf8_next_char (p);
... | Overflow | 0 | g_utf8_strlen (const gchar * p, gssize max)
{
glong len = 0;
const gchar *start = p;
g_return_val_if_fail (p != NULL || max == 0, 0);
if (max < 0)
{
while (*p)
{
p = g_utf8_next_char (p);
++len;
}
}
else
{
if (max == 0 || !*p)
return 0;
p = g_utf8_next_char (p);
... | @@ -1002,6 +1002,8 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
return g_unichar_to_utf8 (c, outbuf);
}
+#include <unistr.h>
+
/**
* stringprep_utf8_to_ucs4:
* @str: a UTF-8 encoded string
@@ -1010,9 +1012,10 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
* @items_written: location to... | CWE-119 | null | null |
3,785 | g_utf8_to_ucs4_fast (const gchar * str, glong len, glong * items_written)
{
gunichar *result;
gsize n_chars, i;
const gchar *p;
g_return_val_if_fail (str != NULL, NULL);
p = str;
n_chars = 0;
if (len < 0)
{
while (*p)
{
p = g_utf8_next_char (p);
++n_chars;
}
}
else
{
wh... | Overflow | 0 | g_utf8_to_ucs4_fast (const gchar * str, glong len, glong * items_written)
{
gunichar *result;
gsize n_chars, i;
const gchar *p;
g_return_val_if_fail (str != NULL, NULL);
p = str;
n_chars = 0;
if (len < 0)
{
while (*p)
{
p = g_utf8_next_char (p);
++n_chars;
}
}
else
{
wh... | @@ -1002,6 +1002,8 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
return g_unichar_to_utf8 (c, outbuf);
}
+#include <unistr.h>
+
/**
* stringprep_utf8_to_ucs4:
* @str: a UTF-8 encoded string
@@ -1010,9 +1012,10 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
* @items_written: location to... | CWE-119 | null | null |
3,786 | stringprep_ucs4_nfkc_normalize (const uint32_t * str, ssize_t len)
{
char *p;
uint32_t *result_wc;
p = stringprep_ucs4_to_utf8 (str, len, 0, 0);
result_wc = _g_utf8_normalize_wc (p, -1, G_NORMALIZE_NFKC);
free (p);
return result_wc;
}
| Overflow | 0 | stringprep_ucs4_nfkc_normalize (const uint32_t * str, ssize_t len)
{
char *p;
uint32_t *result_wc;
p = stringprep_ucs4_to_utf8 (str, len, 0, 0);
result_wc = _g_utf8_normalize_wc (p, -1, G_NORMALIZE_NFKC);
free (p);
return result_wc;
}
| @@ -1002,6 +1002,8 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
return g_unichar_to_utf8 (c, outbuf);
}
+#include <unistr.h>
+
/**
* stringprep_utf8_to_ucs4:
* @str: a UTF-8 encoded string
@@ -1010,9 +1012,10 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
* @items_written: location to... | CWE-119 | null | null |
3,787 | stringprep_ucs4_to_utf8 (const uint32_t * str, ssize_t len,
size_t * items_read, size_t * items_written)
{
return g_ucs4_to_utf8 (str, len, (glong *) items_read,
(glong *) items_written);
}
| Overflow | 0 | stringprep_ucs4_to_utf8 (const uint32_t * str, ssize_t len,
size_t * items_read, size_t * items_written)
{
return g_ucs4_to_utf8 (str, len, (glong *) items_read,
(glong *) items_written);
}
| @@ -1002,6 +1002,8 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
return g_unichar_to_utf8 (c, outbuf);
}
+#include <unistr.h>
+
/**
* stringprep_utf8_to_ucs4:
* @str: a UTF-8 encoded string
@@ -1010,9 +1012,10 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
* @items_written: location to... | CWE-119 | null | null |
3,788 | stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
{
return g_unichar_to_utf8 (c, outbuf);
}
| Overflow | 0 | stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
{
return g_unichar_to_utf8 (c, outbuf);
}
| @@ -1002,6 +1002,8 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
return g_unichar_to_utf8 (c, outbuf);
}
+#include <unistr.h>
+
/**
* stringprep_utf8_to_ucs4:
* @str: a UTF-8 encoded string
@@ -1010,9 +1012,10 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
* @items_written: location to... | CWE-119 | null | null |
3,789 | stringprep_utf8_nfkc_normalize (const char *str, ssize_t len)
{
return g_utf8_normalize (str, len, G_NORMALIZE_NFKC);
}
| Overflow | 0 | stringprep_utf8_nfkc_normalize (const char *str, ssize_t len)
{
return g_utf8_normalize (str, len, G_NORMALIZE_NFKC);
}
| @@ -1002,6 +1002,8 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
return g_unichar_to_utf8 (c, outbuf);
}
+#include <unistr.h>
+
/**
* stringprep_utf8_to_ucs4:
* @str: a UTF-8 encoded string
@@ -1010,9 +1012,10 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
* @items_written: location to... | CWE-119 | null | null |
3,790 | stringprep_utf8_to_unichar (const char *p)
{
return g_utf8_get_char (p);
}
| Overflow | 0 | stringprep_utf8_to_unichar (const char *p)
{
return g_utf8_get_char (p);
}
| @@ -1002,6 +1002,8 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
return g_unichar_to_utf8 (c, outbuf);
}
+#include <unistr.h>
+
/**
* stringprep_utf8_to_ucs4:
* @str: a UTF-8 encoded string
@@ -1010,9 +1012,10 @@ stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
* @items_written: location to... | CWE-119 | null | null |
3,791 | stringprep_4i (uint32_t * ucs4, size_t * len, size_t maxucs4len,
Stringprep_profile_flags flags,
const Stringprep_profile * profile)
{
size_t i, j;
ssize_t k;
size_t ucs4len = *len;
int rc;
for (i = 0; profile[i].operation; i++)
{
switch (profile[i].operation)
{
case STRINGPREP_NF... | Overflow | 0 | stringprep_4i (uint32_t * ucs4, size_t * len, size_t maxucs4len,
Stringprep_profile_flags flags,
const Stringprep_profile * profile)
{
size_t i, j;
ssize_t k;
size_t ucs4len = *len;
int rc;
for (i = 0; profile[i].operation; i++)
{
switch (profile[i].operation)
{
case STRINGPREP_NF... | @@ -380,6 +380,8 @@ stringprep (char *in,
free (ucs4);
ucs4 = stringprep_utf8_to_ucs4 (in, -1, &ucs4len);
+ if (ucs4 == NULL)
+ return STRINGPREP_ICONV_ERROR;
maxucs4len = ucs4len + adducs4len;
newp = realloc (ucs4, maxucs4len * sizeof (uint32_t));
if (!newp)
@@ -402,7 +404,7 @... | CWE-119 | null | null |
3,792 | stringprep_4zi (uint32_t * ucs4, size_t maxucs4len,
Stringprep_profile_flags flags,
const Stringprep_profile * profile)
{
size_t ucs4len;
for (ucs4len = 0; ucs4len < maxucs4len && ucs4[ucs4len] != 0; ucs4len++)
;
return stringprep_4zi_1 (ucs4, ucs4len, maxucs4len, flags, profile);
}
| Overflow | 0 | stringprep_4zi (uint32_t * ucs4, size_t maxucs4len,
Stringprep_profile_flags flags,
const Stringprep_profile * profile)
{
size_t ucs4len;
for (ucs4len = 0; ucs4len < maxucs4len && ucs4[ucs4len] != 0; ucs4len++)
;
return stringprep_4zi_1 (ucs4, ucs4len, maxucs4len, flags, profile);
}
| @@ -380,6 +380,8 @@ stringprep (char *in,
free (ucs4);
ucs4 = stringprep_utf8_to_ucs4 (in, -1, &ucs4len);
+ if (ucs4 == NULL)
+ return STRINGPREP_ICONV_ERROR;
maxucs4len = ucs4len + adducs4len;
newp = realloc (ucs4, maxucs4len * sizeof (uint32_t));
if (!newp)
@@ -402,7 +404,7 @... | CWE-119 | null | null |
3,793 | stringprep_4zi_1 (uint32_t * ucs4, size_t ucs4len, size_t maxucs4len,
Stringprep_profile_flags flags,
const Stringprep_profile * profile)
{
int rc;
rc = stringprep_4i (ucs4, &ucs4len, maxucs4len, flags, profile);
if (rc != STRINGPREP_OK)
return rc;
if (ucs4len >= maxucs4len)
return STRINGPREP_... | Overflow | 0 | stringprep_4zi_1 (uint32_t * ucs4, size_t ucs4len, size_t maxucs4len,
Stringprep_profile_flags flags,
const Stringprep_profile * profile)
{
int rc;
rc = stringprep_4i (ucs4, &ucs4len, maxucs4len, flags, profile);
if (rc != STRINGPREP_OK)
return rc;
if (ucs4len >= maxucs4len)
return STRINGPREP_... | @@ -380,6 +380,8 @@ stringprep (char *in,
free (ucs4);
ucs4 = stringprep_utf8_to_ucs4 (in, -1, &ucs4len);
+ if (ucs4 == NULL)
+ return STRINGPREP_ICONV_ERROR;
maxucs4len = ucs4len + adducs4len;
newp = realloc (ucs4, maxucs4len * sizeof (uint32_t));
if (!newp)
@@ -402,7 +404,7 @... | CWE-119 | null | null |
3,794 | stringprep_apply_table_to_string (uint32_t * ucs4,
size_t * ucs4len,
size_t maxucs4len,
const Stringprep_table_element * table)
{
ssize_t pos;
size_t i, maplen;
while ((pos = stringprep_find_string_in_table (ucs4, *ucs4len,
&i, table)) != -1)
{
for (maplen = STRINGPREP_MAX_MAP_... | Overflow | 0 | stringprep_apply_table_to_string (uint32_t * ucs4,
size_t * ucs4len,
size_t maxucs4len,
const Stringprep_table_element * table)
{
ssize_t pos;
size_t i, maplen;
while ((pos = stringprep_find_string_in_table (ucs4, *ucs4len,
&i, table)) != -1)
{
for (maplen = STRINGPREP_MAX_MAP_... | @@ -380,6 +380,8 @@ stringprep (char *in,
free (ucs4);
ucs4 = stringprep_utf8_to_ucs4 (in, -1, &ucs4len);
+ if (ucs4 == NULL)
+ return STRINGPREP_ICONV_ERROR;
maxucs4len = ucs4len + adducs4len;
newp = realloc (ucs4, maxucs4len * sizeof (uint32_t));
if (!newp)
@@ -402,7 +404,7 @... | CWE-119 | null | null |
3,795 | Parser::Parser(XRef *xrefA, Lexer *lexerA, GBool allowStreamsA) {
xref = xrefA;
lexer = lexerA;
inlineImg = 0;
allowStreams = allowStreamsA;
buf1 = lexer->getObj();
buf2 = lexer->getObj();
}
| DoS Mem. Corr. | 0 | Parser::Parser(XRef *xrefA, Lexer *lexerA, GBool allowStreamsA) {
xref = xrefA;
lexer = lexerA;
inlineImg = 0;
allowStreams = allowStreamsA;
buf1 = lexer->getObj();
buf2 = lexer->getObj();
}
| @@ -154,6 +154,11 @@ Object Parser::getObj(GBool simpleOnly,
const int gen = buf1.getInt();
shift();
shift();
+
+ if (unlikely(num <= 0 || gen < 0)) {
+ return Object();
+ }
+
return Object(num, gen);
} else {
return Object(num); | CWE-125 | null | null |
3,796 | ProcXSendExtensionEvent(ClientPtr client)
{
int ret;
DeviceIntPtr dev;
xEvent *first;
XEventClass *list;
struct tmask tmp[EMASKSIZE];
REQUEST(xSendExtensionEventReq);
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
if (stuff->length !=
bytes_to_int32(sizeof(xSendExtensionEventRe... | null | 0 | ProcXSendExtensionEvent(ClientPtr client)
{
int ret;
DeviceIntPtr dev;
xEvent *first;
XEventClass *list;
struct tmask tmp[EMASKSIZE];
REQUEST(xSendExtensionEventReq);
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
if (stuff->length !=
bytes_to_int32(sizeof(xSendExtensionEventRe... | @@ -78,7 +78,7 @@ SProcXSendExtensionEvent(ClientPtr client)
{
CARD32 *p;
int i;
- xEvent eventT;
+ xEvent eventT = { .u.u.type = 0 };
xEvent *eventP;
EventSwapPtr proc; | CWE-665 | null | null |
3,797 | ActivateEnterGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
{
BOOL rc = FALSE;
DeviceEvent event;
if (dev->deviceGrab.grab) {
if (!dev->deviceGrab.fromPassiveGrab ||
dev->deviceGrab.grab->type != XI_Enter ||
dev->deviceGrab.grab->window == win ||
IsParent(d... | Exec Code Overflow | 0 | ActivateEnterGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
{
BOOL rc = FALSE;
DeviceEvent event;
if (dev->deviceGrab.grab) {
if (!dev->deviceGrab.fromPassiveGrab ||
dev->deviceGrab.grab->type != XI_Enter ||
dev->deviceGrab.grab->window == win ||
IsParent(d... | @@ -5366,6 +5366,12 @@ ProcSendEvent(ClientPtr client)
client->errorValue = stuff->event.u.u.type;
return BadValue;
}
+ /* Generic events can have variable size, but SendEvent request holds
+ exactly 32B of event data. */
+ if (stuff->event.u.u.type == GenericEvent) {
+ client-... | CWE-119 | null | null |
3,798 | ActivateFocusInGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
{
BOOL rc = FALSE;
DeviceEvent event;
if (dev->deviceGrab.grab) {
if (!dev->deviceGrab.fromPassiveGrab ||
dev->deviceGrab.grab->type != XI_FocusIn ||
dev->deviceGrab.grab->window == win ||
IsPare... | Exec Code Overflow | 0 | ActivateFocusInGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
{
BOOL rc = FALSE;
DeviceEvent event;
if (dev->deviceGrab.grab) {
if (!dev->deviceGrab.fromPassiveGrab ||
dev->deviceGrab.grab->type != XI_FocusIn ||
dev->deviceGrab.grab->window == win ||
IsPare... | @@ -5366,6 +5366,12 @@ ProcSendEvent(ClientPtr client)
client->errorValue = stuff->event.u.u.type;
return BadValue;
}
+ /* Generic events can have variable size, but SendEvent request holds
+ exactly 32B of event data. */
+ if (stuff->event.u.u.type == GenericEvent) {
+ client-... | CWE-119 | null | null |
3,799 | ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time,
Bool passive)
{
GrabInfoPtr grabinfo = &keybd->deviceGrab;
GrabPtr oldgrab = grabinfo->grab;
WindowPtr oldWin;
/* slave devices need to float for the duration of the grab. */
if (grab->grabtype == XI2 && key... | Exec Code Overflow | 0 | ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time,
Bool passive)
{
GrabInfoPtr grabinfo = &keybd->deviceGrab;
GrabPtr oldgrab = grabinfo->grab;
WindowPtr oldWin;
/* slave devices need to float for the duration of the grab. */
if (grab->grabtype == XI2 && key... | @@ -5366,6 +5366,12 @@ ProcSendEvent(ClientPtr client)
client->errorValue = stuff->event.u.u.type;
return BadValue;
}
+ /* Generic events can have variable size, but SendEvent request holds
+ exactly 32B of event data. */
+ if (stuff->event.u.u.type == GenericEvent) {
+ client-... | CWE-119 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.