code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
public static void light(float x, float y, float x2, float y2){
if(renderer == null) return;
renderer.lights.line(x, y, x2, y2, 30, Color.orange, 0.3f);
} | 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 | Vulnerable | Python |
static int fx_command(effect_handle_t self,
uint32_t cmdCode,
uint32_t cmdSize,
void *pCmdData,
uint32_t *replySize,
void *pReplyData)
{
struct effect_s *effect = (struct effect_s *)self;
if (effect == NULL)
return -EINVAL;
switch (cmdCode) {
case EFFECT_CMD_INIT:
if (pReplyData == ... | vuln | Safe | C/C++ |
@Override
protected ItemStack onItemUseSuccess(final ItemStack itemStack, final World world, final ServerPlayerEntity player)
{
if (world.rand.nextInt(10) == 0)
{
// Fail
player.sendStatusMessage(new TranslationTextComponent("minecolonies.scroll.failed" + (world.rand.next... | vuln | Safe | Java |
protected void clearProgression(ItemStack itemStack) {
NBTHelper.getTag(itemStack).remove(String.format(settleProgressKey, getSlot()));
} | vuln | Vulnerable | Java |
static int key_notify_policy_flush(const struct km_event *c)
{
struct sk_buff *skb_out;
struct sadb_msg *hdr;
skb_out = alloc_skb(sizeof(struct sadb_msg) + 16, GFP_ATOMIC);
if (!skb_out)
return -ENOBUFS;
hdr = (struct sadb_msg *) skb_put(skb_out, sizeof(struct sadb_msg));
hdr->sadb_msg_type = SADB_X_SPDFLUSH;
... | vuln | Vulnerable | C/C++ |
/*
* NET3 Protocol independent device support routines.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later versi... | vuln | Vulnerable | C/C++ |
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 | Vulnerable | C/C++ |
int redisContextConnectUnix(redisContext *c, const char *path, const struct timeval *timeout) {
int blocking = (c->flags & REDIS_BLOCK);
struct sockaddr_un sa;
long timeout_msec = -1;
if (redisCreateSocket(c,AF_UNIX) < 0)
return REDIS_ERR;
if (redisSetBlocking(c,0) != REDIS_OK)
retu... | vuln | Safe | C/C++ |
ProcXFixesCopyRegion(ClientPtr client)
{
RegionPtr pSource, pDestination;
REQUEST(xXFixesCopyRegionReq);
VERIFY_REGION(pSource, stuff->source, client, DixReadAccess);
VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess);
if (!RegionCopy(pDestination, pSource))
retu... | vuln | Vulnerable | C/C++ |
func Extract(rs io.Reader, dest string) error {
linkMap := make(map[int][]string)
stream := NewCpioStream(rs)
for {
entry, err := stream.ReadNextEntry()
if err != nil {
return err
}
if entry.Header.filename == TRAILER {
break
}
target := path.Join(dest, path.Clean(entry.Header.filename))
pare... | vuln | Vulnerable | Go |
static int local_mknod(FsContext *fs_ctx, V9fsPath *dir_path,
const char *name, FsCred *credp)
{
int err = -1;
int dirfd;
dirfd = local_opendir_nofollow(fs_ctx, dir_path->data);
if (dirfd == -1) {
return -1;
}
if (fs_ctx->export_flags & V9FS_SM_MAPPED ||
... | vuln | Vulnerable | Unknown |
def get_data_center_from_api_key(api_key)
# Return an empty string for invalid API keys so Gibbon hits the main endpoint
data_center = ""
if api_key && api_key["-"]
# Add a period since the data_center is a subdomain and it keeps things dry
data_center = "#{api_key.split('-').last}."
... | vuln | Vulnerable | Ruby |
void copyBytes(InStream* is, size_t length) {
while (length > 0) {
size_t n = check(1, length);
is->readBytes(ptr, n);
ptr += n;
length -= n;
}
} | vuln | Safe | C/C++ |
@NonNull
@Override
public WindowInsets onProgress(@NonNull WindowInsets insets, @NonNull List<WindowInsetsAnimation> runningAnimations) {
if (animation == null) {
return insets;
}
if (mFabLayout != null) ... | vuln | Safe | Java |
@SuppressLint({"RestrictedApi", "UnspecifiedImmutableFlag"})
public static void initialize(final MainApplication mainApplication) {
SentryAndroid.init(mainApplication, options -> {
// If crash reporting is disabled, stop here.
if (!MainApplication.isCrashReportingEnabled()) {
... | vuln | Safe | Java |
bilinear_magnify_make_weights (PixopsFilterDimension *dim,
double scale)
{
double *pixel_weights;
int n;
int offset;
int i;
if (scale > 1.0) /* Linear */
{
n = 2;
dim->offset = 0.5 * (1 / scale - 1);
}
else /* Tile */
{
... | vuln | Safe | Unknown |
@Override
protected int[] calculateOverclock(@Nonnull Recipe recipe) {
int recipeEUt = recipe.getEUt();
int recipeDuration = recipe.getDuration();
if (!isAllowOverclocking()) {
return new int[]{recipeEUt, recipeDuration};
}
int origina... | vuln | Safe | Java |
static int phar_tar_writeheaders_int(phar_entry_info *entry, void *argument) /* {{{ */
{
tar_header header;
size_t pos;
struct _phar_pass_tar_info *fp = (struct _phar_pass_tar_info *)argument;
char padding[512];
if (entry->is_mounted) {
return ZEND_HASH_APPLY_KEEP;
}
if (entry->is_deleted) {
if (entry->fp_... | vuln | Safe | C/C++ |
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFT... | vuln | Safe | Python |
static void pmac_dma_write(BlockBackend *blk,
int64_t sector_num, int nb_sectors,
void (*cb)(void *opaque, int ret), void *opaque)
{
DBDMA_io *io = opaque;
MACIOIDEState *m = io->opaque;
IDEState *s = idebus_active_if(&m->bus);
dma_addr_t dma_addr, dma_l... | vuln | Vulnerable | C/C++ |
static int x509parse_verify_child(
x509_cert *child, x509_cert *parent, x509_cert *trust_ca,
x509_crl *ca_crl, int path_cnt, int *flags,
int (*f_vrfy)(void *, x509_cert *, int, int *),
void *p_vrfy )
{
int hash_id, ret;
int parent_flags = 0;
un... | vuln | Vulnerable | Unknown |
#include "common/http/conn_manager_utility.h"
#include <atomic>
#include <cstdint>
#include <string>
#include "envoy/type/v3/percent.pb.h"
#include "common/common/empty_string.h"
#include "common/common/utility.h"
#include "common/http/conn_manager_config.h"
#include "common/http/header_utility.h"
#include "common/h... | vuln | Safe | C/C++ |
/* 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 |
int parse_unix(grpc_uri *uri, grpc_resolved_address *resolved_addr) {
struct sockaddr_un *un = (struct sockaddr_un *)resolved_addr->addr;
const size_t maxlen = sizeof(un->sun_path);
const size_t path_len = strnlen(uri->path, maxlen);
if (path_len == maxlen) return 0;
un->sun_family = AF_UNIX;
strcpy(un->sun... | vuln | Vulnerable | C/C++ |
send(data, allDevices) {
let coreData = data && data.data;
if (!coreData || !allDevices || !Array.isArray(allDevices)) {
log.warn(LOG_PREFIX, 'invalid push payload');
return;
}
let expirationTime = data['expiration_time'] || coreData['expiration_time'];
let collapseId = data['collapse_id... | vuln | Safe | JavaScript |
@Override
public boolean canRemove (RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, int position) {
ListItem item = adapter.getItems().get(position);
return item.getId() == R.id.btn_session && !terminatingAll && (terminatingSessions == null || terminatingSessions.get(item.getL... | vuln | Vulnerable | Java |
function networkStatsSingle(iface) {
function parseLinesWindowsPerfData(sections) {
let perfData = [];
for (let i in sections) {
if ({}.hasOwnProperty.call(sections, i)) {
if (sections[i].trim() !== '') {
let lines = sections[i].trim().split('\r\n');
perfData.push({
... | vuln | Safe | JavaScript |
@Override
public void callSessionHandover(int srcNetworkType, int targetNetworkType,
ImsReasonInfo reasonInfo) {
TelephonyUtils.runWithCleanCallingIdentity(()-> {
if (mListener != null) {
mListener.callSessionHandover(ImsCallSession.this, srcNetwor... | vuln | Safe | Java |
ex_retab(exarg_T *eap)
{
linenr_T lnum;
int got_tab = FALSE;
long num_spaces = 0;
long num_tabs;
long len;
long col;
long vcol;
long start_col = 0; // For start of white-space string
long start_vcol = 0; // For start of white-space string
long old_len;
char_u *ptr;
cha... | vuln | Vulnerable | C/C++ |
HWNDMessageHandler::HWNDMessageHandler(HWNDMessageHandlerDelegate* delegate)
: delegate_(delegate),
fullscreen_handler_(new FullscreenHandler),
weak_factory_(this),
waiting_for_close_now_(false),
remove_standard_frame_(false),
use_system_default_icon_(false),
restore_focus_when_e... | vuln | Safe | C/C++ |
@Override
protected boolean processFile(AbstractFile file, Object recurseParams) {
// Stop if interrupted
if (getState() == FileJobState.INTERRUPTED)
return false;
// Destination folder
AbstractFile destFolder = baseDestFolder;
// If the file is a directory, pro... | vuln | Vulnerable | Java |
static inline ut8 r_read_le8(const void *src) {
return r_read_ble8 (src);
} | vuln | Vulnerable | Unknown |
void verifyDirectoryPermissions(const string &path) {
TRACE_POINT();
struct stat buf;
if (stat(path.c_str(), &buf) == -1) {
int e = errno;
throw FileSystemException("Cannot stat() " + path, e, path);
} else if (buf.st_mode != (S_IFDIR | parseModeString("u=rwx,g=rx,o=rx"))) {
throw RuntimeException("Tr... | vuln | Vulnerable | C/C++ |
function set_up() {
// Add custom profile fields elements to user account settings.
add_custom_profile_fields_to_settings();
$("#account-settings-status").hide();
const setup_api_key_modal = () => {
function request_api_key(data) {
channel.post({
url: "/json/fetch_ap... | vuln | Safe | JavaScript |
@app.route('/summary', methods=['GET'])
def summary():
if 'username' in session:
conn = mysql.connect()
cursor = conn.cursor()
#select the maximum score from the results table
cursor.execute("SELECT courseConcentration FROM results WHERE total = (SELECT MAX(total) FROM (SELECT * FROM results WHERE courseId >... | vuln | Safe | Python |
@SubscribeEvent
public static void gatherData(GatherDataEvent event)
{
// Capabilities are not registered yet, but cap references throw on null caps
CapabilityItemHandler.register();
CapabilityFluidHandler.register();
CapabilityEnergy.register();
CapabilityRedstoneNetwork.register();
ExistingFileHelper e... | vuln | Safe | Java |
static int ipvideo_decode_block_opcode_0xD(IpvideoContext *s, AVFrame *frame)
{
int y;
unsigned char P[2];
if (bytestream2_get_bytes_left(&s->stream_ptr) < 4) {
av_log(s->avctx, AV_LOG_ERROR, "too little data for opcode 0xD\n");
return AVERROR_INVALIDDATA;
}
for (y = 0; y < 8; y... | vuln | Safe | C/C++ |
static int tap_set_sndbuf(TAPState *s, const char *sndbuf_str, Monitor *mon)
{
if (sndbuf_str) {
config_error(mon, "No '-net tap,sndbuf=<nbytes>' support available\n");
return -1;
}
return 0;
} | vuln | Safe | C/C++ |
/*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#include "delta.h"
/* maximum hash entry list for the same hash bucket */
#define HASH_LIMIT 64
#defin... | vuln | Safe | C/C++ |
http_splitheader(struct http *hp, int req)
{
char *p, *q, **hh;
int n;
char buf[20];
CHECK_OBJ_NOTNULL(hp, HTTP_MAGIC);
if (req) {
memset(hp->req, 0, sizeof hp->req);
hh = hp->req;
} else {
memset(hp->resp, 0, sizeof hp->resp);
hh = hp->resp;
}
n = 0;
p = hp->rxbuf;
/* REQ/PROTO */
while (vct_islw... | vuln | Safe | Unknown |
public void addFirstPatchedPurl(String purl) {
firstPatchedPurls.add(purl);
} | vuln | Vulnerable | Java |
// ParseServer - open-source compatible API Server for Parse apps
var batch = require('./batch'),
bodyParser = require('body-parser'),
express = require('express'),
middlewares = require('./middlewares'),
Parse = require('parse/node').Parse,
{ parse } = require('graphql'),
path = require('path'),
fs = re... | vuln | Vulnerable | JavaScript |
static int flashsv_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
FlashSVContext *s = avctx->priv_data;
int h_blocks, v_blocks, h_part... | vuln | Safe | C/C++ |
h2_end_headers(struct worker *wrk, struct h2_sess *h2,
struct req *req, struct h2_req *r2)
{
h2_error h2e;
ssize_t cl;
ASSERT_RXTHR(h2);
assert(r2->state == H2_S_OPEN);
h2e = h2h_decode_fini(h2);
h2->new_req = NULL;
if (h2e != NULL) {
Lck_Lock(&h2->sess->mtx);
VSLb(h2->vsl, SLT_Debug, "HPACK/FINI %s", h... | vuln | Safe | Unknown |
std::vector<GetLengthType> CSoundFile::GetLength(enmGetLengthResetMode adjustMode, GetLengthTarget target)
{
std::vector<GetLengthType> results;
GetLengthType retval;
retval.startOrder = target.startOrder;
retval.startRow = target.startRow;
// Are we trying to reach a certain pattern position?
const bool hasSear... | vuln | Safe | Unknown |
public synchronized static String getLogString(SharedPreferences preferences) {
if (DEBUG) {
return preferences.getString(Const.PREFERENCES_LOG_STRING, "");
}
return "";
} | vuln | Safe | Java |
cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
uint32_t offs, cdf_property_info_t **info, size_t *count, size_t *maxcount)
{
const cdf_section_header_t *shp;
cdf_section_header_t sh;
const uint8_t *p, *q, *e;
size_t i, o4, nelements, j, slen, left;
cdf_property_info_t *inp;
if (offs >... | vuln | Safe | C/C++ |
private void authenticate(String username, String password) throws UnsupportedCallbackException, IOException {
// if username equals '$accessToken' we treat the password as an access token
// otherwise, we treat username as clientId, password as client secret and perform client credential auth
/... | vuln | Vulnerable | Java |
DefaultResetPasswordRequestResponse(UserReference reference, InternetAddress userEmail, String verificationCode)
{
this.userReference = reference;
this.userEmail = userEmail;
this.verificationCode = verificationCode;
} | vuln | Vulnerable | Java |
@Override
public int fillFields( byte[] data, int offset,
EscherRecordFactory recordFactory )
{
int bytesRemaining = readHeader( data, offset );
if (bytesRemaining < 0) {
throw new IllegalStateException("Invalid value for bytesRemaining: " + bytesRemaining);
}
... | vuln | Safe | Java |
SchedulerObject::suspend(std::string key, std::string &/*reason*/, std::string &text)
{
PROC_ID id = getProcByString(key.c_str());
if (id.cluster <= 0 || id.proc < 0) {
dprintf(D_FULLDEBUG, "Remove: Failed to parse id: %s\n", key.c_str());
text = "Invalid Id";
... | vuln | Safe | C/C++ |
private func initStreamsWithData(_ data: Data, _ port: Int) {
//higher level API we will cut over to at some point
//NSStream.getStreamsToHostWithName(url.host, port: url.port.integerValue, inputStream: &inputStream, outputStream: &outputStream)
// Disconnect and clean up any existing streams b... | vuln | Vulnerable | Swift |
duint32 dwgCompressor::twoByteOffset(duint32 *ll){
duint32 cont = 0;
duint8 fb = bufC[pos++];
cont = (fb >> 2) | (bufC[pos++] << 6);
*ll = (fb & 0x03);
return cont;
} | vuln | Vulnerable | Unknown |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
OpData* data = reinterpret_cast<OpData*>(node->user_data);
ruy::profiler::ScopeLabel label("SquaredDifference");
const TfLiteTensor* input1;
TF_LITE_ENSURE_OK(context,
GetInputSafe(context, node, kInputTensor1, &input1));
const... | vuln | Safe | C/C++ |
/*
* SPDX-License-Identifier: Apache-2.0
*/
// Copyright (c) ONNX Project Contributors.
// Licensed under the MIT license.
#include "onnx/common/path.h"
namespace ONNX_NAMESPACE {
bool is_path_separator(char c) {
// Windows accept / as path separator.
if (k_preferred_path_separator == "\\") {
return c == ... | vuln | Safe | Python |
static int prealloc_elems_and_freelist(struct bpf_stack_map *smap)
{
u64 elem_size = sizeof(struct stack_map_bucket) +
(u64)smap->map.value_size;
int err;
smap->elems = bpf_map_area_alloc(elem_size * smap->map.max_entries,
smap->map.numa_node);
if (!smap->elems)
return -ENOMEM;
err = pcpu_freelist_ini... | vuln | Safe | C/C++ |
static void
gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length)
{
u_int len = length;
uint16_t flags, prot;
/* 16 bits ND_TCHECKed in gre_print() */
flags = EXTRACT_16BITS(bp);
if (ndo->ndo_vflag)
ND_PRINT((ndo, ", Flags [%s]",
bittok2str(gre_flag_values,"non... | vuln | Safe | C/C++ |
const bootbox = require('bootbox');
const Requisition = require('../model/Requisition');
require('../services/Requisitions');
require('../services/Synchronize');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(function() {
'use strict';
angular.module('onms-req... | vuln | Vulnerable | Java |
void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler handler)
{
hal_info *info = getHalInfo(handle);
char buf[64];
info->cleaned_up_handler = handler;
if (write(info->cleanup_socks[0], "Exit", 4) < 1) {
ALOGE("could not write to the cleanup socket");
} else {
memset(buf, 0, sizeof(b... | vuln | Vulnerable | C/C++ |
/*!
* URI.js - Mutating URLs
*
* Version: 1.19.6
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
*
*/
(function (root, factory) {
'use strict';
// https://github.com/umdjs/umd/blob/master/returnExports.js
... | vuln | Safe | JavaScript |
*/
PHPAPI void php_print_info(int flag TSRMLS_DC)
{
char **env, *tmp1, *tmp2;
char *php_uname;
if (!sapi_module.phpinfo_as_text) {
php_print_info_htmlhead(TSRMLS_C);
} else {
php_info_print("phpinfo()\n");
}
if (flag & PHP_INFO_GENERAL) {
char *zend_version = get_zend_version();
char temp_api[10];
ph... | vuln | Vulnerable | C/C++ |
KRB5_LIB_CALL
krb5_init_creds_step(krb5_context context,
krb5_init_creds_context ctx,
krb5_data *in,
krb5_data *out,
krb5_krbhst_info *hostinfo,
unsigned int *flags)
{
krb5_error_code ret;
size_t len = 0;
size_t size;
AS_REQ req2;
krb5_data_zero(out);
if (ctx... | vuln | Safe | C/C++ |
void usb_deregister_dev(struct usb_interface *intf,
struct usb_class_driver *class_driver)
{
if (intf->minor == -1)
return;
dev_dbg(&intf->dev, "removing %d minor\n", intf->minor);
device_destroy(usb_class->class, MKDEV(USB_MAJOR, intf->minor));
down_write(&minor_rwsem);
usb_minors[intf->minor] = NULL;
up_... | vuln | Safe | Unknown |
"top center";ea.style.backgroundRepeat="no-repeat";ea.setAttribute("title","Minimize");var ha=!1,ma=mxUtils.bind(this,function(){T.innerHTML="";if(!ha){var aa=function(la,qa,ta){la=C("",la.funct,null,qa,la,ta);la.style.width="40px";la.style.opacity="0.7";return ca(la,null,"pointer")},ca=function(la,qa,ta){null!=qa&&la.... | vuln | Vulnerable | JavaScript |
static void monitor_qapi_event_emit(QAPIEvent event, QDict *qdict)
{
Monitor *mon;
trace_monitor_protocol_event_emit(event, qdict);
QLIST_FOREACH(mon, &mon_list, entry) {
if (monitor_is_qmp(mon)
&& mon->qmp.commands != &qmp_cap_negotiation_commands) {
monitor_json_emitter(mon... | vuln | Safe | C/C++ |
static inline zend_string* phar_get_stub(const char *index_php, const char *web, const int name_len, const int web_len)
{
static const char newstub0[] = "<?php\n\n$web = '";
static const char newstub1_0[] = "';\n\nif (in_array('phar', stream_get_wrappers()) && class_exists('Phar', 0)) {\nPhar::interceptFileFuncs();\n... | vuln | Vulnerable | C/C++ |
static bool vtd_decide_config(IntelIOMMUState *s, Error **errp)
{
X86IOMMUState *x86_iommu = X86_IOMMU_DEVICE(s);
if (x86_iommu->intr_supported && kvm_irqchip_in_kernel() &&
!kvm_irqchip_is_split()) {
error_setg(errp, "Intel Interrupt Remapping cannot work with "
"k... | vuln | Safe | C/C++ |
static int build_basic_mjpeg_vlc(MJpegDecodeContext *s)
{
int ret;
if ((ret = build_vlc(&s->vlcs[0][0], avpriv_mjpeg_bits_dc_luminance,
avpriv_mjpeg_val_dc, 12, 0, 0)) < 0)
return ret;
if ((ret = build_vlc(&s->vlcs[0][1], avpriv_mjpeg_bits_dc_chrominance,
... | vuln | Safe | C/C++ |
static int dv_extract_audio(uint8_t* frame, uint8_t* ppcm[4],
const DVprofile *sys)
{
int size, chan, i, j, d, of, smpls, freq, quant, half_ch;
uint16_t lc, rc;
const uint8_t* as_pack;
uint8_t *pcm, ipcm;
as_pack = dv_extract_pack(frame, dv_audio_source);
if (!as_pack... | vuln | Vulnerable | C/C++ |
_dopr(char **sbuffer,
char **buffer,
size_t *maxlen,
size_t *retlen, int *truncated, const char *format, va_list args)
{
char ch;
LLONG value;
LDOUBLE fvalue;
char *strvalue;
int min;
int max;
int state;
int flags;
int cflags;
size_t currlen;
state = DP_S_D... | vuln | Safe | Unknown |
int scsi_convert_sense(uint8_t *in_buf, int in_len,
uint8_t *buf, int len, bool fixed)
{
SCSISense sense;
bool fixed_in;
if (in_len == 0) {
return scsi_build_sense_buf(buf, len, SENSE_CODE(NO_SENSE), fixed);
}
fixed_in = (in_buf[0] & 2) == 0;
if (fixed == fixed_in)... | vuln | Safe | C/C++ |
@ReactMethod
public void peerConnectionSetRemoteDescription(int id,
ReadableMap desc,
Promise promise) {
ThreadUtils.runOnExecutor(() -> {
PeerConnectionObserver pco = mPeerConnectionObservers.g... | vuln | Safe | Java |
public Response workspaceClientEnqueue(@FormParam(WorkSpaceAdapter.CLIENT_NAME) String clientName,
@FormParam(WorkSpaceAdapter.WORK_BUNDLE_OBJ) String workBundleString) {
logger.debug("TPWorker incoming execute! check prio={}", Thread.currentThread().getPriority());
// TODO Doesn't look like... | vuln | Safe | Java |
gtls_connect_step1(struct Curl_easy *data,
struct connectdata *conn,
int sockindex)
{
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
struct ssl_backend_data *backend = connssl->backend;
unsigned int init_flags;
gnutls_session_t session;
int rc;
bool sni = TRU... | vuln | Safe | Unknown |
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(mResponseCode);
if (mResponseCode == RESPONSE_RETRY) {
dest.writeInt(mTimeout);
} else if (mResponseCode == RESPONSE_OK) {
dest.writeInt(mShouldReEnroll ? 1 : 0);
if (mPayload != n... | vuln | Vulnerable | Java |
static inline int compat_copy_match_from_user(struct ipt_entry_match *m,
void **dstptr, compat_uint_t *size, const char *name,
const struct ipt_ip *ip, unsigned int hookmask, int *i)
{
struct ipt_entry_match *dm;
struct ipt_match *match;
int ret;
dm = (struct ipt_entry_match *)*dstptr;
match = m->u.kernel.match... | vuln | Vulnerable | Unknown |
static int tcp_get_msgfds(CharDriverState *chr, int *fds, int num)
{
TCPCharDriver *s = chr->opaque;
int to_copy = (s->read_msgfds_num < num) ? s->read_msgfds_num : num;
if (to_copy) {
memcpy(fds, s->read_msgfds, to_copy * sizeof(int));
g_free(s->read_msgfds);
s->read_msgfds = 0;
... | vuln | Vulnerable | C/C++ |
@Override
@Transactional
public File exportProject(ProjectExportRequest aRequest, ProjectExportTaskMonitor aMonitor)
throws ProjectExportException, IOException
{
boolean success = false;
File exportTempDir = null;
try {
// Directory to store source documents and a... | vuln | Vulnerable | Java |
@PostMapping("/create")
@ResponseBody
@MonitorScopeAuth(targetType = AuthTargetType.TENANT, needPower = PowerConstants.EDIT)
public JsonResult<UserFavorite> save(@RequestBody UserFavorite userFavorite) {
final JsonResult<UserFavorite> result = new JsonResult<>();
facadeTemplate.manage(result, new ManageCa... | vuln | Safe | Java |
static int show_modified(struct oneway_unpack_data *cbdata,
struct cache_entry *old,
struct cache_entry *new,
int report_missing,
int cached, int match_missing)
{
unsigned int mode, oldmode;
const unsigned char *sha1;
struct rev_info *revs = cbdata->revs;
if (get_stat_data(new, &sha1, &mode, cached... | vuln | Safe | Unknown |
_gnutls_server_name_recv_params (gnutls_session_t session,
const opaque * data, size_t _data_size)
{
int i;
const unsigned char *p;
uint16_t len, type;
ssize_t data_size = _data_size;
int server_names = 0;
if (session->security_parameters.entity == GNUTLS_SERVER)
{
DECR_LENGTH_RET (data_size... | vuln | Vulnerable | C/C++ |
@SubscribeEvent
public void onPlayerTickEvent(PlayerTickEvent aEvent) {
if (!aEvent.player.isDead && aEvent.phase == Phase.END) {
if (COMPAT_TC != null && aEvent.player.openContainer != null && aEvent.player.openContainer.getClass() == ContainerArcaneWorkbench.class) {
aEvent.player.openContainer = COMPAT... | vuln | Safe | Java |
static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
{
AVIOContext *pb = s->pb;
AVCodecParameters *par = s->streams[pkt->stream_index]->codecpar;
FLVContext *flv = s->priv_data;
FLVStreamContext *sc = s->streams[pkt->stream_index]->priv_data;
unsigned ts;
int size = pkt->size... | vuln | Vulnerable | Unknown |
static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t size,
int flags)
{
struct sock_iocb *siocb = kiocb_to_siocb(iocb);
struct scm_cookie tmp_scm;
struct sock *sk = sock->sk;
struct unix_sock *u = unix_sk(sk);
struct sockaddr_un *sunaddr = msg->msg_... | vuln | Safe | C/C++ |
@Override
@NotNull
public BlockState updateShape(
@NotNull final BlockState state,
@NotNull final Direction dir,
final BlockState state2,
@NotNull final LevelAccessor level,
@NotNull final BlockPos pos1,
@NotNull final BlockPos pos2)
{
final BlockEntity bEntity1 =... | vuln | Vulnerable | Java |
private void onDeauthorizeComplete(@NonNull NotifyOnCompleteFuture<Object> future) {
final DeauthorizeRequest request = (DeauthorizeRequest) future;
try {
try {
request.get();
} catch (ExecutionException e) {
handleRpcError(request.id, ERROR_INTER... | vuln | Vulnerable | Java |
static ExitStatus gen_mtpr(DisasContext *ctx, TCGv vb, int regno)
{
TCGv tmp;
int data;
switch (regno) {
case 255:
gen_helper_tbia(cpu_env);
break;
case 254:
gen_helper_tbis(cpu_env, vb);
break;
case 253:
tmp = tcg_const_i64(1);
... | vuln | Vulnerable | C/C++ |
xdaemon(bool nochdir, bool noclose, bool exitflag)
{
pid_t pid;
int ret;
#ifdef ENABLE_LOG_TO_FILE
if (log_file_name)
flush_log_file();
#endif
/* In case of fork is error. */
pid = fork();
if (pid < 0) {
log_message(LOG_INFO, "xdaemon: fork error");
return -1;
}
/* In case of this is parent process. */... | vuln | Safe | Unknown |
public static void assembleJigsawStructure(
RegistryAccess dynamicRegistryManager,
JigsawConfiguration jigsawConfig,
ChunkGenerator chunkGenerator,
StructureManager templateManager,
BlockPos startPos,
List<? super StructurePiece> components,
... | vuln | Vulnerable | Java |
int secure_check(void *data)
{
const at91_secure_header_t *header;
void *file;
if (secure_decrypt(data, sizeof(*header), 0))
return -1;
header = (const at91_secure_header_t *)data;
if (header->magic != AT91_SECURE_MAGIC)
return -1;
file = (unsigned char *)data + sizeof(*header);
return secure_decrypt(file... | vuln | Vulnerable | C/C++ |
static void process_mget_command(conn *c, token_t *tokens, const size_t ntokens) {
char *key;
size_t nkey;
item *it;
unsigned int i = 0;
struct _meta_flags of = {0}; // option bitflags.
uint32_t hv; // cached hash value for unlocking an item.
bool failed = false;
bool item_created = fals... | vuln | Vulnerable | Unknown |
int ndlz4_decompress(const uint8_t *input, int32_t input_len, uint8_t *output, int32_t output_len,
uint8_t meta, blosc2_dparams *dparams) {
BLOSC_UNUSED_PARAM(meta);
BLOSC_UNUSED_PARAM(dparams);
BLOSC_ERROR_NULL(input, BLOSC2_ERROR_NULL_POINTER);
BLOSC_ERROR_NULL(output, BLOSC2_ERROR_NULL_P... | vuln | Safe | C/C++ |
void WebContentsImpl::DidCallFocus() {
ForSecurityDropFullscreen();
} | vuln | Safe | C/C++ |
int der_decode_utf8_string(const unsigned char *in, unsigned long inlen,
wchar_t *out, unsigned long *outlen)
{
wchar_t tmp;
unsigned long x, y, z, len;
int err;
LTC_ARGCHK(in != NULL);
LTC_ARGCHK(out != NULL);
LTC_ARGCHK(outlen != NULL);
/* mu... | vuln | Vulnerable | C/C++ |
private boolean isDisabled(Plugin plugin) {
return Arrays.stream(plugin.getFeatureIds()).noneMatch(id -> getFeatureDefinition(id).isEnabled());
} | vuln | Vulnerable | Java |
@SubscribeEvent
public static void onExpDrop(LivingExperienceDropEvent event) {
if (event.getDroppedExperience() == 0)
return;
EffectInstance greed = event.getAttackingPlayer().getActivePotionEffect(OccultismEffects.DRAGON_GREED.get());
if (greed == null)
ret... | vuln | Vulnerable | Java |
ipmi_sdr_print_sensor_mc_locator(struct sdr_record_mc_locator *mc)
{
char desc[17];
if (!mc)
return -1;
memset(desc, 0, sizeof (desc));
snprintf(desc, sizeof(desc), "%.*s", (mc->id_code & 0x1f) + 1, mc->id_string);
if (verbose == 0) {
if (csv_output)
printf("%s,00h,ok,%d.%d\n",
mc->id_code ? de... | vuln | Safe | Unknown |
static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define RMT_EQUAL_RGB 1
#define RMT_NONE 0
#define RMT_RAW 2
#define RT_STANDARD 1
#define RT_ENCODED 2
#define RT_FORMAT_RGB 3
typedef struct _SUNInfo
{
unsigned int
magic,
width,
height,
depth,
... | vuln | Vulnerable | C/C++ |
// Copyright 2012-2020 (c) Peter Širka <petersirka@gmail.com>
//
// 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, cop... | vuln | Vulnerable | JavaScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.