code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
public void unpark() {
for (int i = 0; i < tasks; i++) {
LockSupport.unpark(parkedThreads[i]);
parkedThreads[i] = null;
}
} | vuln | Vulnerable | Java |
int ssl3_get_client_certificate(SSL *s)
{
int i, ok, al, ret = -1;
X509 *x = NULL;
unsigned long l, nc, llen, n;
const unsigned char *p, *q;
unsigned char *d;
STACK_OF(X509) *sk = NULL;
n = s->method->ssl_get_message(s,
SSL3_ST_SR_CERT_A,
... | vuln | Vulnerable | Unknown |
static void lsi_do_msgout(LSIState *s)
{
uint8_t msg;
int len;
uint32_t current_tag;
SCSIDevice *current_dev;
lsi_request *p, *p_next;
int id;
if (s->current) {
current_tag = s->current->tag;
} else {
current_tag = s->select_tag;
}
id = (current_tag >> 8) & 0xf;
... | vuln | Vulnerable | C/C++ |
struct dst_entry *fib6_rule_lookup(struct net *net, struct flowi6 *fl6,
const struct sk_buff *skb,
int flags, pol_lookup_t lookup)
{
struct rt6_info *rt;
rt = lookup(net, net->ipv6.fib6_main_tbl, fl6, skb, flags);
if (rt->dst.error == -EAGAIN) {
ip6_rt_put_flags(rt, flags);
rt = net->ipv6.ip6_null... | vuln | Vulnerable | C/C++ |
def _check_dataflow_job_state(self, job) -> bool:
"""
Helper method to check the state of one job in dataflow for this task if job failed raise exception.
:return: True if job is done.
:raise: Exception
"""
current_state = job["currentState"]
is_streaming = job.g... | vuln | Safe | Python |
/*
* AC-3 parser
* Copyright (c) 2003 Fabrice Bellard
* Copyright (c) 2003 Michael Niedermayer
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either... | vuln | Safe | C/C++ |
static void frag_kfree_skb(struct netns_frags *nf, struct sk_buff *skb)
{
atomic_sub(skb->truesize, &nf->mem);
kfree_skb(skb);
} | vuln | Vulnerable | C/C++ |
process_bitmap_updates(STREAM s)
{
int i;
uint16 num_updates;
in_uint16_le(s, num_updates); /* rectangles */
for (i = 0; i < num_updates; i++)
{
process_bitmap_data(s);
}
} | vuln | Safe | Unknown |
static int search_func(_UNUSED_ struct ldb_kv_private *ldb_kv,
struct ldb_val key,
struct ldb_val val,
void *state)
{
struct ldb_context *ldb;
struct ldb_kv_context *ac;
struct ldb_message *msg, *filtered_msg;
struct timeval now;
int ret, timeval_cmp;
bool matched;
ac = talloc_get_typ... | vuln | Safe | Unknown |
static void _slurm_rpc_job_will_run(slurm_msg_t * msg)
{
/* init */
DEF_TIMERS;
int error_code = SLURM_SUCCESS;
struct job_record *job_ptr = NULL;
job_desc_msg_t *job_desc_msg = (job_desc_msg_t *) msg->data;
/* Locks: Read config, read job, read node, read partition */
slurmctld_lock_t job_read_lock = {
READ_L... | vuln | Safe | Unknown |
static void __io_cqring_fill_event(struct io_kiocb *req, long res, long cflags)
{
struct io_ring_ctx *ctx = req->ctx;
struct io_uring_cqe *cqe;
trace_io_uring_complete(ctx, req->user_data, res);
/*
* If we can't get a cq entry, userspace overflowed the
* submission (by quite a lot). Increment the overflow cou... | vuln | Vulnerable | Unknown |
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
JWSAuthentication token = null;
try {
if(authentication instanceof JWSAuthentication) {
token = JWSAuthentication.class.cast(authentication);
Str... | vuln | Safe | Java |
int StreamTcpPacket (ThreadVars *tv, Packet *p, StreamTcpThread *stt,
PacketQueue *pq)
{
SCEnter();
DEBUG_ASSERT_FLOW_LOCKED(p->flow);
SCLogDebug("p->pcap_cnt %"PRIu64, p->pcap_cnt);
HandleThreadId(tv, p, stt);
TcpSession *ssn = (TcpSession *)p->flow->protoctx;
/* track... | vuln | Vulnerable | C/C++ |
int inet_nonblocking_connect(const char *str,
NonBlockingConnectHandler *callback,
void *opaque, Error **errp)
{
QemuOpts *opts;
int sock = -1;
g_assert(callback != NULL);
opts = qemu_opts_create(&dummy_opts, NULL, 0, NULL);
if (inet_parse(op... | vuln | Safe | C/C++ |
"""Tornado handlers for the contents web service."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import json
from tornado import gen, web
from IPython.html.utils import url_path_join, url_escape
from IPython.utils.jsonutil import date_default
from IPython.ht... | vuln | Vulnerable | Python |
TEE_Result syscall_asymm_verify(unsigned long state,
const struct utee_attribute *usr_params,
size_t num_params, const void *data, size_t data_len,
const void *sig, size_t sig_len)
{
TEE_Result res;
struct tee_cryp_state *cs;
struct tee_ta_session *sess;
struct tee_obj *o;
size_t hash_size;
int salt_len ... | vuln | Safe | Unknown |
static void nlmclnt_unlock_callback(struct rpc_task *task, void *data)
{
struct nlm_rqst *req = data;
u32 status = ntohl(req->a_res.status);
if (RPC_ASSASSINATED(task))
goto die;
if (task->tk_status < 0) {
dprintk("lockd: unlock failed (err = %d)\n", -task->tk_status);
switch (task->tk_status) {
case -EAC... | vuln | Safe | Unknown |
private void configureDosFilter(ServletContextHandler context) {
if (!config.isDosFilterEnabled()) {
return;
}
DoSFilter dosFilter;
if (!config.getDosFilterRemotePort() && config.getDosFilterTrackGlobal()) {
dosFilter = new GlobalDosFilter();
} else {
dosFilter = new DoSFilter();
... | vuln | Safe | Java |
def execute(self, context: Context):
vertica = VerticaHook(vertica_conn_id=self.vertica_conn_id)
mysql = MySqlHook(mysql_conn_id=self.mysql_conn_id, local_infile=self.bulk_load)
if self.bulk_load:
self._bulk_load_transfer(mysql, vertica)
else:
self._non_bulk_load... | vuln | Safe | Python |
void AppControllerImpl::BindRequest(mojom::AppControllerRequest request) {
void AppControllerService::BindRequest(mojom::AppControllerRequest request) {
bindings_.AddBinding(this, std::move(request));
} | vuln | Safe | C/C++ |
void
AcpiNsTerminate (
void)
{
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (NsTerminate);
#ifdef ACPI_EXEC_APP
{
ACPI_OPERAND_OBJECT *Prev;
ACPI_OPERAND_OBJECT *Next;
/* Delete any module-level code blocks */
Next = AcpiGbl_ModuleCodeList;
wh... | vuln | Vulnerable | C/C++ |
static void cpu_notify_map_clients(void)
{
MapClient *client;
while (!LIST_EMPTY(&map_client_list)) {
client = LIST_FIRST(&map_client_list);
client->callback(client->opaque);
cpu_unregister_map_client(client);
}
} | vuln | Safe | C/C++ |
Deploy(const char* packageName)
{
int deployStatus = DEPLOY_SUCCESS;
char* command = NULL;
int deploymentResult;
char *nics;
char* cleanupCommand;
uint8 archiveType;
// Move to IN PROGRESS state
TransitionState(NULL, INPROGRESS);
// Notify the vpx of customization in-progress state
SetCu... | vuln | Vulnerable | Unknown |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "CarbonProtocolReader.h"
namespace carbon {
void CarbonProtocolReader::skipLinearContainer() {
const auto pr = readLine... | vuln | Vulnerable | C/C++ |
public boolean isHoldingRod() {
EntityPlayerSP player = Minecraft.getMinecraft().thePlayer;
if (player != null) {
ItemStack item = player.getHeldItem();
if (item.getItem() != Items.fishing_rod) return false;
String itemId = ItemUtils.getSkyblockItemID(item);
... | vuln | Vulnerable | Java |
TfLiteStatus HardSwishPrepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_STATUS(GenericPrepare(context, node));
TfLiteTensor* output = GetOutput(context, node, 0);
if (output->type == kTfLiteUInt8 || output->type == kTfLiteInt8) {
HardSwishData* data = static_cast<HardSwishData*>(node->user_d... | vuln | Vulnerable | C/C++ |
public static void downloadSdk() {
File target = new File("config/game-sdk");
AxolotlClient.LOGGER.info("Downloading SDK!");
try {
if (!target.exists() && !target.mkdir()) {
throw new IllegalStateException("Could not create game-sdk folder");
}
... | vuln | Vulnerable | Java |
static int nbd_reject_length(NBDClient *client, bool fatal, Error **errp)
{
int ret;
assert(client->optlen);
ret = nbd_opt_drop(client, NBD_REP_ERR_INVALID, errp,
"option '%s' has unexpected length",
nbd_opt_lookup(client->opt));
if (fatal && !ret) {
... | vuln | Safe | C/C++ |
private Container[] getContainers(UserGroupInformation ugi,
String serviceName, List<String> componentNames, String version,
List<ContainerState> containerStates) throws IOException,
InterruptedException {
return ugi.doAs((PrivilegedExceptionAction<Container[]>) () -> {
Container[] result;
... | vuln | Vulnerable | Java |
static inline void vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y,
int mvn, int r_x, int r_y, uint8_t* is_intra, int dir)
{
MpegEncContext *s = &v->s;
int xy, wrap, off = 0;
int A[2], B[2], C[2];
int px, py;
int a_valid = 0, b_valid = 0, c_valid = 0... | vuln | Vulnerable | C/C++ |
static uint32_t hpet_time_after64(uint64_t a, uint64_t b)
{
return ((int64_t)(b - a) < 0);
} | vuln | Safe | C/C++ |
static int cirrus_bitblt_videotovideo_patterncopy(CirrusVGAState * s)
{
return cirrus_bitblt_common_patterncopy(s,
s->vram_ptr + ((s->cirrus_blt_srcaddr & ~7) &
s->cirrus_addr_mask));
} | vuln | Safe | Unknown |
nv_replace(cmdarg_T *cap)
{
char_u *ptr;
int had_ctrl_v;
long n;
if (checkclearop(cap->oap))
return;
#ifdef FEAT_JOB_CHANNEL
if (bt_prompt(curbuf) && !prompt_curpos_editable())
{
clearopbeep(cap->oap);
return;
}
#endif
// get another character
if (cap->nchar == Ctrl_V)
{
h... | vuln | Safe | C/C++ |
/*
* privileges.go - Handles inserting/removing into user keyrings.
*
* Copyright 2017 Google Inc.
* Author: Joe Richey (joerichey@google.com)
*
* 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 Lic... | vuln | Vulnerable | Go |
void Segment::AppendCluster(Cluster* pCluster)
const long count = m_clusterCount + m_clusterPreloadCount;
long& size = m_clusterSize;
assert(size >= count);
const long idx = pCluster->m_index;
assert(idx == m_clusterCount);
if (count >= size) {
const long n = (size <= 0) ? 2048 : 2 * size;
C... | vuln | Safe | C/C++ |
@FunctionDoc(
name = "anvilRename",
desc = "This allows you to name an item in an anvil",
params = {
STRING, "name", "the name you want to give the item",
FUNCTION, "predicate", "whether the ItemStack meets a certain criteria"
},
returns = {BOOLEAN, "whether the anvilling was successful, if the p... | vuln | Vulnerable | Java |
@VisibleForTesting
long putSubject(Subject subject, long existingUniqueId) {
final long uniqueId = clientUserAuths.putSubject(subject, existingUniqueId);
// also update the subject in the CacheClientProxy if it's in single user mode
CacheClientProxy clientProxy =
getAcceptor().getCacheClientNotifi... | vuln | Vulnerable | Java |
it "can set password" do
user = InviteRedeemer.new(invite: invite, email: invite.email, username: username, name: name, password: password).redeem
expect(user).to have_password
expect(user.confirm_password?(password)).to eq(true)
expect(user.approved).to eq(false)
end | vuln | Safe | Ruby |
private boolean maybeCancelFinishAnimation() {
View rootView = findRootView();
Animation animation = rootView == null ? null : rootView.getAnimation();
if (animation instanceof FinishAnimation) {
boolean hasEnded = animation.hasEnded();
animation.cancel();
roo... | vuln | Safe | Java |
/*
* Copyright (C) 2009 Voice Sistem SRL
* Copyright (C) 2009 Andrei Dragus
*
* This file is part of opensips, a free SIP server.
*
* opensips 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 ver... | vuln | Vulnerable | C/C++ |
static ssize_t __cgroup_procs_write(struct kernfs_open_file *of, char *buf,
bool threadgroup)
{
struct cgroup *src_cgrp, *dst_cgrp;
struct task_struct *task;
ssize_t ret;
bool locked;
dst_cgrp = cgroup_kn_lock_live(of->kn, false);
if (!dst_cgrp)
return -ENODEV;
task = cgroup_procs_write_start(buf, th... | vuln | Vulnerable | Unknown |
def build_module_command(self, env_string, shebang, cmd, arg_path=None):
bootstrap_wrapper = pkgutil.get_data("ansible.executor.powershell", "bootstrap_wrapper.ps1")
# pipelining bypass
if cmd == '':
return self._encode_script(script=bootstrap_wrapper, strict_mode=False, preserve_rc... | vuln | Safe | Python |
@Override
public void undo() {
Services.EVENT.getAttributeModifiers().keySet()
.stream()
.filter(ingredient::contains).forEach(key -> {
Services.EVENT.getAttributeModifiers().get(key).removeIf(consumer::equals);
});
} | vuln | Vulnerable | Java |
public static Unit fromString(String x) {
if (x.equals(KG.mDisplayName)) return KG;
if (x.equals(LBS.mDisplayName)) return LBS;
if (x.equals(STONES.mDisplayName)) return STONES;
if (x.equals(KM.mDisplayName)) return KM;
if (x.equals(MILES.mDisplayName)) return MILES;
if... | vuln | Vulnerable | Java |
@Override
protected boolean func_230363_a_(ChunkGenerator chunkGenerator, BiomeProvider biomeProvider, long seed, SharedSeedRandom chunkRandom, int chunkX, int chunkZ, Biome biome, ChunkPos chunkPos, NoFeatureConfig config) {
this.random = new SharedSeedRandom(seed + (chunkX * (chunkZ * 17)));
// M... | vuln | Vulnerable | Java |
static void onenand_reset(OneNANDState *s, int cold)
{
memset(&s->addr, 0, sizeof(s->addr));
s->command = 0;
s->count = 1;
s->bufaddr = 0;
s->config[0] = 0x40c0;
s->config[1] = 0x0000;
onenand_intr_update(s);
qemu_irq_raise(s->rdy);
s->status = 0x0000;
s->intstatus = cold ? 0x808... | vuln | Safe | C/C++ |
static void coroutine_fn v9fs_xattrcreate(void *opaque)
{
int flags;
int32_t fid;
int64_t size;
ssize_t err = 0;
V9fsString name;
size_t offset = 7;
V9fsFidState *file_fidp;
V9fsFidState *xattr_fidp;
V9fsPDU *pdu = opaque;
v9fs_string_init(&name);
err = pdu_unmarshal(pdu, of... | vuln | Safe | Unknown |
OmKeyLocationInfoGroup generateNextVersion(
List<OmKeyLocationInfo> newLocationList) {
Map<Long, List<OmKeyLocationInfo>> newMap =
new HashMap<>();
newMap.put(version + 1, new ArrayList<>(newLocationList));
return new OmKeyLocationInfoGroup(version + 1, newMap);
} | vuln | Safe | Java |
bool CModules::GetModInfo(CModInfo& ModInfo, const CString& sModule,
CString& sRetMsg) {
CString sModPath, sTmp;
bool bSuccess;
bool bHandled = false;
GLOBALMODULECALL(OnGetModInfo(ModInfo, sModule, bSuccess, sRetMsg),
&bHandled);
if (bHandled) return ... | vuln | Vulnerable | Unknown |
def populate_obj(self, userobj):
try:
token = userobj.add_access_token(self.name.data, self.expiration.data)
flash(
_(
"Your new personal access token has been created.\n"
"Make sure to save it - you won't be able to access it again... | vuln | Vulnerable | Python |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite/handler/oauth2 (interfaces: AuthorizeCodeStorage)
// Package internal is a generated GoMock package.
package internal
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
fosite "github.com/ory/fosite"
)
... | vuln | Vulnerable | Go |
package logic
import (
"errors"
"fmt"
"time"
"github.com/golang-jwt/jwt/v4"
"github.com/gravitl/netmaker/logger"
"github.com/gravitl/netmaker/models"
"github.com/gravitl/netmaker/servercfg"
)
var jwtSecretKey []byte
// SetJWTSecret - sets the jwt secret on server startup
func SetJWTSecret() {
currentSecret,... | vuln | Safe | Go |
static av_cold int aac_encode_init(AVCodecContext *avctx)
{
AACEncContext *s = avctx->priv_data;
int i, ret = 0;
const uint8_t *sizes[2];
uint8_t grouping[AAC_MAX_CHANNELS];
int lengths[2];
avctx->frame_size = 1024;
for (i = 0; i < 16; i++)
if (avctx->sample_rate == avpriv_mpeg4audio... | vuln | Safe | C/C++ |
void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL pqxl, int group_id)
{
uint64_t phys = le64_to_cpu(pqxl);
uint32_t slot = (phys >> (64 - 8)) & 0xff;
uint64_t offset = phys & 0xffffffffffff;
switch (group_id) {
case MEMSLOT_GROUP_HOST:
return (void *)(intptr_t)offset;
case MEMSLOT_... | vuln | Safe | C/C++ |
'use strict';
/**
* Copyright 2009 Google Inc., 2011 Peter 'Pita' Martischka (Primary Technology 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/lic... | vuln | Vulnerable | JavaScript |
public static /*<name>*/AVMetadataObjectType/*</name>*/ valueOf(/*<type>*/NSString/*</type>*/ value) {
for (/*<name>*/AVMetadataObjectType/*</name>*/ v : values) {
if (v.value().equals(value)) {
return v;
}
}
throw new IllegalArgumentException("No constant... | vuln | Vulnerable | Java |
constructor({asset, message, onClick}: Params, element: HTMLElement) {
super(message);
this.asset = asset;
this.message = message;
this.isVisible = ko.observable(false);
this.onClick = (_data, event) => onClick(message, event);
this.dummyImageUrl = `data:image/svg+xml;utf8,<svg xmlns='http://ww... | vuln | Vulnerable | JavaScript |
public long getBufferFlushCheckIntervalInMs() {
return (long)
this.parameterMap.getOrDefault(
BUFFER_FLUSH_CHECK_INTERVAL_IN_MILLIS_MAP_KEY,
BUFFER_FLUSH_CHECK_INTERVAL_IN_MILLIS_DEFAULT);
} | vuln | Vulnerable | Java |
public static void returnData(Object context, final Intent intent, final ResultWriter resultWriter) {
final PendingResult asyncResult = (context instanceof BroadcastReceiver) ? ((BroadcastReceiver) context)
.goAsync() : null;
final Activity activity = (Activity) ((context instanceof Acti... | vuln | Vulnerable | Java |
SSH_PACKET_CALLBACK(ssh_packet_newkeys){
ssh_string sig_blob = NULL;
int rc;
(void)packet;
(void)user;
(void)type;
SSH_LOG(SSH_LOG_PROTOCOL, "Received SSH_MSG_NEWKEYS");
if(session->session_state!= SSH_SESSION_STATE_DH &&
session->dh_handshake_state != DH_STATE_NEWKEYS_SENT){
ssh_set_error(session,S... | vuln | Vulnerable | C/C++ |
/*
* * Copyright (C) 2006-2011 Anders Brander <anders@brander.dk>,
* * Anders Kvist <akv@lnxbx.dk> and Klaus Post <klauspost@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; e... | vuln | Vulnerable | C/C++ |
public String unlockUnit(String type, boolean dupe, SRR req) throws NoConnectionException {
if(!canUnlockUnit(type, dupe))
return "not enough gold";
String text = req.unlockUnit(type);
if(text == null)
return "critical request error";
JsonObject res = Json.parseObj(text);
JsonElement err = res.g... | vuln | Vulnerable | Java |
public static void checkForOffhandAttack() {
if (!FabricLoader.getInstance().isModLoaded("dualwielding") || !FabricLoader.getInstance().isModLoaded("bettercombat")) {
MinecraftClient mc = MinecraftClient.getInstance();
PlayerEntity player = mc.player;
HitResult hitResult = mc... | vuln | Safe | Java |
/*
* The contents of this file are subject to the OpenMRS Public License
* Version 1.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://license.openmrs.org
*
* Software distributed under the License is distributed on an "AS IS"
*... | vuln | Safe | Java |
/*
* Copyright (c) 2012-2019 Belledonne Communications SARL.
*
* This file is part of belle-sip.
*
* 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++ |
FLAC__bool write_bitbuffer_(FLAC__StreamEncoder *encoder, uint32_t samples, FLAC__bool is_last_block)
{
const FLAC__byte *buffer;
size_t bytes;
FLAC__ASSERT(FLAC__bitwriter_is_byte_aligned(encoder->private_->frame));
if(!FLAC__bitwriter_get_buffer(encoder->private_->frame, &buffer, &bytes)) {
encoder->protected... | vuln | Vulnerable | C/C++ |
OMX_ERRORTYPE omx_vdec::empty_this_buffer(OMX_IN OMX_HANDLETYPE hComp,
OMX_IN OMX_BUFFERHEADERTYPE* buffer)
{
OMX_ERRORTYPE ret1 = OMX_ErrorNone;
unsigned int nBufferIndex = drv_ctx.ip_buf.actualcount;
if (m_state != OMX_StateExecuting &&
m_state != OMX_StatePause &&
... | vuln | Safe | C/C++ |
/*
* Copyright © 2015-2018 Aeneas Rekkas <aeneas+oss@aeneas.io>
*
* 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... | vuln | Vulnerable | Go |
int ff_mms_asf_header_parser(MMSContext *mms)
{
uint8_t *p = mms->asf_header;
uint8_t *end;
int flags, stream_id;
mms->stream_num = 0;
if (mms->asf_header_size < sizeof(ff_asf_guid) * 2 + 22 ||
memcmp(p, ff_asf_header, sizeof(ff_asf_guid))) {
av_log(NULL, AV_LOG_ERROR,
... | vuln | Safe | Unknown |
@RequestMapping(value = LOGOUT_RESOURCE)
public void logout(HttpServletRequest req, HttpServletResponse res) throws IOException {
logger.debug("logout user");
try {
IdentityAuthentication authentication = (IdentityAuthentication) SecurityContextHolder
.getContext()
.getAuthentication... | vuln | Vulnerable | Java |
@SubscribeEvent
public void onLivingEquipmentChange(LivingEquipmentChangeEvent event)
{
if (BloodMagic.curiosLoaded)
{ // Without Curios, there is nothing this cares about.
if (event.getFrom().getItem() instanceof ItemLivingArmor || event.getTo().getItem() instanceof ItemLivingArmor)
{ // Armor change invo... | vuln | Safe | Java |
private String generateAndStoreToken(RoutingContext ctx) {
byte[] salt = new byte[32];
random.nextBytes(salt);
String saltPlusToken = base64UrlEncode(salt) + "." + System.currentTimeMillis();
String signature = base64UrlEncode(mac.doFinal(saltPlusToken.getBytes(StandardCharsets.US_ASCII)));
final ... | vuln | Safe | Java |
def get_corosync_nodes()
stdout, stderror, retval = run_cmd(
PCSAuth.getSuperuserSession, PCS, "status", "nodes", "corosync"
)
if retval != 0
return []
end
stdout.each {|x| x.strip!}
corosync_online = stdout[1].sub(/^.*Online:/,"").strip
corosync_offline = stdout[2].sub(/^.*Offline:/,"").strip
... | vuln | Vulnerable | Ruby |
static int atusb_get_and_show_revision(struct atusb *atusb)
{
struct usb_device *usb_dev = atusb->usb_dev;
unsigned char buffer[3];
int ret;
/* Get a couple of the ATMega Firmware values */
ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0),
ATUSB_ID, ATUSB_REQ_FROM_DEV, 0, 0,
buffer, 3, 1000);
i... | vuln | Vulnerable | Unknown |
/**
* Copyright (c) 2006-2020, JGraph Ltd
* Copyright (c) 2006-2020, draw.io AG
*/
/**
* Constructs a new point for the optional x and y coordinates. If no
* coordinates are given, then the default values for <x> and <y> are used.
* @constructor
* @class Implements a basic 2D point. Known subclassers = {@link m... | vuln | Safe | JavaScript |
rsock_read_nonblock(VALUE sock, VALUE length, VALUE buf, VALUE ex)
{
rb_io_t *fptr;
long n;
long len = NUM2LONG(length);
VALUE str = rsock_strbuf(buf, len);
char *ptr;
GetOpenFile(sock, fptr);
if (len == 0) {
rb_str_set_len(str, 0);
return str;
}
ptr = RSTRING_PTR(str);
n = ... | vuln | Safe | Unknown |
public void swapActiveConfig(final UUID newConfig, final boolean startup)
throws ConfigUpdateException {
final var configToReplace = findActiveConfig();
if (configToReplace.isPresent()) {
swapActiveConfigInDb(newConfig);
if (!startup) {
try {
... | vuln | Vulnerable | Java |
static int check_tag(AVIOContext *s, int offset, unsigned int len)
{
char tag[4];
if (len > 4 ||
avio_seek(s, offset, SEEK_SET) < 0 ||
avio_read(s, tag, len) < (int)len)
return -1;
else if (!AV_RB32(tag) || is_tag(tag, len))
return 1;
return 0;
} | vuln | Safe | C/C++ |
@Override
@SuppressFBWarnings("SPRING_CSRF_PROTECTION_DISABLED")
protected final void configure(final HttpSecurity http) throws Exception {
http.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.authorizeRequests()
... | vuln | Safe | Java |
private static function getTemplateParmValues( $text, $template ) {
$matches = [];
$noMatches = preg_match_all( '/\{\{\s*' . preg_quote( $template, '/' ) . '\s*[|}]/i', $text, $matches, PREG_OFFSET_CAPTURE );
if ( $noMatches <= 0 ) {
return '';
}
$textLen = strlen( $text );
$tval = []; // the result... | vuln | Vulnerable | PHP |
void ip_options_build(struct sk_buff * skb, struct ip_options * opt,
void ip_options_build(struct sk_buff *skb, struct ip_options *opt,
__be32 daddr, struct rtable *rt, int is_frag)
{
unsigned char *iph = skb_network_header(skb);
memcpy(&(IPCB(skb)->opt), opt, sizeof(struct ip_options));
memcpy(iph+sizeof... | vuln | Safe | C/C++ |
void DefaultCertValidator::updateDigestForSessionId(bssl::ScopedEVP_MD_CTX& md,
uint8_t hash_buffer[EVP_MAX_MD_SIZE],
unsigned hash_length) {
int rc;
// Hash all the settings that affect whether the server will ... | vuln | Vulnerable | C/C++ |
void *address_space_map(AddressSpace *as,
hwaddr addr,
hwaddr *plen,
bool is_write)
{
hwaddr len = *plen;
hwaddr done = 0;
hwaddr l, xlat, base;
MemoryRegion *mr, *this_mr;
ram_addr_t raddr;
if (len == 0) {
return NU... | vuln | Safe | C/C++ |
def default(self, action=None, **kwargs):
# Delete session on form submit
form = RevokeSessionForm()
if form.is_submitted():
if form.validate():
session = SessionObject.query.filter(SessionObject.number == form.number.data).first()
if not session:
... | vuln | Vulnerable | Python |
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */
#include <openssl/rand.h>
#include <stdint.h>
#include "lsquic_crand.h"
#define OFF_MASK(crand_) ((sizeof((crand_)->rand_buf) * 2) - 1)
uint8_t
lsquic_crand_get_nybble (struct crand *crand)
{
uint8_t byte;
if (crand->nybble_off == 0... | vuln | Safe | C/C++ |
static int vpc_read(BlockDriverState *bs, int64_t sector_num,
uint8_t *buf, int nb_sectors)
{
BDRVVPCState *s = bs->opaque;
int ret;
int64_t offset;
int64_t sectors, sectors_per_block;
VHDFooter *footer = (VHDFooter *) s->footer_buf;
if (be32_to_cpu(footer->type) == VHD_FIXED... | vuln | Safe | C/C++ |
TEE_Result syscall_authenc_update_payload(unsigned long state,
const void *src_data, size_t src_len, void *dst_data,
uint64_t *dst_len)
{
TEE_Result res;
struct tee_cryp_state *cs;
struct tee_ta_session *sess;
size_t dlen = 0;
res = tee_ta_get_current_session(&sess);
if (res != TEE_SUCCESS)
return res;
... | vuln | Safe | C/C++ |
static int read_old_huffman_tables(HYuvContext *s){
#if 1
GetBitContext gb;
int i;
init_get_bits(&gb, classic_shift_luma, sizeof(classic_shift_luma)*8);
if(read_len_table(s->len[0], &gb)<0)
return -1;
init_get_bits(&gb, classic_shift_chroma, sizeof(classic_shift_chroma)*8);
if(read_len_t... | vuln | Vulnerable | C/C++ |
@Override
public Authentication attemptAuthentication(HttpServletRequest request,
HttpServletResponse response) throws AuthenticationException {
if (this.postOnly && !request.getMethod().equals("POST")) {
throw new AuthenticationServiceException(
"Authentication method not supported: " + req... | vuln | Vulnerable | Java |
RectangleRequest &operator=(const struct RectangleRequest &req)
{
// Not nice, but this is really faster and simpler
memcpy(this,&req,sizeof(struct RectangleRequest));
// Not linked in any way if this is new.
rr_pNext = NULL;
//
return *this;
} | vuln | Vulnerable | C/C++ |
static void scalar32_min_max_or(struct bpf_reg_state *dst_reg,
struct bpf_reg_state *src_reg)
{
bool src_known = tnum_subreg_is_const(src_reg->var_off);
bool dst_known = tnum_subreg_is_const(dst_reg->var_off);
struct tnum var32_off = tnum_subreg(dst_reg->var_off);
s32 smin_val = src_reg->s32_min_value;
u32 umi... | vuln | Safe | Unknown |
private void onChooseOrConfirmLockResult(boolean isChooseLock,
@NonNull ActivityResult activityResult) {
if (!mViewModel.isWaitingActivityResult().compareAndSet(true, false)) {
Log.w(TAG, "isChooseLock:" + isChooseLock + ", fail to unset waiting flag");
}
if (mAutoCredent... | vuln | Vulnerable | Java |
main(int argc, char **argv)
{
const char *safepath = "/bin:/sbin:/usr/bin:/usr/sbin:"
"/usr/local/bin:/usr/local/sbin";
const char *confpath = NULL;
char *shargv[] = { NULL, NULL };
char *sh;
const char *cmd;
char cmdline[LINE_MAX];
#ifdef __OpenBSD__
char mypwbuf[_PW_BUF_LEN], targpwbuf[_PW_BUF_LEN];
#else... | vuln | Vulnerable | Unknown |
@Override
public byte[] transform(String name, String transformedName, byte[] basicClass) {
if (!name.equals("cofh.lib.util.ComparableItem") && !name.equals("cofh.lib.util.ItemWrapper")) return basicClass;
ClassNode classNode = new ClassNode();
ClassReader classReader = new ClassReader(basicClass);
classRea... | vuln | Safe | Java |
optional<ARN> ARN::parse(const string& s, bool wildcards) {
static const char str_wild[] = "arn:([^:]*):([^:]*):([^:]*):([^:]*):([^:]*)";
static const regex rx_wild(str_wild,
sizeof(str_wild) - 1,
ECMAScript | optimize);
static const char str_no_wild[]
= "arn:([^:*]*):([^:*]*):([^:*]*):([^:*]*... | vuln | Vulnerable | C/C++ |
static void parse_rtcp_report( pjmedia_rtcp_session *sess,
const void *pkt,
pj_size_t size)
{
pjmedia_rtcp_common *common = (pjmedia_rtcp_common*) pkt;
const pjmedia_rtcp_rr *rr = NULL;
const pjmedia_rtcp_sr *sr = NULL;
pj_uint32_t last_loss, jitter_samp, jitter;
/* Parse RTCP *... | vuln | Vulnerable | Unknown |
package com.salesmanager.shop.admin.model.catalog;
import com.salesmanager.core.model.catalog.product.image.ProductImage;
import com.salesmanager.core.model.catalog.product.manufacturer.ManufacturerDescription;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import javax.validat... | vuln | Vulnerable | Java |
public boolean isFull() {
if (this.getCatfishSize() == 2) {
return this.hasSwallowedEntity();
} else {
for (int i = 0; i < this.catfishInventory.getContainerSize(); i++) {
if (this.catfishInventory.getItem(i).isEmpty()) {
return false;
... | vuln | Vulnerable | Java |
public Object unmarshal(InputStream inputStream) throws JAXBException, IOException {
Unmarshaller unmarshaller = createJAXBContext().context.createUnmarshaller();
UnmarshallerHandler handler = unmarshaller.getUnmarshallerHandler();
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setNamespaceA... | vuln | Vulnerable | Java |
void OPPROTO op_divd (void)
{
if (unlikely(((int64_t)T0 == INT64_MIN && (int64_t)T1 == (int64_t)-1LL) ||
(int64_t)T1 == 0)) {
T0 = (int64_t)(UINT64_MAX * ((uint64_t)T0 >> 63));
} else {
T0 = (int64_t)T0 / (int64_t)T1;
}
RETURN();
} | vuln | Safe | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.