code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
interp_reply(netdissect_options *ndo,
const struct sunrpc_msg *rp, uint32_t proc, uint32_t vers, int length)
{
register const uint32_t *dp;
register int v3;
int er;
v3 = (vers == NFS_VER3);
if (!v3 && proc < NFS_NPROCS)
proc = nfsv3_procid[proc];
ND_PRINT((ndo, " %s", tok2str(nfsproc_str, "proc-... | cwe | CWE-125 | C/C++ |
void sctp_association_free(struct sctp_association *asoc)
{
struct sock *sk = asoc->base.sk;
struct sctp_transport *transport;
struct list_head *pos, *temp;
int i;
/* Only real associations count against the endpoint, so
* don't bother for if this is a temporary association.
*/
if (!asoc->temp) {
list_del(... | cwe | CWE-20 | Unknown |
/*-
* Copyright 2014 Square Inc.
*
* 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-284 | Go |
int main(int argc, char * argv[])
{
gr_face * face = 0;
try
{
if (argc != 2) throw std::length_error("not enough arguments: need a backing font");
dummyFace = face_handle(argv[1]);
testFeatTable<FeatTableTestA>(testDataA, "A\n");
testFeatTable<FeatTableTestB>(testDataB, "B\n");
testFeatTable<FeatTab... | cwe | CWE-476 | C/C++ |
bool AudioOutputSpeech::needSamples(unsigned int snum) {
for (unsigned int i=iLastConsume;i<iBufferFilled;++i)
pfBuffer[i-iLastConsume]=pfBuffer[i];
iBufferFilled -= iLastConsume;
iLastConsume = snum;
if (iBufferFilled >= snum)
return bLastAlive;
float *pOut;
bool nextalive = bLastAlive;
while (iBufferFi... | cwe | CWE-189 | Unknown |
package za.org.grassroot.webapp.controller.rest.authentication;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.validator.routines.EmailValidator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframewo... | cwe | CWE-347 | Java |
const CuePoint* Cues::GetLast() const {
if (m_cue_points == NULL)
return NULL;
if (m_count <= 0)
return NULL;
#if 0
LoadCuePoint(); //init cues
const size_t count = m_count + m_preload_count;
if (count == 0) //weird
return NULL;
const size_t index = count - 1;
CuePoint* cons... | cwe | CWE-20 | C/C++ |
function unflatten (target, opts) {
opts = opts || {}
const delimiter = opts.delimiter || '.'
const overwrite = opts.overwrite || false
const transformKey = opts.transformKey || keyIdentity
const result = {}
const isbuffer = isBuffer(target)
if (isbuffer || Object.prototype.toString.call(target) !== '[o... | cwe | CWE-1321 | JavaScript |
BOOL update_write_cache_bitmap_v2_order(wStream* s, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2,
BOOL compressed, UINT16* flags)
{
BYTE bitsPerPixelId;
if (!Stream_EnsureRemainingCapacity(
s, update_approximate_cache_bitmap_v2_order(cache_bitmap_v2, compressed, flags)))
... | cwe | CWE-125 | C/C++ |
static bool states_equal(struct bpf_verifier_env *env,
struct bpf_verifier_state *old,
struct bpf_verifier_state *cur)
{
int i;
if (old->curframe != cur->curframe)
return false;
/* for states to be equal callsites have to be the same
* and all frame states need to be equivalent
*/
for (i = 0; ... | cwe | CWE-189 | C/C++ |
void M_LoadDefaults (void)
{
int i;
int len;
FILE* f;
char def[80];
char strparm[100];
char* newstring;
int parm;
boolean isstring;
// set everything to base values
numdefaults = sizeof(defaults)/sizeof(defaults[0]);
for (i=0 ; i<numdefaults ; i++)
*defaults[i].locat... | cwe | CWE-787 | C/C++ |
public String list(Model model, // TODO model should no longer be injected
@RequestParam(required = false, defaultValue = "FILENAME") SortBy sortBy,
@RequestParam(required = false, defaultValue = "false") boolean desc,
@RequestParam(required = false) ... | cwe | CWE-22 | Java |
static MagickBooleanType SyncExifProfile(Image *image, StringInfo *profile)
{
#define MaxDirectoryStack 16
#define EXIF_DELIMITER "\n"
#define EXIF_NUM_FORMATS 12
#define TAG_EXIF_OFFSET 0x8769
#define TAG_INTEROP_OFFSET 0xa005
typedef struct _DirectoryInfo
{
unsigned char
*directory;
size_t
... | cwe | CWE-415 | C/C++ |
package com.zrlog.service;
import com.hibegin.common.util.http.HttpUtil;
import com.hibegin.common.util.http.handle.HttpJsonArrayHandle;
import com.zrlog.common.Constants;
import com.zrlog.common.response.UploadFileResponse;
import org.apache.log4j.Logger;
import javax.servlet.http.HttpServletRequest;
import java.uti... | cwe | CWE-863 | Java |
static int bin_symbols(RCore *r, int mode, ut64 laddr, int va, ut64 at, const char *name, bool exponly, const char *args) {
RBinInfo *info = r_bin_get_info (r->bin);
RList *entries = r_bin_get_entries (r->bin);
RBinSymbol *symbol;
RBinAddr *entry;
RListIter *iter;
bool firstexp = true;
bool printHere = false;
i... | cwe | CWE-78 | Unknown |
asn1_get_packed(
unsigned char **buffer, /* IO - Pointer in buffer */
unsigned char *bufend) /* I - End of buffer */
{
int value; /* Value */
value = 0;
while ((**buffer & 128) && *buffer < bufend)
{
value = (value << 7) | (**buffer & 127);
(*buffer) ++;
}
if (*buffer < bufend)
{... | cwe | CWE-120 | Unknown |
function PMA_getHtmlForForeignKey($save_row, $i, $existrel_foreign, $myfield, $db,
$myfield_md5, $tbl_storage_engine, $options_array
) {
$html_output = '<td>';
if (! empty($save_row[$i]['Key'])) {
$foreign_db = false;
$foreign_table = false;
$foreign_column = false;
// fore... | cwe | CWE-79 | PHP |
bool extractPages (const char *srcFileName, const char *destFileName) {
char pathName[1024];
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}')", ... | cwe | CWE-119 | C/C++ |
static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx)
{
struct xenvif *vif;
struct pending_tx_info *pending_tx_info;
pending_ring_idx_t index;
/* Already complete? */
if (netbk->mmap_pages[pending_idx] == NULL)
return;
pending_tx_info = &netbk->pending_tx_info[pending_idx];
vif = ... | cwe | CWE-399 | C/C++ |
static int verify_cb(int preverify_ok, X509_STORE_CTX *x509_ctx)
{
pj_ssl_sock_t *ssock;
SSL *ossl_ssl;
int err;
/* Get SSL instance */
ossl_ssl = X509_STORE_CTX_get_ex_data(x509_ctx,
SSL_get_ex_data_X509_STORE_CTX_idx());
pj_assert(ossl_ssl);
/* Get SSL socket instance */
sso... | cwe | CWE-362 | 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 applicable law or a... | cwe | CWE-617 | C/C++ |
this.changeUserSettings = function(attr,value){
$.get(this.wwwDir+ 'user/setsettingajax/'+attr+'/'+value);
}; | cwe | CWE-352 | JavaScript |
ip_printroute(netdissect_options *ndo,
register const u_char *cp, u_int length)
{
register u_int ptr;
register u_int len;
if (length < 3) {
ND_PRINT((ndo, " [bad length %u]", length));
return;
}
if ((length + 1) & 3)
ND_PRINT((ndo, " [bad length %u]", length));
ptr = cp[2] - 1;
if ... | cwe | CWE-125 | C/C++ |
/*
* Copyright 2022 Thoughtworks, Inc.
*
* 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 agr... | cwe | CWE-79 | Java |
def all_deposits(self,coin):
sql = "SELECT * FROM deposits WHERE coin='%s'" % coin
self.cursor.execute(sql)
return self.cursor.fetchall() | cwe | CWE-89 | Python |
verify_peer_certificate (GTlsConnectionBase *tls,
GTlsCertificate *peer_certificate)
{
GTlsConnectionBaseClass *tls_class = G_TLS_CONNECTION_BASE_GET_CLASS (tls);
GSocketConnectable *peer_identity;
GTlsDatabase *database;
GTlsCertificateFlags errors;
gboolean is_client;
is_clien... | cwe | CWE-295 | Unknown |
public static function decode($jwt, $key = null, $verify = true)
{
$tks = explode('.', $jwt);
if (count($tks) != 3) {
throw new Exception('Wrong number of segments');
}
list($headb64, $payloadb64, $cryptob64) = $tks;
if (null === ($header = json_decode(JWT::url... | cwe | CWE-20 | PHP |
int WavpackSetConfiguration64 (WavpackContext *wpc, WavpackConfig *config, int64_t total_samples, const unsigned char *chan_ids)
{
uint32_t flags, bps = 0;
uint32_t chan_mask = config->channel_mask;
int num_chans = config->num_channels;
int i;
wpc->stream_version = (config->flags & CONFIG_COMPA... | cwe | CWE-835 | C/C++ |
static void tulip_tx(TULIPState *s, struct tulip_descriptor *desc)
{
if (s->tx_frame_len) {
if ((s->csr[6] >> CSR6_OM_SHIFT) & CSR6_OM_MASK) {
/* Internal or external Loopback */
tulip_receive(s, s->tx_frame, s->tx_frame_len);
} else {
qemu_send_packet(qemu_get_qu... | cwe | CWE-787 | Unknown |
recurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {
var left, right, self = this, args, expression, computed;
recursionFn = recursionFn || noop;
if (!skipWatchIdCheck && isDefined(ast.watchId)) {
intoId = intoId || this.nextId();
this.if_('i',
this.lazyAssign(... | cwe | CWE-74 | JavaScript |
/*
* Copyright (c) 2014 Open Grid Computing, Inc. All rights reserved.
* Copyright (c) 2005-2007 Network Appliance, Inc. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Vers... | cwe | CWE-399 | C/C++ |
// SPDX-License-Identifier: BSD-2-Clause
/*
* Copyright (c) 2014, STMicroelectronics International N.V.
*/
#include <util.h>
#include <kernel/tee_common_otp.h>
#include <kernel/tee_common.h>
#include <tee_api_types.h>
#include <kernel/tee_ta_manager.h>
#include <utee_types.h>
#include <tee/tee_svc.h>
#include <tee/te... | cwe | CWE-119 | C/C++ |
/**********************************************************************
* Log:
* 2006-03-12: Parts originally authored by Doug Madory as wifi_parser.c
* 2013-03-15: Substantially modified by Simson Garfinkel for inclusion into tcpflow
* 2013-11-18: reworked static calls to be entirely calls to a class. Changed Time... | cwe | CWE-125 | C/C++ |
package org.pac4j.saml.util;
import java.net.URI;
import java.net.URISyntaxException;
import org.apache.commons.lang.RandomStringUtils;
import org.pac4j.core.context.HttpConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* SAML2 utilities.
*
* @author jkacer
* @since 1.8.0
*/
public final ... | cwe | CWE-338 | Java |
int Lua::handle_script_request(struct mg_connection *conn,
const struct mg_request_info *request_info,
char *script_path) {
char buf[64], key[64], ifname[MAX_INTERFACE_NAME_LEN];
char *_cookies, user[64] = { '\0' }, outbuf[FILENAME_MAX];
patricia_tree_t *ptree = NULL;
int rc;
if(!L) retur... | cwe | CWE-254 | Unknown |
void LanLinkProvider::udpBroadcastReceived()
{
while (m_udpSocket.hasPendingDatagrams()) {
QByteArray datagram;
datagram.resize(m_udpSocket.pendingDatagramSize());
QHostAddress sender;
m_udpSocket.readDatagram(datagram.data(), datagram.size(), &sender);
if (sender.isLoopba... | cwe | CWE-400 | C/C++ |
function(){function O(ua,ya,Na){var Fa=U.menus.get(ua),Ra=R.addMenu(mxResources.get(ua),mxUtils.bind(this,function(){Fa.funct.apply(this,arguments)}),P);Ra.className="1"==urlParams.sketch?"geToolbarButton":"geMenuItem";Ra.style.display="inline-block";Ra.style.boxSizing="border-box";Ra.style.top="6px";Ra.style.marginRig... | cwe | CWE-94 | JavaScript |
/*
* Copyright (c) 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 copyright notice and this ... | cwe | CWE-125 | C/C++ |
njs_promise_perform_race_handler(njs_vm_t *vm, njs_iterator_args_t *args,
njs_value_t *value, int64_t index)
{
njs_int_t ret;
njs_value_t arguments[2], next;
njs_promise_capability_t *capability;
njs_promise_iterator_args_t *pargs;
pargs = (njs_promise_i... | cwe | CWE-703 | Unknown |
package main
import (
"fmt"
"io"
"io/ioutil"
"math/rand"
"os"
"os/signal"
"path/filepath"
"runtime"
"syscall"
"time"
"github.com/containers/storage/pkg/reexec"
"github.com/spf13/cobra"
"k8s.io/component-base/logs"
"github.com/openshift/library-go/pkg/serviceability"
"github.com/openshift/builder/pkg... | cwe | CWE-522 | Go |
# -*- 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-346 | Python |
/*
Copyright The Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... | cwe | CWE-74 | Go |
gdk_pixbuf__gif_image_load_animation (FILE *file,
GError **error)
{
GifContext *context;
GdkPixbufAnimation *animation;
g_return_val_if_fail (file != NULL, NULL);
context = new_context ();
context->error = error;
context->file = file;
if (gif_main_loop (context) =... | cwe | CWE-20 | Unknown |
static Image *ReadDPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
const char
*client_name;
Display
*display;
float
pixels_per_point;
Image
*image;
int
sans,
status;
Pixmap
pixmap;
register ssize_t
i;
register Quantum
*q;
register size_t
... | cwe | CWE-401 | C/C++ |
void UncompressElementOp::Compute(OpKernelContext* ctx) {
Tensor tensor = ctx->input(0);
const Variant& variant = tensor.scalar<Variant>()();
const CompressedElement* compressed = variant.get<CompressedElement>();
std::vector<Tensor> components;
OP_REQUIRES_OK(ctx, UncompressElement(*compressed, &components)... | cwe | CWE-476 | Unknown |
static json_t *parse_value(lex_t *lex, size_t flags, json_error_t *error)
{
json_t *json;
switch(lex->token) {
case TOKEN_STRING: {
const char *value = lex->value.string.val;
size_t len = lex->value.string.len;
if(!(flags & JSON_ALLOW_NUL)) {
if(memc... | cwe | CWE-20 | Unknown |
/*
* Copyright (c) 2006, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main director... | cwe | CWE-362 | C/C++ |
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2010-2018 Intel Corporation
*/
/* Security model
* --------------
* The vhost-user protocol connection is an external interface, so it must be
* robust against invalid inputs.
*
* This is important because the vhost-user master is only one step removed
* ... | cwe | CWE-787 | Java |
def add_input(self, data):
connection = self.connect()
try:
# The following introduces a deliberate security flaw - SQL Injection
query = "INSERT INTO crimes (description) VALUES ('{}');".format(data)
with connection.cursor() as cursor:
cursor.execute(... | cwe | CWE-89 | Python |
bool PaymentRequest::SatisfiesSkipUIConstraints() const {
return base::FeatureList::IsEnabled(features::kWebPaymentsSingleAppUiSkip) &&
base::FeatureList::IsEnabled(::features::kServiceWorkerPaymentApps) &&
is_show_user_gesture_ && state()->is_get_all_instruments_finished() &&
state()->avai... | cwe | CWE-189 | C/C++ |
int ParseDsdiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, WavpackContext *wpc, WavpackConfig *config)
{
int64_t infilesize, total_samples;
DFFFileHeader dff_file_header;
DFFChunkHeader dff_chunk_header;
uint32_t bcount;
infilesize = DoGetFileSize (infile);
memcpy (&dff_file_hea... | cwe | CWE-824 | Unknown |
static async getInitialProps (ctx) {
const session = new Session({req: ctx.req});
let initialProps = {};
if (Component.getInitialProps) {
initialProps = Component.getInitialProps({...ctx, session});
}
const sessionData = await session.getSession();
let isLoggedIn = false;
if (session... | cwe | CWE-306 | JavaScript |
/*
* Timers abstract layer
* Copyright (c) by Jaroslav Kysela <perex@perex.cz>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at you... | cwe | CWE-362 | C/C++ |
clipboardTextParser(str, $context, _, view) {
const parser = DOMParser.fromSchema(view.state.schema)
const doc = document.cloneNode(false)
const dom = doc.createElement('div')
if (shiftKey) {
// Treat single newlines as linebreaks and double newlines as paragraph breaks when pasting as pl... | cwe | CWE-79 | JavaScript |
bool CModules::GetModPathInfo(CModInfo& ModInfo, const CString& sModule,
const CString& sModPath, CString& sRetMsg) {
ModInfo.SetName(sModule);
ModInfo.SetPath(sModPath);
ModHandle p = OpenModule(sModule, sModPath, ModInfo, sRetMsg);
if (!p) return false;
dlclose(p);
... | cwe | CWE-20 | Unknown |
void operator()(OpKernelContext* context, const Tensor& input_tensor,
Tensor& output_tensor, int n, bool reverse) {
const T* input = input_tensor.flat<T>().data();
T* output = output_tensor.flat<T>().data();
// Assume input_shape is [d1,d2,...dk], and output_shape is [d1,d2...dk-1],
/... | cwe | CWE-197 | Unknown |
void *arm_dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
gfp_t gfp, struct dma_attrs *attrs)
{
pgprot_t prot = __get_dma_pgprot(attrs, pgprot_kernel);
void *memory;
if (dma_alloc_from_coherent(dev, size, handle, &memory))
return memory;
return __dma_alloc(dev, size, handle, gfp, prot, fals... | cwe | CWE-264 | C/C++ |
add_mibdir(const char *dirname)
{
FILE *ip;
const char *oldFile = File;
char **filenames;
int count = 0;
int filename_count, i;
#if !(defined(WIN32) || defined(cygwin))
char *token;
char space;
char newline;
struct stat dir... | cwe | CWE-59 | C/C++ |
cJSON *cJSON_CreateIntArray( int64_t *numbers, int count )
{
int i;
cJSON *n = 0, *p = 0, *a = cJSON_CreateArray();
for ( i = 0; a && i < count; ++i ) {
n = cJSON_CreateInt( numbers[i] );
if ( ! i )
a->child = n;
else
suffix_object( p, n );
p = n;
}
return a;
} | cwe | CWE-120 | C/C++ |
function bp_core_admin_slugs_options() {
// Get the existing WP pages.
$existing_pages = bp_core_get_directory_page_ids();
// Set up an array of components (along with component names) that have directory pages.
$directory_pages = bp_core_admin_get_directory_pages();
if ( !empty( $directory_pages ) ) : ?>
<h... | cwe | CWE-200 | PHP |
static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
{
struct net *net = sock_net(skb->sk);
struct net *tgt_net = net;
int h, s_h;
int idx = 0, s_idx;
struct net_device *dev;
struct hlist_head *head;
struct nlattr *tb[IFLA_MAX+1];
u32 ext_filter_mask = 0;
const struct rtnl_link_ops *ki... | cwe | CWE-476 | Unknown |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
const auto* params = static_cast<TfLiteLSTMParams*>(node->builtin_data);
OpData* op_data = static_cast<OpData*>(node->user_data);
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
const TfLiteTensor* input_to_input_weights =
... | cwe | CWE-125 | C/C++ |
def aesEncrypt(data, key):
cipher = AES.new(key)
data = data + (" " * (16 - (len(data) % 16)))
return cipher.encrypt(data) | cwe | CWE-310 | Python |
TPMI_SM4_KEY_BITS_Unmarshal(TPMI_SM4_KEY_BITS *target, BYTE **buffer, INT32 *size)
{
TPM_RC rc = TPM_RC_SUCCESS;
if (rc == TPM_RC_SUCCESS) {
rc = TPM_KEY_BITS_Unmarshal(target, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
switch (*target) {
case 128:
break;
default:
rc = TPM_RC_VALU... | cwe | CWE-787 | Unknown |
static int ahash_def_finup(struct ahash_request *req)
{
struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
int err;
err = ahash_save_req(req, ahash_def_finup_done1);
if (err)
return err;
err = tfm->update(req);
return ahash_def_finup_finish1(req, err);
} | cwe | CWE-835 | Unknown |
static int anr_replace_value(struct anr_context *ac,
TALLOC_CTX *mem_ctx,
struct ldb_val *match,
struct ldb_parse_tree **ntree)
{
struct ldb_parse_tree *tree = NULL;
struct ldb_module *module = ac->module;
struct ldb_parse_tree *match_tree;
struct dsdb_attribute *cur;
const struct dsdb_sche... | cwe | CWE-703 | Unknown |
this.disableChatSoundUser = function(inst)
{
if (inst.find('> i').text() == 'volume_off') {
$.get(this.wwwDir+ 'user/setsettingajax/chat_message/1');
confLH.new_message_sound_user_enabled = 1;
inst.find('> i').text('volume_up');
} else {
$.get(this.wwwDir+ 'user/setsettingajax/ch... | cwe | CWE-352 | JavaScript |
def main() -> None:
rbac_only_states = [
("check_region", Client.check_region),
("rbac", Client.setup_rbac),
("arm", Client.deploy_template),
("assign_scaleset_identity_role", Client.assign_scaleset_identity_role),
]
full_deployment_states = rbac_only_states + [
("ap... | cwe | CWE-285 | Python |
__htab_map_lookup_and_delete_batch(struct bpf_map *map,
const union bpf_attr *attr,
union bpf_attr __user *uattr,
bool do_delete, bool is_lru_map,
bool is_percpu)
{
struct bpf_htab *htab = container_of(map, struct bpf_htab, map);
u32 bucket_cnt, total, key_size, value_size, roundup_key_siz... | cwe | CWE-787 | C/C++ |
OMX_ERRORTYPE SoftAACEncoder::internalSetParameter(
OMX_INDEXTYPE index, const OMX_PTR params) {
switch (index) {
case OMX_IndexParamStandardComponentRole:
{
const OMX_PARAM_COMPONENTROLETYPE *roleParams =
(const OMX_PARAM_COMPONENTROLETYPE *)params;
if (strncmp(... | cwe | CWE-119 | C/C++ |
function footnote_inline(state, silent) {
var labelStart,
labelEnd,
footnoteId,
token,
tokens,
max = state.posMax,
start = state.pos;
if (start + 2 >= max) { return false; }
if (state.src.charCodeAt(start) !== 0x5E/* ^ */) { return false; }
if (state.src.... | cwe | CWE-755 | 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;
if (sk->sk... | cwe | CWE-125 | C/C++ |
def load_files(*file_paths)
files = (site_configs + file_paths).map { |f| Pathname.new(f) }
# TODO: Validate config state in some way.
configs = files.map { |file| YAML.load(file.read) }
load(*configs)
end | cwe | CWE-502 | Ruby |
static int sctp_wait_for_sndbuf(struct sctp_association *asoc, long *timeo_p,
size_t msg_len, struct sock **orig_sk)
{
struct sock *sk = asoc->base.sk;
int err = 0;
long current_timeo = *timeo_p;
DEFINE_WAIT(wait);
pr_debug("%s: asoc:%p, timeo:%ld, msg_len:%zu\n", __func__, asoc,
*timeo_p, msg_len);
/* I... | cwe | CWE-416 | Unknown |
int ext4_setup_system_zone(struct super_block *sb)
{
ext4_group_t ngroups = ext4_get_groups_count(sb);
struct ext4_sb_info *sbi = EXT4_SB(sb);
struct ext4_system_blocks *system_blks;
struct ext4_group_desc *gdp;
ext4_group_t i;
int flex_size = ext4_flex_bg_size(sbi);
int ret;
if (!test_opt(sb, BLOCK_VALIDITY))... | cwe | CWE-703 | Unknown |
void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
int linesize_align[AV_NUM_DATA_POINTERS])
{
int i;
int w_align = 1;
int h_align = 1;
AVPixFmtDescriptor const *desc = av_pix_fmt_desc_get(s->pix_fmt);
if (desc) {
w_align = 1 << desc->l... | cwe | CWE-787 | Unknown |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016-2017, Yanis Guenane <yanis+ansible@guenane.org>
# Copyright: (c) 2017, Markus Teufelberger <mteufelberger+ansible@mgit.at>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import... | cwe | CWE-116 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-787 | C/C++ |
function makeHtml(data) {
storage.get('mathjax', function(items) {
// Convert MarkDown to HTML without MathJax typesetting.
// This is done to make page responsiveness. The HTML body
// is replaced after MathJax typesetting.
marked.setOptions(config.markedOptions... | cwe | CWE-79 | JavaScript |
TPMI_RH_CLEAR_Unmarshal(TPMI_RH_CLEAR *target, BYTE **buffer, INT32 *size)
{
TPM_RC rc = TPM_RC_SUCCESS;
if (rc == TPM_RC_SUCCESS) {
rc = TPM_HANDLE_Unmarshal(target, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
switch (*target) {
case TPM_RH_LOCKOUT:
case TPM_RH_PLATFORM:
break;
defa... | cwe | CWE-787 | Unknown |
exports.rsync = function (options,callback) {
options = options || {};
if ( typeof options.src === "undefined" ) {
throw(new Error("Source directory 'src' is missing from options"));
}
if ( typeof options.dest === "undefined" ) {
throw(new Error("Destination directory 'dest' is missin... | cwe | CWE-78 | JavaScript |
void Compute(OpKernelContext* ctx) override {
const Tensor* x_tensor = nullptr;
OP_REQUIRES_OK(ctx, ctx->input("x", &x_tensor));
const Tensor* cs_prev_tensor = nullptr;
OP_REQUIRES_OK(ctx, ctx->input("cs_prev", &cs_prev_tensor));
const Tensor* h_prev_tensor = nullptr;
OP_REQUIRES_OK(ctx, ctx->... | cwe | CWE-20 | Unknown |
ppp_hdlc(netdissect_options *ndo,
const u_char *p, int length)
{
u_char *b, *t, c;
const u_char *s;
int i, proto;
const void *se;
if (length <= 0)
return;
b = (u_char *)malloc(length);
if (b == NULL)
return;
/*
* Unescape all the data into a temporary, private, buffer.
*... | cwe | CWE-703 | Unknown |
/************************************************************************
* 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 |
uint64_t HeaderMapImpl::byteSize() const {
uint64_t byte_size = 0;
for (const HeaderEntryImpl& header : headers_) {
byte_size += header.key().size();
byte_size += header.value().size();
}
return byte_size;
} | cwe | CWE-400 | C/C++ |
package api
import (
"errors"
"net/http"
"code.cloudfoundry.org/lager"
"github.com/concourse/concourse/atc/db"
)
type TeamScopedHandlerFactory struct {
logger lager.Logger
teamFactory db.TeamFactory
}
func NewTeamScopedHandlerFactory(
logger lager.Logger,
teamFactory db.TeamFactory,
) *TeamScopedHandl... | cwe | CWE-863 | Go |
static jpc_enc_cp_t *cp_create(char *optstr, jas_image_t *image)
{
jpc_enc_cp_t *cp;
jas_tvparser_t *tvp;
int ret;
int numilyrrates;
double *ilyrrates;
int i;
int tagid;
jpc_enc_tcp_t *tcp;
jpc_enc_tccp_t *tccp;
jpc_enc_ccp_t *ccp;
int cmptno;
uint_fast16_t rlvlno;
uint_fast16_t prcwidthexpn;
uint_fast16_... | cwe | CWE-189 | Unknown |
@endpoints.route("/ranks")
def ranks():
if db == None:
init()
scene = request.args.get('scene', default='austin')
date = request.args.get('date')
# If no date was provided, pick the date of the latest tournament
if date == None:
sql = "SELECT distinct date FROM ranks WHERE scene='... | cwe | CWE-89 | Python |
#
# Copyright (c) 2010 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of... | cwe | CWE-264 | Python |
void GDataFileSystem::OnSearch(const SearchCallback& callback,
GetDocumentsParams* params,
GDataFileError error) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (error != GDATA_FILE_OK) {
if (!callback.is_null())
callback.Run(error... | cwe | CWE-399 | C/C++ |
// @flow
// A database adapter that works with data exported from the hosted
// Parse database.
// @flow-disable-next
import { Parse } from 'parse/node';
// @flow-disable-next
import _ from 'lodash';
// @flow-disable-next
import intersect from 'intersect';
// @flow-disable-next
import deepcopy from 'deepcopy';
import... | cwe | CWE-200 | JavaScript |
void fmtutil_macbitmap_read_pixmap_only_fields(deark *c, dbuf *f, struct fmtutil_macbitmap_info *bi,
i64 pos)
{
i64 pixmap_version;
i64 pack_size;
i64 plane_bytes;
i64 n;
de_dbg(c, "additional PixMap header fields, at %d", (int)pos);
de_dbg_indent(c, 1);
pixmap_version = dbuf_getu16be(f, pos+0);
de_dbg(c, "p... | cwe | CWE-369 | C/C++ |
receive(
struct recvbuf *rbufp
)
{
register struct peer *peer; /* peer structure pointer */
register struct pkt *pkt; /* receive packet pointer */
u_char hisversion; /* packet version */
u_char hisleap; /* packet leap indicator */
u_char hismode; /* packet mode */
u_char hisstratum; /* packet stratum */
u_... | cwe | CWE-254 | C/C++ |
static int init_sig_algs(SSL *s, unsigned int context)
{
/* Clear any signature algorithms extension received */
OPENSSL_free(s->s3->tmp.peer_sigalgs);
s->s3->tmp.peer_sigalgs = NULL;
return 1;
} | cwe | CWE-476 | Unknown |
struct dst_entry *inet_csk_route_req(struct sock *sk,
const struct request_sock *req)
{
struct rtable *rt;
const struct inet_request_sock *ireq = inet_rsk(req);
struct ip_options *opt = inet_rsk(req)->opt;
struct net *net = sock_net(sk);
struct flowi4 fl4;
flowi4_init_output(&fl4, sk->sk_bound_dev_if, s... | cwe | CWE-362 | C/C++ |
TfLiteStatus PrepareImpl(TfLiteContext* context, TfLiteNode* node) {
auto* params =
reinterpret_cast<TfLiteFullyConnectedParams*>(node->builtin_data);
OpData* data = reinterpret_cast<OpData*>(node->user_data);
// Check we have all the inputs and outputs we need.
TF_LITE_ENSURE(context, node->inputs->size ... | cwe | CWE-787 | C/C++ |
function createHook (meta) {
async function resolve (specifier, context, parentResolve) {
const { parentURL = '' } = context
const newSpecifier = deleteIitm(specifier)
if (isWin && parentURL.indexOf('file:node') === 0) {
context.parentURL = ''
}
const url = await parentResolve(newSpecifier, ... | cwe | CWE-20 | JavaScript |
static void rlvl_destroy(jpc_enc_rlvl_t *rlvl)
{
jpc_enc_band_t *band;
uint_fast16_t bandno;
if (rlvl->bands) {
for (bandno = 0, band = rlvl->bands; bandno < rlvl->numbands;
++bandno, ++band) {
band_destroy(band);
}
jas_free(rlvl->bands);
}
} | cwe | CWE-416 | Unknown |
import { mainPage } from "../../support/page_objects/mainPage";
import { isTestSuiteActive } from "../../support/page_objects/projectConstants";
export const genTest = (apiType, dbType) => {
if (!isTestSuiteActive(apiType, dbType)) return;
describe(`${apiType.toUpperCase()} api - M2M Column validation`, () =>... | cwe | CWE-918 | JavaScript |
/*
* Copyright 2016 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-287 | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.