code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
chunk_new_with_alloc_size(size_t alloc)
{
chunk_t *ch;
ch = tor_malloc(alloc);
ch->next = NULL;
ch->datalen = 0;
#ifdef DEBUG_CHUNK_ALLOC
ch->DBG_alloc = alloc;
#endif
ch->memlen = CHUNK_SIZE_WITH_ALLOC(alloc);
total_bytes_allocated_in_chunks += alloc;
ch->data = &ch->mem[0];
return ch;
} | vuln | Vulnerable | C/C++ |
static int avisynth_read_packet_audio(AVFormatContext *s, AVPacket *pkt, int discard) {
AviSynthContext *avs = s->priv_data;
AVRational fps, samplerate;
int samples;
int64_t n;
const char* error;
if (avs->curr_sample >= avs->vi->num_audio_samples)
return AVERROR_EOF;
fps.num = avs->v... | vuln | Safe | C/C++ |
def verify_jwt(jwt,
pub_key=None,
allowed_algs=None,
iat_skew=timedelta(),
checks_optional=False,
ignore_not_implemented=False):
"""
Verify a JSON Web Token.
:param jwt: The JSON Web Token to verify.
:type jwt: str or unicode
... | vuln | Safe | Python |
private int
mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
const unsigned char *s, uint32_t offset, size_t nbytes, struct magic *m)
{
/*
* Note: FILE_SEARCH and FILE_REGEX do not actually copy
* anything, but setup pointers into the source
*/
if (indir == 0) {
switch (type) {
case ... | vuln | Safe | C/C++ |
package tuple
import (
v0 "github.com/authzed/authzed-go/proto/authzed/api/v0"
)
// ONRSet is a set of ObjectAndRelation's.
type ONRSet struct {
onrs map[string]*v0.ObjectAndRelation
}
// NewONRSet creates a new set.
func NewONRSet(onrs ...*v0.ObjectAndRelation) *ONRSet {
created := &ONRSet{
onrs: map[string]*v... | vuln | Vulnerable | Go |
static jpc_enc_cp_t *cp_create(char *optstr, jas_image_t *image)
{
jpc_enc_cp_t *cp;
jas_tvparser_t *tvp;
int ret;
int numilyrrates;
double *ilyrrates;
int i;
int tagid;
jpc_enc_tcp_t *tcp;
jpc_enc_tccp_t *tccp;
jpc_enc_ccp_t *ccp;
int cmptno;
uint_fast16_t rlvlno;
uint_fast16_t prcwidthexpn;
uint_fast16_... | vuln | Safe | Unknown |
@Override
public Template.BlockInfo process(IWorldReader worldReader, BlockPos pos, BlockPos pos2, Template.BlockInfo infoIn1, Template.BlockInfo infoIn2, PlacementSettings settings, @Nullable Template template) {
// Workaround for https://bugs.mojang.com/browse/MC-130584
// Due to a hardcoded fiel... | vuln | Vulnerable | Java |
/**
* OpenKM, Open Document Management System (http://www.openkm.com)
* Copyright (c) 2006-2017 Paco Avila & Josep Llort
* <p>
* No bytes were intentionally harmed during the development of this application.
* <p>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the... | vuln | Vulnerable | Java |
@Override
public StructureTemplate.StructureBlockInfo processBlock(LevelReader worldView, BlockPos pos, BlockPos blockPos, StructureTemplate.StructureBlockInfo structureBlockInfoLocal, StructureTemplate.StructureBlockInfo structureBlockInfoWorld, StructurePlaceSettings structurePlacementData) {
if (structur... | vuln | Safe | Java |
@Override
public void perform(SyntaxNodeAnalysisContext ctx) {
List<Diagnostic> diagnostics = ctx.semanticModel().diagnostics();
for (Diagnostic diagnostic : diagnostics) {
if (diagnostic.diagnosticInfo().severity() == DiagnosticSeverity.ERROR) {
return;
}
... | vuln | Vulnerable | Java |
static void do_under_overlay_for_page(
QPDF& pdf,
Options& o,
UnderOverlay& uo,
std::map<int, std::vector<int> >& pagenos,
size_t page_idx,
std::map<int, QPDFObjectHandle>& fo,
std::vector<QPDFPageObjectHelper>& pages,
QPDFPageObjectHelper& dest_page,
bool before)
{
int pageno = ... | vuln | Vulnerable | Unknown |
error::Error GLES2DecoderImpl::HandleGetUniformfv(uint32 immediate_data_size,
const void* cmd_data) {
const gles2::cmds::GetUniformfv& c =
*static_cast<const gles2::cmds::GetUniformfv*>(cmd_data);
GLuint program = c.program;
GLint fake_location = c.location;... | vuln | Vulnerable | C/C++ |
static int channelmap_config_input(AVFilterLink *inlink)
{
AVFilterContext *ctx = inlink->dst;
ChannelMapContext *s = ctx->priv;
int i, err = 0;
const char *channel_name;
char layout_name[256];
if (s->mode == MAP_PAIR_STR_INT || s->mode == MAP_PAIR_STR_STR) {
for (i = 0; i < s->nch; i++)... | vuln | Vulnerable | C/C++ |
void Utterance::FinishAndDestroy() {
completion_task_->Run();
completion_task_ = NULL;
delete this;
} | vuln | Vulnerable | C/C++ |
Task getTransientLaunchRestoreTarget(@NonNull WindowContainer container) {
for (int i = 0; i < mTransientLaunches.size(); ++i) {
if (mTransientLaunches.keyAt(i).isDescendantOf(container)) {
return mTransientLaunches.valueAt(i);
}
}
return null;
} | vuln | Vulnerable | Java |
@Override
public @Nullable AnnotatedTypeMirror getFieldAnnotations(
Element element,
String fieldName,
AnnotatedTypeMirror lhsATM,
AnnotatedTypeFactory atypeFactory) {
ClassSymbol enclosingClass = ((VarSymbol) element).enclClass();
// Read in classes for the element.
getFileForElem... | vuln | Safe | Java |
function barrettReduce(x) {
x.drShiftTo(this.m.t-1,this.r2);
if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }
this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);
this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);
while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);
x.subTo(this.r2,x);
while(... | vuln | Vulnerable | JavaScript |
static void ssh_throttle_all(Ssh ssh, int enable, int bufsize)
{
int i;
struct ssh_channel *c;
if (enable == ssh->throttled_all)
return;
ssh->throttled_all = enable;
ssh->overall_bufsize = bufsize;
if (!ssh->channels)
return;
for (i = 0; NULL != (c = index234(ssh->channels, i)); i++) {
s... | vuln | Safe | Unknown |
int mutt_ssl_starttls (CONNECTION* conn)
{
sslsockdata* ssldata;
int maxbits;
long ssl_options = 0;
if (ssl_init())
goto bail;
ssldata = (sslsockdata*) safe_calloc (1, sizeof (sslsockdata));
/* the ssl_use_xxx protocol options don't apply. We must use TLS in TLS.
*
* However, we need to be able ... | vuln | Vulnerable | Unknown |
NTSTATUS ProcessMainDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION Extension, PIRP Irp)
{
PIO_STACK_LOCATION irpSp = IoGetCurrentIrpStackLocation (Irp);
NTSTATUS ntStatus;
switch (irpSp->Parameters.DeviceIoControl.IoControlCode)
{
case TC_IOCTL_GET_DRIVER_VERSION:
case TC_IOCTL_LEGACY_GET_DRIVER_VERSI... | vuln | Safe | Unknown |
public PBEWithSHA1AESCBC256()
{
super(new CBCBlockCipher(new AESFastEngine()), PKCS12, SHA1, 256, 16);
} | vuln | Vulnerable | Java |
static void do_lsw(CPUPPCState *env, target_ulong addr, uint32_t nb,
uint32_t reg, uintptr_t raddr)
{
int sh;
for (; nb > 3; nb -= 4) {
env->gpr[reg] = cpu_ldl_data_ra(env, addr, raddr);
reg = (reg + 1) % 32;
addr = addr_add(env, addr, 4);
}
if (unlikely(nb > 0... | vuln | Safe | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Vulnerable | C/C++ |
@Override
public void execute(IngestDocument ingestDocument, BiConsumer<IngestDocument, Exception> handler) {
Object o = ingestDocument.getFieldValue(field, Object.class, ignoreMissing);
if (o == null) {
if (ignoreMissing) {
handler.accept(ingestDocument, null);
... | vuln | Vulnerable | Java |
public static BufferedImage getOriginalImage(String imageKey, boolean useDefaultIfNotFound, CardView cardView) {
if (null == imageKey) {
return null;
}
IPaperCard ipc = null;
boolean altState = imageKey.endsWith(ImageKeys.BACKFACE_POSTFIX);
if(altState)
i... | vuln | Vulnerable | Java |
static void cache_block(BGZF *fp, int size)
{
int ret;
khint_t k;
cache_t *p;
//fprintf(stderr, "Cache block at %llx\n", (int)fp->block_address);
khash_t(cache) *h = (khash_t(cache)*)fp->cache;
if (BGZF_MAX_BLOCK_SIZE >= fp->cache_size) return;
if ((kh_size(h) + 1) * BGZF_MAX_BLOCK_SIZE > (u... | vuln | Vulnerable | C/C++ |
def add_constraint_remote(params, request, auth_user)
if not allowed_for_local_cluster(auth_user, Permissions::WRITE)
return 403, 'Permission denied'
end
case params["c_type"]
when "loc"
retval, error = add_location_constraint(
auth_user,
params["res_id"], params["node_id"], params["score"],... | vuln | Safe | Ruby |
static int get_iovec_page_array(const struct iovec __user *iov,
unsigned int nr_vecs, struct page **pages,
struct partial_page *partial, int aligned)
{
int buffers = 0, error = 0;
down_read(¤t->mm->mmap_sem);
while (nr_vecs) {
unsigned long off, npages;
struct iovec entry;
void __user *base;
... | vuln | Safe | Unknown |
// Copyright 2018 Google LLC
//
// 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 w... | vuln | Safe | Go |
static int decode_nal_unit(HEVCContext *s, const uint8_t *nal, int length)
{
HEVCLocalContext *lc = &s->HEVClc;
GetBitContext *gb = &lc->gb;
int ctb_addr_ts, ret;
ret = init_get_bits8(gb, nal, length);
if (ret < 0)
return ret;
ret = hls_nal_unit(s);
if (ret < 0) {
av_log(s... | vuln | Vulnerable | C/C++ |
public static void write(MapOutput mapOutput, byte[] buffer) {
// Write and commit uncompressed data to MapOutput.
// In the majority of cases, merger allocates memory to accept data,
// but when data size exceeds the threshold, merger can also allocate disk.
// So, we should consider the two situations... | vuln | Safe | Java |
int ff_wma_init(AVCodecContext *avctx, int flags2)
{
WMACodecContext *s = avctx->priv_data;
int i;
float bps1, high_freq;
volatile float bps;
int sample_rate1;
int coef_vlc_table;
if ( avctx->sample_rate <= 0 || avctx->sample_rate > 50000
|| avctx->channels <= 0 || avctx->channe... | vuln | Vulnerable | C/C++ |
@Override
public void onReceive(Context context, Intent intent) {
Bundle bundle = intent.getExtras();
if (bundle != null) {
int index = bundle.getInt(Params.INDEX);
ListIllust listIllust = (ListIllust) bundle.getSerializable(Params.CONT... | vuln | Vulnerable | Java |
static void sbr_gain_calc(AACContext *ac, SpectralBandReplication *sbr,
SBRData *ch_data, const int e_a[2])
{
int e, k, m;
static const SoftFloat limgain[4] = { { 760155524, 0 }, { 0x20000000, 1 },
{ 758351638, 1 }, { 625000000, 34 } ... | vuln | Safe | C/C++ |
static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
xmlDocPtr doc = NULL;
#ifdef LIBXML_TREE_ENABLED
xmlDocPtr tmp;
#endif /* LIBXML_TREE_ENABLED */
if ((timing) && (!repeat))
startTimer();
#ifdef LIBXML_TREE_ENABLED
if (filename == NULL) {
if (generate) {
xmlNodePtr n;
... | vuln | Vulnerable | C/C++ |
static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear,
double cutoff0, enum AVSampleFormat format, enum SwrFilterType filter_type, int kaiser_beta,
double precision, int ch... | vuln | Vulnerable | C/C++ |
static bool getCoverageFormat12(vector<uint32_t>& coverage, const uint8_t* data, size_t size) {
const size_t kNGroupsOffset = 12;
const size_t kFirstGroupOffset = 16;
const size_t kGroupSize = 12;
const size_t kStartCharCodeOffset = 0;
const size_t kEndCharCodeOffset = 4;
const size_t kMaxNGroups = 0xfffffff0 / k... | vuln | Safe | C/C++ |
HandleRFBServerMessage(rfbClient* client)
{
rfbServerToClientMsg msg;
if (client->serverPort==-1)
client->vncRec->readTimestamp = TRUE;
if (!ReadFromRFBServer(client, (char *)&msg, 1))
return FALSE;
switch (msg.type) {
case rfbSetColourMapEntries:
{
/* TODO:
int i;
uint16_t rgb[3];
... | vuln | Vulnerable | Unknown |
def _wrapper(func):
@functools.wraps(func)
def _wrapped(*args, **kwargs):
user_warned = not warn_user
num_attempts = num_retries + 1 # +1 for the first attempt
for attempt in range(1, num_attempts + 1):
try:
return func(*args, **kw... | vuln | Vulnerable | Python |
int StreamBase::WriteString(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
CHECK(args[0]->IsObject());
CHECK(args[1]->IsString());
Local<Object> req_wrap_obj = args[0].As<Object>();
Local<String> string = args[1].As<String>();
Local<Object> send_handle_obj;
i... | vuln | Vulnerable | Unknown |
int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char *d, int n, int *al)
{
unsigned short length;
unsigned short type;
unsigned short size;
unsigned char *data = *p;
int tlsext_servername = 0;
int renegotiate_seen = 0;
#ifndef OPENSSL_NO_NEXTPROTONEG
s->s3->next_proto_neg_seen = 0;
#endif
... | vuln | Vulnerable | Unknown |
/* Copyright 2019 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... | vuln | Safe | Python |
static void tlb_reset_dirty_range(CPUTLBEntry *tlb_entry, uintptr_t start,
uintptr_t length)
{
#if TCG_OVERSIZED_GUEST
uintptr_t addr = tlb_entry->addr_write;
if ((addr & (TLB_INVALID_MASK | TLB_MMIO | TLB_NOTDIRTY)) == 0) {
addr &= TARGET_PAGE_MASK;
addr += tlb_entry-... | vuln | Safe | C/C++ |
/*
* Copyright (C) 2011, 2012, 2013 Citrix Systems
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, thi... | vuln | Vulnerable | C/C++ |
function insertRank(name, description, connection)
{
var strQuery = "INSERT INTO rank VALUES('"+
connection.escape(name) +"', '"+
connection.escape(description) +"', 'NULL')";
connection.query( strQuery, function(err, rows)
{if(err) {
throw err;
}else{
if(debug)
... | vuln | Safe | JavaScript |
/* ruleset.c - rsyslog's ruleset object
*
* We have a two-way structure of linked lists: one global linked list
* (llAllRulesets) hold alls rule sets that we know. Included in each
* list is a list of rules (which contain a list of actions, but that's
* a different story).
*
* Usually, only a single rule set is ... | vuln | Safe | 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... | vuln | Safe | Java |
/*
** $Id: ldo.c $
** Stack and Call structure of Lua
** See Copyright Notice in lua.h
*/
#define ldo_c
#define LUA_CORE
#include "lprefix.h"
#include <setjmp.h>
#include <stdlib.h>
#include <string.h>
#include "lua.h"
#include "lapi.h"
#include "ldebug.h"
#include "ldo.h"
#include "lfunc.h"
#include "lgc.h"
#inc... | vuln | Vulnerable | C/C++ |
@Override
public void checkParameter() {
ParaCheckUtil.checkParaNotNull(userFavorite.relateId, "relateId");
ParaCheckUtil.checkParaNotBlank(userFavorite.type, "type");
switch (userFavorite.type) {
case "folder":
Folder folder = folderService.queryById(Long.parseLong(... | vuln | Safe | Java |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Yanis Guenane <yanis+ansible@guenane.org>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
modul... | vuln | Safe | C/C++ |
/**
* @file
* IMAP network mailbox
*
* @authors
* Copyright (C) 1996-1998,2012 Michael R. Elkins <me@mutt.org>
* Copyright (C) 1996-1999 Brandon Long <blong@fiction.net>
* Copyright (C) 1999-2009,2012,2017 Brendan Cully <brendan@kublai.com>
*
* @copyright
* This program is free software: you can redistribute ... | vuln | Vulnerable | C/C++ |
int main(void)
{
int fd, len, sock_opt;
int error;
struct cn_msg *message;
struct pollfd pfd;
struct nlmsghdr *incoming_msg;
struct cn_msg *incoming_cn_msg;
struct hv_kvp_msg *hv_msg;
char *p;
char *key_value;
char *key_name;
int op;
int pool;
char *if_name;
struct hv_kvp_ipaddr_value *kvp_ip_val;
daemo... | vuln | Safe | C/C++ |
static bool meta_set(RAnal *a, RAnalMetaType type, int subtype, ut64 from, ut64 to, const char *str) {
if (to < from) {
return false;
}
RSpace *space = r_spaces_current (&a->meta_spaces);
RIntervalNode *node = find_node_at (a, type, space, from);
RAnalMetaItem *item = node ? node->data : R_NEW0 (RAnalMetaItem);
... | vuln | Vulnerable | C/C++ |
fstring_find_literal(const char **str, const char *end, int raw,
PyObject **literal, int recurse_lvl,
struct compiling *c, const node *n)
{
/* Get any literal string. It ends when we hit an un-doubled left
brace (which isn't part of a unicode name escape such as
... | vuln | Vulnerable | C/C++ |
static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
const uint8_t *buf, int buf_size)
{
int cmd_pos, pos, cmd, x1, y1, x2, y2, offset1, offset2, next_cmd_pos;
int big_offsets, offset_size, is_8bit = 0;
const uint8_t *yuv_palette = NULL;
uint8_t *co... | vuln | Vulnerable | C/C++ |
png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
{
png_uint_32 chunk_name;
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
int keep; /* unknown handling method */
#endif
png_alloc_size_t limit = PNG_UINT_31_MAX;
/* First we make sure we have enough data for the 4-byte chunk name
* and the 4-byte c... | vuln | Safe | Unknown |
void vnc_display_open(const char *id, Error **errp)
{
VncDisplay *vs = vnc_display_find(id);
QemuOpts *opts = qemu_opts_find(&qemu_vnc_opts, id);
QemuOpts *sopts, *wsopts;
const char *share, *device_id;
QemuConsole *con;
bool password = false;
bool reverse = false;
const char *vnc;
c... | vuln | Vulnerable | C/C++ |
public void pickedFleetMembers(List<FleetMemberAPI> members) {
pickShip(members.get(0));
FireAll.fire(null, dialog, memoryMap, "Nex_BShip_ShipPicked");
} | vuln | Vulnerable | Java |
public static void printPayloadsInfo(Collection<MetaData> data){
Logger.success("List all payloads!");
AsciiTable at = new AsciiTable();
at.addRule();
at.addRow("Payloads", "Author", "Targets", "Dependencies");
at.addRule();
for(MetaData metaData:data){
at.add... | vuln | Vulnerable | Java |
int qemu_show_nic_models(const char *arg, const char *const *models)
{
int i;
if (!arg || strcmp(arg, "?"))
return 0;
fprintf(stderr, "qemu: Supported NIC models: ");
for (i = 0 ; models[i]; i++)
fprintf(stderr, "%s%c", models[i], models[i+1] ? ',' : '\n');
return 1;
} | vuln | Vulnerable | C/C++ |
int llhttp__after_headers_complete(llhttp_t* parser, const char* p,
const char* endp) {
int hasBody;
hasBody = parser->flags & F_CHUNKED || parser->content_length > 0;
if (parser->upgrade && (parser->method == HTTP_CONNECT ||
(parser->flags & F_SKIPBOD... | vuln | Vulnerable | Unknown |
zstatus(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
switch (r_type(op)) {
case t_file:
{
stream *s;
make_bool(op, (file_is_valid(s, op) ? 1 : 0));
}
return 0;
case t_string:
{
gs_parsed_file_name_t pname;
... | vuln | Safe | Unknown |
"""Core API v2 views."""
import logging
from django.utils.html import escape
from django.utils.translation import ugettext as _
from django.utils.datastructures import MultiValueDictKeyError
from django.contrib.auth import login
from drf_spectacular.utils import extend_schema
from rest_framework import response, st... | vuln | Vulnerable | Python |
public static String[] validateObject(ParaObject content) {
if (content == null) {
return new String[]{"Object cannot be null."};
}
LinkedList<String> list = new LinkedList<>();
try {
for (ConstraintViolation<ParaObject> constraintViolation : getValidator().validate(content)) {
String prop = "'".conca... | vuln | Safe | Java |
BnGeneratePrimeForRSA(
bigNum prime, // IN/OUT: points to the BN that will get the
// random value
UINT32 bits, // IN: number of bits to get
UINT32 exponent, // IN: the exponent
RAND_STATE *rand // IN: the random... | vuln | Safe | Unknown |
/*
* 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... | vuln | Safe | Java |
"geCommentActionLnk";mxUtils.write(ba,N);Y.appendChild(ba);mxEvent.addListener(ba,"click",function(ea){Q(ea,K);ea.preventDefault();mxEvent.consume(ea)});T.appendChild(Y);R&&(Y.style.display="none")}function W(){function N(Y){Q.push(R);if(null!=Y.replies)for(var ba=0;ba<Y.replies.length;ba++)R=R.nextSibling,N(Y.replies[... | vuln | Vulnerable | JavaScript |
/*
* Copyright (C) 2011-2012 Christian Beier <dontmind@freeshell.org>
* Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
*
* This 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;... | vuln | Vulnerable | C/C++ |
(function()
{
Sidebar.prototype.addFluidPowerPalette = function()
{
var w = 2;
var h = 2;
var s = mxConstants.STYLE_VERTICAL_LABEL_POSITION + '=bottom;aspect=fixed;html=1;' + mxConstants.STYLE_VERTICAL_ALIGN + '=top;fillColor=strokeColor;align=center;outlineConnect=0;shape=mxgraph.fluid_power.';
var gn = 'mxg... | vuln | Safe | Java |
items: function (schema, candidate, callback) {
if (typeof callback === 'function') {
return this.asyncItems(schema, candidate, callback);
}
if (!(schema.items instanceof Object) || !(candidate instanceof Object)) {
return;
}
var items = schema.items;
var i, l;
// If provided schema is an a... | vuln | Vulnerable | JavaScript |
/*
Copyright 2023 The Fluid 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, softw... | vuln | Vulnerable | Go |
keycompare_mb (const struct line *a, const struct line *b)
{
struct keyfield *key = keylist;
/* For the first iteration only, the key positions have been
precomputed for us. */
char *texta = a->keybeg;
char *textb = b->keybeg;
char *lima = a->keylim;
char *limb = b->keylim;
size_t mblength_a, mblen... | vuln | Safe | C/C++ |
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11,
# andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh,
# falgh1, grunjol, csitk... | vuln | Vulnerable | Python |
WebContents* DevToolsWindow::OpenURLFromTab(
WebContents* source,
const content::OpenURLParams& params) {
DCHECK(source == main_web_contents_);
if (!params.url.SchemeIs(content::kChromeDevToolsScheme)) {
WebContents* inspected_web_contents = GetInspectedWebContents();
return inspected_web_content... | vuln | Vulnerable | C/C++ |
acl_prefetch_http(struct proxy *px, struct session *s, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp, int req_vol)
{
struct http_txn *txn = l7;
struct http_msg *msg = &txn->req;
/* Note: hdr_idx.v cannot be NULL in this ACL because the ACL is tagged
* as a layer7 ACL, wh... | vuln | Vulnerable | Unknown |
void WebURLLoaderImpl::Context::OnReceivedResponse(
const ResourceResponseInfo& info) {
if (!client_)
return;
WebURLResponse response;
response.initialize();
PopulateURLResponse(request_.url(), info, &response);
bool show_raw_listing = (GURL(request_.url()).query() == "raw");
if (info.mime_type =... | vuln | Safe | C/C++ |
getTiledChunkOffsetTableSize(const Header& header)
{
//
// Save the dataWindow information
//
const Box2i &dataWindow = header.dataWindow();
//
// Precompute level and tile information.
//
int* numXTiles;
int* numYTiles;
int numXLevels;
int numYLevels;
precalculate... | vuln | Vulnerable | Unknown |
private synchronized void updateTypingIndicators() {
StringBuilder typing = new StringBuilder();
int count = 0;
if(buffer != null) {
buffer.purgeExpiredTypingIndicators();
count = buffer.getTypingIndicators().size();
if (count > 5) {
typing.a... | vuln | Vulnerable | Java |
set<int> PipeSocketHandler::listen(const SocketEndpoint& endpoint) {
lock_guard<std::recursive_mutex> guard(globalMutex);
string pipePath = endpoint.name();
if (pipeServerSockets.find(pipePath) != pipeServerSockets.end()) {
throw runtime_error("Tried to listen twice on the same path");
}
sockaddr_un loc... | vuln | Safe | C/C++ |
// Copyright 2014 Unknown
//
// 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 writ... | vuln | Safe | Go |
static int handle_to_path(int mountdirfd, struct file_handle __user *ufh,
struct path *path)
{
int retval = 0;
struct file_handle f_handle;
struct file_handle *handle = NULL;
/*
* With handle we don't look at the execute bit on the
* the directory. Ideally we would like CAP_DAC_SEARCH.
* But we don't ha... | vuln | Safe | C/C++ |
var XINGApi = require('xing-api'),
mongoose = require('mongoose'),
Wall = mongoose.model('Wall'),
Profile = mongoose.model('Profile'),
xingApi = new XINGApi({
consumerKey: process.env.XING_CONSUMER_KEY,
consumerSecret: process.env.XING_CONSUMER_SECRET,
... | vuln | Vulnerable | JavaScript |
int qemu_chr_fe_get_msgfd(CharDriverState *s)
{
int fd;
return (qemu_chr_fe_get_msgfds(s, &fd, 1) == 1) ? fd : -1;
} | vuln | Safe | C/C++ |
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/search_engines/template_url_parser.h"
#include <string.h>
#include <algorithm>
#include <vector>
#include "base/bind.h"
#include "... | vuln | Vulnerable | C/C++ |
xfs_attr3_leaf_flipflags(
struct xfs_da_args *args)
{
struct xfs_attr_leafblock *leaf1;
struct xfs_attr_leafblock *leaf2;
struct xfs_attr_leaf_entry *entry1;
struct xfs_attr_leaf_entry *entry2;
struct xfs_attr_leaf_name_remote *name_rmt;
struct xfs_buf *bp1;
struct xfs_buf *bp2;
int error;
#ifdef DEBUG
stru... | vuln | Safe | Unknown |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
auto* params =
reinterpret_cast<TfLiteResizeBilinearParams*>(node->builtin_data);
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
const TfLiteTensor* size = Get... | vuln | Vulnerable | C/C++ |
'use strict';
var Class = require('../util/class'),
array = require('../util/array'),
extend = require('../util/extend'),
constants = require('../util/constants'),
Logging = require('../mixins/logging'),
Engine = require('../engines/proxy'),
Channel = require('./channel... | vuln | Safe | Java |
char const* parse_int(char const* start, char const* end, char delimiter, boost::int64_t& val)
{
while (start < end && *start != delimiter)
{
if (!is_digit(*start)) { return 0; }
val *= 10;
val += *start - '0';
++start;
}
return start;
} | vuln | Vulnerable | C/C++ |
static void set_dirty_tracking(void)
{
BlkMigDevState *bmds;
QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
bmds->dirty_bitmap = bdrv_create_dirty_bitmap(bmds->bs, BLOCK_SIZE);
}
} | vuln | Vulnerable | C/C++ |
module.exports = (yargs) => {
yargs.command(
'logs <scope>',
'Display application logs.',
(yargs) => {
yargs.option(
'tail',
{
alias: 'n',
describe: 'Number of lines to show from the end of the logs',
... | vuln | Vulnerable | JavaScript |
/*-
* Copyright (c) 2013 Chris Torek <torek @ torek net>
* Copyright (c) 2015 xhyve developers
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must r... | vuln | Vulnerable | C/C++ |
TPM_RC
TPML_HANDLE_Unmarshal(TPML_HANDLE *target, BYTE **buffer, INT32 *size)
{
TPM_RC rc = TPM_RC_SUCCESS;
UINT32 i;
if (rc == TPM_RC_SUCCESS) {
rc = UINT32_Unmarshal(&target->count, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
if (target->count > MAX_CAP_HANDLES) {
rc = TPM_RC_SIZE;
}... | vuln | Vulnerable | C/C++ |
folly::Optional<TLSMessage> PlaintextReadRecordLayer::read(
folly::IOBufQueue& buf) {
while (true) {
folly::io::Cursor cursor(buf.front());
if (buf.empty() || !cursor.canAdvance(kPlaintextHeaderSize)) {
return folly::none;
}
TLSMessage msg;
msg.type = static_cast<ContentType>(cursor.re... | vuln | Safe | C/C++ |
gdk_pixbuf__tiff_image_load_increment (gpointer data, const guchar *buf,
guint size, GError **error)
{
TiffData *context = (TiffData *) data;
g_return_val_if_fail (data != NULL, FALSE);
if (fwrite (buf, sizeof (guchar), size, context->file) != size) {
context->all_okay = FA... | vuln | Vulnerable | Unknown |
function W(Fa){function Ma(cb,hb,lb){var rb=cb.useCssTransforms,vb=cb.currentTranslate,ob=cb.currentScale,
Ab=cb.view.translate,Bb=cb.view.scale;cb.useCssTransforms&&(cb.useCssTransforms=!1,cb.currentTranslate=new mxPoint(0,0),cb.currentScale=1,cb.view.translate=new mxPoint(0,0),cb.view.scale=1);var ub=cb.getGraphBound... | vuln | Safe | JavaScript |
void
scanner_filter_arguments (parser_context_t *context_p, /**< context */
scanner_context_t *scanner_context_p) /**< scanner context */
{
/* Fast case: check whether all literals are arguments. */
scanner_literal_pool_t *literal_pool_p = scanner_context_p->active_literal_pool_p;
scanne... | vuln | Vulnerable | C/C++ |
static void listener_add_address_space(MemoryListener *listener,
AddressSpace *as)
{
FlatRange *fr;
if (listener->address_space_filter
&& listener->address_space_filter != as->root) {
return;
}
if (global_dirty_log) {
listener->log_global_st... | vuln | Vulnerable | C/C++ |
main(int argc, char** argv)
{
if (argc < 2) {
PrintUsageAndExit();
}
// default options
Options.input = NULL;
Options.verbose = false;
Options.hls_version = 0;
Options.pmt_pid = 0x100;
... | vuln | Vulnerable | Unknown |
gopherToHTML(GopherStateData * gopherState, char *inbuf, int len)
{
char *pos = inbuf;
char *lpos = NULL;
char *tline = NULL;
LOCAL_ARRAY(char, line, TEMP_BUF_SIZE);
char *name = NULL;
char *selector = NULL;
char *host = NULL;
char *port = NULL;
char *escaped_selector = NULL;
con... | vuln | Safe | C/C++ |
void HELPER(divuw)(CPUM68KState *env, int destr, uint32_t den)
{
uint32_t num = env->dregs[destr];
uint32_t quot, rem;
if (den == 0) {
raise_exception_ra(env, EXCP_DIV0, GETPC());
}
quot = num / den;
rem = num % den;
env->cc_c = 0;
if (quot > 0xffff) {
env->cc_v = -1;
... | vuln | Safe | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.