Dataset Viewer
Auto-converted to Parquet Duplicate
code
stringlengths
46
2.03k
label_name
stringclasses
15 values
label
int64
0
14
private static function retrieveClosurePattern($pure, $closureName) { $pattern = '/'; if (!$pure) { $pattern .= preg_quote(self::$registeredDelimiters[0]) . "\s*"; } $pattern .= "$closureName\(([a-z0-9,\.\s]+)\)"; if (!$pure) { $pattern .= "\s*" . ...
CWE-277
0
$bool = self::evaluateTypedCondition($array, $expression); if (!$bool) { $hit->parentNode->removeChild($hit); } else { $hit->removeAttribute('n-if'); } } return $doc->saveHTML(); }
CWE-277
0
foreach ($flatArray as $key => $value) { $pattern = '/' . $key . '([^.]|$)/'; if (preg_match($pattern, $expression, $matches)) { switch (gettype($flatArray[$key])) { case 'boolean': $expression = str_replace($key, $flatArray[$k...
CWE-277
0
$backup = ['sys' => $GLOBALS['TYPO3_CONF_VARS']['SYS'], 'server' => $_SERVER];
CWE-644
1
protected function checkTrustedHostPattern() { if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] === GeneralUtility::ENV_TRUSTED_HOSTS_PATTERN_ALLOW_ALL) { $this->messageQueue->enqueue(new FlashMessage( 'Trusted hosts pattern is configured to allow all header valu...
CWE-644
1
set: function(k, v) { v = coerce(k, v, this._schema, this) const path = k.split('.') const childKey = path.pop() const parentKey = path.join('.') if (!(parentKey == '__proto__' || parentKey == 'constructor' || parentKey == 'prototype')) { const parent = walk(this._instance, par...
CWE-1321
2
var isValidKey = function (key) { return key !== '__proto__' && key !== 'constructor' && key !== 'prototype'; };
CWE-1321
2
function _merge(target, source) { if (target === source) { return target; } for (var key in source) { if (!Object.prototype.hasOwnProperty.call(source, key)) { continue; } var sourceVal = source[key]; var targetVal = target[key]; if (typeof targetVal !== 'undefined' && typeof sour...
CWE-1321
2
const busboyOptions = deepmerge.all([{ headers: Object.assign({}, req.headers) }, options || {}, opts || {}]) const stream = busboy(busboyOptions) let completed = false let files = 0 req.on('error', function (err) { stream.destroy() if (!completed) { completed = true don...
CWE-1321
2
export function deepExtend (a, b) { // TODO: add support for Arrays to deepExtend if (Array.isArray(b)) { throw new TypeError('Arrays are not supported by deepExtend') } for (const prop in b) { if (hasOwnProperty(b, prop)) { if (b[prop] && b[prop].constructor === Object) { if (a[prop] ===...
CWE-1321
2
depthedLookup: function(name) { return [this.aliasable('container.lookup'), '(depths, "', name, '")']; },
CWE-1321
2
function curry(func) { return (thiz, args) => local.Reflect.apply(func, thiz, args); }
CWE-1321
2
if (NODE_VERSION >= 10) { it('Dynamic import attack', (done) => { process.once('unhandledRejection', (reason) => { assert.strictEqual(reason.message, 'process is not defined'); done(); }); const vm2 = new VM(); vm2.run(` (async () => { try { await import('oops!'); } catch (e...
CWE-1321
2
function merge(target, source, options = {}) { if (!isObjectOrClass(target)) throw new TypeError('Property "target" requires object type'); if (!source) return target; if (!isObjectOrClass(source)) throw new TypeError('Property "source" requires object type'); if (source === target) return target; ...
CWE-1321
2
getAndCreate = function(path, object, defaultValue) { var aPath, key, value; if (object == null) { return; } if (!isObject(object)) { return; } aPath = ("" + path).split("."); value = object; key = aPath.shift(); if (key === 'constructor' && type...
CWE-1321
2
function set(root, space, value) { var i, c, val, nextSpace, curSpace = root; space = parse(space); val = space.pop(); for (i = 0, c = space.length; i < c; i++) { nextSpace = space[i]; if ( nextSpace === '__proto__' || nextSpace === 'constructor' || nextSpace === 'prototype' ) { return...
CWE-1321
2
function wrap (field, file, filename, encoding, mimetype) { log.debug({ field, filename, encoding, mimetype }, 'parsing part') files++ eos(file, waitForFiles) if (field === '__proto__') { file.destroy(new Error('__proto__ is not allowed as field name')) return } h...
CWE-1321
2
function isPrototypePolluted(key) { return ['__proto__', 'constructor', 'prototype'].includes(key) }
CWE-1321
2
set: function(k, v) { for (const path of FORBIDDEN_KEY_PATHS) { if (k.startsWith(`${path}.`)) { return this } } v = coerce(k, v, this._schema, this) const path = k.split('.') const childKey = path.pop() const parentKey = path.join('.') const paren...
CWE-1321
2
getValue = function(path, object, valueIfMissing) { var aPath, key, value; if (valueIfMissing == null) { valueIfMissing = void 0; } if (object == null) { return valueIfMissing; } aPath = ("" + path).split("."); value = object; key = aPath.shift(); ...
CWE-1321
2
PropertiesReader.prototype.set = function (key, value) { var parsedValue = ('' + value).trim(); this._properties = this._propertyAppender(this._properties, key, parsedValue); var expanded = key.split('.'); var source = this._propertiesExpanded; while (expanded.length > 1) { var step = expanded.s...
CWE-1321
2
uploads.upload = async function (socket, data) { const methodToFunc = { 'user.uploadCroppedPicture': socketUser.uploadCroppedPicture, 'user.updateCover': socketUser.updateCover, 'groups.cover.update': socketGroup.cover.update, }; if (!socket.uid || !data || !data.chunk || !data.params || !data.params.method ||...
CWE-1321
2
function attachToBody (options, req, reply, next) { if (req.raw[kMultipart] !== true) { next() return } const consumerStream = options.onFile || defaultConsumer const body = {} const mp = req.multipart((field, file, filename, encoding, mimetype) => { body[field] = body[field] || [] body[field...
CWE-1321
2
run(code, filename) { let dirname; let resolvedFilename; let script; if (code instanceof VMScript) { script = this.options.strict ? code._compileNodeVMStrict() : code._compileNodeVM(); resolvedFilename = pa.resolve(code.filename); dirname = pa.dirname(resolvedFilename); } else { const unresolved...
CWE-1321
2
function get(root, path) { var i, c, space, nextSpace, curSpace = root; if (!root) { return root; } space = parse(path); if (space.length) { for (i = 0, c = space.length; i < c; i++) { nextSpace = space[i]; if ( nextSpace === '__proto__' || nextSpace === 'constructor' || nextSpace ...
CWE-1321
2
function makeCheckAsync(internal) { return (hook, args) => { if (hook === 'function' || hook === 'generator_function' || hook === 'eval' || hook === 'run') { const funcConstructor = internal.Function; if (hook === 'eval') { const script = args[0]; args = [script]; if (typeof(script) !== 'string') r...
CWE-1321
2
EXTENSIONS['.' + ext] = (module, filename, dirname) => { if (vm.options.require.context !== 'sandbox') { try { module.exports = Contextify.readonly(host.require(filename)); } catch (e) { throw Contextify.value(e); } } else { let script; try { // Load module let contents ...
CWE-1321
2
jQuery.extend = jQuery.fn.extend = function() { var options, name, src, copy, copyIsArray, clone, target = arguments[ 0 ] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; // Skip the boolean and the target targe...
CWE-1321
2
function zipObject(keys, values) { const out = {}; for (let i = 0, l = keys.length; i < l; ++i) { out[keys[i]] = values[i]; } return out; }
CWE-1321
2
function loadLocale(name) { var oldLocale = null, aliasedRequire; // TODO: Find a better way to register and load all the locales in Node if ( locales[name] === undefined && typeof module !== 'undefined' && module && module.exports ) { try { ol...
CWE-27
3
static php_mb_regex_t *php_mbregex_compile_pattern(const char *pattern, int patlen, OnigOptionType options, OnigEncoding enc, OnigSyntaxType *syntax TSRMLS_DC) { int err_code = 0; int found = 0; php_mb_regex_t *retval = NULL, **rc = NULL; OnigErrorInfo err_info; OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN]; fou...
CWE-415
4
*/ 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) { zval_ptr_dtor(&((st_entry *)stack->elements[i])->data); } if (((st_entry *)stack->elements[i])->varname) { efree(((st_entry...
CWE-416
5
nfsd4_encode_layoutget(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_layoutget *lgp) { struct xdr_stream *xdr = &resp->xdr; const struct nfsd4_layout_ops *ops = nfsd4_layout_ops[lgp->lg_layout_type]; __be32 *p; dprintk("%s: err %d\n", __func__, nfserr); if (nfserr) goto out; nfserr = nfserr_...
CWE-129
6
static int mwifiex_pcie_init_evt_ring(struct mwifiex_adapter *adapter) { struct pcie_service_card *card = adapter->card; struct mwifiex_evt_buf_desc *desc; struct sk_buff *skb; dma_addr_t buf_pa; int i; for (i = 0; i < MWIFIEX_MAX_EVT_BD; i++) { /* Allocate skb here so that firmware can DMA data from it */ s...
CWE-401
7
static int cac_get_serial_nr_from_CUID(sc_card_t* card, sc_serial_number_t* serial) { cac_private_data_t * priv = CAC_DATA(card); SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_NORMAL); if (card->serialnr.len) { *serial = card->serialnr; SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL...
CWE-415
4
static void mbochs_remove(struct mdev_device *mdev) { struct mdev_state *mdev_state = dev_get_drvdata(&mdev->dev); mbochs_used_mbytes -= mdev_state->type->mbytes; vfio_unregister_group_dev(&mdev_state->vdev); kfree(mdev_state->pages); kfree(mdev_state->vconfig); kfree(mdev_state); }
CWE-401
7
static void put_ucounts(struct ucounts *ucounts) { unsigned long flags; if (atomic_dec_and_test(&ucounts->count)) { spin_lock_irqsave(&ucounts_lock, flags); hlist_del_init(&ucounts->node); spin_unlock_irqrestore(&ucounts_lock, flags); kfree(ucounts); } }
CWE-416
5
static ssize_t rpmsg_eptdev_write_iter(struct kiocb *iocb, struct iov_iter *from) { struct file *filp = iocb->ki_filp; struct rpmsg_eptdev *eptdev = filp->private_data; size_t len = iov_iter_count(from); void *kbuf; int ret; kbuf = kzalloc(len, GFP_KERNEL); if (!kbuf) return -ENOMEM; if (!copy_fr...
CWE-401
7
int gnutls_x509_ext_import_proxy(const gnutls_datum_t * ext, int *pathlen, char **policyLanguage, char **policy, size_t * sizeof_policy) { ASN1_TYPE c2 = ASN1_TYPE_EMPTY; int result; gnutls_datum_t value = { NULL, 0 }; if ((result = asn1_create_element (_gnutls_get_pkix(), "PKIX1.ProxyCertI...
CWE-415
4
void usb_sg_cancel(struct usb_sg_request *io) { unsigned long flags; int i, retval; spin_lock_irqsave(&io->lock, flags); if (io->status) { spin_unlock_irqrestore(&io->lock, flags); return; } /* shut everything down */ io->status = -ECONNRESET; spin_unlock_irqrestore(&io->lock, flags); for (i = io->entrie...
CWE-416
5
static int validate_user_key(struct fscrypt_info *crypt_info, struct fscrypt_context *ctx, u8 *raw_key, const char *prefix) { char *description; struct key *keyring_key; struct fscrypt_key *master_key; const struct user_key_payload *ukp; int res; description = kasprintf(GFP_NOFS, "%s%*phN", prefix, FS_...
CWE-416
5
static int sco_sock_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) { struct sock *sk = sock->sk; int err; BT_DBG("sock %p, sk %p", sock, sk); err = sock_error(sk); if (err) return err; if (msg->msg_flags & MSG_OOB) return -EOPNOTSUPP; lock_sock(sk); if (sk->sk_state == BT_CONNECTED...
CWE-416
5
static BOOL region16_simplify_bands(REGION16* region) { /** Simplify consecutive bands that touch and have the same items * * ==================== ==================== * | 1 | | 2 | | | | | * ==================== | | | | * | 1 | | 2 | ====> ...
CWE-401
7
buflist_getfile( int n, linenr_T lnum, int options, int forceit) { buf_T *buf; win_T *wp = NULL; pos_T *fpos; colnr_T col; buf = buflist_findnr(n); if (buf == NULL) { if ((options & GETF_ALT) && n == 0) emsg(_(e_no_alternate_file)); else semsg(_(e_buffer_nr_no...
CWE-122
8
void gdImageWBMPCtx (gdImagePtr image, int fg, gdIOCtx * out) { int x, y, pos; Wbmp *wbmp; /* create the WBMP */ if ((wbmp = createwbmp (gdImageSX (image), gdImageSY (image), WBMP_WHITE)) == NULL) { gd_error("Could not create WBMP"); return; } /* fill up the WBMP structure */ pos = 0; for (y = 0; y < gdIm...
CWE-415
4
int fscrypt_setup_filename(struct inode *dir, const struct qstr *iname, int lookup, struct fscrypt_name *fname) { int ret = 0, bigname = 0; memset(fname, 0, sizeof(struct fscrypt_name)); fname->usr_fname = iname; if (!dir->i_sb->s_cop->is_encrypted(dir) || fscrypt_is_dot_dotdot(iname)) { fname->dis...
CWE-416
5
latin_ptr2len(char_u *p) { return MB_BYTE2LEN(*p); }
CWE-122
8
static netdev_tx_t hns_nic_net_xmit(struct sk_buff *skb, struct net_device *ndev) { struct hns_nic_priv *priv = netdev_priv(ndev); int ret; assert(skb->queue_mapping < ndev->ae_handle->q_num); ret = hns_nic_net_xmit_hw(ndev, skb, &tx_ring_data(priv, skb->queue_mapping)); if (ret == NETDEV_TX_OK) { ...
CWE-416
5
ex_function(exarg_T *eap) { char_u *line_to_free = NULL; (void)define_function(eap, NULL, &line_to_free); vim_free(line_to_free); }
CWE-416
5
struct addr_t* MACH0_(get_entrypoint)(struct MACH0_(obj_t)* bin) { struct addr_t *entry; int i; if (!bin->entry && !bin->sects) { return NULL; } if (!(entry = calloc (1, sizeof (struct addr_t)))) { return NULL; } if (bin->entry) { entry->addr = entry_to_vaddr (bin); entry->offset = addr_to_offset (bin,...
CWE-416
5
static long do_get_mempolicy(int *policy, nodemask_t *nmask, unsigned long addr, unsigned long flags) { int err; struct mm_struct *mm = current->mm; struct vm_area_struct *vma = NULL; struct mempolicy *pol = current->mempolicy; if (flags & ~(unsigned long)(MPOL_F_NODE|MPOL_F_ADDR|MPOL_F_MEMS_ALLOWED)) ...
CWE-416
5
static int async_polkit_callback(sd_bus_message *reply, void *userdata, sd_bus_error *error) { _cleanup_(sd_bus_error_free) sd_bus_error error_buffer = SD_BUS_ERROR_NULL; AsyncPolkitQuery *q = userdata; int r; assert(reply); assert(q); q->slot = sd_bus_slot_unref(q->slo...
CWE-416
5
unsigned long insn_get_seg_base(struct pt_regs *regs, int seg_reg_idx) { struct desc_struct *desc; short sel; sel = get_segment_selector(regs, seg_reg_idx); if (sel < 0) return -1L; if (v8086_mode(regs)) /* * Base is simply the segment selector shifted 4 * bits to the right. */ return (unsigned lo...
CWE-416
5
int inet6_sk_rebuild_header(struct sock *sk) { struct ipv6_pinfo *np = inet6_sk(sk); struct dst_entry *dst; dst = __sk_dst_check(sk, np->dst_cookie); if (!dst) { struct inet_sock *inet = inet_sk(sk); struct in6_addr *final_p, final; struct flowi6 fl6; memset(&fl6, 0, sizeof(fl6)); fl6.flowi6_proto = sk...
CWE-416
5
static void ffs_user_copy_worker(struct work_struct *work) { struct ffs_io_data *io_data = container_of(work, struct ffs_io_data, work); int ret = io_data->req->status ? io_data->req->status : io_data->req->actual; if (io_data->read && ret > 0) { use_mm(io_data->mm); ret = copy_to_iter(io_data->b...
CWE-416
5
void * gdImageWBMPPtr (gdImagePtr im, int *size, int fg) { void *rv; gdIOCtx *out = gdNewDynamicCtx(2048, NULL); gdImageWBMPCtx(im, fg, out); rv = gdDPExtractData(out, size); out->gd_free(out); return rv; }
CWE-415
4
static void cancel_att_send_op(struct att_send_op *op) { if (op->destroy) op->destroy(op->user_data); op->user_data = NULL; op->callback = NULL; op->destroy = NULL; }
CWE-415
4
static void lo_release(struct gendisk *disk, fmode_t mode) { struct loop_device *lo = disk->private_data; int err; if (atomic_dec_return(&lo->lo_refcnt)) return; mutex_lock(&lo->lo_ctl_mutex); if (lo->lo_flags & LO_FLAGS_AUTOCLEAR) { /* * In autoclear mode, stop the loop thread * and remove configurati...
CWE-416
5
int inet6_csk_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl_unused) { struct ipv6_pinfo *np = inet6_sk(sk); struct flowi6 fl6; struct dst_entry *dst; int res; dst = inet6_csk_route_socket(sk, &fl6); if (IS_ERR(dst)) { sk->sk_err_soft = -PTR_ERR(dst); sk->sk_route_caps = 0; kfree_skb(skb); r...
CWE-416
5
struct net *get_net_ns_by_id(struct net *net, int id) { struct net *peer; if (id < 0) return NULL; rcu_read_lock(); spin_lock_bh(&net->nsid_lock); peer = idr_find(&net->netns_ids, id); if (peer) get_net(peer); spin_unlock_bh(&net->nsid_lock); rcu_read_unlock(); return peer; }
CWE-416
5
static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm) { #ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS if (cpu_feature_enabled(X86_FEATURE_OSPKE)) { /* pkey 0 is the default and always allocated */ mm->context.pkey_allocation_map = 0x1; /* -1 means unallocated or invalid */ ...
CWE-416
5
static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, const char *name, uint32_t *write_to, uint32_t range_min, uint32_t range_max) { uint32_t value; int position, zeroes, i, j; char bits[65]; if (ctx->trace_enable) ...
CWE-129
6
ex_function(exarg_T *eap) { (void)define_function(eap, NULL); }
CWE-416
5
void rose_stop_timer(struct sock *sk) { del_timer(&rose_sk(sk)->timer); }
CWE-416
5
destroyPresentationContextList(LST_HEAD ** l) { PRV_PRESENTATIONCONTEXTITEM * prvCtx; DUL_SUBITEM * subItem; if (*l == NULL) return; prvCtx = (PRV_PRESENTATIONCONTEXTITEM*)LST_Dequeue(l); while (prvCtx != NULL) { subItem = (DUL_SUBITEM*)LST_Dequeue(&prvCtx->transferSynt...
CWE-401
7
R_API RConfigNode* r_config_set(RConfig *cfg, const char *name, const char *value) { RConfigNode *node = NULL; char *ov = NULL; ut64 oi; if (!cfg || STRNULL (name)) { return NULL; } node = r_config_node_get (cfg, name); if (node) { if (node->flags & CN_RO) { eprintf ("(error: '%s' config key is read only)...
CWE-416
5
tabstop_set(char_u *var, int **array) { int valcount = 1; int t; char_u *cp; if (var[0] == NUL || (var[0] == '0' && var[1] == NUL)) { *array = NULL; return OK; } for (cp = var; *cp != NUL; ++cp) { if (cp == var || cp[-1] == ',') { char_u *end; if (strtol((char *...
CWE-122
8
void rose_start_idletimer(struct sock *sk) { struct rose_sock *rose = rose_sk(sk); del_timer(&rose->idletimer); if (rose->idle > 0) { rose->idletimer.function = rose_idletimer_expiry; rose->idletimer.expires = jiffies + rose->idle; add_timer(&rose->idletimer); } }
CWE-416
5
int snd_ctl_replace(struct snd_card *card, struct snd_kcontrol *kcontrol, bool add_on_replace) { struct snd_ctl_elem_id id; unsigned int idx; struct snd_kcontrol *old; int ret; if (!kcontrol) return -EINVAL; if (snd_BUG_ON(!card || !kcontrol->info)) { ret = -EINVAL; goto error; } id = kcontrol->id;...
CWE-416
5
static void smp_task_done(struct sas_task *task) { if (!del_timer(&task->slow_task->timer)) return; complete(&task->slow_task->completion); }
CWE-416
5
PHP_FUNCTION(mb_ereg_search_init) { size_t argc = ZEND_NUM_ARGS(); zval *arg_str; char *arg_pattern = NULL, *arg_options = NULL; int arg_pattern_len = 0, arg_options_len = 0; OnigSyntaxType *syntax = NULL; OnigOptionType option; if (zend_parse_parameters(argc TSRMLS_CC, "z|ss", &arg_str, &arg_pattern, &arg_patt...
CWE-415
4
static void ndpi_reset_packet_line_info(struct ndpi_packet_struct *packet) { packet->parsed_lines = 0, packet->empty_line_position_set = 0, packet->host_line.ptr = NULL, packet->host_line.len = 0, packet->referer_line.ptr = NULL, packet->referer_line.len = 0, packet->content_line.ptr = NULL, packet->content_l...
CWE-416
5
static void timerfd_setup_cancel(struct timerfd_ctx *ctx, int flags) { if ((ctx->clockid == CLOCK_REALTIME || ctx->clockid == CLOCK_REALTIME_ALARM) && (flags & TFD_TIMER_ABSTIME) && (flags & TFD_TIMER_CANCEL_ON_SET)) { if (!ctx->might_cancel) { ctx->might_cancel = true; spin_lock(&cancel_lock); l...
CWE-416
5
xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem, const xmlChar *name, const xmlChar *value) { xmlChar *ret, *dst; const xmlChar *src; xmlAttributePtr attrDecl = NULL; int extsubset = 0; if (doc == NULL) return(NULL); if (elem == NULL) return(NULL);...
CWE-416
5
GF_Err dinf_Read(GF_Box *s, GF_BitStream *bs) { GF_Err e = gf_isom_box_array_read(s, bs, dinf_AddBox); if (e) { return e; } if (!((GF_DataInformationBox *)s)->dref) { GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[iso file] Missing dref box in dinf\n")); ((GF_DataInformationBox *)s)->dref = (GF_DataReferenceBox *)...
CWE-401
7
void jbd2_journal_lock_updates(journal_t *journal) { DEFINE_WAIT(wait); jbd2_might_wait_for_commit(journal); write_lock(&journal->j_state_lock); ++journal->j_barrier_count; /* Wait until there are no reserved handles */ if (atomic_read(&journal->j_reserved_credits)) { write_unlock(&journal->j_state_lock); ...
CWE-416
5
static inline void vmacache_invalidate(struct mm_struct *mm) { mm->vmacache_seqnum++; /* deal with overflows */ if (unlikely(mm->vmacache_seqnum == 0)) vmacache_flush_all(mm); }
CWE-416
5
static struct rpmsg_device *rpmsg_virtio_add_ctrl_dev(struct virtio_device *vdev) { struct virtproc_info *vrp = vdev->priv; struct virtio_rpmsg_channel *vch; struct rpmsg_device *rpdev_ctrl; int err = 0; vch = kzalloc(sizeof(*vch), GFP_KERNEL); if (!vch) return ERR_PTR(-ENOMEM); /* Link the channel to the vr...
CWE-415
4
static int may_create_in_sticky(struct dentry * const dir, struct inode * const inode) { if ((!sysctl_protected_fifos && S_ISFIFO(inode->i_mode)) || (!sysctl_protected_regular && S_ISREG(inode->i_mode)) || likely(!(dir->d_inode->i_mode & S_ISVTX)) || uid_eq(inode->i_uid, dir->d_inode->i_uid) || ...
CWE-416
5
int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2], unsigned char multicast_spec, u8 protocol_version) { struct hsr_priv *hsr; struct hsr_port *port; int res; hsr = netdev_priv(hsr_dev); INIT_LIST_HEAD(&hsr->ports); INIT_LIST_HEAD(&hsr->node_db); INIT_LIST_HEAD(&hsr->self_node_d...
CWE-401
7
static int ipxitf_ioctl(unsigned int cmd, void __user *arg) { int rc = -EINVAL; struct ifreq ifr; int val; switch (cmd) { case SIOCSIFADDR: { struct sockaddr_ipx *sipx; struct ipx_interface_definition f; rc = -EFAULT; if (copy_from_user(&ifr, arg, sizeof(ifr))) break; sipx = (struct sockaddr_ipx *)&...
CWE-416
5
mark_context_stack(mrb_state *mrb, struct mrb_context *c) { size_t i; size_t e; if (c->stack == NULL) return; e = c->stack - c->stbase; if (c->ci) e += c->ci->nregs; if (c->stbase + e > c->stend) e = c->stend - c->stbase; for (i=0; i<e; i++) { mrb_value v = c->stbase[i]; if (!mrb_immediate_p(v))...
CWE-416
5
didset_options2(void) { // Initialize the highlight_attr[] table. (void)highlight_changed(); // Parse default for 'wildmode' check_opt_wim(); // Parse default for 'listchars'. (void)set_chars_option(curwin, &curwin->w_p_lcs); // Parse default for 'fillchars'. (void)set_chars_option(cu...
CWE-122
8
image_load_jpeg(image_t *img, /* I - Image pointer */ FILE *fp, /* I - File to load from */ int gray, /* I - 0 = color, 1 = grayscale */ int load_data)/* I - 1 = load image data, 0 = just info */ { struct jpeg_decompress_struct cinfo; /* Decompressor info */...
CWE-415
4
static unsigned long get_seg_limit(struct pt_regs *regs, int seg_reg_idx) { struct desc_struct *desc; unsigned long limit; short sel; sel = get_segment_selector(regs, seg_reg_idx); if (sel < 0) return 0; if (user_64bit_mode(regs) || v8086_mode(regs)) return -1L; if (!sel) return 0; desc = get_desc(sel...
CWE-416
5
const char * util_acl_to_str(const sc_acl_entry_t *e) { static char line[80], buf[20]; unsigned int acl; if (e == NULL) return "N/A"; line[0] = 0; while (e != NULL) { acl = e->method; switch (acl) { case SC_AC_UNKNOWN: return "N/A"; case SC_AC_NEVER: return "NEVR"; case SC_AC_NONE: return "N...
CWE-415
4
R_API void r_anal_bb_free(RAnalBlock *bb) { if (!bb) { return; } r_anal_cond_free (bb->cond); R_FREE (bb->fingerprint); r_anal_diff_free (bb->diff); bb->diff = NULL; R_FREE (bb->op_bytes); r_anal_switch_op_free (bb->switch_op); bb->switch_op = NULL; bb->fingerprint = NULL; bb->cond = NULL; R_FREE (bb->lab...
CWE-416
5
mrb_proc_copy(mrb_state *mrb, struct RProc *a, struct RProc *b) { if (a->body.irep) { /* already initialized proc */ return; } a->flags = b->flags; a->body = b->body; a->upper = b->upper; if (!MRB_PROC_CFUNC_P(a) && a->body.irep) { mrb_irep_incref(mrb, (mrb_irep*)a->body.irep); } a->e.env = ...
CWE-122
8
char *gf_text_get_utf8_line(char *szLine, u32 lineSize, FILE *txt_in, s32 unicode_type) { u32 i, j, len; char *sOK; char szLineConv[1024]; unsigned short *sptr; memset(szLine, 0, sizeof(char)*lineSize); sOK = gf_fgets(szLine, lineSize, txt_in); if (!sOK) return NULL; if (unicode_type<=1) { j=0; len = (u32)...
CWE-415
4
void gdImageGifCtx(gdImagePtr im, gdIOCtxPtr out) { gdImagePtr pim = 0, tim = im; int interlace, BitsPerPixel; interlace = im->interlace; if (im->trueColor) { /* Expensive, but the only way that produces an acceptable result: mix down to a palette based temporary image. */ pim = gdImageCreatePaletteFromTr...
CWE-415
4
xmlValidNormalizeAttributeValue(xmlDocPtr doc, xmlNodePtr elem, const xmlChar *name, const xmlChar *value) { xmlChar *ret, *dst; const xmlChar *src; xmlAttributePtr attrDecl = NULL; if (doc == NULL) return(NULL); if (elem == NULL) return(NULL); if (name == NULL) return(NULL); if ...
CWE-416
5
ASC_destroyAssociation(T_ASC_Association ** association) { OFCondition cond = EC_Normal; /* don't worry if already destroyed */ if (association == NULL) return EC_Normal; if (*association == NULL) return EC_Normal; if ((*association)->DULassociation != NULL) { ASC_dropAssociation(*associat...
CWE-415
4
destroyUserInformationLists(DUL_USERINFO * userInfo) { PRV_SCUSCPROLE * role; role = (PRV_SCUSCPROLE*)LST_Dequeue(&userInfo->SCUSCPRoleList); while (role != NULL) { free(role); role = (PRV_SCUSCPROLE*)LST_Dequeue(&userInfo->SCUSCPRoleList); } LST_Destroy(&userInfo->SCUSCPRoleLis...
CWE-415
4
static void _php_mb_regex_set_options(OnigOptionType options, OnigSyntaxType *syntax, OnigOptionType *prev_options, OnigSyntaxType **prev_syntax TSRMLS_DC) { if (prev_options != NULL) { *prev_options = MBREX(regex_default_options); } if (prev_syntax != NULL) { *prev_syntax = MBREX(regex_default_syntax); } MBR...
CWE-415
4
void __init(RBuffer *buf, r_bin_ne_obj_t *bin) { bin->header_offset = r_buf_read_le16_at (buf, 0x3c); bin->ne_header = R_NEW0 (NE_image_header); if (!bin->ne_header) { return; } bin->buf = buf; r_buf_read_at (buf, bin->header_offset, (ut8 *)bin->ne_header, sizeof (NE_image_header)); bin->alignment = 1 << bin->...
CWE-129
6
find_start_brace(void) // XXX { pos_T cursor_save; pos_T *trypos; pos_T *pos; static pos_T pos_copy; cursor_save = curwin->w_cursor; while ((trypos = findmatchlimit(NULL, '{', FM_BLOCKSTOP, 0)) != NULL) { pos_copy = *trypos; // copy pos_T, next findmatch will change it trypos = &pos_c...
CWE-122
8
int read_file(struct sc_card *card, char *str_path, unsigned char **data, size_t *data_len) { struct sc_path path; struct sc_file *file; unsigned char *p; int ok = 0; int r; size_t len; sc_format_path(str_path, &path); if (SC_SUCCESS != sc_select_file(card, &path, &file)) { goto err; } len = file ? file->...
CWE-415
4
ga_init2(garray_T *gap, int itemsize, int growsize) { ga_init(gap); gap->ga_itemsize = itemsize; gap->ga_growsize = growsize; }
CWE-416
5
init_evalarg(evalarg_T *evalarg) { CLEAR_POINTER(evalarg); ga_init2(&evalarg->eval_tofree_ga, sizeof(char_u *), 20); }
CWE-416
5
R_API int r_core_bin_set_env(RCore *r, RBinFile *binfile) { RBinObject *binobj = binfile ? binfile->o: NULL; RBinInfo *info = binobj ? binobj->info: NULL; if (info) { int va = info->has_va; const char * arch = info->arch; ut16 bits = info->bits; ut64 baseaddr = r_bin_get_baddr (r->bin); /* Hack to make bad...
CWE-416
5
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
40