code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
public function rename() {
if (!AuthUser::hasPermission('file_manager_rename')) {
Flash::set('error', __('You do not have sufficient permissions to rename this file or directory.'));
redirect(get_url('plugin/file_manager/browse/'));
}
// CSRF checks
if (i... | cwe | CWE-20 | PHP |
function process_tasks($task)
{
global $send;
/**
* First see if the doc_ID exists
* if not we need to create this
*/
$task = make_document($task);
update_taskman($task, 'created', '1');
if ($task['DOC_TYPE'] == 'Fax') {
deliver_document($task);
}
update_taskman($ta... | cwe | CWE-89 | PHP |
static int semctl_setval(struct ipc_namespace *ns, int semid, int semnum,
unsigned long arg)
{
struct sem_undo *un;
struct sem_array *sma;
struct sem* curr;
int err;
int nsems;
struct list_head tasks;
int val;
#if defined(CONFIG_64BIT) && defined(__BIG_ENDIAN)
/* big-endian 64bit */
val = arg >> 32;
#else
/... | cwe | CWE-189 | Unknown |
__switch_to(struct task_struct *prev_p, struct task_struct *next_p)
{
struct thread_struct *prev = &prev_p->thread;
struct thread_struct *next = &next_p->thread;
int cpu = smp_processor_id();
struct tss_struct *tss = &per_cpu(init_tss, cpu);
unsigned fsindex, gsindex;
fpu_switch_t fpu;
fpu = switch_fpu_prepar... | cwe | CWE-200 | C/C++ |
from typing import Any, List
import vyper.utils as util
from vyper.address_space import CALLDATA, DATA, MEMORY
from vyper.ast.signatures.function_signature import FunctionSignature, VariableRecord
from vyper.codegen.context import Context
from vyper.codegen.core import get_element_ptr, getpos, make_setter
from vyper.c... | cwe | CWE-120 | Python |
private static function verifySignature($signature, $input, $key, $algo = 'HS256')
{
switch ($algo) {
case'HS256':
case'HS384':
case'HS512':
return JWT::sign($input, $key, $algo) === $signature;
case 'RS256':
return (boolean) o... | cwe | CWE-20 | PHP |
gplotMakeOutput(GPLOT *gplot)
{
char buf[L_BUF_SIZE];
char *cmdname;
l_int32 ignore;
PROCNAME("gplotMakeOutput");
if (!gplot)
return ERROR_INT("gplot not defined", procName, 1);
gplotGenCommandFile(gplot);
gplotGenDataFiles(gplot);
cmdname = genPathname(gplot->cmdname, NULL);
#i... | cwe | CWE-787 | C/C++ |
1?0:Ua.y*ia);this.shape.bounds.height=ma.height-(Ta==Ma.length-1?0:(Ua.height+Ua.y)*ia)}this.shape.redraw()}};var Ya=!1;za.setPosition=function(Ua,eb,jb){La=Math.max(Graph.minTableColumnWidth-Ea.width,eb.x-Ua.x-Ea.width);Ya=mxEvent.isShiftDown(jb.getEvent());null==Da||Ya||(La=Math.min(La,Da.width-Graph.minTableColumnWi... | cwe | CWE-20 | JavaScript |
mcs_recv_connect_response(STREAM mcs_data)
{
UNUSED(mcs_data);
uint8 result;
int length;
STREAM s;
RD_BOOL is_fastpath;
uint8 fastpath_hdr;
logger(Protocol, Debug, "%s()", __func__);
s = iso_recv(&is_fastpath, &fastpath_hdr);
if (s == NULL)
return False;
ber_parse_header(s, MCS_CONNECT_RESPONSE, &length)... | cwe | CWE-125 | C/C++ |
/*
* Copyright (c) 2018 Fastly, Kazuho Oku
*
* 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, modify, merge, ... | cwe | CWE-908 | C/C++ |
/*
* H.263 decoder
* Copyright (c) 2001 Fabrice Bellard
* Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free S... | cwe | CWE-617 | C/C++ |
def fetch(url):
'''Download and verify a package url.'''
base = os.path.basename(url)
print('Fetching %s...' % base)
fetch_file(url + '.asc')
fetch_file(url)
fetch_file(url + '.sha256')
fetch_file(url + '.asc.sha256')
print('Verifying %s...' % base)
# TODO: check for verification failure.
os.system(... | cwe | CWE-78 | Python |
my_object_increment_val (MyObject *obj, GError **error)
{
obj->val++;
return TRUE;
} | cwe | CWE-264 | C/C++ |
TEE_Result syscall_hash_update(unsigned long state, const void *chunk,
size_t chunk_size)
{
TEE_Result res;
struct tee_cryp_state *cs;
struct tee_ta_session *sess;
/* No data, but size provided isn't valid parameters. */
if (!chunk && chunk_size)
return TEE_ERROR_BAD_PARAMETERS;
/* Zero length hash is vali... | cwe | CWE-327 | Unknown |
writeBufferToSeparateStrips (TIFF* out, uint8* buf,
uint32 length, uint32 width, uint16 spp,
struct dump_opts *dump)
{
uint8 *src;
uint16 bps;
uint32 row, nrows, rowsize, rowsperstrip;
uint32 bytes_per_sample;
tsample_t s;
tstrip_t strip = 0;
tsize_t stripsize = TIFFStripSize(o... | cwe | CWE-125 | Unknown |
public static File createTempDir() throws IOException {
File tmpFile = File.createTempFile("okm", null);
if (!tmpFile.delete())
throw new IOException();
if (!tmpFile.mkdir())
throw new IOException();
return tmpFile;
} | cwe | CWE-377 | Java |
static void opl3_panning(int dev, int voice, int value)
{
devc->voc[voice].panning = value;
} | cwe | CWE-119 | C/C++ |
jbig2_decode_gray_scale_image(Jbig2Ctx *ctx, Jbig2Segment *segment,
const byte *data, const size_t size,
bool GSMMR, uint32_t GSW, uint32_t GSH,
uint32_t GSBPP, bool GSUSESKIP, Jbig2Image *GSKIP, int GSTEMPLATE, Jbig2ArithCx *GB_s... | cwe | CWE-119 | C/C++ |
'use strict';
/* eslint-disable no-continue */
const isObject = (val) => typeof val === 'object' || typeof val === 'function';
const isProto = (val, obj) => val === '__proto__' || (val === 'constructor' && typeof obj.constructor === 'function');
const set = (obj, parts, length, val) => {
let tmp = obj;
let i = 0;... | cwe | CWE-1321 | JavaScript |
static int print_media_desc(const pjmedia_sdp_media *m, char *buf, pj_size_t len)
{
char *p = buf;
char *end = buf+len;
unsigned i;
int printed;
/* check length for the "m=" line. */
if (len < (pj_size_t)m->desc.media.slen+m->desc.transport.slen+12+24) {
return -1;
}
*p++ = 'm'; /*... | cwe | CWE-787 | C/C++ |
static int tt_s2_4600_frontend_attach(struct dvb_usb_adapter *adap)
{
struct dvb_usb_device *d = adap->dev;
struct dw2102_state *state = d->priv;
u8 obuf[3] = { 0xe, 0x80, 0 };
u8 ibuf[] = { 0 };
struct i2c_adapter *i2c_adapter;
struct i2c_client *client;
struct i2c_board_info board_info;
struct m88ds3103_platf... | cwe | CWE-119 | Unknown |
HttpHeader::parse(const char *header_start, size_t hdrLen)
{
const char *field_ptr = header_start;
const char *header_end = header_start + hdrLen; // XXX: remove
int warnOnError = (Config.onoff.relaxed_header_parser <= 0 ? DBG_IMPORTANT : 2);
PROF_start(HttpHeaderParse);
assert(header_start && hea... | cwe | CWE-444 | Unknown |
FLAC__bool read_residual_partitioned_rice_(FLAC__StreamDecoder *decoder, unsigned predictor_order, unsigned partition_order, FLAC__EntropyCodingMethod_PartitionedRiceContents *partitioned_rice_contents, FLAC__int32 *residual, FLAC__bool is_extended)
{
FLAC__uint32 rice_parameter;
int i;
unsigned partition, sample, u... | cwe | CWE-119 | C/C++ |
function peg$parsesection() {
var s0, s1, s2, s3, s4, s5, s6, s7;
peg$silentFails++;
s0 = peg$currPos;
s1 = peg$parsesec_tag_start();
if (s1 !== peg$FAILED) {
s2 = [];
s3 = peg$parsews();
while (s3 !== peg$FAILED) {
s2.push(s3);
s3 = peg$parsews... | cwe | CWE-1321 | JavaScript |
void DevToolsDownloadManagerDelegate::OnDownloadPathGenerated(
uint32_t download_id,
const content::DownloadTargetCallback& callback,
const base::FilePath& suggested_path) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
callback.Run(suggested_path,
content::DownloadItem::TARGET_DIS... | cwe | CWE-434 | C/C++ |
def resource_clone(params, request, session)
if not allowed_for_local_cluster(session, Permissions::WRITE)
return 403, 'Permission denied'
end
unless params[:resource_id]
return [400, 'resource_id has to be specified.']
end
_, stderr, retval = run_cmd(
session, PCS, 'resource', 'clone', params... | cwe | CWE-384 | Ruby |
$post_types_sql .= '( '.$DB->quote( $post_type ).' )';
if( $p != count( $post_types ) - 1 )
{
$post_types_sql .= ',';
}
}
// Insert item types:
$DB->query( $post_types_sql );
$DB->query( 'INSERT INTO T_items__type_custom_field ( itcf_ityp_ID, itcf_label, itcf_name, itcf_type )
VALUES ( 3, "First numeri... | cwe | CWE-79 | PHP |
public EnhancedXStream(boolean export) {
super();
if (export) {
addDefaultImplementation(PersistentList.class, List.class);
addDefaultImplementation(PersistentBag.class, List.class);
addDefaultImplementation(PersistentMap.class, Map.class);
addDefaultImplementation(PersistentSortedMap.class, Map.class)... | cwe | CWE-91 | Java |
var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*Object*/options) {
if (!options) options = {};
var _changing = options.changing;
function getType(schema){
return schema.type || (primitiveConstructors[schema.name] == schema && schema.name.toLowerCase());
}
var errors = [];
// val... | cwe | CWE-1321 | JavaScript |
backend_set_handle (struct backend *b, struct connection *conn, void *handle)
{
assert (b->i < conn->nr_handles);
conn->handles[b->i].handle = handle;
} | cwe | CWE-406 | Unknown |
/**
* @interface ParseServerOptions
* @property {AccountLockoutOptions} accountLockout account lockout policy for failed login attempts
* @property {Boolean} allowClientClassCreation Enable (or disable) client class creation, defaults to true
* @property {Boolean} allowCustomObjectId Enable (or disable) custom obje... | cwe | CWE-1321 | JavaScript |
/************************************************************************
* db.c
* nodau console note taker
* Copyright (C) Lisa Milne 2010-2013 <lisa@ltmnet.com>
*
* db.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 Software F... | cwe | CWE-74 | C/C++ |
void CLASS panasonic_load_raw()
{
int row, col, i, j, sh = 0, pred[2], nonz[2];
pana_bits(0);
for (row = 0; row < height; row++)
{
#ifdef LIBRAW_LIBRARY_BUILD
checkCancel();
#endif
for (col = 0; col < raw_width; col++)
{
if ((i = col % 14) == 0)
pred[0] = pred[1] = nonz[0] = nonz[1] =... | cwe | CWE-125 | C/C++ |
static void set_banner(struct openconnect_info *vpninfo)
{
char *banner, *q;
const char *p;
if (!vpninfo->banner || !(banner = malloc(strlen(vpninfo->banner)))) {
unsetenv("CISCO_BANNER");
return;
}
p = vpninfo->banner;
q = banner;
while (*p) {
if ... | cwe | CWE-119 | C/C++ |
static ssize_t remove_slot_store(struct kobject *kobj,
struct kobj_attribute *attr,
const char *buf, size_t nbytes)
{
char drc_name[MAX_DRC_NAME_LEN];
int rc;
char *end;
if (nbytes >= MAX_DRC_NAME_LEN)
return 0;
memcpy(drc_name, buf, nbytes);
end = strchr(drc_name, '\n');
if (!end)
end = &drc_na... | cwe | CWE-120 | C/C++ |
static int linear_ioctl(struct dm_target *ti, unsigned int cmd,
unsigned long arg)
{
struct linear_c *lc = (struct linear_c *) ti->private;
return __blkdev_driver_ioctl(lc->dev->bdev, lc->dev->mode, cmd, arg);
} | cwe | CWE-264 | C/C++ |
r.HandleFunc("/api/totals/last/{num}", func(w http.ResponseWriter, r *http.Request) {
// Grab vars
vars := mux.Vars(r)
var output string
// This is bad... don't do this.... omg
query := fmt.Sprintf(`SELECT json_agg(r) FROM (select EXTRACT(epoch FROM day) as day, end_of_day_total from trello.dailytallies orde... | cwe | CWE-89 | Go |
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build 386,darwin
package unix
import (
"syscall"
)
//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
func setTimespec(sec, n... | cwe | CWE-287 | Go |
@classmethod
def load(cls, data_store, filename):
pgm_model = None
if type(data_store) is LocalFileSystem:
pgm_model = data_store.read_pomegranate_model(filename=filename)
if type(data_store) is S3DataStore:
local_filename = "/tmp/kronos.json"
data_store.d... | cwe | CWE-502 | Python |
static int bochs_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
BDRVBochsState *s = bs->opaque;
uint32_t i;
struct bochs_header bochs;
int ret;
bs->read_only = 1; // no write support yet
ret = bdrv_pread(bs->file, 0, &bochs, sizeof(bochs));
if (... | cwe | CWE-190 | Unknown |
package com.salesmanager.shop.admin.controller.products;
import com.salesmanager.core.business.services.catalog.category.CategoryService;
import com.salesmanager.core.business.services.catalog.product.ProductService;
import com.salesmanager.core.business.services.catalog.product.relationship.ProductRelationshipService... | cwe | CWE-639 | Java |
void Compute(OpKernelContext* ctx) override {
const Tensor& input = ctx->input(0);
const int depth = (axis_ == -1) ? 1 : input.dim_size(axis_);
Tensor input_min_tensor;
Tensor input_max_tensor;
Tensor* output = nullptr;
OP_REQUIRES_OK(ctx, ctx->allocate_output(0, input.shape(), &output));
if... | cwe | CWE-787 | C/C++ |
# -*- coding: utf-8 -*-
# rdiffweb, A web interface to rdiff-backup repositories
# Copyright (C) 2012-2021 rdiffweb contributors
#
# 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-352 | Python |
ossl_cipher_update(int argc, VALUE *argv, VALUE self)
{
EVP_CIPHER_CTX *ctx;
unsigned char *in;
long in_len, out_len;
VALUE data, str;
rb_scan_args(argc, argv, "11", &data, &str);
StringValue(data);
in = (unsigned char *)RSTRING_PTR(data);
if ((in_len = RSTRING_LEN(data)) == 0)
... | cwe | CWE-326 | C/C++ |
psutil_proc_threads(PyObject *self, PyObject *args) {
HANDLE hThread;
THREADENTRY32 te32 = {0};
long pid;
int pid_return;
int rc;
FILETIME ftDummy, ftKernel, ftUser;
HANDLE hThreadSnap = NULL;
PyObject *py_tuple = NULL;
PyObject *py_retlist = PyList_New(0);
if (py_retlist == NUL... | cwe | CWE-415 | Unknown |
// imagew-util.c
// Part of ImageWorsener, Copyright (c) 2011 by Jason Summers.
// For more information, see the readme.txt file.
// This file is mainly for portability wrappers, and any code that
// may require unusual header files (malloc.h, strsafe.h).
#include "imagew-config.h"
#include <stdio.h>
#include <stdli... | cwe | CWE-682 | C/C++ |
"""
Authentication module that uses /etc/cobbler/auth.conf
Choice of authentication module is in /etc/cobbler/modules.conf
Copyright 2007-2009, Red Hat, Inc and Others
Michael DeHaan <michael.dehaan AT gmail>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Pu... | cwe | CWE-863 | Python |
/* -*-mode:c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include <algorithm>
#include <cassert>
#include <iostream>
#include <tuple>
#include "bitops.hh"
#include "component_info.hh"
#include "uncompressed_components.hh"
#include "jpgcoder.hh"
#include "vp8_decoder.hh"
#include "../io/Reader.hh... | cwe | CWE-17 | C/C++ |
async function csrfPlugin (fastify, opts) {
const {
cookieKey,
cookieOpts,
sessionKey,
getToken,
sessionPlugin,
csrfOpts
} = Object.assign({}, defaultOptions, opts)
assert(typeof cookieKey === 'string', 'cookieKey should be a string')
assert(typeof sessionKey === 'string', 'sessionKey s... | cwe | CWE-352 | JavaScript |
LoadCommand* Binary::add(const SegmentCommand& segment) {
/*
* To add a new segment in a Mach-O file, we need to:
*
* 1. Allocate space for a new Load command: LC_SEGMENT_64 / LC_SEGMENT
* which must include the sections
* 2. Allocate space for the content of the provided segment
*
* For #1, t... | cwe | CWE-703 | Unknown |
ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
{
struct ccp_aes_engine *aes = &cmd->u.aes;
struct ccp_dm_workarea key, ctx, final_wa, tag;
struct ccp_data src, dst;
struct ccp_data aad;
struct ccp_op op;
unsigned int dm_offset;
unsigned int authsize;
unsigned int jobid;
unsigned int ilen... | cwe | CWE-401 | C/C++ |
/*
* 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 |
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2020 The Matrix.org Foundation C.I.C.
#
# 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
#
# U... | cwe | CWE-22 | Python |
/* This file is part of libmspack.
* (C) 2003-2018 Stuart Caie.
*
* libmspack is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License (LGPL) version 2.1
*
* For further details, see the file COPYING.LIB distributed with libmspack
*/
/* CHM decompress... | cwe | CWE-119 | C/C++ |
move_next_session (P11KitIter *iter)
{
CK_ULONG session_flags;
CK_ULONG num_slots;
CK_INFO minfo;
CK_RV rv;
COROUTINE_BEGIN (move_next_session);
finish_slot (iter);
/* If we have no more slots, then move to next module */
while (iter->saw_slots >= iter->num_slots) {
finish_module (iter);
/* Iter is fini... | cwe | CWE-190 | Unknown |
Number(L.value),[f[n]])}}finally{l.getModel().endUpdate()}});M.className="geBtn gePrimaryBtn";mxEvent.addListener(u,"keypress",function(n){13==n.keyCode&&M.click()});t=document.createElement("div");t.style.marginTop="20px";t.style.textAlign="right";b.editor.cancelFirst?(t.appendChild(d),t.appendChild(M)):(t.appendChild... | cwe | CWE-20 | JavaScript |
/** global: ArrayUtil */
/** global: Base64Util */
/** global: DateUtil */
/** global: FunctionUtil */
/** global: JSONUtil */
/** global: MathUtil */
/** global: ObjectUtil */
/** global: StringUtil */
/** global: TypeUtil */
/** global: URLUtil */
ObjectUtil = {
assign: function(obj, other)
{
var ob... | cwe | CWE-1321 | JavaScript |
function logon($username, $password, &$sessionId)
{
global $_POST, $_COOKIE;
global $strUsernameOrPasswordWrong;
/**
* @todo Please check if the following statement is in correct place because
* it seems illogical that user can get session ID from internal login with
... | cwe | CWE-384 | PHP |
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Kernel Probes Jump Optimization (Optprobes)
*
* Copyright (C) IBM Corporation, 2002, 2004
* Copyright (C) Hitachi Ltd., 2012
*/
#include <linux/kprobes.h>
#include <linux/perf_event.h>
#include <linux/ptrace.h>
#include <linux/string.h>
#include <linux/slab.h>
#in... | cwe | CWE-94 | C/C++ |
struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd)
{
struct bpf_map *inner_map, *inner_map_meta;
struct fd f;
f = fdget(inner_map_ufd);
inner_map = __bpf_map_get(f);
if (IS_ERR(inner_map))
return inner_map;
/* prog_array->owner_prog_type and owner_jited
* is a runtime binding. Doing static check alone
... | cwe | CWE-189 | C/C++ |
ZlibOutStream::ZlibOutStream(OutStream* os, int bufSize_, int compressLevel)
: underlying(os), compressionLevel(compressLevel), newLevel(compressLevel),
bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0)
{
zs = new z_stream;
zs->zalloc = Z_NULL;
zs->zfree = Z_NULL;
zs->opaque = Z_NULL;
... | cwe | CWE-787 | C/C++ |
acc_ctx_new(OM_uint32 *minor_status,
gss_buffer_t buf,
gss_ctx_id_t *ctx,
spnego_gss_cred_id_t spcred,
gss_buffer_t *mechToken,
gss_buffer_t *mechListMIC,
OM_uint32 *negState,
send_token_flag *return_token)
{
OM_uint32 tmpmin, ret, req_flags;
gss_OID_set supported_mechSet, mechTypes... | cwe | CWE-763 | C/C++ |
int kvmppc_rtas_hcall(struct kvm_vcpu *vcpu)
{
struct rtas_token_definition *d;
struct rtas_args args;
rtas_arg_t *orig_rets;
gpa_t args_phys;
int rc;
/*
* r4 contains the guest physical address of the RTAS args
* Mask off the top 4 bits since this is a guest real address
*/
args_phys = kvmppc_get_gpr(vcp... | cwe | CWE-787 | C/C++ |
function link(scope, elem, attrs, ctrl) {
var data, panel;
elem = elem.find('.piechart-panel__chart');
var $tooltip = $('<div id="tooltip">');
ctrl.events.on('render', function () {
render(false);
if (panel.legendType === 'Right side') {
setTimeout(function () { render(true); }, 50);
}
});
... | cwe | CWE-79 | JavaScript |
package com.salesmanager.shop.admin.controller.products;
import com.salesmanager.core.business.services.catalog.product.ProductService;
import com.salesmanager.core.business.services.catalog.product.price.ProductPriceService;
import com.salesmanager.core.business.utils.ProductPriceUtils;
import com.salesmanager.core.b... | cwe | CWE-639 | Java |
static int get_client_hello(SSL *s)
{
int i, n;
unsigned long len;
unsigned char *p;
STACK_OF(SSL_CIPHER) *cs; /* a stack of SSL_CIPHERS */
STACK_OF(SSL_CIPHER) *cl; /* the ones we want to use */
STACK_OF(SSL_CIPHER) *prio, *allow;
int z;
/*
* This is a bit of a hack to check f... | cwe | CWE-310 | Unknown |
pcsc_send_apdu_wrapped (int slot, unsigned char *apdu, size_t apdulen,
unsigned char *buffer, size_t *buflen,
pininfo_t *pininfo)
{
long err;
reader_table_t slotp;
size_t len, full_len;
int i, n;
unsigned char msgbuf[9];
int sw = SW_HOST_CARD_IO_ERROR;
(voi... | cwe | CWE-20 | Unknown |
GF_Err HintFile(GF_ISOFile *file, u32 MTUSize, u32 max_ptime, u32 rtp_rate, u32 base_flags, Bool copy_data, Bool interleave, Bool regular_iod, Bool single_group, Bool hint_no_offset)
{
GF_ESD *esd;
GF_InitialObjectDescriptor *iod;
u32 i, val, res, streamType;
u32 sl_mode, prev_ocr, single_ocr, nb_done, tot_bw, bw, ... | cwe | CWE-787 | Unknown |
static int dwa_uncompress(EXRContext *s, const uint8_t *src, int compressed_size,
int uncompressed_size, EXRThreadData *td)
{
int64_t version, lo_usize, lo_size;
int64_t ac_size, dc_size, rle_usize, rle_csize, rle_raw_size;
int64_t ac_count, dc_count, ac_compression;
const int ... | cwe | CWE-20 | C/C++ |
public static function quoteValue($value) {
if ($value instanceof QueryParam || $value instanceof QueryExpression) {
//no quote for query parameters nor expressions
$value = $value->getValue();
} else if ($value === null || $value === 'NULL' || $value === 'null') {
$value = 'NULL'... | cwe | CWE-89 | PHP |
void RendererSchedulerImpl::OnShutdownTaskQueue(
const scoped_refptr<MainThreadTaskQueue>& task_queue) {
if (main_thread_only().was_shutdown)
return;
if (task_queue_throttler_)
task_queue_throttler_->ShutdownTaskQueue(task_queue.get());
if (task_runners_.erase(task_queue)) {
switch (task_queue->... | cwe | CWE-119 | Unknown |
function collideObjects(obj1: any, obj2: any, path: string, modifiers?: ICollideModifiers): any {
if (!isObject(obj2)) {
throw new Error(`Unable to collide. Collide value at path ${path} is not an object.`);
}
if (modifiers && modifiers[path]) {
return modifiers[path](obj1, obj2);
}
... | cwe | CWE-1321 | JavaScript |
function(){return ja.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var U=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(z){return z.tableHandle||U.apply(this,arguments)&&(!this.graph.isTable(this.state.... | cwe | CWE-20 | JavaScript |
package org.akaza.openclinica.controller;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.text.SimpleDateFormat;
import java.util.Array... | cwe | CWE-22 | Java |
/*
* Copyright (C) 2014 XStream Committers.
* All rights reserved.
*
* Created on 08. January 2014 by Joerg Schaible
*/
package com.thoughtworks.xstream.security;
import com.thoughtworks.xstream.XStreamException;
/**
* Exception thrown for a forbidden class.
*
* @author Jörg Schaible
* @since 1.4.7
*/... | cwe | CWE-400 | Java |
/*
* Filename routines for HTMLDOC, a HTML document processing program.
*
* Copyright © 2011-2021 by Michael R Sweet.
* Copyright © 1997-2010 by Easy Software Products. All rights reserved.
*
* This program is free software. Distribution and use rights are outlined in
* the file "COPYING".
*/
/*
* Include n... | cwe | CWE-476 | C/C++ |
package oci
import (
"bytes"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"sync"
"syscall"
"time"
"github.com/cri-o/cri-o/pkg/config"
rspec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
"golang.org/x/net/context"
types "k8s.io/cri-api/pkg/apis/runtime/v1"
"k8s.io/client-go/too... | cwe | CWE-400 | Go |
function apiAdminEndpoints(app) {
if (!app) return;
app.get("/v1/admin/is-multi-user-mode", [validApiKey], (_, response) => {
/*
#swagger.tags = ['Admin']
#swagger.description = 'Check to see if the instance is in multi-user-mode first. Methods are disabled until multi user mode is enabled via the UI.... | cwe | CWE-305 | JavaScript |
int copy_creds(struct task_struct *p, unsigned long clone_flags)
{
#ifdef CONFIG_KEYS
struct thread_group_cred *tgcred;
#endif
struct cred *new;
int ret;
if (
#ifdef CONFIG_KEYS
!p->cred->thread_keyring &&
#endif
clone_flags & CLONE_THREAD
) {
p->real_cred = get_cred(p->cred);
get_cred(p->cred);... | cwe | CWE-119 | C/C++ |
generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out,
loff_t *ppos, size_t len, unsigned int flags)
{
struct address_space *mapping = out->f_mapping;
ssize_t ret;
ret = splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_file);
if (ret > 0) {
struct inode *inode = mapping->host;
*pp... | cwe | CWE-264 | Unknown |
import os
from typing import List, Union
from django.conf import settings
from django.conf.urls import include
from django.conf.urls.i18n import i18n_patterns
from django.contrib.auth.views import (
LoginView,
PasswordResetCompleteView,
PasswordResetConfirmView,
PasswordResetDoneView,
)
from django.url... | cwe | CWE-613 | Python |
static MagickBooleanType WriteDIBImage(const ImageInfo *image_info,Image *image)
{
DIBInfo
dib_info;
MagickBooleanType
status;
register const IndexPacket
*indexes;
register const PixelPacket
*p;
register ssize_t
i,
x;
register unsigned char
*q;
size_t
bytes_per_line;
... | cwe | CWE-787 | Unknown |
function _makeSetter( property, next ){
if ( next ){
return function setter( ctx, value ){
var t = ctx[property];
if ( !t ){
t = ctx[property] = {};
}
return next( t, value );
};
}else{
return function( ctx, value ){
ctx[property] = value;
return ctx;
};
}
} | cwe | CWE-1321 | JavaScript |
static int jsi_DbQuery(Jsi_Db *jdb, Jsi_CDataDb *dbopts, const char *query)
{
int k, cnt, erc = -1;
Jsi_CDataDb statbinds[] = {{}, {}};
if (!dbopts) dbopts = statbinds;
OptionBind ob = {.binds = dbopts};
Jsi_StructSpec *specPtr, *specs;
Jsi_Interp *interp = jdb->interp;
if (!query) query="";... | cwe | CWE-120 | C/C++ |
public CsrfTokenHandler(final Form< ? > form)
{
form.add(csrfTokenField = new HiddenField<String>("csrfToken", Model.of(getCsrfSessionToken())));
} | cwe | CWE-352 | Java |
sctp_disposition_t sctp_sf_do_asconf_ack(struct net *net,
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type, void *arg,
sctp_cmd_seq_t *commands)
{
struct sctp_chunk *asconf_ack = arg;
struct sctp_chunk *last_asconf = asoc->addip_last_asconf;
struc... | cwe | CWE-20 | C/C++ |
@staticmethod
def auto_unlock_tasks(project_id: int):
"""Unlock all tasks locked for longer than the auto-unlock delta"""
expiry_delta = Task.auto_unlock_delta()
lock_duration = (datetime.datetime.min + expiry_delta).time().isoformat()
expiry_date = datetime.datetime.utcnow() - expir... | cwe | CWE-89 | Python |
#include <config.h>
#include "ftpd.h"
#include "ls_p.h"
#include "bsd-glob.h"
#include "messages.h"
#include "dynamic.h"
#include "ftpwho-update.h"
#include "globals.h"
#include "safe_rw.h"
#ifdef WITH_TLS
# include "tls.h"
#endif
#ifdef WITH_DMALLOC
# include <dmalloc.h>
#endif
static void wrstr(const int f, void *... | cwe | CWE-400 | C/C++ |
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// 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 ... | cwe | CWE-306 | Go |
void requestResetPassword() throws Exception
{
when(this.authorizationManager.hasAccess(Right.PROGRAM)).thenReturn(true);
UserReference userReference = mock(UserReference.class);
ResetPasswordRequestResponse requestResponse = mock(ResetPasswordRequestResponse.class);
when(this.resetP... | cwe | CWE-200 | Java |
search_make_new(const struct search_state *const state, int n, const char *const base_name) {
const size_t base_len = strlen(base_name);
const char need_to_append_dot = base_name[base_len - 1] == '.' ? 0 : 1;
struct search_domain *dom;
for (dom = state->head; dom; dom = dom->next) {
if (!n--) {
/* this ... | cwe | CWE-125 | C/C++ |
/*
* Apple HTTP Live Streaming demuxer
* Copyright (c) 2010 Martin Storsjo
* Copyright (c) 2013 Anssi Hannula
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Fou... | cwe | CWE-835 | C/C++ |
("/"==R.charAt(0)?"":u)+R);E.push('url("'+R+'"'+J[Q].substring(T))}else E.push(J[Q])}else E=[u]}return null!=E?E.join(""):null};Editor.prototype.mapFontUrl=function(u,E,J){/^https?:\/\//.test(E)&&!this.isCorsEnabledForUrl(E)&&(E=PROXY_URL+"?url="+encodeURIComponent(E));J(u,E)};Editor.prototype.embedCssFonts=function(u,... | cwe | CWE-20 | JavaScript |
package io.swagger.client;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.text.DateFormat;
import java.tex... | cwe | CWE-200 | Java |
static void settings_init(void) {
settings.use_cas = true;
settings.access = 0700;
settings.port = 11211;
settings.udpport = 11211;
/* By default this string should be NULL for getaddrinfo() */
settings.inter = NULL;
settings.maxbytes = 64 * 1024 * 1024; /* default is 64MB */
settings.ma... | cwe | CWE-400 | Unknown |
function copyRecurse(source, destination) {
var h = destination.$$hashKey;
var key;
if (isArray(source)) {
for (var i = 0, ii = source.length; i < ii; i++) {
destination.push(copyElement(source[i]));
}
} else if (isBlankObject(source)) {
// createMap() fast path --- Safe to avo... | cwe | CWE-74 | JavaScript |
public function store()
{
global $hist, $emitter, $login;
$event = null;
if (!$login->isAdmin() && !$login->isStaff() && !$login->isGroupManager() && $this->id == '') {
if ($this->preferences->pref_bool_create_member) {
$this->_parent = $login->id;
}
... | cwe | CWE-89 | PHP |
SqlString.escape = function(val, stringifyObjects, timeZone, dialect) {
if (val === undefined || val === null) {
return 'NULL';
}
switch (typeof val) {
case 'boolean': return (val) ? 'true' : 'false';
case 'number': return val+'';
}
if (val instanceof Date) {
val = SqlString.dateToString(val... | cwe | CWE-89 | JavaScript |
addMessage(msg, increment, isHistoryAdd) {
// correct the time
msg.time += this._pad.clientTimeOffset;
// create the time string
let minutes = `${new Date(msg.time).getMinutes()}`;
let hours = `${new Date(msg.time).getHours()}`;
if (minutes.length === 1) minutes = `0${minutes}`;
... | cwe | CWE-79 | JavaScript |
void FoFiType1C::convertToType0(char *psName, int *codeMap, int nCodes,
FoFiOutputFunc outputFunc,
void *outputStream) {
int *cidMap;
Type1CIndex subrIdx;
Type1CIndexVal val;
int nCIDs;
GooString *buf;
Type1CEexecBuf eb;
GBool ok;
int fd, i, j, k;
if (codeMap) {
nCIDs = nCodes;
cidMap... | cwe | CWE-125 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.