code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
BGD_DECLARE(void) gdImageWebpCtx (gdImagePtr im, gdIOCtx * outfile, int quality)
{
uint8_t *argb;
int x, y;
uint8_t *p;
uint8_t *out;
size_t out_size;
if (im == NULL) {
return;
}
if (!gdImageTrueColor(im)) {
gd_error("Paletter image not supported by webp");
return;
}
if (quality == -1) {
quality = ... | cwe | CWE-415 | C/C++ |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
auto* params =
reinterpret_cast<TfLiteDepthwiseConvParams*>(node->builtin_data);
OpData* data = reinterpret_cast<OpData*>(node->user_data);
bool has_bias = NumInputs(node) == 3;
TF_LITE_ENSURE(context, has_bias || NumInputs(node) == 2);
... | cwe | CWE-369 | C/C++ |
_zip_cdir_new(int nentry, struct zip_error *error)
{
struct zip_cdir *cd;
if ((cd=(struct zip_cdir *)malloc(sizeof(*cd))) == NULL) {
_zip_error_set(error, ZIP_ER_MEMORY, 0);
return NULL;
}
if ((cd->entry=(struct zip_dirent *)malloc(sizeof(*(cd->entry))*nentry))
== NULL) {
... | cwe | CWE-189 | C/C++ |
static BROTLI_INLINE uint32_t ReadBlockLength(const HuffmanCode* table,
BrotliBitReader* br) {
uint32_t code;
uint32_t nbits;
code = ReadSymbol(table, br);
nbits = kBlockLengthPrefixCode[code].nbits; /* nbits == 2..24 */
return kBlockLengthPrefixCode[code].offset... | cwe | CWE-120 | Unknown |
/**
* <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-91 | Java |
static char *__filterShell(const char *arg) {
r_return_val_if_fail (arg, NULL);
char *a = malloc (strlen (arg) + 1);
if (!a) {
return NULL;
}
char *b = a;
while (*arg) {
switch (*arg) {
case '@':
case '`':
case '|':
case ';':
case '\n':
break;
default:
*b++ = *arg;
break;
}
arg++;
}
... | cwe | CWE-78 | C/C++ |
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | cwe | CWE-287 | Java |
int ff_amf_get_field_value(const uint8_t *data, const uint8_t *data_end,
const uint8_t *name, uint8_t *dst, int dst_size)
{
int namelen = strlen(name);
int len;
while (*data != AMF_DATA_TYPE_OBJECT && data < data_end) {
len = ff_amf_tag_size(data, data_end);
... | cwe | CWE-20 | 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-732 | Java |
def _create_vdisk(self, name, size, units, opts):
"""Create a new vdisk."""
LOG.debug(_('enter: _create_vdisk: vdisk %s ') % name)
model_update = None
autoex = '-autoexpand' if opts['autoexpand'] else ''
easytier = '-easytier on' if opts['easytier'] else '-easytier off'
... | cwe | CWE-78 | Python |
def get_recipe_from_file(self, file):
recipe = Recipe.objects.create(
name=file['name'].strip(),
created_by=self.request.user, internal=True,
space=self.request.space)
try:
if file['recipeYield'] != '':
recipe.servings = int(file['recipeY... | cwe | CWE-918 | Python |
/*
* File: ximapcx.cpp
* Purpose: Platform Independent PCX Image Class Loader and Writer
* 05/Jan/2002 Davide Pizzolato - www.xdp.it
* CxImage version 7.0.2 07/Feb/2011
*
* based on ppmtopcx.c - convert a portable pixmap to PCX
* Copyright (C) 1994 by Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)
* bas... | cwe | CWE-787 | C/C++ |
public function save()
{
$user = $this->getUser();
$values = $this->request->getValues();
if (! $this->userSession->isAdmin()) {
if (isset($values['role'])) {
unset($values['role']);
}
}
list($valid, $errors) = $this->userValidator->v... | cwe | CWE-640 | PHP |
void SocketStream::DoLoop(int result) {
if (!context_.get())
next_state_ = STATE_CLOSE;
if (next_state_ == STATE_NONE)
return;
do {
State state = next_state_;
next_state_ = STATE_NONE;
switch (state) {
case STATE_BEFORE_CONNECT:
DCHECK_EQ(OK, result);
result = DoBefo... | cwe | CWE-399 | C/C++ |
var fs = require('fs')
var path = require('path')
var request = require('teeny-request').teenyRequest
var urlgrey = require('urlgrey')
var jsYaml = require('js-yaml')
var walk = require('ignore-walk')
var execSync = require('child_process').execSync
var validator = require('validator')
var detectProvider = require('./... | cwe | CWE-78 | JavaScript |
const request = require('request')
const { promisify } = require('util')
const SearchProvider = require('../SearchProvider')
const { getURLMeta } = require('../../helpers/request')
const logger = require('../../logger')
const adapter = require('./adapter')
const { ProviderApiError } = require('../error')
const { reque... | cwe | CWE-863 | JavaScript |
static int get_v4l2_ext_controls32(struct file *file,
struct v4l2_ext_controls *kp,
struct v4l2_ext_controls32 __user *up)
{
struct v4l2_ext_control32 __user *ucontrols;
struct v4l2_ext_control __user *kcontrols;
unsigned int n;
compat_caddr_t p;
if (!access_ok(VERIFY_READ, up, sizeof(*up)) ||
... | cwe | CWE-787 | Unknown |
public function whereFileName($fileName)
{
$this->selectSingle = $this->model->getFileNameParts($fileName);
return $this;
} | cwe | CWE-863 | PHP |
function writeCommentDate(comment, dateDiv)
{
dateDiv.innerHTML = '';
var ts = new Date(comment.modifiedDate);
var str = editorUi.timeSince(ts);
if (str == null)
{
str = mxResources.get('lessThanAMinute');
}
mxUtils.write(dateDiv, mxResources.get('timeAgo', [str], '{1} ago'));
dateDiv.setAttri... | cwe | CWE-94 | JavaScript |
static INLINE BOOL update_write_brush(wStream* s, rdpBrush* brush, BYTE fieldFlags)
{
if (fieldFlags & ORDER_FIELD_01)
{
Stream_Write_UINT8(s, brush->x);
}
if (fieldFlags & ORDER_FIELD_02)
{
Stream_Write_UINT8(s, brush->y);
}
if (fieldFlags & ORDER_FIELD_03)
{
Stream_Write_UINT8(s, brush->style);
}
i... | cwe | CWE-125 | C/C++ |
int STDCALL
mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
{
DBUG_ENTER("mysql_option");
DBUG_PRINT("enter",("option: %d",(int) option));
switch (option) {
case MYSQL_OPT_CONNECT_TIMEOUT:
mysql->options.connect_timeout= *(uint*) arg;
break;
case MYSQL_OPT_READ_TIMEOUT:
mysql... | cwe | CWE-319 | Unknown |
void Compute(OpKernelContext* context) override {
const Tensor& indices = context->input(0);
const Tensor& values = context->input(1);
const Tensor& shape = context->input(2);
const Tensor& weights = context->input(3);
bool use_weights = weights.NumElements() > 0;
OP_REQUIRES(context, TensorSha... | cwe | CWE-190 | C/C++ |
void setattr_copy(struct inode *inode, const struct iattr *attr)
{
unsigned int ia_valid = attr->ia_valid;
if (ia_valid & ATTR_UID)
inode->i_uid = attr->ia_uid;
if (ia_valid & ATTR_GID)
inode->i_gid = attr->ia_gid;
if (ia_valid & ATTR_ATIME)
inode->i_atime = timespec_trunc(attr->ia_atime,
inode->i_sb->... | cwe | CWE-264 | C/C++ |
def start():
print("[*] Starting backdoor process")
print("[*] Decompressing target to tmp directory...")
#subprocess.call("jar -x %s" % target, shell=True)
with zipfile.ZipFile(target, 'r') as zip:
zip.extractall("tmp")
print("[*] Target dumped to tmp directory")
print("[*] Modifying m... | cwe | CWE-78 | Python |
addWell: function(data) {
var minX,
maxX,
minY,
maxY;
// first filter for well-samples that have positions
data = data.filter(function(ws){ return ws.position !== undefined; });
// Only show pa... | cwe | CWE-116 | JavaScript |
/*
* Handle git attributes. See gitattributes(5) for a description of
* the file syntax, and attr.h for a description of the API.
*
* One basic design decision here is that we are not going to support
* an insanely large number of attributes.
*/
#include "cache.h"
#include "config.h"
#include "exec-cmd.h"
#incl... | cwe | CWE-190 | C/C++ |
void cJSON_DeleteItemFromObject( cJSON *object, const char *string )
{
cJSON_Delete( cJSON_DetachItemFromObject( object, string ) );
} | cwe | CWE-120 | C/C++ |
CURLcode Curl_urldecode(struct SessionHandle *data,
const char *string, size_t length,
char **ostring, size_t *olen,
bool reject_ctrl)
{
size_t alloc = (length?length:strlen(string))+1;
char *ns = malloc(alloc);
unsigned char in;
size_t str... | cwe | CWE-119 | C/C++ |
void ring_buffer_reset_cpu(struct trace_buffer *buffer, int cpu)
{
struct ring_buffer_per_cpu *cpu_buffer = buffer->buffers[cpu];
if (!cpumask_test_cpu(cpu, buffer->cpumask))
return;
atomic_inc(&cpu_buffer->resize_disabled);
atomic_inc(&cpu_buffer->record_disabled);
/* Make sure all commits have finished */
... | cwe | CWE-362 | Unknown |
'use strict';
const async = require('async');
const validator = require('validator');
const utils = require('../utils');
const meta = require('../meta');
const db = require('../database');
const groups = require('../groups');
const plugins = require('../plugins');
module.exports = function (User) {
User.updateProf... | cwe | CWE-287 | JavaScript |
ims_pcu_get_cdc_union_desc(struct usb_interface *intf)
{
const void *buf = intf->altsetting->extra;
size_t buflen = intf->altsetting->extralen;
struct usb_cdc_union_desc *union_desc;
if (!buf) {
dev_err(&intf->dev, "Missing descriptor data\n");
return NULL;
}
if (!buflen) {
dev_err(&intf->dev, "Zero lengt... | cwe | CWE-125 | C/C++ |
/*
* Cantata
*
* Copyright (c) 2011-2018 Craig Drummond <craig.p.drummond@gmail.com>
*
* ----
*
* 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
* (a... | cwe | CWE-20 | C/C++ |
def GetActionAllowAnyoneRateLimited(rateLimits: RateLimits, avoidCookies: Boolean = false)
(f: GetRequest => Result): Action[Unit] =
PlainApiAction(cc.parsers.empty, rateLimits, allowAnyone = true, avoidCookies = avoidCookies)(f) | cwe | CWE-613 | Scala |
int imap_open_connection (IMAP_DATA* idata)
{
if (mutt_socket_open (idata->conn) < 0)
return -1;
idata->state = IMAP_CONNECTED;
if (imap_cmd_step (idata) != IMAP_CMD_OK)
{
imap_close_connection (idata);
return -1;
}
if (ascii_strncasecmp ("* OK", idata->buf, 4) == 0)
{
if (ascii_strncas... | cwe | CWE-287 | Unknown |
static int tcp_v6_send_synack(const struct sock *sk, struct dst_entry *dst,
struct flowi *fl,
struct request_sock *req,
struct tcp_fastopen_cookie *foc,
bool attach_req)
{
struct inet_request_sock *ireq = inet_rsk(req);
struct ipv6_pinfo *np = inet6_sk(sk);
struct flowi6 *fl6 = &f... | cwe | CWE-284 | Unknown |
ia){la=ha.getAttribute("section");ca=ha.getAttribute("subsection");if(null==la&&(ma=ia.indexOf("/"),la=ia.substring(0,ma),null==ca)){var qa=ia.indexOf("/",ma+1);-1<qa&&(ca=ia.substring(ma+1,qa))}ma=ta[la];null==ma&&(ya++,ma=[],ta[la]=ma);ia=ha.getAttribute("clibs");null!=da[ia]&&(ia=da[ia]);ia={url:ha.getAttribute("url... | cwe | CWE-20 | JavaScript |
term_and_job_init(
term_T *term,
typval_T *argvar,
char **argv,
jobopt_T *opt,
jobopt_T *orig_opt UNUSED)
{
create_vterm(term, term->tl_rows, term->tl_cols);
#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
if (opt->jo_set2 & JO2_ANSI_COLORS)
set_vterm_palette(term->tl_vterm, opt->jo... | cwe | CWE-476 | Unknown |
static struct binder_buffer *binder_alloc_prepare_to_free_locked(
struct binder_alloc *alloc,
uintptr_t user_ptr)
{
struct rb_node *n = alloc->allocated_buffers.rb_node;
struct binder_buffer *buffer;
void *kern_ptr;
kern_ptr = (void *)(user_ptr - alloc->user_buffer_offset);
while (n) {
buffer = rb_entry(n,... | cwe | CWE-416 | Unknown |
/*
Copyright 2008-2017 LibRaw LLC (info@libraw.org)
LibRaw is free software; you can redistribute it and/or modify
it under the terms of the one of two licenses as you choose:
1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
(See file LICENSE.LGPL provided in LibRaw distribution archive for details).
2. COMMON... | cwe | CWE-787 | C/C++ |
R_API RBinJavaAttrInfo *r_bin_java_inner_classes_attr_new(RBinJavaObj *bin, ut8 *buffer, ut64 sz, ut64 buf_offset) {
RBinJavaClassesAttribute *icattr;
RBinJavaAttrInfo *attr = NULL;
RBinJavaCPTypeObj *obj;
ut32 i = 0;
ut64 offset = 0, curpos;
attr = r_bin_java_default_attr_new (bin, buffer, sz, buf_offset);
offs... | cwe | CWE-119 | C/C++ |
package io.onedev.server.web.component.user.twofactorauthentication;
import java.io.IOException;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.codec.binary.Base32;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.tika.mime.MediaType... | cwe | CWE-338 | Java |
SYSCALL_DEFINE5(osf_getsysinfo, unsigned long, op, void __user *, buffer,
unsigned long, nbytes, int __user *, start, void __user *, arg)
{
unsigned long w;
struct percpu_struct *cpu;
switch (op) {
case GSI_IEEE_FP_CONTROL:
/* Return current software fp control & status bits. */
/* Note that DU doesn't veri... | cwe | CWE-189 | C/C++ |
/* Copyright 2016 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 agree... | cwe | CWE-476 | Python |
NAN_METHOD(XmlDocument::FromHtml)
{
Nan::HandleScope scope;
v8::Local<v8::Object> options = Nan::To<v8::Object>(info[1]).ToLocalChecked();
v8::Local<v8::Value> baseUrlOpt = Nan::Get(options,
Nan::New<v8::String>("baseUrl").ToLocalChecked()).ToLocalChecked();
v8::Local<v8::Value> encodingOpt ... | cwe | CWE-400 | Unknown |
bool HexInStream::hexStrToBin(const char* s, char** data, int* length) {
int l=strlen(s);
if ((l % 2) == 0) {
delete [] *data;
*data = 0; *length = 0;
if (l == 0)
return true;
*data = new char[l/2];
*length = l/2;
for(int i=0;i<l;i+=2) {
int byte = 0;
if (!readHexAndShift(s... | cwe | CWE-787 | C/C++ |
void Compute(OpKernelContext* context) override {
const Tensor& input = context->input(0);
OP_REQUIRES(context, input.dims() == 1 || input.dims() == 2,
errors::InvalidArgument(
"input must be a vector or 2D tensor, but got shape ",
input.shape().DebugStrin... | cwe | CWE-125 | Unknown |
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either ... | cwe | CWE-306 | Go |
static void t1_check_unusual_charstring(void)
{
char *p = strstr(t1_line_array, charstringname) + strlen(charstringname);
int i;
/* if no number follows "/CharStrings", let's read the next line */
if (sscanf(p, "%i", &i) != 1) {
/* pdftex_warn("no number found after `%s', I assume it's on the ne... | cwe | CWE-119 | C/C++ |
FileReaderLoader::FileReaderLoader(ReadType read_type,
FileReaderLoaderClient* client)
: read_type_(read_type),
client_(client),
handle_watcher_(FROM_HERE, mojo::SimpleWatcher::ArmingPolicy::AUTOMATIC),
binding_(this) {} | cwe | CWE-416 | C/C++ |
void ConnPoolImplBase::checkForIdleAndCloseIdleConnsIfDraining() {
if (is_draining_for_deletion_) {
closeIdleConnectionsForDrainingPool();
}
if (isIdleImpl()) {
ENVOY_LOG(debug, "invoking idle callbacks - is_draining_for_deletion_={}",
is_draining_for_deletion_);
for (const Instance::Id... | cwe | CWE-703 | Unknown |
def make_eb_config(application_name, default_region):
# Capture our current directory
UTILS_DIR = os.path.dirname(os.path.abspath(__file__))
# Create the jinja2 environment.
# Notice the use of trim_blocks, which greatly helps control whitespace.
j2_env = Environment(loader=FileSystemLoader(UTILS_DI... | cwe | CWE-79 | Python |
exif_mnote_data_fuji_load (ExifMnoteData *en,
const unsigned char *buf, unsigned int buf_size)
{
ExifMnoteDataFuji *n = (ExifMnoteDataFuji*) en;
ExifLong c;
size_t i, tcount, o, datao;
if (!n || !buf || !buf_size) {
exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
"ExifMnoteDataFuji", "Short MakerNote");
r... | cwe | CWE-416 | Unknown |
void protocol_print_filter(pid_t pid) {
EUID_ASSERT();
(void) pid;
#ifdef SYS_socket
// in case the pid is that of a firejail process, use the pid of the first child process
pid = switch_to_child(pid);
// exit if no permission to join the sandbox
check_join_permission(pid);
// find the seccomp filter
EUID_RO... | cwe | CWE-269 | Unknown |
void PrintViewManager::RenderFrameDeleted(
content::RenderFrameHost* render_frame_host) {
if (render_frame_host == print_preview_rfh_)
print_preview_state_ = NOT_PREVIEWING;
PrintViewManagerBase::RenderFrameDeleted(render_frame_host);
} | cwe | CWE-125 | C/C++ |
static int copy_cred(struct svc_cred *target, struct svc_cred *source)
{
int ret;
ret = strdup_if_nonnull(&target->cr_principal, source->cr_principal);
if (ret)
return ret;
ret = strdup_if_nonnull(&target->cr_raw_principal,
source->cr_raw_principal);
if (ret)
return ret;
target->cr_flavor = source->c... | cwe | CWE-404 | C/C++ |
term_and_job_init(
term_T *term,
typval_T *argvar,
char **argv UNUSED,
jobopt_T *opt,
jobopt_T *orig_opt)
{
WCHAR *cmd_wchar = NULL;
WCHAR *cwd_wchar = NULL;
WCHAR *env_wchar = NULL;
channel_T *channel = NULL;
job_T *job = NULL;
DWORD error;
HAND... | cwe | CWE-476 | C/C++ |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "hermes/VM/Operations.h"
#include "hermes/Support/Conversions.h"
#include "hermes/Support/OSCompat.h"
#include "hermes/... | cwe | CWE-787 | C/C++ |
MagickExport void RemoveDuplicateLayers(Image **images,
ExceptionInfo *exception)
{
register Image
*curr,
*next;
RectangleInfo
bounds;
assert((*images) != (const Image *) NULL);
assert((*images)->signature == MagickCoreSignature);
if ((*images)->debug != MagickFalse)
(void) LogMag... | cwe | CWE-369 | C/C++ |
file_ms_alloc(int flags)
{
struct magic_set *ms;
size_t i, len;
if ((ms = CAST(struct magic_set *, calloc((size_t)1,
sizeof(struct magic_set)))) == NULL)
return NULL;
if (magic_setflags(ms, flags) == -1) {
errno = EINVAL;
goto free;
}
ms->o.buf = ms->o.pbuf = NULL;
len = (ms->c.len = 10) * sizeof(*... | cwe | CWE-399 | C/C++ |
static i64 runzip_chunk(rzip_control *control, int fd_in, i64 expected_size, i64 tally)
{
uint32 good_cksum, cksum = 0;
i64 len, ofs, total = 0;
int l = -1, p = 0;
char chunk_bytes;
struct stat st;
uchar head;
void *ss;
bool err = false;
/* for display of progress */
unsigned long divisor[] = {1,1024,1048576... | cwe | CWE-703 | Unknown |
def visit_Call(self, node):
""" A couple function calls are supported: bson's ObjectId() and
datetime().
"""
if isinstance(node.func, ast.Name):
expr = None
if node.func.id == 'ObjectId':
expr = "('" + node.args[0].s + "')"
elif node.fu... | cwe | CWE-94 | Python |
static ssize_t _hostsock_recvfrom(
oe_fd_t* sock_,
void* buf,
size_t count,
int flags,
const struct oe_sockaddr* src_addr,
oe_socklen_t* addrlen)
{
ssize_t ret = -1;
sock_t* sock = _cast_sock(sock_);
oe_socklen_t addrlen_in = 0;
oe_errno = 0;
if (!sock || (count && !buf))
... | cwe | CWE-552 | Unknown |
// SPDX-License-Identifier: GPL-2.0-only
/*
* Xen event channels
*
* Xen models interrupts with abstract event channels. Because each
* domain gets 1024 event channels, but NR_IRQ is not that large, we
* must dynamically map irqs<->event channels. The event channels
* interface with the rest of the kernel by de... | cwe | CWE-400 | C/C++ |
static BOOL region16_simplify_bands(REGION16* region)
{
/** Simplify consecutive bands that touch and have the same items
*
* ==================== ====================
* | 1 | | 2 | | | | |
* ==================== | | | |
* | 1 | | 2 | ====> ... | cwe | CWE-401 | Unknown |
X){null!=X.shortcut&&900>n&&!mxClient.IS_IOS?O.firstChild.nextSibling.setAttribute("title",X.shortcut):m.apply(this,arguments)};var q=App.prototype.updateUserElement;App.prototype.updateUserElement=function(){q.apply(this,arguments);if(null!=this.userElement){var O=this.userElement;O.style.cssText="position:relative;ma... | cwe | CWE-94 | JavaScript |
aa&&(la=pa[ca],null==la&&(la={},pa[ca]=la),ca=la[aa],null==ca&&(ca=[],la[aa]=ca),ca.push(na))}ia=ia.nextSibling}G(ya,fa,wa)}})}function I(ia){v&&(Aa.scrollTop=0,ea.innerHTML="",Ha.spin(ea),U=!1,V=!0,ha.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag")),ba=null,v(ua,function(){z(mxResources.get("cannotLoad"))... | cwe | CWE-94 | JavaScript |
def write(self, bib_data, filename):
def process_person_roles(entry):
for role, persons in entry.persons.iteritems():
yield role, list(process_persons(persons))
def process_person(person):
for type in ('first', 'middle', 'prelast', 'last', 'lineage'):
... | cwe | CWE-502 | Python |
import { FlowRouter } from 'meteor/ostrio:flow-router-extra'
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
import customParseFormat from 'dayjs/plugin/customParseFormat'
import randomColor from 'randomcolor'
import { t } from '../../utils/i18n.js'
import {
emojify,
getUserSetting,
getGlobalSetting,... | cwe | CWE-79 | JavaScript |
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-476 | Python |
static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
struct inode *inode, struct buffer_head *bh)
{
struct inode *dir = dentry->d_parent->d_inode;
const char *name = dentry->d_name.name;
int namelen = dentry->d_name.len;
struct buffer_head *bh2;
struct dx_root *root;
struct dx_frame frames... | cwe | CWE-20 | Unknown |
package com.salesmanager.shop.model.catalog.product;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.salesmanager.shop.model.catalog.category.ReadableCategory;
import com.salesmanager.shop.model.catalog.manufacturer.ReadableManufacturer;
import com.salesmanager.shop.model.ca... | cwe | CWE-79 | Java |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2021
* All rights reserved
*
* This file is part of GPAC / ISO Media File Format sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU L... | cwe | CWE-190 | C/C++ |
SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len,
unsigned long, new_len, unsigned long, flags,
unsigned long, new_addr)
{
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
unsigned long ret = -EINVAL;
unsigned long charged = 0;
bool locked = false;
bool downgraded = false;
s... | cwe | CWE-787 | Unknown |
CAMLprim value caml_alloc_dummy(value size)
{
mlsize_t wosize = Int_val(size);
if (wosize == 0) return Atom(0);
return caml_alloc (wosize, 0);
} | cwe | CWE-200 | C/C++ |
PHP_FUNCTION(finfo_open)
{
long options = MAGIC_NONE;
char *file = NULL;
int file_len = 0;
struct php_fileinfo *finfo;
FILEINFO_DECLARE_INIT_OBJECT(object)
char resolved_path[MAXPATHLEN];
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lp", &options, &file, &file_len) == FAILURE) {
FILEINFO_DESTROY_OBJ... | cwe | CWE-200 | C/C++ |
static cache_accel_t *read_cache_accel(RBuffer *cache_buf, cache_hdr_t *hdr, cache_map_t *maps) {
if (!cache_buf || !hdr || !hdr->accelerateInfoSize || !hdr->accelerateInfoAddr) {
return NULL;
}
ut64 offset = va2pa (hdr->accelerateInfoAddr, hdr->mappingCount, maps, cache_buf, 0, NULL, NULL);
if (!offset) {
ret... | cwe | CWE-787 | C/C++ |
static void nodeDestruct(struct SaveNode* node)
{
if (node->v == &node->sorted)
{
tr_free(node->sorted.val.l.vals);
}
} | cwe | CWE-416 | Unknown |
/*
* 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 |
static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
Image *image, *image2=NULL,
*rotated_image;
register Quantum *q;
unsigned int status;
MATHeader MATLAB_HDR;
size_t size;
size_t CellType;
QuantumInfo *quantum_info;
ImageInfo *clone_info;
int i;
ssize_t ldblk;
u... | cwe | CWE-416 | Unknown |
protected function apiProcessSurvey($args)
{
$visitor = visitor_from_request();
// Get form values
$first_message = $args['message'];
$info = $args['info'];
$email = $args['email'];
$referrer = $args['referrer'];
// Verify group id
$group_id = 0;
... | cwe | CWE-79 | PHP |
int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index)
{
struct mlx4_mac_table *table = &mlx4_priv(dev)->port[port].mac_table;
int i, err = 0;
int free = -1;
mlx4_dbg(dev, "Registering MAC: 0x%llx\n", (unsigned long long) mac);
mutex_lock(&table->mutex);
for (i = 0; i < MLX4_MAX_MAC_NUM - 1; i... | cwe | CWE-119 | C/C++ |
xfs_setattr_nonsize(
struct xfs_inode *ip,
struct iattr *iattr,
int flags)
{
xfs_mount_t *mp = ip->i_mount;
struct inode *inode = VFS_I(ip);
int mask = iattr->ia_valid;
xfs_trans_t *tp;
int error;
kuid_t uid = GLOBAL_ROOT_UID, iuid = GLOBAL_ROOT_UID;
kgid_t gid = GLOBAL_ROOT_GID, igid = GLOBAL_R... | cwe | CWE-399 | C/C++ |
return new Response($emailLog->getHtmlLog());
} elseif ($request->get('type') == 'params') { | cwe | CWE-79 | PHP |
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | cwe | CWE-287 | Java |
void snd_msndmidi_input_read(void *mpuv)
{
unsigned long flags;
struct snd_msndmidi *mpu = mpuv;
void *pwMIDQData = mpu->dev->mappedbase + MIDQ_DATA_BUFF;
spin_lock_irqsave(&mpu->input_lock, flags);
while (readw(mpu->dev->MIDQ + JQS_wTail) !=
readw(mpu->dev->MIDQ + JQS_wHead)) {
u16 wTmp, val;
val = r... | cwe | CWE-125 | C/C++ |
package com.mayank.rucky.activity;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.util.Patterns;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
i... | cwe | CWE-327 | Java |
package context
import (
"bytes"
stdContext "context"
"encoding/json"
"encoding/xml"
"errors"
"fmt"
"io"
"io/ioutil"
"mime/multipart"
"net"
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"reflect"
"regexp"
"sort"
"strconv"
"strings"
"sync/atomic"
"time"
"unsafe"
"github.com/kataras/iris/v12/... | cwe | CWE-59 | Go |
static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
{
long elements;
elements = parse_iv2((*p) + 2, p);
(*p) += 2;
if (ce->serialize == NULL) {
object_init_ex(*rval, ce);
} else {
/* If this class implements Serializable, it should not land here but in object_custom(). The ... | cwe | CWE-125 | Unknown |
def markTokenUsedExternal(token, optStr=""):
conn, c = connectDB()
req = "UPDATE {} SET \"options_selected\"='{}' WHERE token='{}'".format(CFG("tokens_table_name"), \
optStr, token)
c.execute(req)
closeDB(conn) | cwe | CWE-89 | Python |
static int __rds_rdma_map(struct rds_sock *rs, struct rds_get_mr_args *args,
u64 *cookie_ret, struct rds_mr **mr_ret)
{
struct rds_mr *mr = NULL, *found;
unsigned int nr_pages;
struct page **pages = NULL;
struct scatterlist *sg;
void *trans_private;
unsigned long flags;
rds_rdma_cookie_t cookie;
unsigned in... | cwe | CWE-476 | Unknown |
TfLiteStatus LeakyReluPrepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 1);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input = GetInput(context, node, 0);
TfLiteTensor* output = GetOutput(context, node, 0);
TF_LITE_ENSURE_TYPES_EQ(context... | cwe | CWE-787 | C/C++ |
/* $Id$ */
/* tiffcrop.c -- a port of tiffcp.c extended to include manipulations of
* the image data through additional options listed below
*
* Original code:
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
* Additions (c) Richard Nolde 2006-2010
*
* Permission to use, ... | cwe | CWE-119 | C/C++ |
function cron_dbmanager_backup() {
global $wpdb;
$backup_options = get_option('dbmanager_options');
$backup_email = stripslashes($backup_options['backup_email']);
if(intval($backup_options['backup_period']) > 0) {
$backup = array();
$backup['date'] = current_time('timestamp');
$backup['mysqldumppath'] = $back... | cwe | CWE-255 | PHP |
int main(int argc, char **argv, char **envp) {
int i;
int prog_index = -1; // index in argv where the program command starts
int lockfd_network = -1;
int lockfd_directory = -1;
int option_cgroup = 0;
int custom_profile = 0; // custom profile loaded
int arg_caps_cmdline = 0; // caps requested on command line... | cwe | CWE-269 | Unknown |
static void gic_dist_writel(void *opaque, hwaddr offset,
uint32_t value, MemTxAttrs attrs)
{
GICState *s = (GICState *)opaque;
if (offset == 0xf00) {
int cpu;
int irq;
int mask;
int target_cpu;
cpu = gic_get_current_cpu(s);
irq = value... | cwe | CWE-787 | C/C++ |
static void print_value(int output, int num, const char *devname,
const char *value, const char *name, size_t valsz)
{
if (output & OUTPUT_VALUE_ONLY) {
fputs(value, stdout);
fputc('\n', stdout);
} else if (output & OUTPUT_UDEV_LIST) {
print_udev_format(name, value);
} else if (output & OUTPUT_EXPORT_LIST... | cwe | CWE-77 | Unknown |
refresh_account (GoaProvider *provider,
GoaClient *client,
GoaObject *object,
GtkWindow *parent,
GError **error)
{
AddAccountData data;
GVariantBuilder builder;
GoaAccount *account;
GoaEwsClient *ews_client;
GoaExchan... | cwe | CWE-310 | Unknown |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
OpData* op_data = reinterpret_cast<OpData*>(node->user_data);
int num_inputs = node->inputs->size;
// The number of outputs should be the same as number of inputs.
TF_LITE_ENSURE_EQ(context, node->outputs->size, num_inputs);
// Check subgraph i... | cwe | CWE-787 | C/C++ |
BOOL update_write_cache_brush_order(wStream* s, const CACHE_BRUSH_ORDER* cache_brush, UINT16* flags)
{
int i;
BYTE iBitmapFormat;
BOOL compressed = FALSE;
if (!Stream_EnsureRemainingCapacity(s,
update_approximate_cache_brush_order(cache_brush, flags)))
return FALSE;
iBitmap... | cwe | CWE-125 | C/C++ |
import certifi
import requests
import flask_login
from app.auth.oauth_auth import OAuthLoginManager, OAUTH_CALLBACK_PATH
from app.db import with_session, DBSession
from env import QuerybookSettings, get_env_config
from flask import request, session as flask_session, redirect
from lib.logger import get_logger
from lib.... | cwe | CWE-79 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.