code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
/* Copyright (c) 2008-2009, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of co... | cwe | CWE-125 | Python |
xmlTextReaderSetup(xmlTextReaderPtr reader,
xmlParserInputBufferPtr input, const char *URL,
const char *encoding, int options)
{
if (reader == NULL) {
if (input != NULL)
xmlFreeParserInputBuffer(input);
return (-1);
}
/*
* we force the generat... | cwe | CWE-399 | Unknown |
destroy_one_secret (gpointer data)
{
char *secret = (char *) data;
/* Don't leave the secret lying around in memory */
g_message ("%s: destroying %s", __func__, secret);
memset (secret, 0, strlen (secret));
g_free (secret);
} | cwe | CWE-200 | C/C++ |
def set_corosync_conf(params, request, session)
if not allowed_for_local_cluster(session, Permissions::FULL)
return 403, 'Permission denied'
end
if params[:corosync_conf] != nil and params[:corosync_conf].strip != ""
Cfgsync::CorosyncConf.backup()
Cfgsync::CorosyncConf.from_text(params[:corosync_conf]... | cwe | CWE-384 | Ruby |
'use strict';
/**
* Module dependencies.
*/
var utils = require('./utils');
var exec = require('child_process').exec;
var fs = require('fs');
var tmpdir = require('os').tmpdir(); // let the os take care of removing zombie tmp files
var uuid = require('uuid');
var path = require('path');
var { glob, } = require("glob... | cwe | CWE-77 | JavaScript |
'use strict';
module.exports = require('../public/src/utils');
| cwe | CWE-330 | JavaScript |
/*
* 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-327 | C/C++ |
_handle_carbons(xmpp_stanza_t *const stanza)
{
xmpp_stanza_t *carbons = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_CARBONS);
if (!carbons) {
return FALSE;
}
const char *name = xmpp_stanza_get_name(carbons);
if (!name) {
log_error("Unable to retrieve stanza name for Carbon");
... | cwe | CWE-346 | C/C++ |
void Compute(OpKernelContext* context) override {
// Read ragged_splits inputs.
OpInputList ragged_nested_splits_in;
OP_REQUIRES_OK(context, context->input_list("rt_nested_splits",
&ragged_nested_splits_in));
const int ragged_nested_splits_len = ragged_nes... | cwe | CWE-125 | C/C++ |
static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
{
KerndeintContext *kerndeint = inlink->dst->priv;
AVFilterLink *outlink = inlink->dst->outputs[0];
AVFrame *outpic;
const uint8_t *prvp; ///< Previous field's pixel line number n
const uint8_t *prvpp; ///< Previous field's pixel line ... | cwe | CWE-787 | Unknown |
void addDbAdminAnyDbPrivileges(PrivilegeVector* privileges) {
Privilege::addPrivilegeToPrivilegeVector(
privileges, Privilege(ResourcePattern::forClusterResource(), ActionType::listDatabases));
Privilege::addPrivilegeToPrivilegeVector(
privileges, Privilege(ResourcePattern::forAnyNormalResource(... | cwe | CWE-20 | Unknown |
/*
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2012 William Pitcock <nenolod@dereferenced.org>
* Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
* Copyright (C) 2006, 2009 Robin Burchell <robin+git@viroteck.net>
* Copyright (C) 2007, 2009 Dennis Friis <peavey@inspircd.org>
... | cwe | CWE-20 | C/C++ |
// SPDX-License-Identifier: GPL-2.0
/*
* linux/fs/pipe.c
*
* Copyright (C) 1991, 1992, 1999 Linus Torvalds
*/
#include <linux/mm.h>
#include <linux/file.h>
#include <linux/poll.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/log2.h>
#include <li... | cwe | CWE-362 | C/C++ |
public static function get_javascript()
{
// Make sure cURL is installed
if ( ! function_exists('curl_exec'))
{
throw new Kohana_Exception('footer.cURL_not_installed');
return false;
}
// Get the stat id
$stat_id = Settings_Model::get_setting('stat_id');
// If stats isn't set, ignore this
if ($... | cwe | CWE-79 | PHP |
bool Instance::HandleInputEvent(const pp::InputEvent& event) {
pp::InputEvent event_device_res(event);
{
pp::MouseInputEvent mouse_event(event);
if (!mouse_event.is_null()) {
pp::Point point = mouse_event.GetPosition();
pp::Point movement = mouse_event.GetMovement();
ScalePoint(device_scal... | cwe | CWE-119 | C/C++ |
static MagickBooleanType ReadPSDChannel(Image *image,
const ImageInfo *image_info,const PSDInfo *psd_info,LayerInfo* layer_info,
const size_t channel,const PSDCompressionType compression,
ExceptionInfo *exception)
{
Image
*channel_image,
*mask;
MagickOffsetType
offset;
MagickBooleanType
st... | cwe | CWE-476 | C/C++ |
TPM2B_TIMEOUT_Marshal(TPM2B_TIMEOUT *source, BYTE **buffer, INT32 *size)
{
UINT16 written = 0;
written += TPM2B_Marshal(&source->b, buffer, size);
return written;
} | cwe | CWE-787 | Unknown |
// go run mksyscall.go -l32 -tags darwin,386,go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_386.go
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build darwin,386,go1.12
package unix
import (
"syscall"
"unsafe"
)
var _ syscall.Errno
// THIS FILE IS GENERATED BY THE COMMAND AT THE... | cwe | CWE-287 | Go |
static struct n_hdlc *n_hdlc_alloc(void)
{
struct n_hdlc_buf *buf;
int i;
struct n_hdlc *n_hdlc = kzalloc(sizeof(*n_hdlc), GFP_KERNEL);
if (!n_hdlc)
return NULL;
spin_lock_init(&n_hdlc->rx_free_buf_list.spinlock);
spin_lock_init(&n_hdlc->tx_free_buf_list.spinlock);
spin_lock_init(&n_hdlc->rx_buf_list.spinloc... | cwe | CWE-362 | Unknown |
/*
* iso_presentation.c
*
* Copyright 2013-2022 Michael Zillgith
*
* This file is part of libIEC61850.
*
* libIEC61850 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 Lic... | cwe | CWE-835 | C/C++ |
evbuffer_ptr_set(struct evbuffer *buf, struct evbuffer_ptr *pos,
size_t position, enum evbuffer_ptr_how how)
{
size_t left = position;
struct evbuffer_chain *chain = NULL;
int result = 0;
EVBUFFER_LOCK(buf);
switch (how) {
case EVBUFFER_PTR_SET:
chain = buf->first;
pos->pos = position;
position = 0;
... | cwe | CWE-189 | Unknown |
static int check_stack_boundary(struct bpf_verifier_env *env, int regno,
int access_size, bool zero_size_allowed,
struct bpf_call_arg_meta *meta)
{
struct bpf_verifier_state *state = env->cur_state;
struct bpf_reg_state *regs = state->regs;
int off, i, slot, spi;
if (regs[regno].type != PTR_TO_STACK) {
/... | cwe | CWE-119 | C/C++ |
GF_Err gp_rtp_builder_do_avc(GP_RTPPacketizer *builder, u8 *nalu, u32 nalu_size, u8 IsAUEnd, u32 FullAUSize)
{
u32 do_flush, bytesLeft, size, nal_type;
char shdr[2];
char stap_hdr;
do_flush = 0;
if (!nalu) do_flush = 1;
/*we only do STAP or SINGLE modes*/
else if (builder->sl_header.accessUnitStartFlag) do_flus... | cwe | CWE-787 | Unknown |
TfLiteStatus TanhEval(TfLiteContext* context, TfLiteNode* node) {
OpData* data = reinterpret_cast<OpData*>(node->user_data);
const TfLiteTensor* input = GetInput(context, node, 0);
TfLiteTensor* output = GetOutput(context, node, 0);
switch (input->type) {
case kTfLiteFloat32: {
if (kernel_type == kRef... | cwe | CWE-787 | C/C++ |
TEST_F(ConnectionHandlerTest, ListenerFilterDisabledTimeout) {
InSequence s;
TestListener* test_listener =
addListener(1, true, false, "test_listener", Network::Address::SocketType::Stream,
std::chrono::milliseconds());
Network::MockListener* listener = new Network::MockListener();
Netw... | cwe | CWE-835 | Unknown |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-20 | C/C++ |
static int sctp_process_inv_paramlength(const struct sctp_association *asoc,
struct sctp_paramhdr *param,
const struct sctp_chunk *chunk,
struct sctp_chunk **errp)
{
static const char error[] = "The following parameter had invalid length:";
size_t payload_len = WORD_ROUND(sizeof(error)) +
sizeof... | cwe | CWE-20 | Unknown |
/*
* Copyright 2017-2019 original 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 agre... | cwe | CWE-400 | Java |
int cli_scanxar(cli_ctx *ctx)
{
int rc = CL_SUCCESS;
unsigned int cksum_fails = 0;
unsigned int extract_errors = 0;
#if HAVE_LIBXML2
int fd = -1;
struct xar_header hdr;
fmap_t *map = *ctx->fmap;
long length, offset, size, at;
int encoding;
z_stream strm;
char *toc, *tmpname;
... | cwe | CWE-125 | Unknown |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
auto* params = reinterpret_cast<TfLiteMfccParams*>(node->user_data);
const TfLiteTensor* input_wav = GetInput(context, node, kInputTensorWav);
const TfLiteTensor* input_rate = GetInput(context, node, kInputTensorRate);
TfLiteTensor* output = GetOutp... | cwe | CWE-125 | C/C++ |
static int decode_cblk(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty,
Jpeg2000T1Context *t1, Jpeg2000Cblk *cblk,
int width, int height, int bandpos)
{
int passno = cblk->npasses, pass_t = 2, bpno = cblk->nonzerobits - 1, y;
int clnpass_cnt = 0;
int bpa... | cwe | CWE-119 | C/C++ |
static void __init netlink_add_usersock_entry(void)
{
struct listeners *listeners;
int groups = 32;
listeners = kzalloc(sizeof(*listeners) + NLGRPSZ(groups), GFP_KERNEL);
if (!listeners)
panic("netlink_add_usersock_entry: Cannot allocate listeners\n");
netlink_table_grab();
nl_table[NETLINK_USERSOCK].groups ... | cwe | CWE-284 | C/C++ |
package com.salesmanager.shop.application.config;
import static org.springframework.http.MediaType.IMAGE_GIF;
import static org.springframework.http.MediaType.IMAGE_JPEG;
import static org.springframework.http.MediaType.IMAGE_PNG;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import org.ap... | cwe | CWE-79 | Java |
def get_top_popular(top_num):
""" query the top(top_num) popular articles
top_num => list of [title, count]
"""
cmd = """SELECT title, views FROM articles
INNER JOIN (
SELECT path, count(path) AS views
FROM log GROUP BY log.path
) AS log
... | cwe | CWE-89 | Python |
int tcp_fragment(struct sock *sk, enum tcp_queue tcp_queue,
struct sk_buff *skb, u32 len,
unsigned int mss_now, gfp_t gfp)
{
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *buff;
int nsize, old_factor;
int nlen;
u8 flags;
if (WARN_ON(len > skb->len))
return -EINVAL;
nsize = skb_headlen(skb) - len;
i... | cwe | CWE-400 | C/C++ |
/*
* Server-side procedures for NFSv4.
*
* Copyright (c) 2002 The Regents of the University of Michigan.
* All rights reserved.
*
* Kendrick Smith <kmsmith@umich.edu>
* Andy Adamson <andros@umich.edu>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted... | cwe | CWE-404 | C/C++ |
public void reportJobCaches(byte[] cacheInstanceBytes) {
@SuppressWarnings("unchecked")
Collection<CacheInstance> cacheInstances = (Collection<CacheInstance>) SerializationUtils
.deserialize(cacheInstanceBytes);
jobManager.reportJobCaches(getJobToken(), cacheInstances);
} | cwe | CWE-502 | Java |
reverseSamplesBytes (uint16 spp, uint16 bps, uint32 width,
uint8 *src, uint8 *dst)
{
int i;
uint32 col, bytes_per_pixel, col_offset;
uint8 bytebuff1;
unsigned char swapbuff[32];
if ((src == NULL) || (dst == NULL))
{
TIFFError("reverseSamplesBytes","Invalid input or output... | cwe | CWE-119 | C/C++ |
package main
import (
"crypto/tls"
"flag"
"github.com/TykTechnologies/tyk-identity-broker/backends"
"github.com/TykTechnologies/tyk-identity-broker/configuration"
"github.com/TykTechnologies/tyk-identity-broker/data_loader"
"github.com/TykTechnologies/tyk-identity-broker/initializer"
"net"
"net/http"
"strconv... | cwe | CWE-287 | Go |
/* exif-mnote-data-canon.c
*
* Copyright (c) 2002, 2003 Lutz Mueller <lutz@users.sourceforge.net>
* Copyright (c) 2003 Matthieu Castet <mat-c@users.sourceforge.net>
*
* This library 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++ |
package unzip
import (
"archive/zip"
"errors"
"io"
"io/ioutil"
"net/http"
"os"
"os/exec"
"path"
"path/filepath"
"runtime"
"time"
)
var (
netClient = &http.Client{
Timeout: time.Duration(3600 * time.Second),
}
)
// Unzip - struct
type Unzip struct {
Src string
Dest string
}
// New - Create a new Un... | cwe | CWE-22 | Go |
static int sclp_ctl_ioctl_sccb(void __user *user_area)
{
struct sclp_ctl_sccb ctl_sccb;
struct sccb_header *sccb;
int rc;
if (copy_from_user(&ctl_sccb, user_area, sizeof(ctl_sccb)))
return -EFAULT;
if (!sclp_ctl_cmdw_supported(ctl_sccb.cmdw))
return -EOPNOTSUPP;
sccb = (void *) get_zeroed_page(GFP_KER... | cwe | CWE-362 | C/C++ |
/* Copyright 2017 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-119 | C/C++ |
def handle(self, command, kwargs=None):
"""
Dispatch and handle processing of the given command.
:param command: Name of command to run.
:type command: unicode
:param kwargs: Arguments to pass to the command handler. If empty, `request.POST` is used.
:type kwargs: dict
... | cwe | CWE-79 | Python |
function finish () {
if (!that.disconnected && that.will) {
that.broker.publish(that.will, that, function (err) {
if (!err) {
that.broker.persistence.delWill({
id: that.id,
brokerId: that.broker.id
}, nop)
}
})
that.will = null // this fu... | cwe | CWE-285 | JavaScript |
static int fuse_do_getattr(struct inode *inode, struct kstat *stat,
struct file *file)
{
int err;
struct fuse_getattr_in inarg;
struct fuse_attr_out outarg;
struct fuse_mount *fm = get_fuse_mount(inode);
FUSE_ARGS(args);
u64 attr_version;
attr_version = fuse_get_attr_version(fm->fc);
memset(&inarg, 0, s... | cwe | CWE-459 | C/C++ |
/* eslint-disable */
// import assign from "nano-assign";
// import sqlAutoCompletions from "./sqlAutoCompletions";
// import {ext} from "vee-validate/dist/rules.esm";
export default {
name: "MonacoJsonEditor",
props: {
value: {
default: "",
type: String
},
theme: {
type: String,
... | cwe | CWE-400 | JavaScript |
package udsserver
import (
"encoding/json"
"errors"
"fmt"
"k8s.io/klog/v2"
beehiveContext "github.com/kubeedge/beehive/pkg/core/context"
"github.com/kubeedge/beehive/pkg/core/model"
hubmodel "github.com/kubeedge/kubeedge/cloud/pkg/cloudhub/common/model"
"github.com/kubeedge/kubeedge/common/constants"
)
// S... | cwe | CWE-476 | Go |
/*
* 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 |
parsePath (rawPath, opts = {}) {
let pathObj = {
locale: WIKI.config.lang.code,
path: 'home',
private: false,
privateNS: '',
explicitLocale: false
}
// Clean Path
rawPath = _.trim(qs.unescape(rawPath))
if (_.startsWith(rawPath, '/')) { rawPath = rawPath.substring(1) }
... | cwe | CWE-22 | JavaScript |
'X-Parse-Session-Token': user1.getSessionToken(),
},
},
});
let foundGraphQLClassReadPreference = false;
let foundUserClassReadPreference = false;
databaseAdapter.database.serverConfig.cursor.calls
.... | cwe | CWE-863 | JavaScript |
constructor (range, options) {
options = parseOptions(options)
if (range instanceof Range) {
if (
range.loose === !!options.loose &&
range.includePrerelease === !!options.includePrerelease
) {
return range
} else {
return new Range(range.raw, options)
}
... | cwe | CWE-1333 | JavaScript |
/*
IIP JTL Command Handler Class Member Function: Export a single tile
Copyright (C) 2006-2021 Ruven Pillay.
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 3 of t... | cwe | CWE-190 | C/C++ |
int __kvm_set_memory_region(struct kvm *kvm,
struct kvm_userspace_memory_region *mem,
int user_alloc)
{
int r;
gfn_t base_gfn;
unsigned long npages;
unsigned long i;
struct kvm_memory_slot *memslot;
struct kvm_memory_slot old, new;
struct kvm_memslots *slots, *old_memslots;
r = -EINVAL;
/* Gener... | cwe | CWE-264 | Unknown |
int tm_adopt(
char *id,
int adoptCmd,
pid_t pid)
{
int rc = TM_SUCCESS;
int status, ret;
pid_t sid;
char *env;
struct tcp_chan *chan = NULL;
sid = getsid(pid);
/* Must be the only call to call to tm and
must only be called once */
if (init_done) return TM_BADINIT;
init_done... | cwe | CWE-264 | Unknown |
static void cil_reset_classpermission(struct cil_classpermission *cp)
{
if (cp == NULL) {
return;
}
cil_reset_classperms_list(cp->classperms);
} | cwe | CWE-416 | Unknown |
/* radare2 - LGPL - Copyright 2018-2022 - pancake, mrmacete, keegan */
#include <r_types.h>
#include <r_util.h>
#include <r_lib.h>
#include <r_bin.h>
#include <r_core.h>
#include <r_io.h>
#include <ht_pu.h>
// #include "../format/mach0/mach0_defines.h"
#define R_BIN_MACH064 1
#include "../format/mach0/mach0.h"
#includ... | cwe | CWE-787 | C/C++ |
/*
Copyright The containerd 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... | cwe | CWE-200 | Go |
function ame_ajax_set_linkvisibility( link_id ) {
var ame_sack = new sack( ajaxurl );
ame_sack.execute = 1;
ame_sack.method = 'POST';
ame_sack.setVar( "action", "ame_toggle_linkvisibility" );
ame_sack.setVar( "link_id", link_id );
ame_sack.onError = function() { alert('Ajax error on toggling link visibility') };
... | cwe | CWE-352 | JavaScript |
static inline ut8 r_read_le8(const void *src) {
return r_read_ble8 (src);
} | cwe | CWE-476 | Unknown |
TEE_Result syscall_asymm_operate(unsigned long state,
const struct utee_attribute *usr_params,
size_t num_params, const void *src_data, size_t src_len,
void *dst_data, uint64_t *dst_len)
{
TEE_Result res;
struct tee_cryp_state *cs;
struct tee_ta_session *sess;
uint64_t dlen64;
size_t dlen;
struct tee_obj... | cwe | CWE-787 | Unknown |
$descr .= "\n".htmlspecialchars($cert['descr']);
}
}
echo haproxyicon("cert", "SSL offloading cert: {$descr}");
}
$isadvset = "";
if ($frontend['advanced_bind']) {
$isadvset .= "Advanced bind: ".htmlspecialchars($frontend['advanced_bind'])."\r\n";
}
if ($frontend['adva... | cwe | CWE-79 | PHP |
void SendHandwritingStroke(const HandwritingStroke& stroke) {
if (stroke.size() < 2) {
LOG(WARNING) << "Empty stroke data or a single dot is passed.";
return;
}
IBusInputContext* context = GetInputContext(input_context_path_, ibus_);
if (!context) {
return;
}
const size_t ... | cwe | CWE-20 | C/C++ |
function uninstallPage()
{
$id = $this->getId();
if(empty($_POST['uninstall_confirm']))
{
$plug_vars = e107::getPlug()->load($id)->getMeta();
$name = e107::getPlug()->getName();
$this->addTitle(EPL_ADLAN_63);
$this->addTitle($name);
return $this->pluginConfirmUninstall($plug_vars);
... | cwe | CWE-352 | PHP |
static int _hostresolver_getaddrinfo(
oe_resolver_t* resolver,
const char* node,
const char* service,
const struct oe_addrinfo* hints,
struct oe_addrinfo** res)
{
int ret = OE_EAI_FAIL;
uint64_t handle = 0;
struct oe_addrinfo* head = NULL;
struct oe_addrinfo* tail = NULL;
struct ... | cwe | CWE-200 | Unknown |
ma);H.moveCells(ma,N,W)},!0,u);u=null}else if("organic"==P||"auto"==P&&ma.length>y.length){H.view.validate();var wa=new mxFastOrganicLayout(H);wa.forceConstant=3*fa;wa.disableEdgeStyle=!1;wa.resetEdges=!1;var Ea=wa.isVertexIgnored;wa.isVertexIgnored=function(Da){return Ea.apply(this,arguments)||0>mxUtils.indexOf(y,Da)}... | cwe | CWE-20 | JavaScript |
void dd_save_text(struct dump_dir *dd, const char *name, const char *data)
{
if (!dd->locked)
error_msg_and_die("dump_dir is not opened"); /* bug */
if (!str_is_correct_filename(name))
error_msg_and_die("Cannot save text. '%s' is not a valid file name", name);
char *full_path = concat_path... | cwe | CWE-20 | Unknown |
public String createEmbedJavaScript(HttpServletRequest request)
throws IOException
{
String sparam = request.getParameter("s");
String dev = request.getParameter("dev");
StringBuffer result = new StringBuffer("[");
StringBuffer js = new StringBuffer("");
// Processes each stencil only once
HashSet<Stri... | cwe | CWE-918 | JavaScript |
package com.salesmanager.shop.model.catalog.product.attribute;
import java.io.Serializable;
import java.math.BigDecimal;
import com.salesmanager.shop.model.catalog.product.attribute.api.ProductAttributeEntity;
public class PersistableProductAttribute extends ProductAttributeEntity
implements Serializable {
priv... | cwe | CWE-79 | Java |
package api
import (
log "github.com/Sirupsen/logrus"
"github.com/ansible-semaphore/semaphore/api/helpers"
"github.com/ansible-semaphore/semaphore/db"
"github.com/ansible-semaphore/semaphore/util"
"github.com/gorilla/context"
"net/http"
"strings"
"time"
)
func authenticationHandler(w http.ResponseWriter, r *h... | cwe | CWE-287 | Go |
from math import ceil
from vyper.codegen.core import ensure_in_memory
from vyper.codegen.ir_node import IRnode
from vyper.codegen.types import BaseType, ByteArrayLike, is_base_type
from vyper.exceptions import CompilerPanic
from vyper.utils import MemoryPositions, bytes_to_int, keccak256
def _check_byteslike(typ, _e... | cwe | CWE-697 | Python |
import logging.handlers
import yaml
import importlib
import threading
try:
from queue import Queue
except ImportError:
from Queue import Queue
from pystemon.sendmail import PystemonSendmail
from pystemon.storage import PastieStorage
from pystemon.proxy import ProxyList
from pystemon.pastiesearch import Pastie... | cwe | CWE-502 | Python |
/*!
* merge-deep <https://github.com/jonschlinkert/merge-deep>
*
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License.
*/
'use strict';
var union = require('arr-union');
var clone = require('clone-deep');
var typeOf = require('kind-of');
module.exports = function mergeDeep(orig, objects) ... | cwe | CWE-915 | JavaScript |
mesh_state_create(struct module_env* env, struct query_info* qinfo,
struct respip_client_info* cinfo, uint16_t qflags, int prime,
int valrec)
{
struct regional* region = alloc_reg_obtain(env->alloc);
struct mesh_state* mstate;
int i;
if(!region)
return NULL;
mstate = (struct mesh_state*)regional_alloc(region, ... | cwe | CWE-613 | Unknown |
private String displayCategory(final String friendlyUrl, final String ref, Model model, HttpServletRequest request, HttpServletResponse response, Locale locale) throws Exception {
MerchantStore store = (MerchantStore)request.getAttribute(Constants.MERCHANT_STORE);
//set ref as request attribute
request.setAtt... | cwe | CWE-79 | Java |
ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
handle_t *handle, unsigned int reserv_clstrs)
{
struct buffer_head *bitmap_bh = NULL;
struct ext4_group_desc *gdp;
struct buffer_head *gdp_bh;
struct ext4_sb_info *sbi;
struct super_block *sb;
ext4_fsblk_t block;
int err, len;
BUG_ON(ac->ac_st... | cwe | CWE-416 | Unknown |
void aes_crypt_ecb( aes_context *ctx,
int mode,
const unsigned char input[16],
unsigned char output[16] )
{
int i;
unsigned long *RK, X0, X1, X2, X3, Y0, Y1, Y2, Y3;
#if defined(XYSSL_PADLOCK_C) && defined(XYSSL_HAVE_X86)
if( padlock_supports( PAD... | cwe | CWE-908 | C/C++ |
void initialize(const string &path, bool owner) {
TRACE_POINT();
this->path = path;
this->owner = owner;
/* Create the server instance directory. We only need to write to this
* directory for these reasons:
* 1. Initial population of structure files (structure_version.txt, instance.pid).
* 2. Creat... | cwe | CWE-59 | C/C++ |
/*
* Copyright (c) 2004-2021, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
* list of cond... | cwe | CWE-918 | Java |
void HeaderMapImpl::remove(const LowerCaseString& key) {
EntryCb cb = ConstSingleton<StaticLookupTable>::get().find(key.get());
if (cb) {
StaticLookupResponse ref_lookup_response = cb(*this);
removeInline(ref_lookup_response.entry_);
} else {
for (auto i = headers_.begin(); i != headers_.end();) {
... | cwe | CWE-703 | Unknown |
rename_principal_2_svc(rprinc_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg1,
*prime_arg2;
gss_buffer_desc client_name,
service_name;
OM_uint32 minor_stat;
kadm5_server_handle_t handle;
... | cwe | CWE-772 | C/C++ |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | cwe | CWE-502 | Java |
'use strict';
(function (factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory();
process.profile = function (operation, start) {
console.log('%s took %d milliseconds', operation, process.elapsedTimeSince(start));
};
process.elapsedTimeSince = function (start) {
const... | cwe | CWE-330 | JavaScript |
$sanitized_description = $hp->purify($fileinfo->getDescription(), CODENDI_PURIFIER_CONVERT_HTML);
$link_show = '<a href="' . $query_link . '"' .
$this->getVisioningAttributeForLink($fileinfo, $read_only, $lytebox_id) . '
title="' . $sani... | cwe | CWE-79 | PHP |
mxEvent.getSource(F);null!=G;){if(G==v||G==x){F.stopPropagation();F.preventDefault();break}G=G.parentNode}});var K=function(F){return function(G,N,J,E,H,S,U,Q,W){null!=W&&(/(\.v(dx|sdx?))($|\?)/i.test(W.name)||/(\.vs(x|sx?))($|\?)/i.test(W.name))?b.importVisio(W,mxUtils.bind(this,function(V){c(V,N,J,E,H,S,U,"fixed",mxE... | cwe | CWE-20 | JavaScript |
void CLASS foveon_dp_load_raw()
{
unsigned c, roff[4], row, col, diff;
ushort huff[512], vpred[2][2], hpred[2];
fseek (ifp, 8, SEEK_CUR);
foveon_huff (huff);
roff[0] = 48;
FORC3 roff[c+1] = -(-(roff[c] + get4()) & -16);
FORC3 {
fseek (ifp, data_offset+roff[c], SEEK_SET);
getbits(-1);
vpred[0]... | cwe | CWE-190 | Unknown |
static void vmxnet3_activate_device(VMXNET3State *s)
{
int i;
VMW_CFPRN("MTU is %u", s->mtu);
s->max_rx_frags =
VMXNET3_READ_DRV_SHARED16(s->drv_shmem, devRead.misc.maxNumRxSG);
if (s->max_rx_frags == 0) {
s->max_rx_frags = 1;
}
VMW_CFPRN("Max RX fragments is %u", s->max_rx_... | cwe | CWE-20 | C/C++ |
def main():
global word
print("Starting script... press 'ctrl+c' in terminal to turn off")
while True:
if pyperclip.paste() != word and len(pyperclip.paste().split())<5:
word = pyperclip.paste()
wordChc=False
req = requests.get("https://api-portal.dictionary.com/d... | cwe | CWE-78 | Python |
/************************************************************************
* 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 |
static void blk_mq_sched_tags_teardown(struct request_queue *q)
{
struct blk_mq_tag_set *set = q->tag_set;
struct blk_mq_hw_ctx *hctx;
int i;
queue_for_each_hw_ctx(q, hctx, i)
blk_mq_sched_free_tags(set, hctx, i);
} | cwe | CWE-416 | Unknown |
WebRunnerBrowserContext::~WebRunnerBrowserContext() {
if (resource_context_) {
content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE,
std::move(resource_context_));
}
} | cwe | CWE-264 | C/C++ |
static int fsck_gitmodules_fn(const char *var, const char *value, void *vdata)
{
struct fsck_gitmodules_data *data = vdata;
const char *subsection, *key;
int subsection_len;
char *name;
if (parse_config_key(var, "submodule", &subsection, &subsection_len, &key) < 0 ||
!subsection)
return 0;
name = xmemdup... | cwe | CWE-20 | Unknown |
static int parse_video_info(AVIOContext *pb, AVStream *st)
{
uint16_t size_asf; // ASF-specific Format Data size
uint32_t size_bmp; // BMP_HEADER-specific Format Data size
unsigned int tag;
st->codecpar->width = avio_rl32(pb);
st->codecpar->height = avio_rl32(pb);
avio_skip(pb, 1); // skip res... | cwe | CWE-119 | C/C++ |
int RGWGetObj_ObjStore_S3::send_response_data(bufferlist& bl, off_t bl_ofs,
off_t bl_len)
{
const char *content_type = NULL;
string content_type_str;
map<string, string> response_attrs;
map<string, string>::iterator riter;
bufferlist metadata_bl;
if (sent_header)
goto send_data;
if (custo... | cwe | CWE-79 | Unknown |
mp_sint32 LoaderS3M::load(XMFileBase& f, XModule* module)
{
module->cleanUp();
// this will make code much easier to read
TXMHeader* header = &module->header;
TXMInstrument* instr = module->instr;
TXMSample* smp = module->smp;
TXMPattern* phead = module->phead;
// we're already out of memory here
if... | cwe | CWE-787 | C/C++ |
@register.tag
@basictag(takes_context=True)
def gravatar(context, user, size=None):
"""
Outputs the HTML for displaying a user's gravatar.
This can take an optional size of the image (defaults to 80 if not
specified).
This is also influenced by the following settings:
GRAVATAR_SIZE - D... | cwe | CWE-79 | Python |
public static function wpSetUpBeforeClass( $factory ) {
self::make_user_by_role( 'administrator' );
self::$post = $factory->post->create_and_get();
} | cwe | CWE-862 | PHP |
def add_input(self, data):
connection = self.connect()
try:
# The following introduces a deliberate security flaw.See section on SQL injection below
query = "INSERT INTO crimes (description) VALUES('{}');".format(data)
with connection.cursor() as cursor:
cursor.execute(query)
connection.commit()
... | cwe | CWE-89 | Python |
int main(int argc, char **argv) {
FILE *infile = NULL;
VpxVideoWriter *writer = NULL;
vpx_codec_ctx_t codec;
vpx_codec_enc_cfg_t cfg;
vpx_image_t raw;
vpx_codec_err_t res;
vpx_fixed_buf_t stats = {0};
VpxVideoInfo info = {0};
const VpxInterface *encoder = NULL;
int pass;
const int fps = 30;... | cwe | CWE-119 | C/C++ |
from __future__ import annotations
from datetime import timedelta as td
from django import forms
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from hc.accounts.models import REPORT_CHOICES, Member
from hc.api.models import TokenBucket
from hc.lib.tz import all_timezones
c... | cwe | CWE-203 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.