code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
public static String getTranslation(String title, String... insertions) {
String pattern = getString(desiredLanguage(), title);
String message = MessageFormat.format(pattern, (Object[]) insertions);
return appendUnusedInsertions(message, insertions);
} | vuln | Vulnerable | Java |
private void logMetrics(int selectedPos) {
if (mRankerServiceName != null) {
MetricsLogger metricsLogger = new MetricsLogger();
LogMaker log = new LogMaker(MetricsEvent.ACTION_TARGET_SELECTED);
log.setComponentName(mRankerServiceName);
log.addT... | vuln | Vulnerable | Java |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | vuln | Vulnerable | Python |
static rsRetVal createSocket(instanceConf_t* info, void** sock) {
int rv;
sublist* sub;
*sock = zsocket_new(s_context, info->type);
if (!sock) {
errmsg.LogError(0,
RS_RET_INVALID_PARAMS,
"zsocket_new failed: %s, for type %d",
... | vuln | Safe | 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... | vuln | Vulnerable | Go |
public PtNotice saveNotice(final String applicationNumber, final String noticeNo, final String noticeType,
final BasicProperty basicProperty, final InputStream fileStream) {
final PtNotice ptNotice = new PtNotice();
final Module module = moduleDao.getModuleByName(PTMODULENAME);
ptNot... | vuln | Vulnerable | Java |
def read_templates(
self,
filenames: List[str],
custom_template_directory: Optional[str] = None,
autoescape: bool = False,
) -> List[jinja2.Template]:
"""Load a list of template files from disk using the given variables.
This function will attempt to load the given t... | vuln | Vulnerable | Python |
void* IOBuf::operator new(size_t size) {
size_t fullSize = offsetof(HeapStorage, buf) + size;
auto storage = static_cast<HeapStorage*>(checkedMalloc(fullSize));
new (&storage->prefix) HeapPrefix(kIOBufInUse, fullSize);
if (io_buf_alloc_cb) {
io_buf_alloc_cb(storage, fullSize);
}
return &(storage->buf... | vuln | Vulnerable | Unknown |
OMX_ERRORTYPE SoftAACEncoder::internalSetParameter(
OMX_INDEXTYPE index, const OMX_PTR params) {
switch (index) {
case OMX_IndexParamStandardComponentRole:
{
const OMX_PARAM_COMPONENTROLETYPE *roleParams =
(const OMX_PARAM_COMPONENTROLETYPE *)params;
if (!isValidO... | vuln | Safe | C/C++ |
static int check_trust(X509_STORE_CTX *ctx)
{
#ifdef OPENSSL_NO_CHAIN_VERIFY
return 1;
#else
int i, ok;
X509 *x;
int (*cb)(int xok,X509_STORE_CTX *xctx);
cb=ctx->verify_cb;
/* For now just check the last certificate in the chain */
i = sk_X509_num(ctx->chain) - 1;
x = sk_X509_value(ctx->chain, i);
ok = X509_che... | vuln | Vulnerable | Unknown |
ScopedRequest(PepperDeviceEnumerationHostHelper* owner,
const Delegate::EnumerateDevicesCallback& callback)
: owner_(owner),
callback_(callback),
requested_(false),
request_id_(0),
sync_call_(false) {
if (!owner_->document_url_.is_valid())
return;
req... | vuln | Vulnerable | C/C++ |
function decode (str) {
var out = {}
var p = out
var section = null
// section |key = value
var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i
var lines = str.split(/[\r\n]+/g)
lines.forEach(function (line, _, __) {
if (!line || line.match(/^\s*[;#]/)) return
var match = line.match(re... | vuln | Safe | JavaScript |
static int xfrm_expand_policies(const struct flowi *fl, u16 family,
struct xfrm_policy **pols,
int *num_pols, int *num_xfrms)
{
int i;
if (*num_pols == 0 || !pols[0]) {
*num_pols = 0;
*num_xfrms = 0;
return 0;
}
if (IS_ERR(pols[0])) {
*num_pols = 0;
return PTR_ERR(pols[0]);
}
*num_xfrms = pols... | vuln | Safe | C/C++ |
def run_fix(self, local_id, analysis_id):
import subprocess
command = ["sealert", "-f", local_id, "-P", analysis_id]
return subprocess.check_output(command, universal_newlines=True) | vuln | Safe | Python |
function decodeMap (buf, offset, length, headerLength, options) {
const _temp = decodeArray(buf, offset, 2 * length, headerLength)
if (!_temp) return null
const [ result, consumedBytes ] = _temp
var isPlainObject = !options.preferMap
if (isPlainObject) {
for (let i = 0; i < 2 * length; i += ... | vuln | Safe | JavaScript |
/*
* Copyright 2000-2021 Vaadin Ltd.
*
* 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... | vuln | Safe | Java |
// ximage.cpp : main implementation file
/* 07/08/2001 v1.00 - Davide Pizzolato - www.xdp.it
* CxImage version 7.0.2 07/Feb/2011
*/
#include "ximage.h"
#ifndef min
#define min(a,b) (((a)<(b))?(a):(b))
#endif
#ifndef max
#define max(a,b) (((a)>(b))?(a):(b))
#endif
////////////////////////////////////... | vuln | Safe | C/C++ |
init_users(in_addr_t my_ip, int netbits)
{
int i;
int skip = 0;
char newip[16];
int maxusers;
in_addr_t netmask = 0;
struct in_addr net;
struct in_addr ipstart;
for (i = 0; i < netbits; i++) {
netmask = (netmask << 1) | 1;
}
netmask <<= (32 - netbits);
net.s_addr = htonl(netmask);
ipstart.s_addr = my_i... | vuln | Safe | Unknown |
static Image *ReadMONOImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
Image
*image;
MagickBooleanType
status;
register IndexPacket
*indexes;
register PixelPacket
*q;
register ssize_t
x;
size_t
bit,
byte;
ssize_t
y;
/*
Open image file.
*/
as... | vuln | Safe | C/C++ |
private void upgradePermissions(final int version, final Rank rank)
{
// keep this consistent with loadRanks(), as that's still used for new colonies
if (version < 4)
{
if (rank.isHostile())
{
this.setPermission(rank, Action.HURT_CITIZEN);
... | vuln | Vulnerable | Java |
krb5_gss_export_sec_context(minor_status, context_handle, interprocess_token)
OM_uint32 *minor_status;
gss_ctx_id_t *context_handle;
gss_buffer_t interprocess_token;
{
krb5_context context = NULL;
krb5_error_code kret;
OM_uint32 retval;
size_t ... | vuln | Safe | C/C++ |
@Override
public void serialize(String value, JsonGenerator jsonGenerator, SerializerProvider serializerProvider)
throws IOException {
if (value != null) {
// 开启 Xss 才进行处理
if (XssStateHolder.enabled()) {
value = HtmlUtils.cleanUnSafe(value);
}
jsonGenerator.writeString(value);
}
} | vuln | Vulnerable | Java |
public void pushSwapping(RegistryKey<World> newDimension) {
RegistryKey<World> currentDimension = getCurrentDimension();
ContextRecord<Context> oldContext = contextMap.get(currentDimension);
ContextRecord<Context> newContext = contextMap.computeIfAbsent(newDimension, k -> {
... | vuln | Safe | Java |
void
vrrp_print_json(void)
{
FILE *file;
element e;
struct json_object *array;
if (LIST_ISEMPTY(vrrp_data->vrrp))
return;
file = fopen ("/tmp/keepalived.json","w");
if (!file) {
log_message(LOG_INFO, "Can't open /tmp/keepalived.json (%d: %s)",
errno, strerror(errno));
return;
}
array = json_object_n... | vuln | Vulnerable | C/C++ |
public static boolean canSuspend(PlayerEntity entity) {
ItemStack itemStack = ToolbeltHelper.findToolbelt(entity);
boolean hasEffect = !itemStack.isEmpty() && ((IModularItem) itemStack.getItem()).getEffectLevel(itemStack, ItemEffect.suspendSelf) > 0;
return hasEffect && entity.getActivePotionEf... | vuln | Safe | Java |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | vuln | Safe | Python |
def start(self):
"""
Prepare the server to start serving connections.
Configure the server socket handler and establish a TLS wrapping
socket from which all client connections descend. Bind this TLS
socket to the specified network address for the server.
Raises:
... | vuln | Vulnerable | Python |
void linsertCommand(client *c) {
int where;
robj *subject;
listTypeIterator *iter;
listTypeEntry entry;
int inserted = 0;
if (strcasecmp(c->argv[2]->ptr,"after") == 0) {
where = LIST_TAIL;
} else if (strcasecmp(c->argv[2]->ptr,"before") == 0) {
where = LIST_HEAD;
} else ... | vuln | Vulnerable | Unknown |
static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
TCGArg *args, TCGOpDef *tcg_op_defs)
{
int i, nb_ops, op_index, nb_temps, nb_globals, nb_call_args;
TCGOpcode op;
const TCGOpDef *def;
TCGArg *gen_args;
TCGArg tmp;
nb_temps = s->nb... | vuln | Safe | C/C++ |
PostgresMain(int argc, char *argv[],
const char *dbname,
const char *username)
{
int firstchar;
StringInfoData input_message;
sigjmp_buf local_sigjmp_buf;
volatile bool send_ready_for_query = true;
/* Initialize startup process environment if necessary. */
if (!IsUnderPostmaster)
InitStandaloneProces... | vuln | Vulnerable | Unknown |
public Channel getChannel(ProcessingChain processingChain)
{
if(processingChain != null)
{
for(Map.Entry<Channel,ProcessingChain> entry : mProcessingChains.entrySet())
{
if(entry.getValue() == processingChain)
{
return entry... | vuln | Vulnerable | Java |
void WebPluginProxy::InitiateHTTPRangeRequest(const char* url,
const char* range_info,
intptr_t existing_stream,
bool notify_needed,
int... | vuln | Vulnerable | C/C++ |
static int ape_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
AVFrame *frame = data;
const uint8_t *buf = avpkt->data;
APEContext *s = avctx->priv_data;
uint8_t *sample8;
int16_t *sample16;
int32_t *sample24;
int i, ch, ... | vuln | Vulnerable | C/C++ |
@Override
public Element[] supStreamFeatures(final XMPPResourceConnection session) {
if (session != null && session.isAuthorized()) {
return RosterAbstract.FEATURES;
} else {
return null;
}
} | vuln | Safe | Java |
public T parse(InputStream contents) throws Exception {
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setNamespaceAware(true);
SAXParser saxParser = spf.newSAXParser();
XMLReader xmlReader = saxParser.getXMLReader();
xmlReader.setEntityResolver(
(arg0... | vuln | Vulnerable | Java |
/*
* hmp.c -- Midi Wavetable Processing library
*
* Copyright (C) WildMIDI Developers 2001-2016
*
* This file is part of WildMIDI.
*
* WildMIDI is free software: you can redistribute and/or modify the player
* under the terms of the GNU General Public License and you can redistribute
* and/or modify the librar... | vuln | Vulnerable | C/C++ |
private Element renderImage(Element parent, InlineImageArea a, Document d) {
Element g = Documents.createElement(d, SVGDocumentFrame.svgGroupEltName);
maybeMarkClasses(g, a, "image");
LineArea l = a.getLine();
double bpdLine = l.getBPD();
double bpdLineAnnotationBefore = l.getAnn... | vuln | Vulnerable | Java |
Strgrow(Str x)
{
char *old = x->ptr;
int newlen;
newlen = x->area_size * 6 / 5;
if (newlen == x->area_size)
newlen += 2;
x->ptr = GC_MALLOC_ATOMIC(newlen);
x->area_size = newlen;
bcopy((void *)old, (void *)x->ptr, x->length);
GC_free(old);
} | vuln | Safe | C/C++ |
foreach ($criteria as $criterion) {
// recursive call
if (isset($criterion['criteria'])) {
return $check_criteria($criterion['criteria']);
}
if (!isset($criterion['field']) || !isset($criterion['searchtype'])
|| !isset($cr... | vuln | Vulnerable | PHP |
/*
Copyright (c) 2013, David C Horton
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, modify, merge, publish, distribute,... | vuln | Vulnerable | C/C++ |
int sfgets(void)
{
struct pollfd pfd;
int pollret;
ssize_t readnb;
signed char seen_r = 0;
static size_t scanned;
static size_t readnbd;
if (scanned > (size_t) 0U) { /* support pipelining */
readnbd -= scanned;
memmove(cmd, cmd + scanned, readnbd); ... | vuln | Vulnerable | C/C++ |
package main
/* TODO
* turn into more generic functions for printing into tables
*/
import (
"database/sql"
"fmt"
_ "github.com/go-sql-driver/mysql"
"net/http"
"strconv"
"strings"
"text/template"
)
// Shows selection of databases at top level
func home(w http.ResponseWriter, r *http.Request) {
user, pw, h... | vuln | Safe | Go |
private void handlePost(MessageContext msgCtx,
org.apache.axis2.context.MessageContext axisMsgCtx) {
JSONObject response;
try {
JsonObject payload = Utils.getJsonPayload(axisMsgCtx);
if (payload.has(Constants.NAME)) {
String inboundNam... | vuln | Safe | Java |
private GridConcurrentMultiPairQueue<PageMemoryEx, FullPageId> writePages(
GridConcurrentMultiPairQueue<PageMemoryEx, FullPageId> writePageIds
) throws IgniteCheckedException {
Map<PageMemoryEx, List<FullPageId>> pagesToRetry = new HashMap<>();
CheckpointMetricsTracker tracker = persStoreMe... | vuln | Safe | Java |
@Override
protected List<TableInfo<CommonField<BsonType>>> discoverInternal(final MongoDatabase database)
throws Exception {
final List<TableInfo<CommonField<BsonType>>> tableInfos = new ArrayList<>();
for (final String collectionName : database.getCollectionNames()) {
final MongoCollection<Docum... | vuln | Vulnerable | Java |
static int vmdk_open_vmdk4(BlockDriverState *bs,
BlockDriverState *file,
int flags)
{
int ret;
uint32_t magic;
uint32_t l1_size, l1_entry_sectors;
VMDK4Header header;
VmdkExtent *extent;
int64_t l1_backup_offset = 0;
ret = bdrv_pread(file... | vuln | Safe | C/C++ |
@Override
public void getAuthToken(
IAccountManagerResponse response,
final Account account,
final String authTokenType,
final boolean notifyOnAuthFailure,
final boolean expectActivityLaunch,
final Bundle loginOptions) {
Bundle.setDefus... | vuln | Vulnerable | Java |
static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
{
AVIOContext *pb = s->pb;
APEContext *ape = s->priv_data;
AVStream *st;
uint32_t tag;
int i;
int total_blocks;
int64_t pts;
ape->junklength = 0;
tag = avio_rl32(pb);
if (tag != MKTAG('M', 'A', 'C', ' '... | vuln | Safe | C/C++ |
import Helpers from '../utils/helpers';
import Toolbar from './toolbar';
import Color from './color';
import Ajax from './ajax';
function Editor() {
var Component = (function(el, options) {
// New instance
var obj = { type:'editor' };
obj.options = {};
// Default configuration
... | vuln | Safe | JavaScript |
// © 2017 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
#include <cstdlib>
#include <cmath>
#include <limits>
#include <stdlib.h>
#include "unicode/plurrule.h"
#include "cmemory.h"
#include "number_decnum.... | vuln | Safe | Java |
int ssh_scp_push_file64(ssh_scp scp, const char *filename, uint64_t size,
int mode)
{
char buffer[1024] = {0};
int rc;
char *file = NULL;
char *perms = NULL;
if (scp == NULL) {
return SSH_ERROR;
}
if (scp->state != SSH_SCP_WRITE_INITED) {
ssh_set_err... | vuln | Safe | Unknown |
# -*- coding: utf-8 -*-
# Copyright 2015, 2016 OpenMarket Ltd
#
# 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 applica... | vuln | Safe | Python |
uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes)
{
ulg rowbytes;
/* expand palette images to RGB, low-bit-depth grayscale images to 8 bits,
* transparency chunks to full alpha channel; strip 16-bit-per-sample
* images to 8 bits per sample; and convert grayscale to RGB[A]... | vuln | Safe | C/C++ |
int cpu_exec(CPUArchState *env)
{
CPUState *cpu = ENV_GET_CPU(env);
#if !(defined(CONFIG_USER_ONLY) && \
(defined(TARGET_M68K) || defined(TARGET_PPC) || defined(TARGET_S390X)))
CPUClass *cc = CPU_GET_CLASS(cpu);
#endif
#ifdef TARGET_I386
X86CPU *x86_cpu = X86_CPU(cpu);
#endif
int ret, interrupt_re... | vuln | Safe | C/C++ |
TfLiteStatus SoftmaxEval(TfLiteContext* context, TfLiteNode* node) {
auto* params = reinterpret_cast<TfLiteSoftmaxParams*>(node->builtin_data);
SoftmaxOpData* data = reinterpret_cast<SoftmaxOpData*>(node->user_data);
const TfLiteTensor* input;
TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, 0, &input));... | vuln | Safe | C/C++ |
@POST
@Consumes({MEDIA_TYPE_SCIM_JSON, MediaType.APPLICATION_JSON})
@Produces({MEDIA_TYPE_SCIM_JSON + UTF8_CHARSET_FRAGMENT, MediaType.APPLICATION_JSON + UTF8_CHARSET_FRAGMENT})
@HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON)
@ProtectedApi(scopes = {"https://jans.io/scim/users.write"})
@R... | vuln | Vulnerable | Java |
ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,
struct pipe_inode_info *pipe, size_t len,
unsigned int flags)
{
struct sock *sk = sock->sk;
struct tcp_splice_state tss = {
.pipe = pipe,
.len = len,
.flags = flags,
};
long timeo;
ssize_t spliced;
int ret;
sock_rps_record_flow(sk);
/*
* ... | vuln | Safe | C/C++ |
void luaV_execute (lua_State *L, CallInfo *ci) {
LClosure *cl;
TValue *k;
StkId base;
const Instruction *pc;
int trap;
#if LUA_USE_JUMPTABLE
#include "ljumptab.h"
#endif
tailcall:
trap = L->hookmask;
cl = clLvalue(s2v(ci->func));
k = cl->p->k;
pc = ci->u.l.savedpc;
if (trap) {
if (cl->p->is_var... | vuln | Vulnerable | Unknown |
private static void handleEntityFallDamage(LivingEntity livingEntity, Pos currentPosition, Pos newPosition, boolean isOnGround) {
double dy = newPosition.y() - currentPosition.y();
double fallDistance = livingEntity.hasTag(Tracker.FALL_DISTANCE) ? livingEntity.getTag(Tracker.FALL_DISTANCE) : 0;
if ((livingEntity... | vuln | Safe | Java |
/*
* 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,... | vuln | Vulnerable | Java |
const fs = require('fs');
const path = require('path');
const Errors = {
ATTACHMENT_NOT_FOUND: {
attachmentNotFound: 'Attachment not found',
},
};
module.exports = {
inputs: {
id: {
type: 'string',
regex: /^[0-9]+$/,
required: true,
},
},
exits: {
attachmentNotFound: {
... | vuln | Safe | JavaScript |
/*
// Copyright (c) 2018 Intel Corporation
//
// 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... | vuln | Vulnerable | C/C++ |
void Compute(OpKernelContext *ctx) override {
const Tensor *a_indices_t, *a_values_t, *a_shape_t, *b_indices_t,
*b_values_t, *b_shape_t;
OP_REQUIRES_OK(ctx, ctx->input("a_indices", &a_indices_t));
OP_REQUIRES_OK(ctx, ctx->input("a_values", &a_values_t));
OP_REQUIRES_OK(ctx, ctx->input("a_shape",... | vuln | Vulnerable | 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 | Vulnerable | Java |
import { configFromStringAndFormat } from './from-string-and-format';
import { createUTCDate } from './date-from-array';
import { hooks } from '../utils/hooks';
import { deprecate } from '../utils/deprecate';
import getParsingFlags from './parsing-flags';
import { defaultLocaleMonthsShort } from '../units/month';
impor... | vuln | Vulnerable | JavaScript |
public ResponseEntity<Client> call123testSpecialTagsWithHttpInfo(Client body) throws RestClientException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the requi... | vuln | Vulnerable | Java |
/*
* Copyright (C) 2003, 2004, 2005 Joe Walnes.
* Copyright (C) 2006, 2007, 2008, 2010, 2011, 2012, 2013, 2018, 2021 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
* style license a copy of which has been included with this distribution in
* th... | vuln | Safe | Java |
public Module getProgramContainerModule(CConfiguration cConf) {
return new AbstractModule() {
@Override
protected void configure() {
Credential remoteCredentials = loadRemoteCredentials(cConf);
if (remoteCredentials != null) {
String username = getUsername();
bind(Aut... | vuln | Safe | Java |
mm_answer_pam_free_ctx(int sock, Buffer *m)
{
int r = sshpam_authok != NULL && sshpam_authok == sshpam_ctxt;
debug3("%s", __func__);
(sshpam_device.free_ctx)(sshpam_ctxt);
sshpam_ctxt = sshpam_authok = NULL;
buffer_clear(m);
mm_request_send(sock, MONITOR_ANS_PAM_FREE_CTX, m);
auth_method = "keyboard-inte... | vuln | Safe | C/C++ |
public void onMantleSettingsLoaded( MantleSettingsLoadedEvent event ) {
final HashMap<String, String> settings = event.getSettings();
final boolean showOnlyPerspective =
Boolean.parseBoolean( StringUtils.isEmpty( Window.Location.getParameter( "showOnlyPerspective" ) ) ? settings.get( "showOnlyPerspecti... | vuln | Vulnerable | Java |
void ext4_xattr_destroy_cache(struct mb_cache *cache)
{
if (cache)
mb_cache_destroy(cache);
} | vuln | Vulnerable | C/C++ |
copy_thread(unsigned long clone_flags, unsigned long stack_start,
unsigned long stk_sz, struct task_struct *p)
{
struct thread_info *thread = task_thread_info(p);
struct pt_regs *childregs = task_pt_regs(p);
memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save));
if (likely(!(p->flags & PF_KTHREAD)... | vuln | Vulnerable | C/C++ |
static void send_ext_key_event_ack(VncState *vs)
{
vnc_lock_output(vs);
vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE);
vnc_write_u8(vs, 0);
vnc_write_u16(vs, 1);
vnc_framebuffer_update(vs, 0, 0,
surface_width(vs->vd->ds),
surface_height(vs-... | vuln | Vulnerable | Unknown |
dhcpv4_print(netdissect_options *ndo,
const u_char *cp, u_int length, int indent)
{
u_int i, t;
const u_char *tlv, *value;
uint8_t type, optlen;
i = 0;
while (i < length) {
tlv = cp + i;
type = (uint8_t)tlv[0];
optlen = (uint8_t)tlv[1];
value = tlv... | vuln | Vulnerable | C/C++ |
function targetLinksToNewWindow(el) {
var links = el.getElementsByTagName('a');
for (var i = links.length - 1; i >= 0; i--) {
links[i].setAttribute('target', '_blank');
}
} | vuln | Vulnerable | JavaScript |
def self.search_by_user(key, operator, value)
key_name = key.sub(/^.*\./,'')
condition = sanitize_sql_for_conditions(["? #{operator} ?", key_name, value_to_sql(operator, value)])
users = User.all(:conditions => condition)
hosts = users.map(&:hosts).flatten
opts = hosts... | vuln | Safe | Ruby |
/*
Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
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, m... | vuln | Safe | C/C++ |
public void save_data(){
if(ipAddrTxt == null || portTxt == null || magBox == null) return;
SharedPreferences prefs = get_prefs();
SharedPreferences.Editor editor = prefs.edit();
editor.putString("ip_address", get_ip_address());
editor.putInt("port", get_port());
editor... | vuln | Safe | Java |
static int sha256_password_authenticate(MYSQL_PLUGIN_VIO *vio,
MYSQL_SERVER_AUTH_INFO *info)
{
uchar *pkt;
int pkt_len;
char *user_salt_begin;
char *user_salt_end;
char scramble[SCRAMBLE_LENGTH + 1];
char stage2[CRYPT_MAX_PASSWORD_SIZE + 1];
String scramble_respon... | vuln | Safe | Unknown |
/*
Unix SMB/CIFS implementation.
Files[] structure handling
Copyright (C) Andrew Tridgell 1998
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
... | vuln | Vulnerable | C/C++ |
feed_table_tag(struct table *tbl, char *line, struct table_mode *mode,
int width, struct parsed_tag *tag)
{
int cmd;
#ifdef ID_EXT
char *p;
#endif
struct table_cell *cell = &tbl->cell;
int colspan, rowspan;
int col, prev_col;
int i, j, k, v, v0, w, id;
Str tok, tmp, anchor;
table... | vuln | Safe | Unknown |
/*
gd_bmp.c
Bitmap format support for libgd
* Written 2007, Scott MacVicar
---------------------------------------------------------------------------
Todo:
Bitfield encoding
----------------------------------------------------------------------------
*/
/**
* File: BMP IO
*
* Read and write BMP images... | vuln | Safe | C/C++ |
static void nextstate(struct gps_packet_t *lexer, unsigned char c)
{
static int n = 0;
#ifdef RTCM104V2_ENABLE
enum isgpsstat_t isgpsstat;
#endif /* RTCM104V2_ENABLE */
#ifdef SUPERSTAR2_ENABLE
static unsigned char ctmp;
#endif /* SUPERSTAR2_ENABLE */
/*@ +charint -casebreak @*/
n++;
switch (lexer->... | vuln | Safe | Unknown |
public static boolean isPlayerTouchDeclared(final Class<?> targetClass) {
return ReflectionUtil.doesMethodExist(
targetClass,
Entity.class,
"playerTouch",
ReflectionUtil.PLAYER_TOUCH_METHOD_ARGS,
void.class
);
} | vuln | Safe | Java |
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.eperson;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util... | vuln | Safe | Java |
private static String getVulnerabilityExcel(List<Vulnerability> vulnerabilityList) throws Exception{
Workbook wb = null;
Sheet sheet = null;
try(
FileInputStream inFile= new FileInputStream(new File(downloadpath+"/VulnerabilityReport.xlsx"));
) {
try {wb = new XSSFWorkbook(inFile);} catch (IOException ... | vuln | Safe | Java |
def node_unstandby(params, request, auth_user)
if params[:name]
code, response = send_request_with_token(
auth_user, params[:name], 'node_unstandby', true, {"node"=>params[:name]}
)
# data={"node"=>params[:name]} for backward compatibility with older versions of pcs/pcsd
else
if not allowed_fo... | vuln | Safe | Ruby |
def _resolve_orders(orders):
requester = get_user_or_app_from_context(info.context)
if not requester.has_perm(OrderPermissions.MANAGE_ORDERS):
# allow fetch requestor orders (except drafts)
if root == info.context.user:
orders = list(
... | vuln | Safe | Python |
ScriptValue ScriptController::executeScriptInMainWorld(const ScriptSourceCode& sourceCode, AccessControlStatus corsStatus)
{
String sourceURL = sourceCode.url();
const String* savedSourceURL = m_sourceURL;
m_sourceURL = &sourceURL;
v8::HandleScope handleScope;
v8::Handle<v8::Context> v8Context = Sc... | vuln | Vulnerable | C/C++ |
static RzList *classes_from_symbols(RzBinFile *bf) {
RzBinSymbol *sym;
RzListIter *iter;
rz_list_foreach (bf->o->symbols, iter, sym) {
if (sym->name[0] != '_') {
continue;
}
const char *cn = sym->classname;
if (cn) {
RzBinClass *c = rz_bin_file_add_class(bf, sym->classname, NULL, 0);
if (!c) {
c... | vuln | Vulnerable | Unknown |
void btsock_rfc_signaled(UNUSED_ATTR int fd, int flags, uint32_t user_id) {
pthread_mutex_lock(&slot_lock);
rfc_slot_t *slot = find_rfc_slot_by_id(user_id);
if (!slot)
goto out;
bool need_close = false;
if (flags & SOCK_THREAD_FD_RD && !slot->f.server) {
if (slot->f.connected) {
int size = 0;
... | vuln | Vulnerable | C/C++ |
private void loadRelatedContent() {
// reset the list view
View root = getView();
Activity a = getActivity();
if (fileClaim != null && root != null && a != null) {
Context context = getContext();
List<Claim> loadingPlaceholders = new ArrayList<>();
in... | vuln | Vulnerable | Java |
$scope.refresh = function() {
growl.success('Retrieving node ' + $scope.foreignId + ' from requisition ' + $scope.foreignSource + '...');
RequisitionsService.getNode($scope.foreignSource, $scope.foreignId).then(
function(node) { // success
$scope.node = node;
},
$scope.erro... | vuln | Vulnerable | JavaScript |
void
main_print_unhandled_exception (jerry_value_t error_value) /**< error value */
{
assert (jerry_value_is_error (error_value));
error_value = jerry_get_value_from_error (error_value, true);
jerry_char_t err_str_buf[256];
jerry_value_t err_str_val = jerry_value_to_string (error_value);
jerry_size_t err_st... | vuln | Vulnerable | C/C++ |
public boolean equals(final Object obj) {
if (! (obj instanceof DigestPasswordImpl)) {
return false;
}
DigestPasswordImpl other = (DigestPasswordImpl) obj;
return Arrays.equals(digest, other.digest) && username.equals(other.username) && realm.equals(other.realm) && algorithm.... | vuln | Vulnerable | Java |
StatusWith<Message> MessageCompressorManager::decompressMessage(const Message& msg) {
auto inputHeader = msg.header();
ConstDataRangeCursor input(inputHeader.data(), inputHeader.data() + inputHeader.dataLen());
if (input.length() < CompressionHeader::size()) {
return {ErrorCodes::BadValue, "Invalid ... | vuln | Safe | Unknown |
static int sctp_eat_data(const struct sctp_association *asoc,
struct sctp_chunk *chunk,
sctp_cmd_seq_t *commands)
{
sctp_datahdr_t *data_hdr;
struct sctp_chunk *err;
size_t datalen;
sctp_verb_t deliver;
int tmp;
__u32 tsn;
int account_value;
struct sock *sk = asoc->base.sk;
data_hdr = chunk->subh.data... | vuln | Vulnerable | Unknown |
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 | Safe | Unknown |
static Sdb *store_versioninfo_gnu_verneed(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz) {
ut8 *end, *need = NULL;
const char *section_name = "";
Elf_(Shdr) *link_shdr = NULL;
const char *link_section_name = "";
Sdb *sdb_vernaux = NULL;
Sdb *sdb_version = NULL;
Sdb *sdb = NULL;
int i, cnt;
if (!bin || !bin->dynstr) {... | vuln | Safe | C/C++ |
/* Copyright 2020 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 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.