code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
void ih264d_rest_of_residual_cav_chroma_dc_block(UWORD32 u4_total_coeff_trail_one,
dec_bit_stream_t *ps_bitstrm)
{
UWORD32 u4_total_zeroes;
WORD16 i;
UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
UWORD32 u4_bitstream_offset = ps_bitstrm->u4_ofst;
UWORD32 u4_trailing_ones = u4_total_coeff_tr... | cwe | CWE-119 | C/C++ |
int hfsplus_rename_cat(u32 cnid,
struct inode *src_dir, struct qstr *src_name,
struct inode *dst_dir, struct qstr *dst_name)
{
struct super_block *sb = src_dir->i_sb;
struct hfs_find_data src_fd, dst_fd;
hfsplus_cat_entry entry;
int entry_size, type;
int err;
dprint(DBG_CAT_MOD, "rename_cat: %u... | cwe | CWE-264 | C/C++ |
SProcXFixesCreatePointerBarrier(ClientPtr client)
{
REQUEST(xXFixesCreatePointerBarrierReq);
int i;
int i;
CARD16 *in_devices = (CARD16 *) &stuff[1];
swaps(&stuff->length);
swaps(&stuff->num_devices);
REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq, pad_to_int32(stuff->num_devices))... | cwe | CWE-20 | C/C++ |
int cx23888_ir_probe(struct cx23885_dev *dev)
{
struct cx23888_ir_state *state;
struct v4l2_subdev *sd;
struct v4l2_subdev_ir_parameters default_params;
int ret;
state = kzalloc(sizeof(struct cx23888_ir_state), GFP_KERNEL);
if (state == NULL)
return -ENOMEM;
spin_lock_init(&state->rx_kfifo_lock);
if (kfifo_... | cwe | CWE-401 | C/C++ |
/*
* Dragonfly - Runtime dependency management library
* Copyright (c) 2021 Joshua Sing <joshua@hypera.dev>
*
* 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, in... | cwe | CWE-611 | Java |
def get_roster(self, server_id):
sql = """SELECT username, role
FROM roles
WHERE roles.server_id = {0};
""".format(server_id)
self.cur.execute(sql)
return self.cur.fetchall() | cwe | CWE-89 | Python |
function cellClicked(cell)
{
// Forces focusout in IE
if (!ui.editor.isChromelessView())
{
graph.container.focus();
}
// Gets the selection cell
if (cell == null)
{
highlight.highlight(null);
div.innerHTML = '<p><i>' + mxResources.get('nothingIsSelected') + '</i></p>';
}
else
{
var att... | cwe | CWE-94 | JavaScript |
MG_INTERNAL int parse_mqtt(struct mbuf *io, struct mg_mqtt_message *mm) {
uint8_t header;
size_t len = 0, len_len = 0;
const char *p, *end;
unsigned char lc = 0;
int cmd;
if (io->len < 2) return MG_MQTT_ERROR_INCOMPLETE_MSG;
header = io->buf[0];
cmd = header >> 4;
/* decode mqtt variable length */
... | cwe | CWE-119 | Unknown |
/* 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-476 | Python |
build_version_comments(docinfo, out) {
var me = this;
docinfo.versions.forEach(function(version) {
if(!version.data) return;
var data = JSON.parse(version.data);
// comment
if(data.comment) {
out.push(me.get_version_comment(version, data.comment, data.comment_type));
return;
}
// value c... | cwe | CWE-79 | JavaScript |
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code distributions
* retain the above co... | cwe | CWE-787 | C/C++ |
# -*- coding: utf-8 -*-
"""
RDFa 1.1 parser, also referred to as a “RDFa Distiller”. It is
deployed, via a CGI front-end, on the U{W3C RDFa 1.1 Distiller page<http://www.w3.org/2012/pyRdfa/>}.
For details on RDFa, the reader should consult the U{RDFa Core 1.1<http://www.w3.org/TR/rdfa-core/>}, U{XHTML+RDFa1.1<http://w... | cwe | CWE-707 | Python |
/*
* RELIC is an Efficient LIbrary for Cryptography
* Copyright (C) 2007-2020 RELIC Authors
*
* This file is part of RELIC. RELIC is legal property of its developers,
* whose names are not listed here. Please refer to the COPYRIGHT file
* for contact information.
*
* RELIC is free software; you can redistribute... | cwe | CWE-20 | C/C++ |
# 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 applica... | cwe | CWE-502 | Python |
SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf)
{
struct shmid_kernel *shp;
int err, version;
struct ipc_namespace *ns;
if (cmd < 0 || shmid < 0)
return -EINVAL;
version = ipc_parse_version(&cmd);
ns = current->nsproxy->ipc_ns;
switch (cmd) {
case IPC_INFO:
case SHM_INFO:
cas... | cwe | CWE-362 | C/C++ |
TfLiteStatus GenericPrepare(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, 0);
TfLiteTensor* output = GetOutput(context, node, 0);
TF_LITE_ENSURE_TYPES_EQ(context, ... | cwe | CWE-787 | C/C++ |
static CURLcode ossl_connect_step1(struct Curl_easy *data,
struct connectdata *conn, int sockindex)
{
CURLcode result = CURLE_OK;
char *ciphers;
SSL_METHOD_QUAL SSL_METHOD *req_method = NULL;
X509_LOOKUP *lookup = NULL;
curl_socket_t sockfd = conn->sock[sockindex];
struct ... | cwe | CWE-416 | Unknown |
GF_Err SetupWriters(MovieWriter *mw, GF_List *writers, u8 interleaving)
{
u32 i, trackCount;
TrackWriter *writer;
GF_TrackBox *trak;
GF_ISOFile *movie = mw->movie;
mw->total_samples = mw->nb_done = 0;
if (!movie->moov) return GF_OK;
trackCount = gf_list_count(movie->moov->trackList);
for (i = 0; i < trackCoun... | cwe | CWE-476 | C/C++ |
static void tulip_xmit_list_update(TULIPState *s)
{
struct tulip_descriptor desc;
if (tulip_ts(s) != CSR5_TS_SUSPENDED) {
return;
}
for (;;) {
tulip_desc_read(s, s->current_tx_desc, &desc);
tulip_dump_tx_descriptor(s, &desc);
if (!(desc.status & TDES0_OWN)) {
... | cwe | CWE-787 | Unknown |
juniper_es_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, register const u_char *p)
{
struct juniper_l2info_t l2info;
struct juniper_ipsec_header {
uint8_t sa_index[2];
uint8_t ttl;
uint8_t type;
uint8_t spi[4];
ui... | cwe | CWE-125 | C/C++ |
constructor() {
super();
this.synchronous = true;
this.idx = {};
const customInspectSymbol = getCustomInspectSymbol();
if (customInspectSymbol) {
this[customInspectSymbol] = this.inspect;
}
} | cwe | CWE-1321 | JavaScript |
import os.path
import Missing
from Acquisition import aq_base
from AccessControl import getSecurityManager
from Products.CMFCore.utils import getToolByName
from five import grok
from z3c.table import interfaces
from zope.component import getMultiAdapter
from zope.i18nmessageid import MessageFactory
from zope.i18n impor... | cwe | CWE-79 | Python |
composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
{
struct usb_composite_dev *cdev = get_gadget_data(gadget);
struct usb_request *req = cdev->req;
int value = -EOPNOTSUPP;
int status = 0;
u16 w_index = le16_to_cpu(ctrl->wIndex);
u8 intf = w_index & 0xFF;
u16 w_value =... | cwe | CWE-476 | C/C++ |
ProcDbeGetVisualInfo(ClientPtr client)
{
REQUEST(xDbeGetVisualInfoReq);
DbeScreenPrivPtr pDbeScreenPriv;
xDbeGetVisualInfoReply rep;
Drawable *drawables;
DrawablePtr *pDrawables = NULL;
register int i, j, rc;
register int count; /* number of visual infos in reply */
register int ... | cwe | CWE-190 | Unknown |
package com.salesmanager.shop.admin.controller.user;
import com.salesmanager.core.business.services.user.GroupService;
import com.salesmanager.core.model.user.Group;
import com.salesmanager.core.model.user.GroupType;
import com.salesmanager.shop.admin.model.web.Menu;
import org.springframework.stereotype.Controller;
i... | cwe | CWE-639 | Java |
#include "extensions/filters/common/expr/context.h"
#include "absl/strings/numbers.h"
#include "absl/time/time.h"
namespace Envoy {
namespace Extensions {
namespace Filters {
namespace Common {
namespace Expr {
namespace {
absl::optional<CelValue> convertHeaderEntry(const Http::HeaderEntry* header) {
if (header =... | cwe | CWE-400 | C/C++ |
function g(U,
X,t){F.innerHTML="";var E=l.model.getDescendants(l.model.getRoot()),K=u.value.toLowerCase(),T=B.checked?new RegExp(K):null,P=null;z=null;p!=K&&(p=K,q=null,y=!1);var Q=null==q;if(0<K.length){if(y){y=!1;for(var S,Y=0;Y<b.pages.length;Y++)if(b.currentPage==b.pages[Y]){S=Y;break}U=(S+1)%b.pages.length;q=null;... | cwe | CWE-94 | JavaScript |
/* Library for accessing X3F Files
----------------------------------------------------------------
BSD-style License
----------------------------------------------------------------
* Copyright (c) 2010, Roland Karlsson (roland@proxel.se)
* All rights reserved.
*
* Redistribution and use in source and binary forms, ... | cwe | CWE-125 | C/C++ |
int nf_ct_frag6_gather(struct net *net, struct sk_buff *skb, u32 user)
{
struct net_device *dev = skb->dev;
int fhoff, nhoff, ret;
struct frag_hdr *fhdr;
struct frag_queue *fq;
struct ipv6hdr *hdr;
u8 prevhdr;
/* Jumbo payload inhibits frag. header */
if (ipv6_hdr(skb)->payload_len == 0) {
pr_debug("paylo... | cwe | CWE-787 | C/C++ |
static void l2cap_do_create(struct l2cap_chan *chan, int result,
u8 local_amp_id, u8 remote_amp_id)
{
BT_DBG("chan %p state %s %u -> %u", chan, state_to_string(chan->state),
local_amp_id, remote_amp_id);
chan->fcs = L2CAP_FCS_NONE;
/* Outgoing channel on AMP */
if (chan->state == BT_CONNECT) {
if... | cwe | CWE-787 | Unknown |
ves_icall_System_Array_FastCopy (MonoArray *source, int source_idx, MonoArray* dest, int dest_idx, int length)
{
int element_size;
void * dest_addr;
void * source_addr;
MonoClass *src_class;
MonoClass *dest_class;
int i;
MONO_ARCH_SAVE_REGS;
if (source->obj.vtable->klass->rank != dest->obj.vtable->klass->rank... | cwe | CWE-264 | C/C++ |
function LocalMedia(opts) {
WildEmitter.call(this)
const config = this.config = {
audioFallback: false,
logger: mockconsole,
}
let item
for (item in opts) {
if (Object.prototype.hasOwnProperty.call(opts, item)) {
this.config[item] = opts[item]
}
}
this.logger = config.logger
this._log = this.logge... | cwe | CWE-200 | JavaScript |
'use strict';
// Load modules
const Boom = require('boom');
const Cryptiles = require('cryptiles');
const Hoek = require('hoek');
const Iron = require('iron');
const Items = require('items');
// Declare internals
const internals = {
version: '2'
};
exports = module.exports = internals.Socket = function (ws, ... | cwe | CWE-287 | JavaScript |
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
{
AVFilterContext *ctx = inlink->dst;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
uint32_t plane_checksum[4] = {0}, checksum = 0;
int i, plane, vsub = desc->log2_chroma_h;
for (plane = 0; plane < 4 && frame->... | cwe | CWE-119 | C/C++ |
'use strict'
const crypto = require('crypto')
const fp = require('fastify-plugin')
const defaultOptions = {
keys: [],
auth: undefined,
errorResponse (err) {
return { error: err.message }
},
contentType: undefined,
bearerType: 'Bearer'
}
function verifyBearerAuthFactory (options) {
const _options = ... | cwe | CWE-203 | JavaScript |
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt SVG module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commerc... | cwe | CWE-125 | C/C++ |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | cwe | CWE-352 | Python |
/*
* relay-websocket.c - websocket server functions for relay plugin (RFC 6455)
*
* Copyright (C) 2013-2021 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
* WeeChat is free software; you can redistribute it and/or modify
* it under the terms of the GNU ... | cwe | CWE-125 | C/C++ |
bool ms_deliver_verify_authorizer(Connection *con, int peer_type,
int protocol, bufferlist& authorizer, bufferlist& authorizer_reply,
bool& isvalid, CryptoKey& session_key) {
for (list<Dispatcher*>::iterator p = dispatchers.begin();
p != dispatchers.end();
++p) {
if ((*p)->ms_verify_author... | cwe | CWE-284 | Unknown |
int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
{
bool pr = false;
u32 msr = msr_info->index;
u64 data = msr_info->data;
switch (msr) {
case MSR_AMD64_NB_CFG:
case MSR_IA32_UCODE_REV:
case MSR_IA32_UCODE_WRITE:
case MSR_VM_HSAVE_PA:
case MSR_AMD64_PATCH_LOADER:
case MSR_AMD64_BU_CFG2... | cwe | CWE-399 | C/C++ |
def load_yaml(self, file):
data = yaml.load(file)
for concept_type_key, vocabs in data.items():
concept_type = {
'classification_schemes': ClassificationRecord,
'subject_schemes': AuthorityRecord,
}.get(concept_type_key)
for scheme_code... | cwe | CWE-502 | Python |
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/webui/nearby_share/nearby_share_dialog_ui.h"
#include <string>
#include "base/strings/string_split.h"
#include "chrome/brows... | cwe | CWE-416 | C/C++ |
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
{
unsigned x, y;
AVFilterContext *ctx = inlink->dst;
VignetteContext *s = ctx->priv;
AVFilterLink *outlink = inlink->dst->outputs[0];
AVFrame *out;
out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
if (!out) {
av_f... | cwe | CWE-119 | C/C++ |
$pfTaskJob->update($input);
$tasks_id = $data['plugin_glpiinventory_tasks_id'];
}
} else {
// case 2: if not exist, create a new task + taskjob
$this->getFromDB($packages_id);
//Add the new task
$input = [
'name' ... | cwe | CWE-89 | PHP |
xfs_attr3_leaf_add_work(
struct xfs_buf *bp,
struct xfs_attr3_icleaf_hdr *ichdr,
struct xfs_da_args *args,
int mapindex)
{
struct xfs_attr_leafblock *leaf;
struct xfs_attr_leaf_entry *entry;
struct xfs_attr_leaf_name_local *name_loc;
struct xfs_attr_leaf_name_remote *name_rmt;
struct xfs_mount *mp;
int t... | cwe | CWE-19 | C/C++ |
function initLink($p) {
// navTab
$("a[target=navTab]", $p).each(function() {
$(this).click(function(event) {
var $this = $(this);
var title = $this.attr("title") || $this.text();
if(title){
title = title.replace(/<[^>]*>/gi,"");
}
... | cwe | CWE-79 | JavaScript |
Status UncompressElement(const CompressedElement& compressed,
std::vector<Tensor>* out) {
int num_components = compressed.component_metadata_size();
out->clear();
out->reserve(num_components);
// Step 1: Prepare the memory that we will uncompress into.
std::vector<struct iovec> iov(n... | cwe | CWE-476 | C/C++ |
private static void verifyPeerName(PGStream stream, Properties info, SSLSocket newConnection)
throws PSQLException {
HostnameVerifier hvn;
String sslhostnameverifier = PGProperty.SSL_HOSTNAME_VERIFIER.get(info);
if (sslhostnameverifier == null) {
hvn = PGjdbcHostnameVerifier.INSTANCE;
sslh... | cwe | CWE-665 | Java |
static int pop_sync_mailbox (CONTEXT *ctx, int *index_hint)
{
int i, j, ret = 0;
char buf[LONG_STRING];
POP_DATA *pop_data = (POP_DATA *)ctx->data;
progress_t progress;
#ifdef USE_HCACHE
header_cache_t *hc = NULL;
#endif
pop_data->check_time = 0;
FOREVER
{
if (pop_reconnect (ctx) < 0)
return... | cwe | CWE-119 | C/C++ |
/*
* Bittorrent Client using Qt and libtorrent.
* Copyright (C) 2014 Vladimir Golovnev <glassez@yandex.ru>
*
* 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 Lic... | cwe | CWE-20 | C/C++ |
/* Copyright (c) 2019 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "brave/browser/net/brave_ad_block_tp_networ... | cwe | CWE-200 | C/C++ |
def remove_acl_roles_remote(params, request, session)
if not allowed_for_local_cluster(session, Permissions::GRANT)
return 403, 'Permission denied'
end
errors = ""
params.each { |name, value|
if name.index("role-") == 0
out, errout, retval = run_cmd(
session, PCS, "acl", "role", "delete", ... | cwe | CWE-384 | Ruby |
@require_server_admin
@has_request_variables
def stats_for_realm(request: HttpRequest, realm_str: str) -> HttpResponse:
try:
realm = get_realm(realm_str)
except Realm.DoesNotExist:
return HttpResponseNotFound(f"Realm {realm_str} does not exist")
return render_stats(
request,
... | cwe | CWE-79 | Python |
long Chapters::Edition::ParseAtom(
IMkvReader* pReader,
long long pos,
long long size)
{
if (!ExpandAtomsArray())
return -1;
Atom& a = m_atoms[m_atoms_count++];
a.Init();
return a.Parse(pReader, pos, size);
} | cwe | CWE-119 | C/C++ |
package com.salesmanager.core.model.catalog.product.price;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* Transient entity used to display
* different price information in the catalogue
* @author Carl Samson
*
*/
public class FinalPrice implements Se... | cwe | CWE-639 | Java |
static int dwc3_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
{
struct property_entry *p = (struct property_entry *)id->driver_data;
struct dwc3_pci *dwc;
struct resource res[2];
int ret;
struct device *dev = &pci->dev;
ret = pcim_enable_device(pci);
if (ret) {
dev_err(dev, "failed to en... | cwe | CWE-401 | Unknown |
/*
* Copyright (c) 2018. Abstrium SAS <team (at) pydio.com>
* This file is part of Pydio Cells.
*
* Pydio Cells 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 License, or
... | cwe | CWE-209 | Go |
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chooser_controller/title_util.h"
#include "base/strings/utf_string_conversions.h"
#include "components/permissions/chooser_title... | cwe | CWE-732 | C/C++ |
ActionReply Smb4KMountHelper::unmount(const QVariantMap &args)
{
ActionReply reply;
// The mountpoint is a unique and can be used to
// find the share.
reply.addData("mh_mountpoint", args["mh_mountpoint"]);
// Check if the mountpoint is valid and the file system is
// also correct.
bool mountpoint_ok = f... | cwe | CWE-20 | Unknown |
static struct inet_frag_queue *inet_frag_intern(struct netns_frags *nf,
struct inet_frag_queue *qp_in, struct inet_frags *f,
void *arg)
{
struct inet_frag_bucket *hb;
struct inet_frag_queue *qp;
unsigned int hash;
read_lock(&f->lock); /* Protects against hash rebuild */
/*
* While we stayed w/o the lock oth... | cwe | CWE-362 | C/C++ |
) => {
if (!info || !info.sessionToken) {
throw new Parse.Error(
Parse.Error.INVALID_SESSION_TOKEN,
'Invalid session token'
);
}
const sessionToken = info.sessionToken;
const selectedFields = getFieldNames(queryInfo)
.filter(field => field.startsWith(keysPrefix))
.map(field => field.... | cwe | CWE-863 | JavaScript |
function initialize() {
destroy();
if (! window.Clipboard) {
// Insert the content editable at the top to avoid scrolling down in the board view
pasteCatcher = document.createElement('div');
pasteCatcher.id = 'screenshot-pastezone';
pasteCatcher.contentEd... | cwe | CWE-79 | JavaScript |
const bootbox = require('bootbox');
require('./Requisitions');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(function() {
'use strict';
angular.module('onms-requisitions')
/**
* @ngdoc service
* @name SynchronizeService
* @module onms-requisitions
*... | cwe | CWE-352 | Java |
public function setRemoteUrl($name, $url, array $params = NULL)
{
$this->run('remote', 'set-url', $params, $name, $url);
return $this;
} | cwe | CWE-88 | PHP |
static void l2cap_do_start(struct l2cap_chan *chan)
{
struct l2cap_conn *conn = chan->conn;
if (conn->hcon->type == LE_LINK) {
l2cap_le_start(chan);
return;
}
if (!(conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT)) {
l2cap_request_info(conn);
return;
}
if (!(conn->info_state & L2CAP_INFO_FEAT_MASK_REQ... | cwe | CWE-327 | Unknown |
fname_match(
regmatch_T *rmp,
char_u *name,
int ignore_case) // when TRUE ignore case, when FALSE use 'fic'
{
char_u *match = NULL;
char_u *p;
if (name != NULL)
{
// Ignore case when 'fileignorecase' or the argument is set.
rmp->rm_ic = p_fic || ignore_case;
if (vim_regexec(rmp, name, ... | cwe | CWE-476 | C/C++ |
@SuppressLint("SdCardPath")
private void startNewUpload(
User user,
List<String> requestedUploads,
boolean onWifiOnly,
boolean whileChargingOnly,
NameCollisionPolicy nameCollisionPolicy,
int localAction,
boolean isCreateRemoteFolder,
int createdBy,
... | cwe | CWE-22 | Java |
_pickle_PicklerMemoProxy_copy_impl(PicklerMemoProxyObject *self)
/*[clinic end generated code: output=bb83a919d29225ef input=b73043485ac30b36]*/
{
Py_ssize_t i;
PyMemoTable *memo;
PyObject *new_memo = PyDict_New();
if (new_memo == NULL)
return NULL;
memo = self->pickler->memo;
for (i = ... | cwe | CWE-190 | Unknown |
protected function getCheckFileQuery()
{
global $zdb;
$select = $zdb->select(self::TABLE);
$select->columns(
array(
'picture',
'format'
)
);
$select->where(self::PK . ' = ' . $this->db_id);
return $select;
} | cwe | CWE-89 | PHP |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-122 | 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 |
newSession(userInfo, context, sessionType, sessionParams) {
if (sessionType !== ApiSession.typeId) {
throw new Error("SessionType must be ApiSession.");
}
const options = {};
if (this.token) {
options.headers = {
authorization: "Bearer " + this.token,
};
}
return { s... | cwe | CWE-918 | JavaScript |
/*
* Copyright (C) 2004-2018 ZNC, see the NOTICE file for details.
*
* 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 requi... | cwe | CWE-20 | C/C++ |
width: withinElement.outerWidth(),
height: withinElement.outerHeight()
};
}
};
$.fn.position = function( options ) {
if ( !options || !options.of ) {
return _position.apply( this, arguments );
}
// Make a copy, we don't want to modify arguments
options = $.extend( {}, options );
var atOffset, targetWidt... | cwe | CWE-79 | JavaScript |
void Compute(OpKernelContext* context) override {
// There are two steps when calculating gradient for FractionalMaxPool.
// 1) Walk through the process of calculating fractional pooling given
// pooling region; however, in the process, keep track of where the max
// element comes from. (arg_max)
... | cwe | CWE-703 | C/C++ |
decrypt(MPI output, MPI a, MPI b, ELG_secret_key *skey )
{
MPI t1 = mpi_alloc_secure( mpi_get_nlimbs( skey->p ) );
mpi_normalize (a);
mpi_normalize (b);
/* output = b/(a^x) mod p */
mpi_powm( t1, a, skey->x, skey->p );
mpi_invm( t1, t1, skey->p );
mpi_mulm( output, b, t1, skey->p );
#if 0
... | cwe | CWE-200 | Unknown |
// 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 |
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 1992 obz under the linux copyright
*
* Dynamic diacritical handling - aeb@cwi.nl - Dec 1993
* Dynamic keymap and string allocation - aeb@cwi.nl - May 1994
* Restrict VT switching via ioctl() - grif@cs.ucr.edu - Dec 1995
* Some code moved for less code du... | cwe | CWE-362 | C/C++ |
TfLiteStatus EvalSum(TfLiteContext* context, TfLiteNode* node) {
OpContext op_context(context, node);
ruy::profiler::ScopeLabel label("Sum");
const auto& input = op_context.input;
const auto& output = op_context.output;
const bool same_scale =
(input->params.scale == output->params.scale &&
input... | cwe | CWE-125 | C/C++ |
auth_shadow (
/* PARAMETERS */
const char *login, /* I: plaintext authenticator */
const char *password, /* I: plaintext password */
const char *service __attribute__((unused)),
const char *realm __attribute__((unused))
/* END PARAMETERS */
)
{
/*******************************************************... | cwe | CWE-189 | Unknown |
static void voutf(struct GlobalConfig *config,
const char *prefix,
const char *fmt,
va_list ap)
{
size_t width = (79 - strlen(prefix));
if(!config->mute) {
size_t len;
char *ptr;
char *print_buffer;
print_buffer = curlx_mvaprintf(fmt, ap);
i... | cwe | CWE-125 | C/C++ |
public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
Integer sc = (Integer) request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE);
String msg = (String) request.getAttribute(RequestDispatcher.ERROR_MESSAGE);
Throwable err = (Th... | cwe | CWE-79 | Java |
package com.salesmanager.shop.admin.controller.orders;
import com.salesmanager.core.business.services.catalog.product.PricingService;
import com.salesmanager.core.business.services.customer.CustomerService;
import com.salesmanager.core.business.services.order.OrderService;
import com.salesmanager.core.business.service... | cwe | CWE-79 | Java |
jp2_box_t *jp2_box_get(jas_stream_t *in)
{
jp2_box_t *box;
jp2_boxinfo_t *boxinfo;
jas_stream_t *tmpstream;
uint_fast32_t len;
uint_fast64_t extlen;
bool dataflag;
box = 0;
tmpstream = 0;
if (!(box = jas_malloc(sizeof(jp2_box_t)))) {
goto error;
}
box->ops = &jp2_boxinfo_unk.ops;
if (jp2_getuint32(in, &... | cwe | CWE-476 | C/C++ |
'use strict'
const Buffer = require('safe-buffer').Buffer
const crypto = require('crypto')
const Transform = require('stream').Transform
const SPEC_ALGORITHMS = ['sha256', 'sha384', 'sha512']
const BASE64_REGEX = /^[a-z0-9+/]+(?:=?=?)$/i
const SRI_REGEX = /^([^-]+)-([^?]+)([?\S*]*)$/
const STRICT_SRI_REGEX = /^([^-... | cwe | CWE-400 | Java |
Status ComputeConv2DDimension(const Conv2DParameters& params,
const Tensor& input, const Tensor& filter,
Conv2DDimensions* dimensions) {
// Check that 2D convolution input and filter have exactly 4 dimensions.
TF_REQUIRES(input.dims() == 4,
e... | cwe | CWE-369 | Unknown |
_gnutls_recv_handshake_header (gnutls_session_t session,
gnutls_handshake_description_t type,
gnutls_handshake_description_t * recv_type)
{
int ret;
uint32_t length32 = 0;
uint8_t *dataptr = NULL; /* for realloc */
size_t handshake_header_size = HANDSHAKE_HEADER_SIZE;
/* if we have data i... | cwe | CWE-189 | Unknown |
/*
===========================================================================
Copyright (C) 1999 - 2005, Id Software, Inc.
Copyright (C) 2000 - 2013, Raven Software, Inc.
Copyright (C) 2001 - 2013, Activision, Inc.
Copyright (C) 2005 - 2015, ioquake3 contributors
Copyright (C) 2013 - 2015, OpenJK contributors
This fi... | cwe | CWE-254 | C/C++ |
static struct bpf_verifier_state *push_stack(struct bpf_verifier_env *env,
int insn_idx, int prev_insn_idx)
{
struct bpf_verifier_state *cur = env->cur_state;
struct bpf_verifier_stack_elem *elem;
int err;
elem = kzalloc(sizeof(struct bpf_verifier_stack_elem), GFP_KERNEL);
if (!elem)
goto err;
elem-... | cwe | CWE-189 | Unknown |
/*
* OpenEXR (.exr) image decoder
* Copyright (c) 2006 Industrial Light & Magic, a division of Lucas Digital Ltd. LLC
* Copyright (c) 2009 Jimmy Christensen
*
* B44/B44A, Tile, UINT32 added by Jokyo Images support by CNC - French National Center for Cinema
*
* This file is part of FFmpeg.
*
* FFmpeg is free so... | cwe | CWE-129 | C/C++ |
void exit_io_context(void)
{
struct io_context *ioc;
task_lock(current);
ioc = current->io_context;
current->io_context = NULL;
task_unlock(current);
if (atomic_dec_and_test(&ioc->nr_tasks)) {
if (ioc->aic && ioc->aic->exit)
ioc->aic->exit(ioc->aic);
cfq_exit(ioc);
put_io_context(ioc);
}
} | cwe | CWE-400 | C/C++ |
long Tracks::Parse()
{
assert(m_trackEntries == NULL);
assert(m_trackEntriesEnd == NULL);
const long long stop = m_start + m_size;
IMkvReader* const pReader = m_pSegment->m_pReader;
int count = 0;
long long pos = m_start;
while (pos < stop)
{
long long id, size;
const lon... | cwe | CWE-119 | C/C++ |
void silk_NLSF_stabilize(
opus_int16 *NLSF_Q15, /* I/O Unstable/stabilized normalized LSF vector in Q15 [L] */
const opus_int16 *NDeltaMin_Q15, /* I Min distance vector, NDeltaMin_Q15[L] must be >= 1 [L+1] */
const opus_int L /* I Number... | cwe | CWE-190 | C/C++ |
// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
//
// This file is provided under a dual BSD/GPLv2 license. When using or
// redistributing this file, you may do so under either license.
//
// Copyright(c) 2018 Intel Corporation. All rights reserved.
//
// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
... | cwe | CWE-400 | C/C++ |
TPMI_ALG_SYM_OBJECT_Unmarshal(TPMI_ALG_SYM_OBJECT *target, BYTE **buffer, INT32 *size, BOOL allowNull)
{
TPM_RC rc = TPM_RC_SUCCESS;
if (rc == TPM_RC_SUCCESS) {
rc = TPM_ALG_ID_Unmarshal(target, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
switch (*target) {
#if ALG_AES
case TPM_ALG_AES:
#endif
... | cwe | CWE-787 | Unknown |
e_mail_formatter_format_security_header (EMailFormatter *formatter,
EMailFormatterContext *context,
GString *buffer,
EMailPart *part,
guint32 flags)
{
cons... | cwe | CWE-347 | Unknown |
_handle_single_connection (int sockin, int sockout)
{
const char *plugin_name;
int ret = -1, r;
struct connection *conn;
int nworkers = threads ? threads : DEFAULT_PARALLEL_REQUESTS;
pthread_t *workers = NULL;
if (backend->thread_model (backend) < NBDKIT_THREAD_MODEL_PARALLEL ||
nworkers == 1)
nw... | cwe | CWE-406 | Unknown |
function ame_ajax_author_save( cat_id, typenumber ) {
var newauthor = jQuery("select#author-" + cat_id).prop('value');
var ame_sack = new sack( ajaxurl );
ame_sack.execute = 1;
ame_sack.method = 'POST';
ame_sack.setVar( "action", "ame_save_author" );
ame_sack.setVar( "category_id", cat_id );
ame_sack.setVar( "ne... | cwe | CWE-352 | JavaScript |
/*
* 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-732 | Java |
void Compute(OpKernelContext* ctx) override {
try {
const Tensor& input = ctx->input(kInputTensorIndex);
const Tensor& input_min_vec = ctx->input(kInputMinVecIndex);
float* input_min_vec_data = (float*)const_cast<void*>(
static_cast<const void*>(input_min_vec.flat<float>().data()));
... | cwe | CWE-20 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.