code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
jbig2_sd_list_referred(Jbig2Ctx *ctx, Jbig2Segment *segment)
{
int index;
Jbig2Segment *rsegment;
Jbig2SymbolDict **dicts;
int n_dicts = jbig2_sd_count_referred(ctx, segment);
int dindex = 0;
dicts = jbig2_new(ctx, Jbig2SymbolDict *, n_dicts);
if (dicts == NULL) {
jbig2_error(... | cwe | CWE-119 | C/C++ |
XIQueryDevice(Display *dpy, int deviceid, int *ndevices_return)
{
XIDeviceInfo *info = NULL;
xXIQueryDeviceReq *req;
xXIQueryDeviceReq *req;
xXIQueryDeviceReply reply;
char *ptr;
int i;
char *buf;
LockDisplay(dpy);
if (_... | cwe | CWE-284 | C/C++ |
def verify_signature(jwt)
head = token_head(jwt)
# Make sure the algorithm is supported and get the decode key.
if head[:alg] == 'RS256'
[rs256_decode_key(head[:kid]), head[:alg]]
elsif head[:alg] == 'HS256'
[@client_secret, head[:alg]]
else
raise O... | cwe | CWE-287 | Ruby |
int GetS16BE (int nPos, bool *pbSuccess)
{
//*pbSuccess = true;
if ( nPos < 0 || nPos + 1 >= m_nLen )
{
*pbSuccess = false;
return 0;
}
int nRes = m_sFile[nPos];
nRes = (nRes << 8) + m_sFile[ nPos +... | cwe | CWE-787 | C/C++ |
static struct ucma_multicast* ucma_alloc_multicast(struct ucma_context *ctx)
{
struct ucma_multicast *mc;
mc = kzalloc(sizeof(*mc), GFP_KERNEL);
if (!mc)
return NULL;
mutex_lock(&mut);
mc->id = idr_alloc(&multicast_idr, mc, 0, 0, GFP_KERNEL);
mutex_unlock(&mut);
if (mc->id < 0)
goto error;
mc->ctx = ctx;... | cwe | CWE-416 | C/C++ |
static unsigned uv__utf8_decode1_slow(const char** p,
const char* pe,
unsigned a) {
unsigned b;
unsigned c;
unsigned d;
unsigned min;
if (a > 0xF7)
return -1;
switch (*p - pe) {
default:
if (a > 0xEF) {
min = 0x100... | cwe | CWE-125 | Unknown |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
if (output->type == kTfLiteFloat32) {
EvalAddN<float>(context, node);
} else if (output->type == kTfLiteInt32) {
EvalAddN<int32_t>(context, node);
} else {
context->Rep... | cwe | CWE-125 | C/C++ |
protected function driverRead(CacheItemInterface $item)
{
$this->driverConnect();
// return null if no caching
// return value if in caching
$keyword = self::PREFIX . $item->getKey();
$x = isset($_COOKIE[ $keyword ]) ? $this->decode(json_decode($_COOKIE[ $keyword ], true)) : ... | cwe | CWE-94 | PHP |
grub_username_get (char buf[], unsigned buf_size)
{
unsigned cur_len = 0;
int key;
while (1)
{
key = grub_getkey ();
if (key == '\n' || key == '\r')
break;
if (key == '\e')
{
cur_len = 0;
break;
}
if (key == '\b')
{
cur_len--;
grub_printf ("\b");
continue;
}
... | cwe | CWE-264 | C/C++ |
function getGoogleSpeechCmdWithArgs(fields) {
var text = fields.textToSpeech,
language = fields.language,
speed = fields.speed,
cmd = 'google_speech' + ' -l ' + language + ' \"' + text + '\"' + ' -e overdrive 10 speed ' + speed;
return cmd;
} | cwe | CWE-78 | JavaScript |
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ... | cwe | CWE-190 | C/C++ |
proto_read_byte_buffer (p11_rpc_message *msg,
CK_BYTE_PTR *buffer,
CK_ULONG *n_buffer)
{
uint32_t length;
assert (msg != NULL);
assert (buffer != NULL);
assert (n_buffer != NULL);
assert (msg->input != NULL);
/* Check that we're supposed to be reading this at this... | cwe | CWE-190 | Unknown |
/* mqtt_client.c
*
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfMQTT.
*
* wolfMQTT is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your... | cwe | CWE-787 | C/C++ |
static void ip_cmsg_recv_checksum(struct msghdr *msg, struct sk_buff *skb,
int tlen, int offset)
{
__wsum csum = skb->csum;
if (skb->ip_summed != CHECKSUM_COMPLETE)
return;
if (offset != 0)
csum = csum_sub(csum,
csum_partial(skb_transport_header(skb) + tlen,
offset, 0));
put_cmsg(msg... | cwe | CWE-125 | C/C++ |
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 | CWE-284 | C/C++ |
QPDFWriter::copyEncryptionParameters(QPDF& qpdf)
{
this->m->preserve_encryption = false;
QPDFObjectHandle trailer = qpdf.getTrailer();
if (trailer.hasKey("/Encrypt"))
{
generateID();
this->m->id1 =
trailer.getKey("/ID").getArrayItem(0).getStringValue();
QPDFObjectHandle encr... | cwe | CWE-787 | Unknown |
GF_Err latm_dmx_process(GF_Filter *filter)
{
GF_LATMDmxCtx *ctx = gf_filter_get_udta(filter);
GF_FilterPacket *pck, *dst_pck;
u32 pos;
u8 *data, *output;
u32 pck_size, prev_pck_size;
u64 cts = GF_FILTER_NO_TS;
if (ctx->in_error)
return ctx->in_error;
//always reparse duration
if (!ctx->duration.num)
latm... | cwe | CWE-476 | C/C++ |
int nfc_data_exchange(struct nfc_dev *dev, u32 target_idx, struct sk_buff *skb,
data_exchange_cb_t cb, void *cb_context)
{
int rc;
pr_debug("dev_name=%s target_idx=%u skb->len=%u\n",
dev_name(&dev->dev), target_idx, skb->len);
device_lock(&dev->dev);
if (!device_is_registered(&dev->dev)) {
rc = -ENO... | cwe | CWE-416 | Unknown |
TIFFReadRawStrip1(TIFF* tif, uint32 strip, void* buf, tmsize_t size,
const char* module)
{
TIFFDirectory *td = &tif->tif_dir;
if (!_TIFFFillStriles( tif ))
return ((tmsize_t)(-1));
assert((tif->tif_flags&TIFF_NOREADRAW)==0);
if (!isMapped(tif)) {
tmsize_t cc;
if (!SeekOK(tif, td->td_st... | cwe | CWE-190 | Unknown |
bool handleBackslash(signed char& out) {
char ch = *p++;
switch (ch) {
case 0: return false;
case '"': out = ch; return true;
case '\\': out = ch; return true;
case '/': out = ch; return true;
case 'b': out = '\b'; return true;
case 'f': out = '\f'; return true;
case 'n... | cwe | CWE-125 | C/C++ |
static int get_exif_tag_dbl_value(struct iw_exif_state *e, unsigned int tag_pos,
double *pv)
{
unsigned int field_type;
unsigned int value_count;
unsigned int value_pos;
unsigned int numer, denom;
field_type = iw_get_ui16_e(&e->d[tag_pos+2],e->endian);
value_count = iw_get_ui32_e(&e->d[tag_pos+4],e->endian);... | cwe | CWE-125 | C/C++ |
static inline struct f2fs_sb_info *F2FS_P_SB(struct page *page)
{
return F2FS_M_SB(page->mapping);
} | cwe | CWE-476 | C/C++ |
static int su3000_power_ctrl(struct dvb_usb_device *d, int i)
{
struct dw2102_state *state = (struct dw2102_state *)d->priv;
u8 obuf[] = {0xde, 0};
info("%s: %d, initialized %d", __func__, i, state->initialized);
if (i && !state->initialized) {
state->initialized = 1;
/* reset board */
return dvb_usb_generi... | cwe | CWE-119 | Unknown |
/**
* Testing dockable windows.
*/
EditorUi.windowed = urlParams['windows'] != '0';
/**
* Code for the minimal UI theme.
*/
EditorUi.initMinimalTheme = function()
{
// Disabled in lightbox and chromeless mode
if (urlParams['lightbox'] == '1' || urlParams['chrome'] == '0' || typeof window.Format === 'undefined' |... | cwe | CWE-79 | Java |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
// This function only checks the types. Additional shape validations are
// performed in the reference implementation called during Eval().
const TfLiteConcatenationParams* params =
reinterpret_cast<TfLiteConcatenationParams*>(node->builtin_da... | cwe | CWE-787 | C/C++ |
static NTLM_AV_PAIR* ntlm_av_pair_next(NTLM_AV_PAIR* pAvPair, size_t* pcbAvPair)
{
size_t offset;
if (!pcbAvPair)
return NULL;
if (!ntlm_av_pair_check(pAvPair, *pcbAvPair))
return NULL;
offset = ntlm_av_pair_get_next_offset(pAvPair);
*pcbAvPair -= offset;
return (NTLM_AV_PAIR*)((PBYTE)pAvPair + offset);
} | cwe | CWE-125 | C/C++ |
/*
* Copyright 2014 Ted Dunning
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | cwe | CWE-377 | Java |
/*
* This file is part of ubridge, a program to bridge network interfaces
* to UDP tunnels.
*
* Copyright (C) 2015 GNS3 Technologies Inc.
*
* ubridge is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Fou... | cwe | CWE-200 | C/C++ |
function yourls_html_menu() {
// Build menu links
if( defined( 'YOURLS_USER' ) ) {
$logout_link = yourls_apply_filter( 'logout_link', sprintf( yourls__('Hello <strong>%s</strong>'), YOURLS_USER ) . ' (<a href="' . yourls_admin_url( 'index.php' ) . '?action=logout" title="' . yourls_esc_attr__( 'Logout' ) . '">' . ... | cwe | CWE-352 | PHP |
module.exports = fileCompletion
var correctMkdir = require('../correct-mkdir.js')
var glob = require('glob')
function fileCompletion (root, req, depth, cb) {
if (typeof cb !== 'function') {
cb = depth
depth = Infinity
}
correctMkdir(root, function (er) {
if (er) return cb(er)
// can be either e... | cwe | CWE-284 | JavaScript |
function A(ha,qa,aa,ca,na){na||(da.innerHTML="",K(),T=ha,X=ca);var la=null;if(aa){la=document.createElement("table");
la.className="geTempDlgDiagramsListGrid";var oa=document.createElement("tr"),ra=document.createElement("th");ra.style.width="50%";ra.innerHTML=mxUtils.htmlEntities(mxResources.get("diagram"));oa.appendC... | cwe | CWE-94 | JavaScript |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
#include <assert.h>
#include <string.h>
#include <openssl/ssl.h>
#include <openssl/crypto.h>
#include <openssl/stack.h>
#include <openssl/x509.h>
#include <openssl/rand.h>
#include <openssl/curve25519.h>
#include <openssl/hkdf.h>
#include <opens... | cwe | CWE-476 | C/C++ |
keyid_from_pk (PKT_public_key *pk, u32 *keyid)
{
u32 lowbits;
u32 dummy_keyid[2];
if (!keyid)
keyid = dummy_keyid;
if( pk->keyid[0] || pk->keyid[1] )
{
keyid[0] = pk->keyid[0];
keyid[1] = pk->keyid[1];
lowbits = keyid[1];
}
else
{
const byte *dp;
gcry_md_hd_t md... | cwe | CWE-20 | Unknown |
int passwd_to_utf16(unsigned char *in_passwd,
int length,
int max_length,
unsigned char *out_passwd)
{
#ifdef WIN32
int ret;
(void)length;
ret = MultiByteToWideChar(
CP_ACP,
0,
(LPCSTR)in_passwd,
-1,
(LPWSTR)... | cwe | CWE-120 | C/C++ |
init_ccline(int firstc, int indent)
{
ccline.overstrike = FALSE; // always start in insert mode
/*
* set some variables for redrawcmd()
*/
ccline.cmdfirstc = (firstc == '@' ? 0 : firstc);
ccline.cmdindent = (firstc > 0 ? indent : 0);
// alloc initial ccline.cmdbuff
alloc_cmdbuff... | cwe | CWE-122 | C/C++ |
public function action_edge_mode_enable() {
w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/activation.php');
$config_path = w3_get_wp_config_path();
$config_data = @file_get_contents($config_path);
if ($config_data === false)
return;
$new_config_data = $this->wp_config_... | cwe | CWE-352 | PHP |
static int futex_requeue(u32 __user *uaddr1, unsigned int flags,
u32 __user *uaddr2, int nr_wake, int nr_requeue,
u32 *cmpval, int requeue_pi)
{
union futex_key key1 = FUTEX_KEY_INIT, key2 = FUTEX_KEY_INIT;
int drop_count = 0, task_count = 0, ret;
struct futex_pi_state *pi_state = NULL;
struct futex_hash_bu... | cwe | CWE-190 | C/C++ |
'use strict'
var fs = require('graceful-fs')
var path = require('path')
var chain = require('slide').chain
var iferr = require('iferr')
var rimraf = require('rimraf')
var correctMkdir = require('../../utils/correct-mkdir')
var rmStuff = require('../../unbuild.js').rmStuff
var lifecycle = require('../../utils/lifecycle.... | cwe | CWE-284 | JavaScript |
def handleConfigPacket(m: MsgOutputCfgPayload): Unit = m match {
case MsgOutputCfgRSMode(r) => rsMode = r
case _ => sys.error("Invalid output config packet %s to config %s".format(m, this))
}
} | cwe | CWE-502 | Scala |
function _t(e){if(!ht(e)||(a=e,$i&&$i in a))return!1;var a,i=function(e){var a=ht(e)?Vi.call(e):"";return a==xi||a==qi}(e)||function(e){var a=!1;if(null!=e&&"function"!=typeof e.toString)try{a=!!(e+"")}catch(e){}return a}(e)?Ji:Ti;return i.test(function(e){if(null!=e){try{return Ui.call(e)}catch(e){}try{return e+""}cat... | cwe | CWE-79 | JavaScript |
null!=u.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=u.showRemoteCursors)}};Editor.configureFontCss=function(u){if(null!=u){Editor.prototype.fontCss=u;var E=document.getElementsByTagName("script")[0];if(null!=E&&null!=E.parentNode){var J=document.createElement("style");J.setAttribute("type","text/css");J.ap... | cwe | CWE-20 | JavaScript |
func (s *ConsoleServer) Authenticate(ctx context.Context, in *console.AuthenticateRequest) (*console.ConsoleSession, error) {
role := console.UserRole_USER_ROLE_UNKNOWN
var uname string
var email string
switch in.Username {
case s.config.GetConsole().Username:
if in.Password == s.config.GetConsole().Password {
... | cwe | CWE-613 | Go |
void FastCGITransport::onHeader(std::unique_ptr<folly::IOBuf> key_chain,
std::unique_ptr<folly::IOBuf> value_chain) {
Cursor keyCur(key_chain.get());
auto key = keyCur.readFixedString(key_chain->computeChainDataLength());
Cursor valCur(value_chain.get());
auto value = valCur.rea... | cwe | CWE-665 | C/C++ |
static void url_stream_auth (auth_client *auth_user)
{
ice_config_t *config;
int port;
client_t *client = auth_user->client;
auth_url *url = client->auth->state;
char *mount, *host, *user, *pass, *ipaddr, *admin="";
char post [4096];
if (strchr (url->stream_auth, '@') == NULL)
{
... | cwe | CWE-119 | Unknown |
xmlBufGrowInternal(xmlBufPtr buf, size_t len) {
size_t size;
xmlChar *newbuf;
if ((buf == NULL) || (buf->error != 0)) return(0);
CHECK_COMPAT(buf)
if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return(0);
if (buf->use + len < buf->size)
return(buf->size - buf->use);
/*
* Windo... | cwe | CWE-190 | Unknown |
long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
unsigned long flags;
void __user *uarg = (void __user *)arg;
switch (cmd) {
case DIGI_GETDD:
{
/*
* This returns the total number of boards
* in the system, as well as driver version
* and has space for a reserved entry
*... | cwe | CWE-200 | C/C++ |
/*
* linux/fs/ext4/super.c
*
* Copyright (C) 1992, 1993, 1994, 1995
* Remy Card (card@masi.ibp.fr)
* Laboratoire MASI - Institut Blaise Pascal
* Universite Pierre et Marie Curie (Paris VI)
*
* from
*
* linux/fs/minix/inode.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*
* Big-endian to little-endian... | cwe | CWE-19 | C/C++ |
inline const TfLiteTensor* GetIntermediates(TfLiteContext* context,
const TfLiteNode* node, int index) {
return &context->tensors[node->intermediates->data[index]];
} | cwe | CWE-787 | Unknown |
xz_decomp(xz_statep state)
{
int ret;
unsigned had;
unsigned long crc, len;
lzma_stream *strm = &(state->strm);
lzma_action action = LZMA_RUN;
/* fill output buffer up to end of deflate stream */
had = strm->avail_out;
do {
/* get more input for inflate() */
if (strm->a... | cwe | CWE-835 | C/C++ |
import intersect from './intersect';
import { Bounds } from 'vega-scenegraph';
/**
* Appends a new point to the lasso
*
* @param {*} lasso the lasso in pixel space
* @param {*} x the x coordinate in pixel space
* @param {*} y the y coordinate in pixel space
* @param {*} minDist the minimum distance, in pixels, ... | cwe | CWE-79 | JavaScript |
'use strict';
var ar = require('appium-running');
var cp = require('child_process');
var debug = require('debug');
var log = debug('nemo-appium:log');
var error = debug('nemo-appium:error');
module.exports.setup = function (apath, nemo, cb) {
var once = function () {
cb.apply(null, arguments);
on... | cwe | CWE-77 | JavaScript |
function test_new_comment_duplicated() {
$comment_args = array(
1,
'administrator',
'administrator',
self::$post->ID,
array(
'content' => rand_str( 100 ),
),
);
// First time it's a valid comment.
$result = $this->myxmlrpcserver->wp_newComment( $comment_args );
$this->assertNotIXRError(... | cwe | CWE-862 | PHP |
#
# Copyright (c) 2010 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of... | cwe | CWE-264 | Python |
static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
const ImageInfo *IMimage_info,Image *IMimage,ExceptionInfo *exception)
{
char
im_vers[32],
libpng_runv[32],
libpng_vers[32],
zlib_runv[32],
zlib_vers[32];
Image
*image;
ImageInfo
*image_info;
char
s[2];
const ch... | cwe | CWE-476 | C/C++ |
# -*- coding: utf-8 -*-
# Copyright 2019 New Vector Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | cwe | CWE-400 | Python |
bool VaapiVideoDecodeAccelerator::VaapiH264Accelerator::SubmitDecode(
const scoped_refptr<H264Picture>& pic) {
VLOGF(4) << "Decoding POC " << pic->pic_order_cnt;
scoped_refptr<VaapiDecodeSurface> dec_surface =
H264PictureToVaapiDecodeSurface(pic);
return vaapi_dec_->DecodeSurface(dec_surface);
} | cwe | CWE-362 | C/C++ |
function processRows(rows) {
$j.each(rows, function(ndx, row) {
try {
row.Message = decodeURIComponent(row.Message);
} catch(e) {
// ignore errors
}
});
return rows;
} | cwe | CWE-79 | JavaScript |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* lookup = GetInput(context, node, 0);
const TfLiteTensor* value = GetInput(context, node, 1);
TfLiteTensor* output = GetOutput(context, node, 0);
switch (value->type) {
case kTfLiteFloat32:
return EvalSimple(context, node... | cwe | CWE-125 | C/C++ |
void pb_controller::play_file(const std::string& file) {
std::string cmdline;
std::string player = cfg->get_configvalue("player");
if (player == "")
return;
cmdline.append(player);
cmdline.append(" \"");
cmdline.append(utils::replace_all(file,"\"", "\\\""));
cmdline.append("\"");
stfl::reset();
LOG(LOG_DEBUG... | cwe | CWE-78 | C/C++ |
static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags,
const char *dev_name, void *raw_data)
{
struct super_block *s;
struct ecryptfs_sb_info *sbi;
struct ecryptfs_dentry_info *root_info;
const char *err = "Getting sb failed";
struct inode *inode;
struct path path;
int rc;
s... | cwe | CWE-264 | C/C++ |
private function LoadData()
{
$this->dataLoaded = true;
$args = array();
$args[] = '-s';
$args[] = '-l';
$args[] = $this->commitHash;
$args[] = '--';
$args[] = $this->path;
$blamelines = explode("\n", $this->exe->Execute($this->project->GetPath(), GIT_BLAME, $args));
$lastcommit = '';
foreach ($... | cwe | CWE-78 | PHP |
(ma=ka[ja],null==ma&&(ma={},ka[ja]=ma),ja=ma[ba],null==ja&&(ja=[],ma[ba]=ja),ja.push(ia))}fa=fa.nextSibling}G(ta,pa,va)}})}function J(fa){D&&(Aa.scrollTop=0,aa.innerHTML="",Ea.spin(aa),V=!1,W=!0,ua.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag")),da=null,D(ra,function(){A(mxResources.get("cannotLoad"));ra(... | cwe | CWE-20 | JavaScript |
static ssize_t f_hidg_write(struct file *file, const char __user *buffer,
size_t count, loff_t *offp)
{
struct f_hidg *hidg = file->private_data;
struct usb_request *req;
unsigned long flags;
ssize_t status = -ENOMEM;
if (!access_ok(buffer, count))
return -EFAULT;
spin_lock_irqsave(&hidg->write_spinlo... | cwe | CWE-667 | C/C++ |
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version... | cwe | CWE-122 | C/C++ |
PHP_METHOD(Phar, delete)
{
char *fname;
size_t fname_len;
char *error;
phar_entry_info *entry;
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot write out phar archive, phar is read-only");
return... | cwe | CWE-20 | C/C++ |
nonComputedMember: function(left, right) {
var SAFE_IDENTIFIER = /^[$_a-zA-Z][$_a-zA-Z0-9]*$/;
var UNSAFE_CHARACTERS = /[^$_a-zA-Z0-9]/g;
if (SAFE_IDENTIFIER.test(right)) {
return left + '.' + right;
} else {
return left + '["' + right.replace(UNSAFE_CHARACTERS, this.stringEscapeFn) + '"]';... | cwe | CWE-74 | JavaScript |
bson_iter_codewscope (const bson_iter_t *iter, /* IN */
uint32_t *length, /* OUT */
uint32_t *scope_len, /* OUT */
const uint8_t **scope) /* OUT */
{
uint32_t len;
BSON_ASSERT (iter);
if (ITER_TYPE (iter) == BSON_TYPE_CODEWSCOPE) ... | cwe | CWE-125 | C/C++ |
// Copyright (C) 2015 University of Dundee & Open Microscopy Environment.
// All rights reserved.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
//... | cwe | CWE-200 | Python |
static inline ut8 r_read_ble8(const void *src) {
return *(ut8 *)src;
} | cwe | CWE-476 | Unknown |
T[N],"cells"),this.updateCustomLinkAction(u,T[N],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(u,E,J){if(null!=E&&null!=E[J]){for(var T=[],N=0;N<E[J].length;N++)if("*"==E[J][N])T.push(E[J][N]);else{var Q=u[E[J][N]];null!=Q?""!=Q&&T.push(Q):T.push(E[J][N])}E[J]=T}};Graph.prototype.getCellsForAction=f... | cwe | CWE-20 | JavaScript |
/*
* Copyright 2017-2019 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | cwe | CWE-400 | Java |
/************************************************************************
* edit.c
* nodau console note taker
* Copyright (C) Lisa Milne 2010-2013 <lisa@ltmnet.com>
*
* edit.c is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Softwa... | cwe | CWE-89 | C/C++ |
RestQuery.prototype.runFind = function (options = {}) {
if (this.findOptions.limit === 0) {
this.response = { results: [] };
return Promise.resolve();
}
const findOptions = Object.assign({}, this.findOptions);
if (this.keys) {
findOptions.keys = this.keys.map(key => {
return key.split('.')[0];... | cwe | CWE-74 | JavaScript |
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 | CWE-284 | Unknown |
function simpleContent(a,d,e){var b=document.getElementsByTagName("body")[0],e=e||findNWC(b,compId),h,c,k,g;if(e){if(e.style.position!="absolute"&&e.style.position!="relative")e.style.position="relative"}else e=b;for(var m=0;m<a.length;m++){b=a[m];b.type=="image"?(h=document.createElement("img"),h.src=b.fill[1]):h=docu... | cwe | CWE-79 | JavaScript |
static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
Image
*image;
MagickBooleanType
status;
MagickSizeType
number_pixels;
MemoryInfo
*pixel_info;
register Quantum
*q;
register ssize_t
i,
x;
register unsigned char
*p;
SGIInfo
iris_... | cwe | CWE-119 | C/C++ |
_proto.inlineTokens = function inlineTokens(src, tokens, inLink, inRawBlock) {
if (tokens === void 0) {
tokens = [];
}
if (inLink === void 0) {
inLink = false;
}
if (inRawBlock === void 0) {
inRawBlock = false;
}
var token, lastToken; // String with l... | cwe | CWE-400 | JavaScript |
package golf
import (
"encoding/hex"
"math/rand"
"time"
)
const chars = "abcdefghijklmnopqrstuvwxyz0123456789"
func randomBytes(strlen int) []byte {
rand.Seed(time.Now().UTC().UnixNano())
result := make([]byte, strlen)
for i := 0; i < strlen; i++ {
result[i] = chars[rand.Intn(len(chars))]
}
return result
}... | cwe | CWE-352 | Go |
int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
struct file *file, unsigned open_flags,
umode_t mode)
{
DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
struct nfs_open_context *ctx;
struct dentry *res;
struct iattr attr = { .ia_valid = ATTR_OPEN };
struct inode *inode;
unsigned int lookup_flags = 0... | cwe | CWE-909 | C/C++ |
for(var I=0;I<X.length;I++)if("label"!=X[I].nodeName){var T=mxUtils.trim(X[I].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==V&&(C&&0<=T.indexOf(p)||!C&&T.substring(0,p.length)===p)||null!=V&&V.test(T))return!0}}return!1}function c(){v&&K.value?(S.removeAttribute("disabled"),U.removeAttribut... | cwe | CWE-20 | JavaScript |
function j(t){h("emit readable"),t.emit("readable"),A(t)} | cwe | CWE-601 | JavaScript |
evbuffer_add(struct evbuffer *buf, const void *data_in, size_t datlen)
{
struct evbuffer_chain *chain, *tmp;
const unsigned char *data = data_in;
size_t remain, to_alloc;
int result = -1;
EVBUFFER_LOCK(buf);
if (buf->freeze_end) {
goto done;
}
chain = buf->last;
/* If there are no chains allocated for th... | cwe | CWE-189 | C/C++ |
static long ec_device_ioctl_xcmd(struct cros_ec_dev *ec, void __user *arg)
{
long ret;
struct cros_ec_command u_cmd;
struct cros_ec_command *s_cmd;
if (copy_from_user(&u_cmd, arg, sizeof(u_cmd)))
return -EFAULT;
if ((u_cmd.outsize > EC_MAX_MSG_BYTES) ||
(u_cmd.insize > EC_MAX_MSG_BYTES))
return -EINVAL;... | cwe | CWE-362 | C/C++ |
Status AuthorizationManagerImpl::_initializeUserFromPrivilegeDocument(User* user,
const BSONObj& privDoc) {
V2UserDocumentParser parser;
std::string userName = parser.extractUserNameFromUserDocument(privDoc);
if (userName != user->getName... | cwe | CWE-613 | Unknown |
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator p... | cwe | CWE-200 | Java |
open_ssl_connection (rfbClient *client, int sockfd, rfbBool anonTLS, rfbCredential *cred)
{
SSL_CTX *ssl_ctx = NULL;
SSL *ssl = NULL;
int n, finished = 0;
X509_VERIFY_PARAM *param;
uint8_t verify_crls = cred->x509Credential.x509CrlVerifyMode;
if (!(ssl_ctx = SSL_CTX_new(SSLv23_client_method())))
{
rf... | cwe | CWE-476 | C/C++ |
xmlRelaxNGGetErrorString(xmlRelaxNGValidErr err, const xmlChar * arg1,
const xmlChar * arg2)
{
char msg[1000];
if (arg1 == NULL)
arg1 = BAD_CAST "";
if (arg2 == NULL)
arg2 = BAD_CAST "";
msg[0] = 0;
switch (err) {
case XML_RELAXNG_OK:
re... | cwe | CWE-134 | Unknown |
static int renameColumnSelectCb(Walker *pWalker, Select *p){
renameWalkWith(pWalker, p);
return WRC_Continue;
} | cwe | CWE-674 | Unknown |
// SPDX-License-Identifier: GPL-2.0
/*
* trace_events_filter - generic event filtering
*
* Copyright (C) 2009 Tom Zanussi <tzanussi@gmail.com>
*/
#include <linux/module.h>
#include <linux/ctype.h>
#include <linux/mutex.h>
#include <linux/perf_event.h>
#include <linux/slab.h>
#include "trace.h"
#include "trace_out... | cwe | CWE-401 | C/C++ |
bool SiteInstanceImpl::ShouldLockToOrigin(BrowserContext* browser_context,
GURL site_url) {
if (RenderProcessHost::run_renderer_in_process())
return false;
if (!DoesSiteRequireDedicatedProcess(browser_context, site_url))
return false;
if (site_url.SchemeIs(cont... | cwe | CWE-119 | C/C++ |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | cwe | CWE-502 | Java |
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | cwe | CWE-287 | Java |
napi_status napi_get_value_string_utf8(napi_env env,
napi_value value,
char* buf,
size_t bufsize,
size_t* result) {
CHECK_ENV(env);
CHECK_ARG(env, value);
v8... | cwe | CWE-191 | Unknown |
static int unix_getpw(UNUSED void *instance, REQUEST *request,
VALUE_PAIR **vp_list)
{
const char *name;
const char *encrypted_pass;
#ifdef HAVE_GETSPNAM
struct spwd *spwd = NULL;
#endif
#ifdef OSFC2
struct pr_passwd *pr_pw;
#else
struct passwd *pwd;
#endif
#ifdef HAVE_GETUSERSHELL
char *shell;
#endif
V... | cwe | CWE-255 | C/C++ |
PJ_DEF(pj_status_t) pjmedia_vid_conf_add_port( pjmedia_vid_conf *vid_conf,
pj_pool_t *parent_pool,
pjmedia_port *port,
const pj_str_t *name,
void *opt,
unsigned *p_slot)
{
pj_pool_t *pool;
vconf_port *cport;
unsigned index;
PJ_ASSERT_RETURN(vi... | cwe | CWE-667 | C/C++ |
/*****************************************************************************/
/* LibreDWG - free implementation of the DWG file format */
/* */
/* Copyright (C) 2009-2010,2018-2021 Free Software Foundation, Inc. */
... | cwe | CWE-415 | C/C++ |
static bool regsafe(struct bpf_reg_state *rold, struct bpf_reg_state *rcur,
struct idpair *idmap)
{
if (!(rold->live & REG_LIVE_READ))
/* explored state didn't use this */
return true;
if (memcmp(rold, rcur, offsetof(struct bpf_reg_state, live)) == 0)
return true;
if (rold->type == NOT_INIT)
/* explo... | cwe | CWE-119 | C/C++ |
/* Copyright 2011-2014 Autronica Fire and Security AS
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* Autho... | cwe | CWE-772 | C/C++ |
protected function getFile()
{
$task_id = $this->request->getIntegerParam('task_id');
$file_id = $this->request->getIntegerParam('file_id');
$model = 'projectFileModel';
if ($task_id > 0) {
$model = 'taskFileModel';
$project_id = $this->taskFinderModel->getPr... | cwe | CWE-200 | PHP |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | cwe | CWE-269 | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.