code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
/* vi:set ts=8 sts=4 sw=4 noet:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
/*
* normal.c: Contains the main routine fo... | cwe | CWE-416 | C/C++ |
parse_charstrings( T1_Face face,
T1_Loader loader )
{
T1_Parser parser = &loader->parser;
PS_Table code_table = &loader->charstrings;
PS_Table name_table = &loader->glyph_names;
PS_Table swap_table = &loader->swap_table;
FT_Memory me... | cwe | CWE-119 | C/C++ |
QPDF_Array::insertItem(int at, QPDFObjectHandle const& item)
{
// As special case, also allow insert beyond the end
if ((at < 0) || (at > static_cast<int>(this->items.size())))
{
throw std::logic_error(
"INTERNAL ERROR: bounds error accessing QPDF_Array element");
}
this->items.insert(this->it... | cwe | CWE-787 | Unknown |
function r(){var a,b,c,d,e;return Bc++,a=vc,b=N(),b!==X?(c=v(),c!==X?(d=t(),d!==X?(e=O(),e!==X?(wc=a,b=za(c,d),a=b):(vc=a,a=aa)):(vc=a,a=aa)):(vc=a,a=aa)):(vc=a,a=aa),Bc--,a===X&&(b=X,0===Bc&&g(ya)),a} | cwe | CWE-1321 | JavaScript |
QPDFObjectHandle::newIndirect(QPDF* qpdf, int objid, int generation)
{
return QPDFObjectHandle(qpdf, objid, generation);
} | cwe | CWE-835 | Unknown |
DECLAREreadFunc(readContigTilesIntoBuffer)
{
int status = 1;
tsize_t tilesize = TIFFTileSize(in);
tdata_t tilebuf;
uint32 imagew = TIFFScanlineSize(in);
uint32 tilew = TIFFTileRowSize(in);
int iskew = imagew - tilew;
uint8* bufp = (uint8*) buf;
uint32 tw, tl;
uint32 row;
(void) spp;
tilebuf = _TIFFmalloc(t... | cwe | CWE-190 | Unknown |
/*
* VFIO PCI interrupt handling
*
* Copyright (C) 2012 Red Hat, Inc. All rights reserved.
* Author: Alex Williamson <alex.williamson@redhat.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the F... | cwe | CWE-190 | C/C++ |
j2k_decode_entry(Imaging im, ImagingCodecState state) {
JPEG2KDECODESTATE *context = (JPEG2KDECODESTATE *)state->context;
opj_stream_t *stream = NULL;
opj_image_t *image = NULL;
opj_codec_t *codec = NULL;
opj_dparameters_t params;
OPJ_COLOR_SPACE color_space;
j2k_unpacker_t unpack = NULL;
... | cwe | CWE-125 | C/C++ |
import os.path
import secrets
from enum import Enum
from itertools import chain
from typing import (
Any,
Collection,
Dict,
Iterable,
List,
Optional,
Tuple,
Type,
TypeVar,
Union,
cast,
overload,
)
from uuid import UUID
import graphene
from django.core.exceptions import (... | cwe | CWE-209 | Python |
void getElemMatchOrPushdownDescendants(MatchExpression* node, std::vector<MatchExpression*>* out) {
if (node->getTag() && node->getTag()->getType() == TagType::OrPushdownTag) {
out->push_back(node);
} else if (node->matchType() == MatchExpression::ELEM_MATCH_OBJECT ||
node->matchType() ==... | cwe | CWE-834 | Unknown |
/** BEGIN COPYRIGHT BLOCK
* Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
* Copyright (C) 2005 Red Hat, Inc.
* All rights reserved.
*
* License: GPL (version 3 or any later version).
* See LICENSE for details.
* END COPYRIGHT BLOCK **/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* result.c... | cwe | CWE-200 | C/C++ |
/* ELF program property support.
Copyright (C) 2017-2020 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
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 Softwa... | cwe | CWE-476 | C/C++ |
function updateTimeRange() {
TimeRange.type = 'relative';
TimeRange.relativeStartQuantity = quantityField.getValue();
TimeRange.relativeStartUnits = unitField.getValue();
TimeRange.relativeUntilQuantity = untilQuantityField.getValue();
TimeRange.relativeUntilUnits = untilUnitField.getValue();
wi... | cwe | CWE-79 | JavaScript |
static void __skb_complete_tx_timestamp(struct sk_buff *skb,
struct sock *sk,
int tstype)
{
struct sock_exterr_skb *serr;
int err;
serr = SKB_EXT_ERR(skb);
memset(serr, 0, sizeof(*serr));
serr->ee.ee_errno = ENOMSG;
serr->ee.ee_origin = SO_EE_ORIGIN_TIMESTAMPING;
serr->ee.ee_info = tstype;
... | cwe | CWE-125 | C/C++ |
async function getRequest({ request, base, bodySizeLimit }) {
return new Request(base + request.url, {
// @ts-expect-error
duplex: 'half',
method: request.method,
headers: /** @type {Record<string, string>} */ (request.headers),
body: get_raw_body(request, bodySizeLimit)
});
} | cwe | CWE-20 | JavaScript |
/* ecc-mul-m.c
Point multiplication using Montgomery curve representation.
Copyright (C) 2014 Niels Möller
This file is part of GNU Nettle.
GNU Nettle is free software: you can redistribute it and/or
modify it under the terms of either:
* the GNU Lesser General Public License as published by th... | cwe | CWE-327 | C/C++ |
function ta(ra,ia,Da){mxEvent.addListener(ia,"click",function(){Ea!=ia&&(Ea.style.backgroundColor="",Ea=ia,Ea.style.backgroundColor=E,Z.scrollTop=0,Z.innerHTML="",J=0,Pa=Da?Ga[ra][Da]:sa[ra],V=null,N(!1))})} | cwe | CWE-94 | JavaScript |
OMX_ERRORTYPE SoftAAC2::internalSetParameter(
OMX_INDEXTYPE index, const OMX_PTR params) {
switch ((int)index) {
case OMX_IndexParamStandardComponentRole:
{
const OMX_PARAM_COMPONENTROLETYPE *roleParams =
(const OMX_PARAM_COMPONENTROLETYPE *)params;
if (strncmp((... | cwe | CWE-119 | C/C++ |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 1);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
TfLiteIntArray* input_dims = input->dims;
int input_dims_size = input_dims->size;... | cwe | CWE-125 | C/C++ |
/*
* Copyright (C) Igor Sysoev
* Copyright (C) NGINX, Inc.
*/
#include <njs_main.h>
struct njs_property_next_s {
uint32_t index;
njs_array_t *array;
};
static njs_jump_off_t njs_vmcode_object(njs_vm_t *vm);
static njs_jump_off_t njs_vmcode_array(njs_vm_t *vm, u_char *pc);
static njs_jump_off_t njs... | cwe | CWE-843 | C/C++ |
static bool r_bin_mdmp_init_directory_entry(struct r_bin_mdmp_obj *obj, struct minidump_directory *entry) {
r_strf_buffer (128);
struct minidump_handle_operation_list handle_operation_list;
struct minidump_memory_list memory_list;
struct minidump_memory64_list memory64_list;
struct minidump_memory_info_list memory... | cwe | CWE-400 | Unknown |
/*
* util.c: utility functions used by OpenSC command line tools.
*
* Copyright (C) 2011 OpenSC Project developers
*
* This library 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 Foundation; either
* versi... | cwe | CWE-119 | C/C++ |
void BinaryParameter::setParam(const void* v, int len) {
LOCK_CONFIG;
if (immutable) return;
vlog.debug("set %s(Binary)", getName());
delete [] value; value = 0;
if (len) {
value = new char[len];
length = len;
memcpy(value, v, len);
}
} | cwe | CWE-122 | C/C++ |
def impersonateWithKey(key: String): Action[Unit] = GetActionIsLogin { request =>
// Dupl code? Reuse /-/v0/login-with-secret instead? [7AKBRW02]
// Delete the key so no one else can use it, in case Mallory sees it in a log file.
val redisTransaction = redis.transaction()
val futureGetResult = redisTr... | cwe | CWE-613 | Scala |
////////////////////////////////////////////////////////////////////////////
// **** WAVPACK **** //
// Hybrid Lossless Wavefile Compressor //
// Copyright (c) 1998 - 2018 David Bryant. //
// ... | cwe | CWE-125 | C/C++ |
parse_args(int argc, char **argv, int *old_optind, int *nargc, char ***nargv,
struct sudo_settings **settingsp, char ***env_addp)
{
struct environment extra_env;
int mode = 0; /* what mode is sudo to be run in? */
int flags = 0; /* mode flags */
int valid_flags = DEFAULT_VALID_FLAGS;
int ch, i... | cwe | CWE-193 | C/C++ |
R_API ut8 *r_bin_java_get_attr_buf(RBinJavaObj *bin, ut64 sz, const ut64 offset, const ut8 *buf, const ut64 len) {
ut8 *attr_buf = NULL;
int pending = len - offset;
const ut8 *a_buf = offset + buf;
attr_buf = (ut8 *) calloc (pending + 1, 1);
if (!attr_buf) {
eprintf ("Unable to allocate enough bytes (0x%04"PFMT6... | cwe | CWE-125 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-125 | C/C++ |
it "updates to a mongo advanced selector" do
query.explain
query.operation.selector.should eq(
"$query" => selector,
"$explain" => true,
"$orderby" => { _id: 1 }
)
end | cwe | CWE-20 | Ruby |
x[C].apply(this,arguments);null!=G&&B.push(G)}b.sidebar.showEntries(0<B.length?B.join(";"):"",A.checked);b.hideDialog()});g.className="geBtn gePrimaryBtn";f=document.createElement("div");f.style.marginTop="26px";f.style.textAlign="right"}b.editor.cancelFirst?(f.appendChild(n),f.appendChild(g)):(f.appendChild(g),f.appen... | cwe | CWE-94 | JavaScript |
module.exports = function apply(doc, patch) {
if (typeof patch !== OBJECT || patch === null || Array.isArray(patch)) {
return patch;
}
if (typeof doc !== OBJECT || doc === null || Array.isArray(doc)) {
doc = Object.create(null);
}
const keys = Object.keys(patch);
for (const key of keys) {
cons... | cwe | CWE-1321 | JavaScript |
'use strict';
const request = require('request');
/**
* A default set of user agent patterns for bots/crawlers that do not perform
* well with pages that require JavaScript.
*/
const botUserAgents = module.exports.botUserAgents = [
'W3C_Validator',
'baiduspider',
'bingbot',
'embedly',
'facebookexternalhi... | cwe | CWE-22 | JavaScript |
/*
* The MIT License
*
* Copyright (c) 2004-2011, Sun Microsystems, Inc., Kohsuke Kawaguchi,
* Erik Ramfelt, Koichi Fujikawa, Red Hat, Inc., Seiji Sogabe,
* Stephen Connolly, Tom Huybrechts, Yahoo! Inc., Alan Harder, CloudBees, Inc.,
* Yahoo!, Inc.
*
* Permission is hereby granted, free of charge, to any person... | cwe | CWE-200 | Java |
static void* swoole_unserialize_object(void *buffer, zval *return_value, zend_uchar bucket_len, zval *args, long flag)
{
zval property;
uint32_t arr_num = 0;
size_t name_len = *((unsigned short*) buffer);
if (!name_len)
{
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "illegal unserialize data")... | cwe | CWE-200 | Unknown |
PS_READ_FUNC(files)
{
long n;
struct stat sbuf;
PS_FILES_DATA;
ps_files_open(data, key TSRMLS_CC);
if (data->fd < 0) {
return FAILURE;
}
if (fstat(data->fd, &sbuf)) {
return FAILURE;
}
data->st_size = *vallen = sbuf.st_size;
if (sbuf.st_size == 0) {
*val = STR_EMPTY_ALLOC();
return SUCCESS;
}
*... | cwe | CWE-264 | Unknown |
mono_runtime_shutdown (void)
{
mono_domain_foreach (fire_process_exit_event, NULL);
} | cwe | CWE-399 | Unknown |
long Tracks::ParseTrackEntry(
long long track_start,
long long track_size,
long long element_start,
long long element_size,
Track*& pResult) const
{
if (pResult)
return -1;
IMkvReader* const pReader = m_pSegment->m_pReader;
long long pos = track_start;
const long long track_s... | cwe | CWE-119 | C/C++ |
static int dalvik_disassemble (RAsm *a, RAsmOp *op, const ut8 *buf, int len) {
int vA, vB, vC, payload = 0, i = (int) buf[0];
int size = dalvik_opcodes[i].len;
char str[1024], *strasm;
ut64 offset;
const char *flag_str;
op->buf_asm[0] = 0;
if (buf[0] == 0x00) { /* nop */
switch (buf[1]) {
case 0x01: /* pac... | cwe | CWE-119 | Unknown |
from django.contrib import admin
import import_export.widgets as widgets
from import_export.admin import ImportExportModelAdmin
from import_export.fields import Field
from import_export.resources import ModelResource
from .models import (PurchaseOrder, PurchaseOrderExtraLine,
PurchaseOrderLineIte... | cwe | CWE-1236 | Python |
package graph
import (
"context"
"errors"
v0 "github.com/authzed/authzed-go/proto/authzed/api/v0"
v1_proto "github.com/authzed/authzed-go/proto/authzed/api/v1"
"github.com/rs/zerolog/log"
"github.com/shopspring/decimal"
"github.com/authzed/spicedb/internal/datastore"
"github.com/authzed/spicedb/internal/disp... | cwe | CWE-20 | Go |
static ssize_t write_mem(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
phys_addr_t p = *ppos;
ssize_t written, sz;
unsigned long copied;
void *ptr;
if (p != *ppos)
return -EFBIG;
if (!valid_phys_addr_range(p, count))
return -EFAULT;
written = 0;
#ifdef __ARCH_HAS_NO_PAGE_ZE... | cwe | CWE-200 | Unknown |
void PrintPreviewUI::OnCancelPendingPreviewRequest() {
g_print_preview_request_id_map.Get().Set(preview_ui_addr_str_, -1);
} | cwe | CWE-200 | C/C++ |
function PMA_findExistingColNames($db, $cols, $allFields=false)
{
$cfgCentralColumns = PMA_centralColumnsGetParams();
if (empty($cfgCentralColumns)) {
return array();
}
$pmadb = $cfgCentralColumns['db'];
$GLOBALS['dbi']->selectDb($pmadb, $GLOBALS['controllink']);
$central_list_table = $c... | cwe | CWE-89 | PHP |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "hermes/BCGen/HBC/BytecodeGenerator.h"
#include "hermes/FrontEndDefs/Builtins.h"
#include "llvh/ADT/SmallString.h"
#in... | cwe | CWE-681 | C/C++ |
'use strict'
/*
Char codes:
'#': 35
'*': 42
'-': 45
'/': 47
':': 58
';': 59
'?': 63
*/
const assert = require('assert')
const http = require('http')
const fastDecode = require('fast-decode-uri-component')
const isRegexSafe = require('safe-regex2')
const { flattenNode, compressFlattenedNo... | cwe | CWE-444 | JavaScript |
("/"==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 |
set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
mode_t mode, unsigned long set, unsigned long clear)
{
int ret;
int myfd = fd;
int newflags, oldflags;
/*
* Linux has no define for the flags that are only settable by
* the root user. This code may seem a little complex, but
... | cwe | CWE-59 | Unknown |
def __init__(self, **kwargs):
self.basic_auth = get_anymail_setting('webhook_authorization', default=[],
kwargs=kwargs) # no esp_name -- auth is shared between ESPs
# Allow a single string:
if isinstance(self.basic_auth, six.string_types):
... | cwe | CWE-532 | Python |
int X509_verify_cert(X509_STORE_CTX *ctx)
{
X509 *x, *xtmp, *xtmp2, *chain_ss = NULL;
int bad_chain = 0;
X509_VERIFY_PARAM *param = ctx->param;
int depth, i, ok = 0;
int num, j, retry;
int (*cb) (int xok, X509_STORE_CTX *xctx);
STACK_OF(X509) *sktmp = NULL;
if (ctx->cert == NULL) {
... | cwe | CWE-254 | Unknown |
static void scsi_free_request(SCSIRequest *req)
{
SCSIDiskReq *r = DO_UPCAST(SCSIDiskReq, req, req);
qemu_vfree(r->iov.iov_base);
} | cwe | CWE-119 | C/C++ |
static inline int xsave_state(struct xsave_struct *fx, u64 mask)
{
u32 lmask = mask;
u32 hmask = mask >> 32;
int err = 0;
/*
* If xsaves is enabled, xsaves replaces xsaveopt because
* it supports compact format and supervisor states in addition to
* modified optimization in xsaveopt.
*
* Otherwise, if xs... | cwe | CWE-20 | Unknown |
PHP_FUNCTION( msgfmt_format_message )
{
zval *args;
UChar *spattern = NULL;
int spattern_len = 0;
char *pattern = NULL;
int pattern_len = 0;
const char *slocale = NULL;
int slocale_len = 0;
MessageFormatter_object mf = {0};
MessageFormatter_object *mfo = &mf;
/* Parse... | cwe | CWE-119 | C/C++ |
GF_Err Media_GetESD(GF_MediaBox *mdia, u32 sampleDescIndex, GF_ESD **out_esd, Bool true_desc_only)
{
u32 type;
GF_ESD *esd;
GF_MPEGSampleEntryBox *entry = NULL;
GF_ESDBox *ESDa;
GF_ProtectionSchemeInfoBox *sinf;
GF_SampleDescriptionBox *stsd = mdia->information->sampleTable->SampleDescription;
*out_esd = NULL;
... | cwe | CWE-476 | C/C++ |
QPDF::trim_user_password(std::string& user_password)
{
// Although unnecessary, this routine trims the padding string
// from the end of a user password. Its only purpose is for
// recovery of user passwords which is done in the test suite.
char const* cstr = user_password.c_str();
size_t len = use... | cwe | CWE-787 | Unknown |
TfLiteStatus GatherStrings(TfLiteContext* context, const TfLiteTensor* input,
const TfLiteTensor* positions,
TfLiteTensor* output) {
DynamicBuffer buffer;
const PositionT* indexes = GetTensorData<PositionT>(positions);
const PositionT num_strings = GetStringCo... | cwe | CWE-125 | Unknown |
def safe_eval(expr, locals={}, include_exceptions=False):
'''
this is intended for allowing things like:
with_items: a_list_variable
where Jinja2 would return a string
but we do not want to allow it to call functions (outside of Jinja2, where
the env is constrained)
Based on:
http://sta... | cwe | CWE-74 | Python |
void LanLinkProvider::dataReceived()
{
QSslSocket* socket = qobject_cast<QSslSocket*>(sender());
#if QT_VERSION < QT_VERSION_CHECK(5,7,0)
if (!socket->canReadLine())
return;
#else
socket->startTransaction();
#endif
const QByteArray data = socket->readLine();
qCDebug(KDECONNECT_CORE) << "La... | cwe | CWE-703 | Unknown |
function addExternalVideoStreamer(meetingId) {
const streamName = `external-videos-${meetingId}`;
if (!Meteor.StreamerCentral.instances[streamName]) {
const streamer = new Meteor.Streamer(streamName);
streamer.allowRead('all');
streamer.allowWrite('none');
streamer.allowEmit(allowRecentMessages);
... | cwe | CWE-285 | JavaScript |
package fleet
import "time"
type SoftwareCVE struct {
CVE string `json:"cve" db:"cve"`
DetailsLink string `json:"details_link" db:"details_link"`
}
// Software is a named and versioned piece of software installed on a device.
type Software struct {
ID uint `json:"id" db:"id"`
// Name is the reported name... | cwe | CWE-863 | Go |
// imagew-jpeg.c
// Part of ImageWorsener, Copyright (c) 2011 by Jason Summers.
// For more information, see the readme.txt file.
#include "imagew-config.h"
#if IW_SUPPORT_JPEG == 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <setjmp.h>
#include <jpeglib.h>
#include <jerror... | cwe | CWE-125 | C/C++ |
/*
* 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 |
int avi_parse_input_file(avi_t *AVI, int getIndex)
{
int i, rate, scale, idx_type;
s64 n;
unsigned char *hdrl_data;
u64 header_offset=0;
int hdrl_len=0;
int nvi, nai[AVI_MAX_TRACKS], ioff;
u64 tot[AVI_MAX_TRACKS];
u32 j;
int lasttag = 0;
int vids_strh_seen = 0;
int vids_strf_seen = 0;
int auds_strh_seen = 0... | cwe | CWE-835 | C/C++ |
void test_base64_lengths(void)
{
const char *in = "FuseMuse";
char out1[32];
char out2[32];
size_t enclen;
int declen;
/* Encoding a zero-length string should fail */
enclen = mutt_b64_encode(out1, in, 0, 32);
if (!TEST_CHECK(enclen == 0))
{
TEST_MSG("Expected: %zu", 0);
TEST_MSG("Actual : %... | cwe | CWE-120 | Unknown |
write_header( FT_Error error_code )
{
FT_Face face;
const char* basename;
const char* format;
error = FTC_Manager_LookupFace( handle->cache_manager,
handle->scaler.face_id, &face );
if ( error )
Fatal( "can't access font file" );
if ( !statu... | cwe | CWE-120 | Unknown |
jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2SymbolDictParams *params, const byte *data, size_t size, Jbig2ArithCx *GB_stats, Jbig2ArithCx *GR_stats)
{
Jbig2SymbolDict *SDNEWSYMS = NULL;
Jbig2SymbolDict *SDEXSYMS = NULL;
uint32_t... | cwe | CWE-476 | C/C++ |
import ast
import datetime
import re
import secrets
import time
from datetime import timedelta
from typing import (
AbstractSet,
Any,
Callable,
Dict,
List,
Optional,
Sequence,
Set,
Tuple,
TypeVar,
Union,
)
import django.contrib.auth
from bitfield import BitField
from bitfiel... | cwe | CWE-400 | Python |
/**
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
... | cwe | CWE-310 | Java |
void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines,
Size const & previewSize )
{
jpeg_decompress_struct cinfo;
ErrorManagerStruct jerr;
if ( setjmp( jerr.setjmp_buffer ) )
{
jpeg_destroy_decompress( &cinfo );
return;
}
cinfo.err = jpeg_std_e... | cwe | CWE-119 | C/C++ |
int jp2_encode(jas_image_t *image, jas_stream_t *out, char *optstr)
{
jp2_box_t *box;
jp2_ftyp_t *ftyp;
jp2_ihdr_t *ihdr;
jas_stream_t *tmpstream;
int allcmptssame;
jp2_bpcc_t *bpcc;
long len;
uint_fast16_t cmptno;
jp2_colr_t *colr;
char buf[4096];
uint_fast32_t overhead;
jp2_cdefchan_t *cdefchanent;
jp2_c... | cwe | CWE-189 | Unknown |
AcpiDsCreateOperands (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *FirstArg)
{
ACPI_STATUS Status = AE_OK;
ACPI_PARSE_OBJECT *Arg;
ACPI_PARSE_OBJECT *Arguments[ACPI_OBJ_NUM_OPERANDS];
UINT32 ArgCount = 0;
UINT32 In... | cwe | CWE-200 | Unknown |
int rxrpc_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t len, int flags)
{
struct rxrpc_skb_priv *sp;
struct rxrpc_call *call = NULL, *continue_call = NULL;
struct rxrpc_sock *rx = rxrpc_sk(sock->sk);
struct sk_buff *skb;
long timeo;
int copy, ret, ullen, offset, copied = 0;
u32 ... | cwe | CWE-20 | C/C++ |
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: https://www.espocrm.com
*
* EspoCRM is free software: you can redistribute i... | cwe | CWE-79 | JavaScript |
private function load($id)
{
try {
$select = $this->zdb->select(self::TABLE);
$select->limit(1)->where(self::PK . ' = ' . $id);
if ($this->login->isSuperAdmin()) {
$select->where(Adherent::PK . ' IS NULL');
} else {
$select->whe... | cwe | CWE-89 | PHP |
qb_ipcs_us_connect(struct qb_ipcs_service *s,
struct qb_ipcs_connection *c,
struct qb_ipc_connection_response *r)
{
char path[PATH_MAX];
int32_t fd_hdr;
int32_t res = 0;
struct ipc_us_control *ctl;
char *shm_ptr;
qb_util_log(LOG_DEBUG, "connecting to client (%s)", c->description);
c->request.u.us.soc... | cwe | CWE-59 | Unknown |
/*
* Global javascript utilities
*/
/* global $ */
var static_url = "";
/*
* A simple function to initialize the value of the global variable
* 'media_url' (corresponding to django's MEDIA_URL variable).
*/
function set_static_url(url) {
static_url = url;
}
/*
* Shortcut function that construct an url fro... | cwe | CWE-79 | Python |
/* Copyright 2015 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 a... | cwe | CWE-617 | Python |
__ext4_xattr_check_block(struct inode *inode, struct buffer_head *bh,
const char *function, unsigned int line)
{
int error = -EFSCORRUPTED;
if (buffer_verified(bh))
return 0;
if (BHDR(bh)->h_magic != cpu_to_le32(EXT4_XATTR_MAGIC) ||
BHDR(bh)->h_blocks != cpu_to_le32(1))
goto errout;
error = -EFSBADCR... | cwe | CWE-416 | C/C++ |
def insert(key, value):
connection = psycopg2.connect(host=config['HOST'], port=config['PORT'], database=config['NAME'], user=config['USER'], password=config['PASSWORD'])
cur = connection.cursor()
try:
cur.execute("insert into reply_map values('{}', '{}')".format(key, value))
connection.comm... | cwe | CWE-89 | Python |
bool HTMLMediaElement::IsMediaDataCORSSameOrigin(
const SecurityOrigin* origin) const {
if (GetWebMediaPlayer() &&
GetWebMediaPlayer()->DidGetOpaqueResponseFromServiceWorker()) {
return false;
}
if (!HasSingleSecurityOrigin())
return false;
return (GetWebMediaPlayer() &&
GetWeb... | cwe | CWE-732 | C/C++ |
int sqlite3WindowRewrite(Parse *pParse, Select *p){
int rc = SQLITE_OK;
if( p->pWin && p->pPrior==0 && (p->selFlags & SF_WinRewrite)==0 ){
Vdbe *v = sqlite3GetVdbe(pParse);
sqlite3 *db = pParse->db;
Select *pSub = 0; /* The subquery */
SrcList *pSrc = p->pSrc;
Expr *pWhere = p->pWher... | cwe | CWE-755 | C/C++ |
bool LocalFrame::ShouldReuseDefaultView(const KURL& url) const {
if (!Loader().StateMachine()->IsDisplayingInitialEmptyDocument())
return false;
return GetDocument()->IsSecureTransitionTo(url);
} | cwe | CWE-285 | C/C++ |
/* SSDP responder
*
* Copyright (c) 2017 Joachim Nilsson <troglobit@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWA... | cwe | CWE-193 | C/C++ |
*/
static int send_client_reply_packet(MCPVIO_EXT *mpvio,
const uchar *data, int data_len)
{
MYSQL *mysql= mpvio->mysql;
NET *net= &mysql->net;
char *buff, *end;
size_t buff_size;
size_t connect_attrs_len=
(mysql->server_capabilities & CLIENT_CONNECT_ATTRS &&
mysql... | cwe | CWE-284 | Unknown |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
const bool is_soft_nms = NumInputs(node) == 6;
const TfLiteTensor* input_boxes = GetInput(context, node, kInputTensorBoxes);
const int num_boxes = SizeOfDimension(input_boxes, 0);
const TfLiteTensor* input_scores =
GetInput(context, node, kInp... | cwe | CWE-787 | C/C++ |
package io.quarkus.smallrye.graphql.runtime;
import java.io.StringReader;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.json.Json;
import javax.json.JsonObject;
import javax.json.JsonReader;
import javax.json.JsonReaderFactory;
impo... | cwe | CWE-444 | Java |
/*
* Copyright 2019 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* 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.apach... | cwe | CWE-377 | Java |
display_sigset( const char *msg, sigset_t *mask )
{
int signo;
NameTableIterator next_sig( SigNames );
if( msg ) {
dprintf( D_ALWAYS, msg );
}
while( (signo = next_sig()) != -1 ) {
if( sigismember(mask,signo) ) {
dprintf( D_ALWAYS | D_NOHEAD... | cwe | CWE-134 | C/C++ |
public Operation.OperationResult executeFixedCostOperation(
final MessageFrame frame, final EVM evm) {
Bytes shiftAmount = frame.popStackItem();
if (shiftAmount.size() > 4 && (shiftAmount = shiftAmount.trimLeadingZeros()).size() > 4) {
frame.popStackItem();
frame.pushStackItem(UInt256.ZERO);
... | cwe | CWE-681 | Java |
static bool fib6_rule_suppress(struct fib_rule *rule, struct fib_lookup_arg *arg)
{
struct fib6_result *res = arg->result;
struct rt6_info *rt = res->rt6;
struct net_device *dev = NULL;
if (!rt)
return false;
if (rt->rt6i_idev)
dev = rt->rt6i_idev->dev;
/* do not accept result if the route does
* not mee... | cwe | CWE-401 | C/C++ |
def get_view(db, options = {}, fetch_data = false)
if !fetch_data && @report_data_additional_options.nil?
process_show_list_options(options, db)
end
unless @edit.nil?
object_ids = @edit[:object_ids] unless @edit[:object_ids].nil?
object_ids = @edit[:pol_items] unless @edit[:pol_items].nil?... | cwe | CWE-502 | Ruby |
/*
* Copyright (c) 2015. David Sowerby
*
* 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 in wri... | cwe | CWE-89 | Java |
/*
* plist.c
* XML plist implementation
*
* Copyright (c) 2008 Jonathan Beck All Rights Reserved.
*
* This library 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 Foundation; either
* version 2.1 of the Li... | cwe | CWE-611 | C/C++ |
protected URI addContentToRepo(MediaPackage mp, String elementId, URI uri) throws IOException {
InputStream in = null;
HttpResponse response = null;
CloseableHttpClient externalHttpClient = null;
try {
if (uri.toString().startsWith("http")) {
HttpGet get = new HttpGet(uri);
List<St... | cwe | CWE-287 | Java |
ProcSendEvent(ClientPtr client)
{
WindowPtr pWin;
WindowPtr effectiveFocus = NullWindow; /* only set if dest==InputFocus */
DeviceIntPtr dev = PickPointer(client);
DeviceIntPtr keybd = GetMaster(dev, MASTER_KEYBOARD);
SpritePtr pSprite = dev->spriteInfo->sprite;
REQUEST(xSendEventReq);
... | cwe | CWE-119 | Unknown |
def karma_sub(name):
karma = karma_ask(name)
db = db_connect()
cursor = db.cursor()
if karma is None:
try:
cursor.execute('''
INSERT INTO people(name,karma,shame) VALUES('{}',-1,0)
'''.format(name))
db.commit()
logger.debug('Ins... | cwe | CWE-89 | Python |
public function getHtmlForControlButtons()
{
$ret = '';
$cfgRelation = PMA_getRelationsParam();
if ($cfgRelation['navwork']) {
$db = $this->realParent()->real_name;
$item = $this->real_name;
$ret = '<span class="navItemControls">'
. '<a ... | cwe | CWE-79 | PHP |
def _get_chap_secret_for_host(self, host_name):
"""Return the CHAP secret for the given host."""
LOG.debug(_('enter: _get_chap_secret_for_host: host name %s')
% host_name)
ssh_cmd = 'svcinfo lsiscsiauth -delim !'
out, err = self._run_ssh(ssh_cmd)
if not len(o... | cwe | CWE-78 | Python |
static void server_real_connect(SERVER_REC *server, IPADDR *ip,
const char *unix_socket)
{
GIOChannel *handle;
IPADDR *own_ip = NULL;
const char *errmsg;
char *errmsg2;
char ipaddr[MAX_IP_LEN];
int port;
g_return_if_fail(ip != NULL || unix_socket != NULL);
signal_emit("server connecting", 2, server... | cwe | CWE-20 | Unknown |
// A RestWrite encapsulates everything we need to run an operation
// that writes to the database.
// This could be either a "create" or an "update".
var SchemaController = require('./Controllers/SchemaController');
var deepcopy = require('deepcopy');
const Auth = require('./Auth');
var cryptoUtils = require('./crypt... | cwe | CWE-74 | JavaScript |
TfLiteStatus NonMaxSuppressionSingleClassHelper(
TfLiteContext* context, TfLiteNode* node, OpData* op_data,
const std::vector<float>& scores, std::vector<int>* selected,
int max_detections) {
const TfLiteTensor* input_box_encodings =
GetInput(context, node, kInputTensorBoxEncodings);
const TfLiteT... | cwe | CWE-787 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.