code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
// A RestWrite encapsulates everything we need to run an operation
// that writes to the database.
// This could be either a "create" or an "update".
var SchemaController = require('./Controllers/SchemaController');
var deepcopy = require('deepcopy');
const Auth = require('./Auth');
var cryptoUtils = require('./crypt... | cwe | CWE-287 | JavaScript |
char *strdup(const char *s1)
{
char *s2 = 0;
if (s1) {
s2 = malloc(strlen(s1) + 1);
strcpy(s2, s1);
}
return s2;
} | cwe | CWE-119 | C/C++ |
static int rose_getname(struct socket *sock, struct sockaddr *uaddr,
int *uaddr_len, int peer)
{
struct full_sockaddr_rose *srose = (struct full_sockaddr_rose *)uaddr;
struct sock *sk = sock->sk;
struct rose_sock *rose = rose_sk(sk);
int n;
if (peer != 0) {
if (sk->sk_state != TCP_ESTABLISHED)
return -ENOTC... | cwe | CWE-200 | C/C++ |
public Optional<InputStream> getResourceAsStream(String path) {
Path filePath = getFilePath(normalize(path));
try {
return Optional.of(Files.newInputStream(filePath));
} catch (IOException e) {
return Optional.empty();
}
} | cwe | CWE-22 | Java |
/* 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-908 | C/C++ |
TEST(QueryProjectionTest, InvalidElemMatchWhereProjection) {
assertInvalidProjection("{}", "{a: {$elemMatch: {$where: 'this.a == this.b'}}}");
} | cwe | CWE-732 | Unknown |
/* $Id$ */
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
*
* 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; eit... | cwe | CWE-835 | C/C++ |
void PPB_URLLoader_Impl::LastPluginRefWasDeleted(bool instance_destroyed) {
Resource::LastPluginRefWasDeleted(instance_destroyed);
if (instance_destroyed) {
loader_.reset();
}
} | cwe | CWE-416 | C/C++ |
void __init pt_regs_check(void)
{
BUILD_BUG_ON(offsetof(struct pt_regs, gpr) !=
offsetof(struct user_pt_regs, gpr));
BUILD_BUG_ON(offsetof(struct pt_regs, nip) !=
offsetof(struct user_pt_regs, nip));
BUILD_BUG_ON(offsetof(struct pt_regs, msr) !=
offsetof(struct user_pt_regs, msr));
BUILD_BUG_ON... | cwe | CWE-284 | Unknown |
static int report_block(struct dquot *dquot, unsigned int blk, char *bitmap,
int (*process_dquot) (struct dquot *, void *),
void *data)
{
struct qtree_mem_dqinfo *info =
&dquot->dq_h->qh_info.u.v2_mdqi.dqi_qtree;
dqbuf_t buf = getdqbuf();
struct qt_disk_dqdbheader *dh;
char *ddata;
int entries, i;
if (!... | cwe | CWE-787 | Unknown |
void WebGraphicsContext3DCommandBufferImpl::FlipVertically(
uint8* framebuffer,
unsigned int width,
unsigned int height) {
uint8* scanline = scanline_.get();
if (!scanline)
return;
unsigned int row_bytes = width * 4;
unsigned int count = height / 2;
for (unsigned int i = 0; i < count; i... | cwe | CWE-119 | C/C++ |
void dostor(char *name, const int append, const int autorename)
{
ULHandler ulhandler;
int f;
const char *ul_name = NULL;
const char *atomic_file = NULL;
off_t filesize = (off_t) 0U;
struct stat st;
double started = 0.0;
signed char overwrite = 0;
int overflow = 0;
int ret = -1;
... | cwe | CWE-434 | C/C++ |
void imap_quote_string(char *dest, size_t dlen, const char *src, bool quote_backtick)
{
const char *quote = "`\"\\";
if (!quote_backtick)
quote++;
char *pt = dest;
const char *s = src;
*pt++ = '"';
/* save room for trailing quote-char */
dlen -= 2;
for (; *s && dlen; s++)
{
if (strchr(quote... | cwe | CWE-787 | C/C++ |
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache... | cwe | CWE-22 | Java |
BIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N)
{
/* k = SHA1(PAD(A) || PAD(B) ) -- tls-srp draft 8 */
BIGNUM *u;
unsigned char cu[SHA_DIGEST_LENGTH];
unsigned char *cAB;
EVP_MD_CTX ctxt;
int longN;
if ((A == NULL) ||(B == NULL) || (N == NULL))
return NULL;
if ((A == NULL) ||(B == NULL) || (N... | cwe | CWE-119 | C/C++ |
package getter
import "net/url"
// RedactURL is a port of url.Redacted from the standard library,
// which is like url.String but replaces any password with "xxxxx".
// Only the password in u.URL is redacted. This allows the library
// to maintain compatibility with go1.14.
func RedactURL(u *url.URL) string {
if u =... | cwe | CWE-532 | Go |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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-770 | Go |
/*
* Copyright 2004-present Facebook, 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 a... | cwe | CWE-20 | C/C++ |
int ZEXPORT deflateCopy (dest, source)
z_streamp dest;
z_streamp source;
{
#ifdef MAXSEG_64K
return Z_STREAM_ERROR;
#else
deflate_state *ds;
deflate_state *ss;
ushf *overlay;
if (deflateStateCheck(source) || dest == Z_NULL) {
return Z_STREAM_ERROR;
}
ss = source->state;
... | cwe | CWE-284 | Unknown |
ProcessTCPHeader(tTcpIpPacketParsingResult _res, PVOID pIpHeader, ULONG len, USHORT ipHeaderSize)
{
ULONG tcpipDataAt;
tTcpIpPacketParsingResult res = _res;
tcpipDataAt = ipHeaderSize + sizeof(TCPHeader);
res.xxpStatus = ppresXxpIncomplete;
res.TcpUdp = ppresIsTCP;
if (len >= tcpipDataAt)
{... | cwe | CWE-20 | C/C++ |
/* radare2 - LGPL - Copyright 2016-2017 - Davis, Alex Kornitzer */
#include <r_util.h>
#include "mdmp.h"
// XXX: this is a random number, no idea how long it should be.
#define COMMENTS_SIZE 32
ut64 r_bin_mdmp_get_paddr(struct r_bin_mdmp_obj *obj, ut64 vaddr) {
/* FIXME: Will only resolve exact matches, probably no... | cwe | CWE-400 | C/C++ |
package com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger;
import com.sonyericsson.hudson.plugins.gerrit.trigger.GerritServer;
import com.sonyericsson.hudson.plugins.gerrit.trigger.Messages;
import com.sonyericsson.hudson.plugins.gerrit.trigger.PluginImpl;
import com.sonyericsson.hudson.plugins.gerrit.trigg... | cwe | CWE-352 | Java |
/**
* Edit this
* Page[[N|Solid](img/GitHub-Mark-32px.png)](https://github.com/mermaid-js/mermaid/blob/develop/src/mermaidAPI.js)
*
* This is the API to be used when optionally handling the integration with the web page, instead of
* using the default integration provided by mermaid.js.
*
* The core of this api ... | cwe | CWE-74 | JavaScript |
/**
* @license
* Lodash <https://lodash.com/>
* Copyright JS Foundation and other contributors <https://js.foundation/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters ... | cwe | CWE-284 | JavaScript |
private void downloadAndUnpackResource(final Location source,
final File targetFolder) throws InterruptedException, ExecutionException,
IOException
{
// allocate array
final ByteArray byteArray = new ByteArray(1024 * 1024);
log.debug("Started download of " + source.getURI());
// Download the zip file
fi... | cwe | CWE-22 | Java |
function access_get_project_level( $p_project_id = null, $p_user_id = null ) {
if( null === $p_user_id ) {
$p_user_id = auth_get_current_user_id();
}
# Deal with not logged in silently in this case
/** @todo we may be able to remove this and just error and once we default to anon login, we can remove it for sure... | cwe | CWE-264 | PHP |
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (c) 1999-2001 Vojtech Pavlik
*/
/*
* Sun keyboard driver for Linux
*/
/*
*/
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/input.h>
#include <linux/serio... | cwe | CWE-416 | C/C++ |
public function execute()
{
parent::execute();
// get parameters
$term = SpoonFilter::getPostValue('term', null, '');
// validate
if($term == '') $this->output(self::BAD_REQUEST, null, 'term-parameter is missing.');
// previous search result
$previousTerm = SpoonSession::exists('searchTerm') ? SpoonSe... | cwe | CWE-79 | PHP |
int usb_cypress_load_firmware(struct usb_device *udev, const struct firmware *fw, int type)
{
struct hexline *hx;
u8 reset;
int ret,pos=0;
hx = kmalloc(sizeof(*hx), GFP_KERNEL);
if (!hx)
return -ENOMEM;
/* stop the CPU */
reset = 1;
if ((ret = usb_cypress_writemem(udev,cypress[type].cpu_cs_register,&r... | cwe | CWE-119 | C/C++ |
/*
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 |
static inline int pmd_none_or_trans_huge_or_clear_bad(pmd_t *pmd)
{
/* depend on compiler for an atomic pmd read */
pmd_t pmdval = *pmd;
/*
* The barrier will stabilize the pmdval in a register or on
* the stack so that it will stop changing under the code.
*/
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
barrier();
#en... | cwe | CWE-362 | C/C++ |
def getAllComments(self):
sqlText="select comment from comments where userid=%d order by date;"
allposts=sql.queryDB(self.conn,sqlText)
return allposts; | cwe | CWE-89 | Python |
int ssl2_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p)
{
long l;
if (p != NULL)
{
l=c->id;
if ((l & 0xff000000) != 0x02000000) return(0);
p[0]=((unsigned char)(l>>16L))&0xFF;
p[1]=((unsigned char)(l>> 8L))&0xFF;
p[2]=((unsigned char)(l ))&0xFF;
}
return(3);
} | cwe | CWE-310 | Unknown |
/*
Copyright (C) 2010 ABRT team
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 your option) any later version.
This program is distributed in th... | cwe | CWE-59 | C/C++ |
/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2009-2014 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
*
* OpenNMS(... | cwe | CWE-352 | Java |
int unit_patch_contexts(Unit *u) {
CGroupContext *cc;
ExecContext *ec;
unsigned i;
int r;
assert(u);
/* Patch in the manager defaults into the exec and cgroup
* contexts, _after_ the rest of the settings have been
* initialized */
ec = unit_ge... | cwe | CWE-269 | C/C++ |
Status SparseTensorToCSRSparseMatrixCPUFunctor::operator()(
const int64 batch_size, const int num_rows,
TTypes<int64>::ConstMatrix indices, TTypes<int32>::Vec batch_ptr,
TTypes<int32>::Vec csr_row_ptr, TTypes<int32>::Vec csr_col_ind) {
// Validate inputs.
if (batch_ptr.size() != batch_size + 1) {
re... | cwe | CWE-369 | C/C++ |
long vorbis_book_decodevv_add(codebook *book,ogg_int32_t **a,
long offset,int ch,
oggpack_buffer *b,int n,int point){
if(book->used_entries>0){
ogg_int32_t *v = book->dec_buf;//(ogg_int32_t *)alloca(sizeof(*v)*book->dim);
long i,j;
int chptr=0;
if (!v) return -1;
for(i=offset;i... | cwe | CWE-200 | C/C++ |
static int encrypted_update(struct key *key, struct key_preparsed_payload *prep)
{
struct encrypted_key_payload *epayload = key->payload.data[0];
struct encrypted_key_payload *new_epayload;
char *buf;
char *new_master_desc = NULL;
const char *format = NULL;
size_t datalen = prep->datalen;
int ret = 0;
if (test... | cwe | CWE-20 | Unknown |
sctp_disposition_t sctp_sf_ootb(struct net *net,
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
{
struct sctp_chunk *chunk = arg;
struct sk_buff *skb = chunk->skb;
sctp_chunkhdr_t *ch;
sctp_errhdr_t *err;
__u8... | cwe | CWE-125 | C/C++ |
static long vop_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
{
struct vop_vdev *vdev = f->private_data;
struct vop_info *vi = vdev->vi;
void __user *argp = (void __user *)arg;
int ret;
switch (cmd) {
case MIC_VIRTIO_ADD_DEVICE:
{
struct mic_device_desc dd, *dd_config;
if (copy_from_user(&dd, ... | cwe | CWE-119 | C/C++ |
static zval *phar_rename_archive(phar_archive_data *phar, char *ext, zend_bool compress TSRMLS_DC) /* {{{ */
{
const char *oldname = NULL;
char *oldpath = NULL;
char *basename = NULL, *basepath = NULL;
char *newname = NULL, *newpath = NULL;
zval *ret, arg1;
zend_class_entry *ce;
char *error;
const char *pcr_err... | cwe | CWE-416 | C/C++ |
tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
{
struct nlmsghdr *nlh;
unsigned char *b = skb->tail;
struct rtattr *x;
struct tc_action_ops *a_o;
struct tc_action a;
int ret = 0;
struct tcamsg *t = (struct tcamsg *) NLMSG_DATA(cb->nlh);
char *kind = find_dump_kind(cb->nlh);
if (kind == NULL)... | cwe | CWE-200 | Unknown |
Status ValidateInput(const OpInputList& indices_list_in,
const OpInputList& values_list_in,
const OpInputList& shapes_list_in,
const OpInputList& dense_list_in) {
const auto size = indices_list_in.size();
// Validates indices_list_in OpInputList.
for ... | cwe | CWE-843 | C/C++ |
static ssize_t add_slot_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t nbytes)
{
char drc_name[MAX_DRC_NAME_LEN];
char *end;
int rc;
if (nbytes >= MAX_DRC_NAME_LEN)
return 0;
memcpy(drc_name, buf, nbytes);
end = strchr(drc_name, '\n');
if (!end)
end = &drc_name[n... | cwe | CWE-120 | C/C++ |
pkinit_server_verify_padata(krb5_context context,
krb5_data *req_pkt,
krb5_kdc_req * request,
krb5_enc_tkt_part * enc_tkt_reply,
krb5_pa_data * data,
krb5_kdcpreauth_callbacks cb,
... | cwe | CWE-264 | C/C++ |
int64 CSteamNetworkConnectionBase::SNP_SendMessage( CSteamNetworkingMessage *pSendMessage, SteamNetworkingMicroseconds usecNow, bool *pbThinkImmediately )
{
int cbData = (int)pSendMessage->m_cbSize;
// Assume we won't want to wake up immediately
if ( pbThinkImmediately )
*pbThinkImmediately = false;
// Check if... | cwe | CWE-787 | Unknown |
psutil_disk_partitions(PyObject *self, PyObject *args) {
int num;
int i;
long len;
uint64_t flags;
char opts[200];
#ifdef PSUTIL_NETBSD
struct statvfs *fs = NULL;
#else
struct statfs *fs = NULL;
#endif
PyObject *py_retlist = PyList_New(0);
PyObject *py_dev = NULL;
PyObject *py_mo... | cwe | CWE-415 | Unknown |
static OPJ_BOOL opj_pi_next_cprl(opj_pi_iterator_t * pi)
{
opj_pi_comp_t *comp = NULL;
opj_pi_resolution_t *res = NULL;
OPJ_UINT32 index = 0;
if (pi->poc.compno0 >= pi->numcomps ||
pi->poc.compno1 >= pi->numcomps + 1) {
opj_event_msg(pi->manager, EVT_ERROR,
"op... | cwe | CWE-125 | Unknown |
int print_calc(
image_desc_t *im)
{
long i, ii, validsteps;
double printval;
struct tm tmvdef;
int graphelement = 0;
long vidx;
int max_ii;
double magfact = -1;
char *si_symb = "";
char *percent_s;
int prline_cnt = 0;
/* wow init... | cwe | CWE-134 | C/C++ |
crypto_retrieve_X509_sans(krb5_context context,
pkinit_plg_crypto_context plgctx,
pkinit_req_crypto_context reqctx,
X509 *cert,
krb5_principal **princs_ret,
krb5_principal **upn_ret,
... | cwe | CWE-287 | C/C++ |
bool Scanner::fill(size_t need)
{
if (eof) return false;
pop_finished_files();
DASSERT(bot <= tok && tok <= lim);
size_t free = static_cast<size_t>(tok - bot);
size_t copy = static_cast<size_t>(lim - tok);
if (free >= need) {
memmove(bot, tok, copy);
shift_ptrs_and_fpos(-stati... | cwe | CWE-787 | C/C++ |
"...");p.value=d;A.updateCellSize(p);if(0<this.maxTextWidth&&p.geometry.width>this.maxTextWidth){var O=A.getPreferredSizeForCell(p,this.maxTextWidth);p.geometry.width=O.width;p.geometry.height=O.height}Graph.isLink(p.value)&&A.setLinkForCell(p,p.value);p.geometry.width+=A.gridSize;p.geometry.height+=A.gridSize}finally{... | cwe | CWE-20 | JavaScript |
SchedulerObject::setAttribute(std::string key,
std::string name,
std::string value,
std::string &text)
{
PROC_ID id = getProcByString(key.c_str());
if (id.cluster < 0 || id.proc < 0) {
dprintf(D_FULLDEBUG, "SetAt... | cwe | CWE-20 | C/C++ |
function networkStatsSingle(iface) {
function parseLinesWindowsPerfData(sections) {
let perfData = [];
for (let i in sections) {
if ({}.hasOwnProperty.call(sections, i)) {
if (sections[i].trim() !== '') {
let lines = sections[i].trim().split('\r\n');
perfData.push({
... | cwe | CWE-78 | JavaScript |
deleteFile(fileName) {
return this.execute("del", fileName, "");
} | cwe | CWE-77 | JavaScript |
static unsigned int tun_chr_poll(struct file *file, poll_table * wait)
{
struct tun_file *tfile = file->private_data;
struct tun_struct *tun = __tun_get(tfile);
struct sock *sk = tun->sk;
unsigned int mask = 0;
if (!tun)
return POLLERR;
DBG(KERN_INFO "%s: tun_chr_poll\n", tun->dev->name);
poll_wait(file, &t... | cwe | CWE-119 | Unknown |
H264PictureToVaapiDecodeSurface(const scoped_refptr<H264Picture>& pic) {
VaapiH264Picture* vaapi_pic = pic->AsVaapiH264Picture();
CHECK(vaapi_pic);
return vaapi_pic->dec_surface();
} | cwe | CWE-362 | C/C++ |
/*
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
di... | cwe | CWE-200 | Go |
package backendplugin
import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"strings"
"sync"
"time"
"github.com/grafana/grafana-aws-sdk/pkg/awsds"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/... | cwe | CWE-79 | Go |
static void buffer_pipe_buf_get(struct pipe_inode_info *pipe,
struct pipe_buffer *buf)
{
struct buffer_ref *ref = (struct buffer_ref *)buf->private;
ref->ref++;
} | cwe | CWE-416 | C/C++ |
protected function _save($fp, $dir, $name, $stat)
{
//TODO optionally encrypt $fp before uploading if mime is not already encrypted type
$path = $this->_joinPath($dir, $name);
return $this->connect->put($path, $fp)
? $path
: false;
} | cwe | CWE-78 | PHP |
QPDF::readObjectAtOffset(bool try_recovery,
qpdf_offset_t offset, std::string const& description,
int exp_objid, int exp_generation,
int& objid, int& generation)
{
if (! this->m->attempt_recovery)
{
try_recovery = false;
}
setLastObjectDescription(description, exp_objid, exp_generati... | cwe | CWE-125 | Unknown |
int TNEFParse(TNEFStruct *TNEF) {
WORD key;
DWORD type;
DWORD size;
DWORD signature;
BYTE *data;
WORD checksum, header_checksum;
int i;
if (TNEF->IO.ReadProc == NULL) {
printf("ERROR: Setup incorrectly: No ReadProc\n");
return YTNEF_INCORRECT_SETUP;
}
if (TNEF->IO.InitProc != NULL) {
D... | cwe | CWE-125 | C/C++ |
/* IIPImage Server: OpenJPEG JPEG2000 handler
Copyright (C) 2019-2022 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 the License, or
(at your ... | cwe | CWE-190 | C/C++ |
_processSubscribeResponse(status, payload) {
if (status.error) {
// if error comes from request abort, ignore
if (status.errorData && status.errorData.message === 'Aborted') {
return;
}
// if we timeout from server, restart the loop.
if (status.category === categoryConstants.P... | cwe | CWE-331 | JavaScript |
do_bid_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
int swap __attribute__((__unused__)), uint32_t namesz, uint32_t descsz,
size_t noff, size_t doff, int *flags)
{
if (namesz == 4 && strcmp((char *)&nbuf[noff], "GNU") == 0 &&
type == NT_GNU_BUILD_ID && (descsz >= 4 || descsz <= 20)) {... | cwe | CWE-119 | C/C++ |
parse_wbxml_attribute_list_defined (proto_tree *tree, tvbuff_t *tvb,
guint32 offset, guint32 str_tbl, guint8 level, guint8 *codepage_attr,
const wbxml_decoding *map)
{
guint32 tvb_len = tvb_reported_length (tvb);
guint32 off = offset;
guint32 len;
guint str_len;
guint32 ... | cwe | CWE-119 | C/C++ |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2020
* All rights reserved
*
* This file is part of GPAC / common tools sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser Gen... | cwe | CWE-617 | C/C++ |
/**
* @file
* Read/parse/write an NNTP config file of subscribed newsgroups
*
* @authors
* Copyright (C) 1998 Brandon Long <blong@fiction.net>
* Copyright (C) 1999 Andrej Gritsenko <andrej@lucky.net>
* Copyright (C) 2000-2017 Vsevolod Volkov <vvv@mutt.org.ua>
*
* @copyright
* This program is free software: yo... | cwe | CWE-22 | C/C++ |
package com.salesmanager.shop.admin.controller.content;
import com.salesmanager.core.business.services.content.ContentService;
import com.salesmanager.core.business.utils.ajax.AjaxResponse;
import com.salesmanager.core.model.content.FileContentType;
import com.salesmanager.core.model.content.InputContentFile;
import c... | cwe | CWE-79 | Java |
protected function remove($path, $force = false)
{
$stat = $this->stat($path);
if (empty($stat)) {
return $this->setError(elFinder::ERROR_RM, $path, elFinder::ERROR_FILE_NOT_FOUND);
}
$stat['realpath'] = $path;
$this->rmTmb($stat);
$this->clearcache();
... | cwe | CWE-918 | PHP |
uint8_t* FAST_FUNC udhcp_get_option(struct dhcp_packet *packet, int code)
{
uint8_t *optionptr;
int len;
int rem;
int overload = 0;
enum {
FILE_FIELD101 = FILE_FIELD * 0x101,
SNAME_FIELD101 = SNAME_FIELD * 0x101,
};
/* option bytes: [code][len][data1][data2]..[dataLEN] */
optionptr = packet->options;
re... | cwe | CWE-125 | Unknown |
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
| Copyrigh... | cwe | CWE-22 | C/C++ |
zfs_fastaccesschk_execute(znode_t *zdp, cred_t *cr)
{
boolean_t owner = B_FALSE;
boolean_t groupmbr = B_FALSE;
boolean_t is_attr;
uid_t uid = crgetuid(cr);
if (zdp->z_pflags & ZFS_AV_QUARANTINED)
return (1);
is_attr = ((zdp->z_pflags & ZFS_XATTR) &&
(ZTOV(zdp)->v_type == VDIR));
if (is_attr)
return (1... | cwe | CWE-732 | Unknown |
static BROTLI_INLINE size_t BrotliGetRemainingBytes(BrotliBitReader* br) {
return br->avail_in + (BrotliGetAvailableBits(br) >> 3);
} | cwe | CWE-120 | Unknown |
static zend_long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, size_t sql_len) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
isc_stmt_handle stmt = PDO_FIREBIRD_HANDLE_INITIALIZER;
static char const info_count[] = { isc_info_sql_records };
char result[64];
int ret = 0;... | cwe | CWE-787 | C/C++ |
static void suboption(struct Curl_easy *data)
{
struct curl_slist *v;
unsigned char temp[2048];
ssize_t bytes_written;
size_t len;
int err;
char varname[128] = "";
char varval[128] = "";
struct TELNET *tn = data->req.p.telnet;
struct connectdata *conn = data->conn;
printsub(data, '<', (unsigned cha... | cwe | CWE-200 | C/C++ |
rfbClientIteratorNext(rfbClientIteratorPtr i)
{
if(i->next == 0) {
LOCK(rfbClientListMutex);
i->next = i->screen->clientHead;
UNLOCK(rfbClientListMutex);
} else {
rfbClientPtr cl = i->next;
i->next = i->next->next;
rfbDecrClientRef(cl);
}
#if defined(LIBVNCSERVER_HAVE_LIBPTHREAD) || defin... | cwe | CWE-476 | Unknown |
static Bool locate_js_script(char *path, const char *file_name, const char *file_ext)
{
u32 len = (u32) strlen(path);
strcat(path, file_name);
if (gf_file_exists(path))
return GF_TRUE;
if (!file_ext) {
strcat(path, ".js");
if (gf_file_exists(path))
return GF_TRUE;
}
path[len] = 0;
strcat(path, file_nam... | cwe | CWE-787 | Unknown |
*/
static int send_client_reply_packet(MCPVIO_EXT *mpvio,
const uchar *data, int data_len)
{
MYSQL *mysql= mpvio->mysql;
NET *net= &mysql->net;
char *buff, *end;
size_t buff_size;
size_t connect_attrs_len=
(mysql->server_capabilities & CLIENT_CONNECT_ATTRS &&
mysql... | cwe | CWE-295 | Unknown |
if rf, ok := ret.Get(0).(func(string, kube.ResourceKey, func(v1alpha1.ResourceNode, string)) error); ok {
r0 = rf(server, key, action)
} else {
r0 = ret.Error(0)
}
return r0
} | cwe | CWE-200 | Go |
ModHandle CModules::OpenModule(const CString& sModule, const CString& sModPath,
CModInfo& Info, CString& sRetMsg) {
// Some sane defaults in case anything errors out below
sRetMsg.clear();
for (unsigned int a = 0; a < sModule.length(); a++) {
if (((sModule[a] < '0') |... | cwe | CWE-20 | C/C++ |
static inline unsigned short ScaleQuantumToShort(const Quantum quantum)
{
if (quantum <= 0.0)
return(0);
if ((quantum/281479271743489.0) >= 65535.0)
return(65535);
return((unsigned short) (quantum/281479271743489.0+0.5));
} | cwe | CWE-190 | Unknown |
static int ssl_parse_server_psk_hint( mbedtls_ssl_context *ssl,
unsigned char **p,
unsigned char *end )
{
int ret = MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE;
size_t len;
((void) ssl);
/*
* PSK parameters:
*
* opaque ... | cwe | CWE-125 | C/C++ |
this.defaultFilename,!0);q.getHash=function(){return k};this.fileLoaded(q);"csv"==c.format&&this.importCsv(v,mxUtils.bind(this,function(M){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=c.update){var x=null!=c.interval?parseInt(c.interval):6E4,A=null,z=mxUtils.bind(thi... | cwe | CWE-20 | JavaScript |
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-703 | Unknown |
if(!self.define){const e=e=>{"require"!==e&&(e+=".js");let r=Promise.resolve();return i[e]||(r=new Promise((async r=>{if("document"in self){const i=document.createElement("script");i.src=e,document.head.appendChild(i),i.onload=r}else importScripts(e),r()}))),r.then((()=>{if(!i[e])throw new Error(`Module ${e} didn’t reg... | cwe | CWE-78 | JavaScript |
SMBC_server_internal(TALLOC_CTX *ctx,
SMBCCTX *context,
bool connect_if_not_found,
const char *server,
uint16_t port,
const char *share,
char **pp_workgroup,
char **pp_username,
char **pp_password,
bool *in_cache)
{
SM... | cwe | CWE-20 | Unknown |
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unl... | cwe | CWE-23 | Java |
/*
* MinIO Cloud Storage, (C) 2015-2018 MinIO, 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 applicab... | cwe | CWE-863 | Go |
PHP_FUNCTION(imageaffine)
{
zval *IM;
gdImagePtr src;
gdImagePtr dst;
gdRect rect;
gdRectPtr pRect = NULL;
zval *z_rect = NULL;
zval *z_affine;
zval **tmp;
double affine[6];
int i, nelems;
zval **zval_affine_elem = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra|a", &IM, &z_affine, &z_rect) ... | cwe | CWE-189 | C/C++ |
/*
* linux/fs/lockd/svc.c
*
* This is the central lockd service.
*
* FIXME: Separate the lockd NFS server functionality from the lockd NFS
* client functionality. Oh why didn't Sun create two separate
* services in the first place?
*
* Authors: Olaf Kirch (okir@monad.swb.de)
*
* Copyright (C) 1995, 1996... | cwe | CWE-399 | C/C++ |
@app.route("/api/preferences/get/<key>")
def pref_get(key):
if get_user() is None:
return "Authentication required", 401
if key in get_preferences():
return Response(json.dumps({'key': key, 'value': get_preferences()[key]}))
else:
return Response(json.dumps({'key': key, 'error': 'no... | cwe | CWE-79 | Python |
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\... | cwe | CWE-287 | C/C++ |
# -*- coding: utf-8 -*-
# Copyright (C) 2017-2018 CIRCL Computer Incident Response Center Luxembourg (smile gie)
# Copyright (C) 2017-2018 Christian Studer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published... | cwe | CWE-77 | Python |
generate_parentside_target_query(struct module_qstate* qstate,
struct iter_qstate* iq, int id, uint8_t* name, size_t namelen,
uint16_t qtype, uint16_t qclass)
{
struct module_qstate* subq;
if(!generate_sub_request(name, namelen, qtype, qclass, qstate,
id, iq, INIT_REQUEST_STATE, FINISHED_STATE, &subq, 0, 0))
... | cwe | CWE-613 | Unknown |
void dtls1_free(SSL *s)
{
DTLS_RECORD_LAYER_free(&s->rlayer);
{
pqueue *buffered_messages;
pqueue *sent_messages;
unsigned int mtu;
unsigned int link_mtu;
DTLS_RECORD_LAYER_clear(&s->rlayer);
if (s->d1) {
buffered_messages = s->d1->buffered_messages;
sent_messages = s->d1... | cwe | CWE-399 | C/C++ |
GC_malloc_explicitly_typed_ignore_off_page(size_t lb, GC_descr d)
{
ptr_t op;
size_t lg;
DCL_LOCK_STATE;
GC_ASSERT(GC_explicit_typing_initialized);
lb += TYPD_EXTRA_BYTES;
if (SMALL_OBJ(lb)) {
GC_DBG_COLLECT_AT_MALLOC(lb);
lg = GC_size_map[lb];
LOCK();
op = GC_eo... | cwe | CWE-119 | Unknown |
def generateKeys(len=1024):
fludkey = FludRSA.generate(len)
return fludkey.publickey(), fludkey.privatekey() | cwe | CWE-326 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.