code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
/*
* 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 |
static int raw_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
{
struct inet_sock *inet = inet_sk(sk);
struct net *net = sock_net(sk);
struct ipcm_cookie ipc;
struct rtable *rt = NULL;
struct flowi4 fl4;
int free = 0;
__be32 daddr;
__be32 saddr;
u8 tos;
int err;
struct ip_options_data opt_copy;
... | cwe | CWE-362 | C/C++ |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
"""
Frappe - Low Code Open Source Framework in Python and JS
Frappe, pronounced fra-pay, is a full stack, batteries-included, web
framework written in Python and Javascript with MariaDB as the database.
It is the framew... | cwe | CWE-79 | Python |
xmlDictCreate(void) {
xmlDictPtr dict;
if (!xmlDictInitialized)
if (!xmlInitializeDict())
return(NULL);
#ifdef DICT_DEBUG_PATTERNS
fprintf(stderr, "C");
#endif
dict = xmlMalloc(sizeof(xmlDict));
if (dict) {
dict->ref_counter = 1;
dict->size = MIN_DICT_SIZE;
d... | cwe | CWE-399 | Unknown |
int ZlibOutStream::overrun(int itemSize, int nItems)
{
#ifdef ZLIBOUT_DEBUG
vlog.debug("overrun");
#endif
if (itemSize > bufSize)
throw Exception("ZlibOutStream overrun: max itemSize exceeded");
checkCompressionLevel();
while (end - ptr < itemSize) {
zs->next_in = start;
zs->avail_in = ptr - star... | cwe | CWE-122 | C/C++ |
def stream_exists_backend(request, user_profile, stream_id, autosubscribe):
# type: (HttpRequest, UserProfile, int, bool) -> HttpResponse
try:
stream = get_and_validate_stream_by_id(stream_id, user_profile.realm)
except JsonableError:
stream = None
result = {"exists": bool(stream)}
i... | cwe | CWE-863 | Python |
public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int streamDependency,
short weight, boolean exclusive, int padding, boolean endOfStream) throws Http2Exception {
Http2Stream stream = connection.stream(streamId);
boolean allowHalfClosedRemot... | cwe | CWE-444 | Java |
IDNSpoofChecker::IDNSpoofChecker() {
UErrorCode status = U_ZERO_ERROR;
checker_ = uspoof_open(&status);
if (U_FAILURE(status)) {
checker_ = nullptr;
return;
}
uspoof_setRestrictionLevel(checker_, USPOOF_HIGHLY_RESTRICTIVE);
SetAllowedUnicodeSet(&status);
int32_t checks = uspoof_getChecks(check... | cwe | CWE-19 | C/C++ |
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholi... | cwe | CWE-125 | C/C++ |
package restful
// Copyright 2013 Ernest Micklei. All rights reserved.
// Use of this source code is governed by a license
// that can be found in the LICENSE file.
import (
"regexp"
"strconv"
"strings"
)
// CrossOriginResourceSharing is used to create a Container Filter that implements CORS.
// Cross-origin reso... | cwe | CWE-639 | Go |
void ring_buffer_reset_online_cpus(struct trace_buffer *buffer)
{
struct ring_buffer_per_cpu *cpu_buffer;
int cpu;
for_each_online_buffer_cpu(buffer, cpu) {
cpu_buffer = buffer->buffers[cpu];
atomic_inc(&cpu_buffer->resize_disabled);
atomic_inc(&cpu_buffer->record_disabled);
}
/* Make sure all commits hav... | cwe | CWE-362 | Unknown |
/* tfm.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) a... | cwe | CWE-326 | C/C++ |
protected TlsSecret safeDecryptPreMasterSecret(TlsCryptoParameters cryptoParams, PrivateKey rsaServerPrivateKey,
byte[] encryptedPreMasterSecret)
{
SecureRandom secureRandom = crypto.getSecureRandom();
/*
* RFC 5246 7.4.7.1.
*/
... | cwe | CWE-203 | Java |
bool extractPages (const char *srcFileName, const char *destFileName) {
char pathName[4096];
GooString *gfileName = new GooString (srcFileName);
PDFDoc *doc = new PDFDoc (gfileName, NULL, NULL, NULL);
if (!doc->isOk()) {
error(errSyntaxError, -1, "Could not extract page(s) from damaged file ('{0:s}')", src... | cwe | CWE-20 | Unknown |
static ssize_t show_crash_notes_size(struct device *dev,
struct device_attribute *attr,
char *buf)
{
ssize_t rc;
rc = sprintf(buf, "%zu\n", sizeof(note_buf_t));
return rc;
} | cwe | CWE-787 | Unknown |
static void exitErrorHandler(jpeg_common_struct *error) {
j_decompress_ptr cinfo = (j_decompress_ptr)error;
str_src_mgr * src = (struct str_src_mgr *)cinfo->src;
src->abort = true;
} | cwe | CWE-20 | C/C++ |
void createDirectory(const string &path) const {
// We do not use makeDirTree() here. If an attacker creates a directory
// just before we do, then we want to abort because we want the directory
// to have specific permissions.
if (mkdir(path.c_str(), parseModeString("u=rwx,g=rx,o=rx")) == -1) {
int e = errn... | cwe | CWE-59 | Unknown |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2005-2012
*
* This file is part of GPAC / MPEG2-TS sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as publishe... | cwe | CWE-416 | C/C++ |
static int sanitize_ptr_alu(struct bpf_verifier_env *env,
struct bpf_insn *insn,
const struct bpf_reg_state *ptr_reg,
const struct bpf_reg_state *off_reg,
struct bpf_reg_state *dst_reg,
struct bpf_sanitize_info *info,
const bool commit_window)
{
struct bpf_insn_aux_data *aux =... | cwe | CWE-843 | C/C++ |
TfLiteStatus EqualEval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input1 = GetInput(context, node, kInputTensor1);
const TfLiteTensor* input2 = GetInput(context, node, kInputTensor2);
TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
bool requires_broadcast = !HaveSameShapes(i... | cwe | CWE-125 | C/C++ |
#include "CMOS.h"
#include "Process.h"
#include "StdLib.h"
#include <AK/Assertions.h>
#include <AK/kstdio.h>
#include <Kernel/Arch/i386/CPU.h>
#include <Kernel/FileSystem/Inode.h>
#include <Kernel/Multiboot.h>
#include <Kernel/VM/AnonymousVMObject.h>
#include <Kernel/VM/InodeVMObject.h>
#include <Kernel/VM/MemoryManage... | cwe | CWE-269 | C/C++ |
GDataFileError GDataWapiFeedProcessor::FeedToFileResourceMap(
const std::vector<DocumentFeed*>& feed_list,
FileResourceIdMap* file_map,
int64* feed_changestamp,
FeedToFileResourceMapUmaStats* uma_stats) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(uma_stats);
GDataFileError err... | cwe | CWE-399 | C/C++ |
delete_port(struct seq_oss_devinfo *dp)
{
if (dp->port < 0)
return 0;
debug_printk(("delete_port %i\n", dp->port));
return snd_seq_event_port_detach(dp->cseq, dp->port);
} | cwe | CWE-415 | Unknown |
void *nlmsg_reserve(struct nl_msg *n, size_t len, int pad)
{
void *buf = n->nm_nlh;
size_t nlmsg_len = n->nm_nlh->nlmsg_len;
size_t tlen;
tlen = pad ? ((len + (pad - 1)) & ~(pad - 1)) : len;
if ((tlen + nlmsg_len) > n->nm_size)
n->nm_nlh->nlmsg_len += tlen;
if (tlen > len)
mems... | cwe | CWE-190 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-119 | C/C++ |
function g_sendError(channel: ServerSecureChannelLayer, message: Message, ResponseClass: any, statusCode: StatusCode): void {
const response = new ResponseClass({
responseHeader: { serviceResult: statusCode }
});
return channel.send_response("MSG", response, message);
} | cwe | CWE-400 | JavaScript |
bool DebuggerDetachFunction::RunAsync() {
std::unique_ptr<Detach::Params> params(Detach::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
CopyDebuggee(&debuggee_, params->target);
if (!InitClientHost())
return false;
client_host_->Close();
SendResponse(true);
return true;
} | cwe | CWE-20 | C/C++ |
int main(int argc, char *argv[])
{
FILE *iplist = NULL;
plist_t root_node = NULL;
char *plist_out = NULL;
uint32_t size = 0;
int read_size = 0;
char *plist_entire = NULL;
struct stat filestats;
options_t *options = parse_arguments(argc, argv);
if (!options)
{
print_usage... | cwe | CWE-125 | Unknown |
static inline bool nested_vmx_prepare_msr_bitmap(struct kvm_vcpu *vcpu,
struct vmcs12 *vmcs12)
{
int msr;
struct page *page;
unsigned long *msr_bitmap_l1;
unsigned long *msr_bitmap_l0 = to_vmx(vcpu)->nested.vmcs02.msr_bitmap;
/*
* pred_cmd & spec_ctrl are trying to verify two things:
*
* 1. L0 gave a ... | cwe | CWE-863 | C/C++ |
cssp_read_tsrequest(STREAM token, STREAM pubkey)
{
STREAM s;
int length;
int tagval;
s = tcp_recv(NULL, 4);
if (s == NULL)
return False;
if (s->p[0] != (BER_TAG_SEQUENCE | BER_TAG_CONSTRUCTED))
{
logger(Protocol, Error,
"cssp_read_tsrequest(), expected BER_TAG_SEQUENCE|BER_TAG_CONSTRUCTED, ... | cwe | CWE-119 | C/C++ |
void luaD_call (lua_State *L, StkId func, int nresults) {
lua_CFunction f;
retry:
switch (ttypetag(s2v(func))) {
case LUA_VCCL: /* C closure */
f = clCvalue(s2v(func))->f;
goto Cfunc;
case LUA_VLCF: /* light C function */
f = fvalue(s2v(func));
Cfunc: {
int n; /* number of r... | cwe | CWE-125 | Unknown |
long long Segment::CreateInstance(
IMkvReader* pReader,
long long pos,
Segment*& pSegment)
{
assert(pReader);
assert(pos >= 0);
pSegment = NULL;
long long total, available;
const long status = pReader->Length(&total, &available);
if (status < 0) //error
return status;... | cwe | CWE-119 | C/C++ |
static int nbd_negotiate_read(QIOChannel *ioc, void *buffer, size_t size)
{
ssize_t ret;
guint watch;
assert(qemu_in_coroutine());
/* Negotiation are always in main loop. */
watch = qio_channel_add_watch(ioc,
G_IO_IN,
nbd_negotiate_... | cwe | CWE-20 | C/C++ |
// Copyright 2015 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 gccgo
// +build !aix
package unix
import "syscall"
// We can't use the gc-syntax .s files for gccgo. On the plus side
// much of the functionality ... | cwe | CWE-287 | Go |
static double OptimalTau(const ssize_t *histogram,const double max_tau,
const double min_tau,const double delta_tau,const double smooth_threshold,
short *extrema)
{
IntervalTree
**list,
*node,
*root;
MagickBooleanType
peak;
double
average_tau,
*derivative,
*second_derivative,
... | cwe | CWE-369 | Unknown |
function ft(t){return q(t)?new et(t):B(t)?new it(t):F(t)?new rt(t):void 0} | cwe | CWE-200 | JavaScript |
const express = require('express');
const cb = require('cb');
const createError = require('http-errors');
const debug = require('../lib/debug')('auth');
const { get: getConfig } = require('../lib/config');
const { get: getClient } = require('../lib/client');
const { requiresAuth } = require('./requiresAuth');
const at... | cwe | CWE-384 | JavaScript |
agent_scd_apdu (const char *hexapdu, unsigned int *r_sw)
{
gpg_error_t err;
/* Start the agent but not with the card flag so that we do not
autoselect the openpgp application. */
err = start_agent (NULL, 0);
if (err)
return err;
if (!hexapdu)
{
err = assuan_transact (agent_ctx, "SCD RESE... | cwe | CWE-20 | Unknown |
count: $( '.wrap .theme-count' ),
// The live themes count
liveThemeCount: 0,
initialize: function( options ) {
var self = this;
// Set up parent
this.parent = options.parent;
// Set current view to [grid]
this.setView( 'grid' );
// Move the active theme to the beginning of the collection
self.cur... | cwe | CWE-352 | JavaScript |
package com.salesmanager.shop.admin.controller.tax;
import com.salesmanager.core.business.services.tax.TaxService;
import com.salesmanager.core.model.merchant.MerchantStore;
import com.salesmanager.core.model.tax.TaxConfiguration;
import com.salesmanager.shop.admin.model.web.Menu;
import com.salesmanager.shop.constant... | cwe | CWE-639 | Java |
static Image *ExtractPostscript(Image *image,const ImageInfo *image_info,
MagickOffsetType PS_Offset,ssize_t PS_Size,ExceptionInfo *exception)
{
char
postscript_file[MagickPathExtent];
const MagicInfo
*magic_info;
FILE
*ps_file;
ImageInfo
*clone_info;
Image
*image2;
un... | cwe | CWE-400 | Unknown |
m,!1)});l.className="geBtn";e.appendChild(l);l=mxUtils.button(mxResources.get("apply"),function(){v(b.editor.graph,f,!0)});l.className="geBtn gePrimaryBtn";e.appendChild(l);b.editor.cancelFirst||e.appendChild(u);c.appendChild(e);D.appendChild(c);t.appendChild(D);this.container=t},CustomDialog=function(b,f,l,d,u,t,D,c,e... | cwe | CWE-20 | JavaScript |
/**
* Copyright (c) 2006-2017, JGraph Ltd
* Copyright (c) 2006-2017, Gaudenz Alder
*/
(function()
{
if (typeof html4 !== 'undefined')
{
/**
* Enables paste from Lucidchart
*/
html4.ATTRIBS['span::data-lucid-content'] = 0;
html4.ATTRIBS['span::data-lucid-type'] = 0;
/**
* Enables custom fonts in... | cwe | CWE-78 | JavaScript |
read_16 (IOBUF inp)
{
unsigned short a;
a = iobuf_get_noeof (inp) << 8;
a |= iobuf_get_noeof (inp);
return a;
} | cwe | CWE-20 | Unknown |
static int complete_emulated_mmio(struct kvm_vcpu *vcpu)
{
struct kvm_run *run = vcpu->run;
struct kvm_mmio_fragment *frag;
unsigned len;
BUG_ON(!vcpu->mmio_needed);
/* Complete previous fragment */
frag = &vcpu->mmio_fragments[vcpu->mmio_cur_fragment];
len = min(8u, frag->len);
if (!vcpu->mmio_is_write)
me... | cwe | CWE-120 | Unknown |
void WebGLRenderingContextBase::TexImageHelperDOMArrayBufferView(
TexImageFunctionID function_id,
GLenum target,
GLint level,
GLint internalformat,
GLsizei width,
GLsizei height,
GLsizei depth,
GLint border,
GLenum format,
GLenum type,
GLint xoffset,
GLint yoffset,
GL... | cwe | CWE-119 | C/C++ |
void TensorSliceReader::LoadShard(int shard) const {
CHECK_LT(shard, sss_.size());
if (sss_[shard] || !status_.ok()) {
return; // Already loaded, or invalid.
}
string value;
SavedTensorSlices sts;
const string fname = fnames_[shard];
VLOG(1) << "Reading meta data from file " << fname << "...";
Tabl... | cwe | CWE-190 | C/C++ |
/*
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2005-2008, Open Source Geospatial Foundation (OSGeo)
*
* 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 ... | cwe | CWE-20 | Java |
static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
{
struct sk_buff **pp = NULL;
struct packet_offload *ptype;
__be16 type = skb->protocol;
struct list_head *head = &offload_base;
int same_flow;
enum gro_result ret;
int grow;
if (!(skb->dev->features & NETIF_F_GRO))
goto no... | cwe | CWE-703 | Unknown |
package com.salesmanager.shop.model.catalog.product.attribute;
import java.io.Serializable;
import com.salesmanager.shop.model.entity.Entity;
public class ProductOption extends Entity implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private String code;
private Stri... | cwe | CWE-639 | Java |
StatusWith<QueryMetadataBitSet> CanonicalQuery::isValid(MatchExpression* root,
const QueryRequest& request) {
QueryMetadataBitSet unavailableMetadata{};
// There can only be one TEXT. If there is a TEXT, it cannot appear inside a NOR.
//
// Note ... | cwe | CWE-755 | Unknown |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
TfLiteTensor* output_values = GetOutput(context, node, kOutputValues);
TfLiteTensor* output_indexes = GetOutput(context, node, kOutputIndexes);
if (IsDynamicTensor(output_values)) {
TF_LITE_ENSURE_OK(context, ResizeOutput(context, node));
}
con... | cwe | CWE-125 | C/C++ |
package httpSwagger
import (
"html/template"
"net/http"
"path/filepath"
"regexp"
"sync"
swaggerFiles "github.com/swaggo/files"
"github.com/swaggo/swag"
)
// WrapHandler wraps swaggerFiles.Handler and returns http.HandlerFunc
var WrapHandler = Handler()
// Config stores httpSwagger configuration variables.
ty... | cwe | CWE-755 | Go |
int hidp_connection_add(struct hidp_connadd_req *req,
struct socket *ctrl_sock,
struct socket *intr_sock)
{
struct hidp_session *session;
struct l2cap_conn *conn;
struct l2cap_chan *chan = l2cap_pi(ctrl_sock->sk)->chan;
int ret;
ret = hidp_verify_sockets(ctrl_sock, intr_sock);
if (ret)
return ret;
conn... | cwe | CWE-843 | C/C++ |
/*
* Copyright 2000-2020 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | cwe | CWE-668 | Java |
function submitForm( event ) {
event.preventDefault();
const form = event.currentTarget;
const messageContainer = form.querySelector( '.form-block__message-container' );
if ( messageContainer ) {
messageContainer.remove();
}
setSubmitMessage( form, 'loading', formBlockData.i18n.isLoading );
... | cwe | CWE-352 | JavaScript |
/*
Copyright (c) 2013, David C Horton
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, publish, distribute,... | cwe | CWE-125 | C/C++ |
scoped_refptr<Image> CSSPaintValue::GetImage(
const ImageResourceObserver& client,
const Document& document,
const ComputedStyle&,
const FloatSize& target_size) {
if (!generator_) {
generator_ = CSSPaintImageGenerator::Create(
GetName(), document, paint_image_generator_observer_);
... | cwe | CWE-200 | C/C++ |
/*
* Copyright (C) 2018 The Android Open Source Project
*
* 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 applic... | cwe | CWE-20 | Java |
func (f *ScmpFilter) addRuleWrapper(call ScmpSyscall, action ScmpAction, exact bool, cond C.scmp_cast_t) error {
var length C.uint
if cond != nil {
length = 1
} else {
length = 0
}
var retCode C.int
if exact {
retCode = C.seccomp_rule_add_exact_array(f.filterCtx, action.toNative(), C.int(call), length, con... | cwe | CWE-20 | Go |
m.style.top=e+"px";m.style.left=g+"px";m.style.width=Math.max(0,q-3)+"px";m.style.height=Math.max(0,k-3)+"px";null!=c&&c.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(m):document.body.appendChild(m);return m};EditorUi.prototype.stringToCells=function(c){c=mxUtils.parseXml(c);var e=this... | cwe | CWE-20 | JavaScript |
function u(P,Q,S,Y,ba){function da(Ca){N.stop();var oa=document.createElement("table");oa.className="odFileListGrid";for(var Ba=null,Ea=0,Ka=0;null!=Ca&&Ka<Ca.length;Ka++){var Fa=Ca[Ka];if(1!=ja||!Fa.webUrl||0<Fa.webUrl.indexOf("sharepoint.com/sites/")||
0>Fa.webUrl.indexOf("sharepoint.com/")){var Ha=Fa.displayName||Fa... | cwe | CWE-94 | JavaScript |
# -*- 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-613 | Python |
/**
* Copyright (c) 2006-2012, JGraph Ltd
*/
// Workaround for handling named HTML entities in mxUtils.parseXml
// LATER: How to configure DOMParser to just ignore all entities?
(function()
{
var entities = [
['nbsp', '160'],
['shy', '173']
];
var parseXml = mxUtils.parseXml;
mxUtils.parseXml = function... | cwe | CWE-79 | JavaScript |
static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
union iwreq_data *wrqu, char *extra)
{
u8 _status = false;
int ret = 0;
struct adapter *padapter = rtw_netdev_priv(dev);
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct ndis_802_11_ssid ssid[RTW_SSID_SCAN_AMOUNT];
RT_TR... | cwe | CWE-787 | C/C++ |
Init_ossl_cipher(void)
{
#if 0
mOSSL = rb_define_module("OpenSSL");
eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
#endif
/* Document-class: OpenSSL::Cipher
*
* Provides symmetric algorithms for encryption and decryption. The
* algorithms that are available dep... | cwe | CWE-326 | Unknown |
function insertRank(name, description, connection)
{
var strQuery = "INSERT INTO rank VALUES('"+name+"', '" + description + "', 'NULL')";
connection.query( strQuery, function(err, rows)
{if(err) {
throw err;
}else{
if(debug)
{console.log("insertRank \n"+rows[0]+"\n");}
return rows[0];
}
... | cwe | CWE-89 | JavaScript |
void Document::InitContentSecurityPolicy(ContentSecurityPolicy* csp) {
//// the first parameter specifies a policy to use as the document csp meaning
//// the document will take ownership of the policy
//// the second parameter specifies a policy to inherit meaning the document
//// will attempt to copy over the policy... | cwe | CWE-732 | C/C++ |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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 3 of the License, or
# (at your option) an... | cwe | CWE-77 | Python |
/**
* Copyright (c) 2006-2016, JGraph Ltd
* Copyright (c) 2006-2016, Gaudenz Alder
*/
/**
* Constructs a new point for the optional x and y coordinates. If no
* coordinates are given, then the default values for <x> and <y> are used.
* @constructor
* @class Implements a basic 2D point. Known subclassers = {@link... | cwe | CWE-94 | JavaScript |
static void Launch(OpKernelContext* context, const Tensor& in_x,
const Tensor& in_y, bool adjoint, bool lower,
const MatMulBCast& bcast, Tensor* out) {
// Number of banded matrix triangular solves i.e. size of the batch.
const int64 batch_size = bcast.output_batch_size(... | cwe | CWE-754 | C/C++ |
function mci_account_get_array_by_id( $p_user_id ) {
$t_result = array();
$t_result['id'] = $p_user_id;
if( user_exists( $p_user_id ) ) {
$t_result['name'] = user_get_field( $p_user_id, 'username' );
$t_dummy = user_get_field( $p_user_id, 'realname' );
if( !empty( $t_dummy ) ) {
$t_result['real_name'] = $... | cwe | CWE-200 | PHP |
/*
* . .o8 oooo
* .o8 "888 `888
* .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo
* 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P'
* 888 888 888 888 8... | cwe | CWE-79 | JavaScript |
int CServer::SendMsg(CMsgPacker *pMsg, int Flags, int ClientID)
{
CNetChunk Packet;
if(!pMsg)
return -1;
// drop packet to dummy client
if(0 <= ClientID && ClientID < MAX_CLIENTS && GameServer()->IsClientBot(ClientID))
return 0;
mem_zero(&Packet, sizeof(CNetChunk));
Packet.m_ClientID = ClientID;
Packet.m_p... | cwe | CWE-20 | C/C++ |
protected HtmlRenderable htmlBody() {
return sequence(
HtmlElement.div(cssClass("dir-container")).content(
HtmlElement.span(cssClass("directory")).content(
HtmlElement.a(onclick("BuildDetail.tree_navigator(this)"))
.cont... | cwe | CWE-79 | Java |
ex_substitute(exarg_T *eap)
{
linenr_T lnum;
long i = 0;
regmmatch_T regmatch;
static subflags_T subflags = {FALSE, FALSE, FALSE, TRUE, FALSE,
FALSE, FALSE, 0};
#ifdef FEAT_EVAL
subflags_T subflags_save;
#endif
int save_do_all; // remember user specified 'g' flag
int save_do_... | cwe | CWE-416 | C/C++ |
void ExtensionOptionsGuest::DidNavigateMainFrame(
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) {
if (attached()) {
auto guest_zoom_controller =
ui_zoom::ZoomController::FromWebContents(web_contents());
guest_zoom_controller->SetZoomMode(
ui... | cwe | CWE-284 | C/C++ |
static int qcow2_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
BDRVQcowState *s = bs->opaque;
unsigned int len, i;
int ret = 0;
QCowHeader header;
QemuOpts *opts;
Error *local_err = NULL;
uint64_t ext_end;
uint64_t l1_vm_state_index;
cons... | cwe | CWE-190 | C/C++ |
static int do_check(struct bpf_verifier_env *env)
{
struct bpf_verifier_state *state = &env->cur_state;
struct bpf_insn *insns = env->prog->insnsi;
struct bpf_reg_state *regs = state->regs;
int insn_cnt = env->prog->len;
int insn_idx, prev_insn_idx = 0;
int insn_processed = 0;
bool do_print_state = false;
init... | cwe | CWE-200 | C/C++ |
SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
{
struct smb_rqst rqst;
struct smb2_negotiate_req *req;
struct smb2_negotiate_rsp *rsp;
struct kvec iov[1];
struct kvec rsp_iov;
int rc = 0;
int resp_buftype;
struct TCP_Server_Info *server = ses->server;
int blob_offset, blob_length;
char *security... | cwe | CWE-125 | C/C++ |
WORD32 ih264d_process_intra_mb(dec_struct_t * ps_dec,
dec_mb_info_t * ps_cur_mb_info,
UWORD8 u1_mb_num)
{
UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
UWORD8 uc_temp = ps_cur_mb_info->u1_mb_ngbr_availablity;
UWORD8 u1_top_available = BOOLEAN(uc_temp & TOP_MB_AVAILABLE_MASK... | cwe | CWE-20 | Unknown |
from pathlib import Path
from os.path import sep
from pkg_resources import require
from shutil import which
import frontmatter
from flask import (
render_template,
flash,
redirect,
request,
url_for,
send_file,
send_from_directory,
)
from flask_login import login_user, current_user, logout_u... | cwe | CWE-352 | Python |
this.setPersistentToken(JSON.stringify(n),!n.remember));e();return}}catch(v){}f({message:mxResources.get("unknownError")+" (Code: "+c.getStatus()+")"})}),f)};OneDriveClient.prototype.executeRequest=function(e,f,c){var m=mxUtils.bind(this,function(n){var v=!0,d=window.setTimeout(mxUtils.bind(this,function(){v=!1;c({code... | cwe | CWE-20 | JavaScript |
package commands
import (
"context"
"sync"
"github.com/go-errors/errors"
"github.com/openfga/openfga/pkg/logger"
tupleUtils "github.com/openfga/openfga/pkg/tuple"
"github.com/openfga/openfga/pkg/utils"
serverErrors "github.com/openfga/openfga/server/errors"
"github.com/openfga/openfga/server/validation"
"git... | cwe | CWE-863 | Go |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_parse_Q046.c -- Parsing functions specific to GQUIC Q046
*/
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <string.h>
#include <sys/queue.h>
#ifndef WIN32
#include <sys/types.h>
#else
#include <vc_compat.h>
#... | cwe | CWE-476 | C/C++ |
xmlXPathNodeSetMerge(xmlNodeSetPtr val1, xmlNodeSetPtr val2) {
int i, j, initNr, skip;
xmlNodePtr n1, n2;
if (val2 == NULL) return(val1);
if (val1 == NULL) {
val1 = xmlXPathNodeSetCreate(NULL);
if (val1 == NULL)
return (NULL);
#if 0
/*
* TODO: The optimization won't work in every case, s... | cwe | CWE-189 | Unknown |
static int ivr_read_header(AVFormatContext *s)
{
unsigned tag, type, len, tlen, value;
int i, j, n, count, nb_streams = 0, ret;
uint8_t key[256], val[256];
AVIOContext *pb = s->pb;
AVStream *st;
int64_t pos, offset, temp;
pos = avio_tell(pb);
tag = avio_rl32(pb);
if (tag == MKTAG('.... | cwe | CWE-399 | Unknown |
static void br_multicast_del_pg(struct net_bridge *br,
struct net_bridge_port_group *pg)
{
struct net_bridge_mdb_htable *mdb;
struct net_bridge_mdb_entry *mp;
struct net_bridge_port_group *p;
struct net_bridge_port_group __rcu **pp;
mdb = mlock_dereference(br->mdb, br);
mp = br_mdb_ip_get(mdb, &pg->addr);
... | cwe | CWE-20 | C/C++ |
static const char* getenv_harder(pam_handle_t *handle, const char *key, const char *fallback) {
const char *v;
assert(handle);
assert(key);
/* Looks for an environment variable, preferrably in the environment block associated with the specified PAM
* handle, falling back to th... | cwe | CWE-863 | Unknown |
bgp_open_receive (struct peer *peer, bgp_size_t size)
{
int ret;
u_char version;
u_char optlen;
u_int16_t holdtime;
u_int16_t send_holdtime;
as_t remote_as;
struct peer *realpeer;
struct in_addr remote_id;
int capability;
u_int8_t notify_data_remote_as[2];
u_int8_t notify_data_remote_id[4];
rea... | cwe | CWE-125 | Unknown |
isdn_net_newslave(char *parm)
{
char *p = strchr(parm, ',');
isdn_net_dev *n;
char newname[10];
if (p) {
/* Slave-Name MUST not be empty */
if (!strlen(p + 1))
return NULL;
strcpy(newname, p + 1);
*p = 0;
/* Master must already exist */
if (!(n = isdn_net_findif(parm)))
return NULL;
/* Master m... | cwe | CWE-119 | Unknown |
package com.salesmanager.shop.admin.model.permission;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPrope... | cwe | CWE-639 | Java |
struct pipe_inode_info *alloc_pipe_info(void)
{
struct pipe_inode_info *pipe;
pipe = kzalloc(sizeof(struct pipe_inode_info), GFP_KERNEL);
if (pipe) {
pipe->bufs = kzalloc(sizeof(struct pipe_buffer) * PIPE_DEF_BUFFERS, GFP_KERNEL);
if (pipe->bufs) {
init_waitqueue_head(&pipe->wait);
pipe->r_counter = pipe-... | cwe | CWE-399 | C/C++ |
IDNSpoofChecker::IDNSpoofChecker() {
UErrorCode status = U_ZERO_ERROR;
checker_ = uspoof_open(&status);
if (U_FAILURE(status)) {
checker_ = nullptr;
return;
}
uspoof_setRestrictionLevel(checker_, USPOOF_MODERATELY_RESTRICTIVE);
SetAllowedUnicodeSet(&status);
int32_t checks = uspoof_getChecks(c... | cwe | CWE-863 | C/C++ |
->first(function (User $user) {
return $user->getPreference('blocksPd', false);
}) !== null; | cwe | CWE-863 | JavaScript |
def _ssl_wrap_socket(
sock, key_file, cert_file, disable_validation, ca_certs, ssl_version, hostname, key_password | cwe | CWE-400 | Python |
MONGO_EXPORT mongo_cursor *gridfile_get_chunks( gridfile *gfile, int start, int size ) {
bson_iterator it;
bson_oid_t id;
bson gte;
bson query;
bson orderby;
bson command;
mongo_cursor *cursor;
bson_find( &it, gfile->meta, "_id" );
id = *bson_iterator_oid( &it );
bson_init( &qu... | cwe | CWE-190 | C/C++ |
void __l2cap_connect_rsp_defer(struct l2cap_chan *chan)
{
struct l2cap_conn_rsp rsp;
struct l2cap_conn *conn = chan->conn;
u8 buf[128];
u8 rsp_code;
rsp.scid = cpu_to_le16(chan->dcid);
rsp.dcid = cpu_to_le16(chan->scid);
rsp.result = cpu_to_le16(L2CAP_CR_SUCCESS);
rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO)... | cwe | CWE-787 | Unknown |
ut32 armass_assemble(const char *str, ut64 off, int thumb) {
int i, j;
char buf[128];
ArmOpcode aop = {.off = off};
for (i = j = 0; i < sizeof (buf) - 1 && str[i]; i++, j++) {
if (str[j] == '#') {
i--; continue;
}
buf[i] = tolower ((const ut8)str[j]);
}
buf[i] = 0;
arm_opcode_parse (&aop, buf);
aop.off... | cwe | CWE-787 | C/C++ |
function compactBuffers(context, node) {
var out = [node[0]],
memo, i, len, res;
for (i=1, len=node.length; i<len; i++) {
res = compiler.filterNode(context, node[i]);
if (res) {
if (res[0] === 'buffer' || res[0] === 'format') {
if (memo) {
memo[0] = (res[0] === ... | cwe | CWE-1321 | JavaScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.