code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
public function handle($request, Closure $next)
{
view()->share('cspNonce', $this->cspService->getNonce());
if ($this->cspService->allowedIFrameHostsConfigured()) {
config()->set('session.same_site', 'none');
}
$response = $next($request);
$this->cspService->set... | vuln | Vulnerable | PHP |
static void fpm_resources_discard(struct fpm_child_s *child) /* {{{ */
{
fpm_scoreboard_proc_free(child->wp->scoreboard, child->scoreboard_i);
fpm_stdio_discard_pipes(child);
fpm_child_free(child);
} | vuln | Vulnerable | Unknown |
public void addBasicItem(ItemLike item, ResourceLocation category, IPatchouliPage recipePage){
PatchouliBuilder builder = new PatchouliBuilder(category, item.asItem().getDescriptionId())
.withIcon(item.asItem())
.withPage(new TextPage("ars_nouveau.page." + item.asItem().getRegist... | vuln | Vulnerable | Java |
# Natural Language Toolkit: Glue Semantics
#
# Author: Dan Garrette <dhgarrette@gmail.com>
#
# Copyright (C) 2001-2021 NLTK Project
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
import os
from itertools import chain
import nltk
from nltk.internals import Counter
from nltk.sem import drt, l... | vuln | Safe | Python |
removeAllCookies(cb) {
this.idx = {};
return cb(null);
} | vuln | Vulnerable | JavaScript |
public static boolean setBlockState(final IWorld world, final BlockPos pos, final BlockState state, int flags)
{
if (world.isRemote() || !(world instanceof ServerWorld))
{
return world.setBlockState(pos, state, flags);
}
if ((flags & 2) != 0)
{
final ... | vuln | Safe | Java |
GC_INNER GC_bool GC_collect_or_expand(word needed_blocks,
GC_bool ignore_off_page,
GC_bool retry)
{
GC_bool gc_not_stopped = TRUE;
word blocks_to_get;
IF_CANCEL(int cancel_state;)
DISABLE_CANCEL(cancel_state);
if (!GC_incre... | vuln | Safe | C/C++ |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2021
* All rights reserved
*
* This file is part of GPAC / mp4box application
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General P... | vuln | Vulnerable | C/C++ |
static void usb_pwc_disconnect(struct usb_interface *intf)
{
struct pwc_device *pdev;
int hint;
lock_kernel();
pdev = usb_get_intfdata (intf);
usb_set_intfdata (intf, NULL);
if (pdev == NULL) {
PWC_ERROR("pwc_disconnect() Called without private pointer.\n");
goto disconnect_out;
}
if (pdev->udev == NULL) {... | vuln | Vulnerable | Unknown |
static int qxl_post_load(void *opaque, int version)
{
PCIQXLDevice* d = opaque;
uint8_t *ram_start = d->vga.vram_ptr;
QXLCommandExt *cmds;
int in, out, newmode;
assert(d->last_release_offset < d->vga.vram_size);
if (d->last_release_offset == 0) {
d->last_release = NULL;
} else {
... | vuln | Safe | C/C++ |
/*
* 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; either version 2 of the License, or
* (at your option) any later v... | vuln | Vulnerable | C/C++ |
bool run(OperationContext* opCtx,
const string& dbname,
const BSONObj& cmdObj,
BSONObjBuilder& result) {
auth::CreateOrUpdateUserArgs args;
Status status = auth::parseCreateOrUpdateUserCommands(cmdObj, "createUser", dbname, &args);
if (!status.isOK()) {
... | vuln | Vulnerable | Unknown |
@DoNotStrip
public void setJSResponder(
final int surfaceId,
final int reactTag,
final int initialReactTag,
final boolean blockNativeResponder) {
addMountItem(
new MountItem() {
@Override
public void execute(MountingManager mountingManager) {
mountin... | vuln | Vulnerable | Java |
static void dump_op_count(void)
{
int i;
FILE *f;
f = fopen("/tmp/op.log", "w");
for(i = INDEX_op_end; i < NB_OPS; i++) {
fprintf(f, "%s %" PRId64 "\n", tcg_op_defs[i].name, tcg_table_op_count[i]);
}
fclose(f);
} | vuln | Vulnerable | C/C++ |
static char *scsibus_get_dev_path(DeviceState *dev)
{
SCSIDevice *d = DO_UPCAST(SCSIDevice, qdev, dev);
DeviceState *hba = dev->parent_bus->parent;
char *id = NULL;
if (hba && hba->parent_bus && hba->parent_bus->info->get_dev_path) {
id = hba->parent_bus->info->get_dev_path(hba);
}
if (i... | vuln | Vulnerable | C/C++ |
static int rose_getname(struct socket *sock, struct sockaddr *uaddr,
int *uaddr_len, int peer)
{
struct full_sockaddr_rose *srose = (struct full_sockaddr_rose *)uaddr;
struct sock *sk = sock->sk;
struct rose_sock *rose = rose_sk(sk);
int n;
memset(srose, 0, sizeof(*srose));
if (peer != 0) {
if (sk->sk_state !... | vuln | Safe | C/C++ |
static int local_statfs(FsContext *s, V9fsPath *fs_path, struct statfs *stbuf)
{
int fd, ret;
fd = local_open_nofollow(s, fs_path->data, O_RDONLY, 0);
ret = fstatfs(fd, stbuf);
close_preserve_errno(fd);
return ret;
} | vuln | Safe | C/C++ |
compat_check_calc_match(struct ipt_entry_match *m,
const char *name,
const struct ipt_ip *ip,
unsigned int hookmask,
int *size, int *i)
{
struct ipt_match *match;
match = try_then_request_module(xt_find_match(AF_INET, m->u.user.name,
m->u.user.revision),
"ipt_%s", m->u.user.name);
... | vuln | Safe | Unknown |
@Override
public void run() {
try {
speaker = DataLines.getSpeaker();
if(speaker == null) {
VoiceClient.LOGGER.error("Failed to open speaker");
return;
}
speaker.open(Recorder.stereoFormat);
gainControl = (FloatContr... | vuln | Vulnerable | Java |
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 | Safe | C/C++ |
@Packet
public void onFlying(WrappedInFlyingPacket packet, long now) {
if(!packet.isPos() || now - data.creation < 800L || now - data.playerInfo.lastRespawn < 500L
|| data.playerInfo.moveTicks == 0
|| data.playerInfo.creative || data.playerInfo.canFly) {
return;
... | vuln | Vulnerable | Java |
@Override
protected boolean removePassenger(Entity entity) {
boolean result = super.removePassenger(entity);
PlatformHelper platformHelper = (PlatformHelper) MyPetApi.getPlatformHelper();
AABB bb = entity.getBoundingBox();
bb = getBBAtPosition(bb, this.getX(), this.getY(), this.getZ());
if (!platformHelper.c... | vuln | Vulnerable | 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 | Vulnerable | Java |
static MagickBooleanType SetGrayscaleImage(Image *image)
{
CacheView
*image_view;
ExceptionInfo
*exception;
MagickBooleanType
status;
PixelPacket
*colormap;
register ssize_t
i;
ssize_t
*colormap_index,
j,
y;
assert(image != (Image *) NULL);
assert(image->signature =... | vuln | Safe | Unknown |
GF_Err stbl_AppendSize(GF_SampleTableBox *stbl, u32 size, u32 nb_pack)
{
u32 i;
CHECK_PACK(GF_ISOM_INVALID_FILE)
if (!stbl->SampleSize->sampleCount) {
stbl->SampleSize->sampleSize = size;
stbl->SampleSize->sampleCount += nb_pack;
return GF_OK;
}
if (stbl->SampleSize->sampleSize && (stbl->SampleSize->sampleS... | vuln | Safe | C/C++ |
static void opj_j2k_set_cinema_parameters(opj_cparameters_t *parameters,
opj_image_t *image, opj_event_mgr_t *p_manager)
{
/* Configure cinema parameters */
int i;
/* No tiling */
parameters->tile_size_on = OPJ_FALSE;
parameters->cp_tdx = 1;
parameters->cp_tdy = 1;
/* One tile part... | vuln | Safe | C/C++ |
/**
* This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/
/**
* Copyright 2009 Google Inc.
*
* Licensed under the Apache License, Version 2.... | vuln | Vulnerable | JavaScript |
/* 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 |
TfLiteStatus GreaterEval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input1 = GetInput(context, node, kInputTensor1);
const TfLiteTensor* input2 = GetInput(context, node, kInputTensor2);
TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
bool requires_broadcast = !HaveSameShapes... | vuln | Vulnerable | C/C++ |
/******************************************************
Copyright (c) 2011-2013 Percona LLC and/or its affiliates.
Streaming implementation for XtraBackup.
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 Founda... | vuln | Safe | C/C++ |
void WT_InterpolateMono (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pWTIntFrame)
{
EAS_I32 *pMixBuffer;
const EAS_I8 *pLoopEnd;
const EAS_I8 *pCurrentPhaseInt;
EAS_I32 numSamples;
EAS_I32 gain;
EAS_I32 gainIncrement;
EAS_I32 currentPhaseFrac;
EAS_I32 phaseInc;
EAS_I32 tmp0;
EAS_I32 tmp1;
... | vuln | Safe | C/C++ |
static void coroutine_fn commit_run(void *opaque)
{
CommitBlockJob *s = opaque;
BlockDriverState *active = s->active;
BlockDriverState *top = s->top;
BlockDriverState *base = s->base;
BlockDriverState *overlay_bs = NULL;
int64_t sector_num, end;
int ret = 0;
int n = 0;
void *buf;
... | vuln | Vulnerable | C/C++ |
void ManualFillingControllerImpl::CreateForWebContentsForTesting(
content::WebContents* web_contents,
base::WeakPtr<PasswordAccessoryController> pwd_controller,
std::unique_ptr<ManualFillingViewInterface> view) {
DCHECK(web_contents) << "Need valid WebContents to attach controller to!";
DCHECK(!Fro... | vuln | Vulnerable | C/C++ |
public function remove()
{
$this->checkCSRFParam();
$project = $this->getProject();
$category = $this->getCategory();
if ($this->categoryModel->remove($category['id'])) {
$this->flash->success(t('Category removed successfully.'));
} else {
$this->flas... | vuln | Vulnerable | PHP |
def get_quorum_info(params, request, auth_user)
if not allowed_for_local_cluster(auth_user, Permissions::READ)
return 403, 'Permission denied'
end
if ISRHEL6
stdout_status, stderr_status, retval = run_cmd(
PCSAuth.getSuperuserAuth(), CMAN_TOOL, "status"
)
stdout_nodes, stderr_nodes, retval =... | vuln | Safe | Ruby |
async initAuthRoutes(router) {
// Local strategy login route (takes username and password)
router.post('/login', passport.authenticate('local'), async (req, res) => {
// return the user login response json if the login was successfull
res.json(await this.getUserLoginResponsePayload(req.user))
})... | vuln | Safe | JavaScript |
bool AddPolicyForGPU(CommandLine* cmd_line, sandbox::TargetPolicy* policy) {
#if !defined(NACL_WIN64) // We don't need this code on win nacl64.
if (base::win::GetVersion() > base::win::VERSION_SERVER_2003) {
if (cmd_line->GetSwitchValueASCII(switches::kUseGL) ==
gfx::kGLImplementationDesktopName) {
... | vuln | Vulnerable | C/C++ |
import json
from tornado import web
from ...base.handlers import APIHandler, json_errors
class NbconvertRootHandler(APIHandler):
SUPPORTED_METHODS = ('GET',)
@web.authenticated
@json_errors
def get(self):
try:
from IPython.nbconvert.exporters.export import exporter_map
ex... | vuln | Safe | Python |
void nci_unregister_device(struct nci_dev *ndev)
{
struct nci_conn_info *conn_info, *n;
/* This set_bit is not protected with specialized barrier,
* However, it is fine because the mutex_lock(&ndev->req_lock);
* in nci_close_device() will help to emit one.
*/
set_bit(NCI_UNREG, &ndev->flags);
nci_close_devi... | vuln | Safe | Unknown |
void SoftMPEG4::onQueueFilled(OMX_U32 /* portIndex */) {
if (mSignalledError || mOutputPortSettingsChange != NONE) {
return;
}
List<BufferInfo *> &inQueue = getPortQueue(0);
List<BufferInfo *> &outQueue = getPortQueue(1);
while (!inQueue.empty() && outQueue.size() == kNumOutputBuffers) {
BufferInfo *inInfo = *... | vuln | Vulnerable | C/C++ |
foreach ( $metric_group_members as $index => $metric_name ) {
print "
<A HREF=\"./graph_all_periods.php?mobile=1&" . $g_metrics[$metric_name]['graph'] . "\">
<IMG BORDER=0 ALT=\"$clustername\" SRC=\"./graph.php?" . $g_metrics[$metric_name]['graph'] . "\"></A>";
} | vuln | Vulnerable | PHP |
static void qxl_init_ramsize(PCIQXLDevice *qxl)
{
if (qxl->vgamem_size_mb < 8) {
qxl->vgamem_size_mb = 8;
}
if (qxl->vgamem_size_mb > 256) {
qxl->vgamem_size_mb = 256;
}
qxl->vgamem_size = qxl->vgamem_size_mb * 1024 * 1024;
if (qxl->ram_size_mb != -1) {
qxl... | vuln | Safe | C/C++ |
static int arm_gic_init(SysBusDevice *dev)
{
int i;
GICState *s = FROM_SYSBUS(GICState, dev);
ARMGICClass *agc = ARM_GIC_GET_CLASS(s);
agc->parent_init(dev);
gic_init_irqs_and_distributor(s, s->num_irq);
memory_region_init_io(&s->cpuiomem[0], &gic_thiscpu_ops, s,
... | vuln | Vulnerable | C/C++ |
static bool new_idmap_permitted(const struct file *file,
struct user_namespace *ns, int cap_setid,
struct uid_gid_map *new_map)
{
/* Allow mapping to your own filesystem ids */
if ((new_map->nr_extents == 1) && (new_map->extent[0].count == 1)) {
u32 id = new_map->extent[0].lower_first;
if (cap_setid ==... | vuln | Safe | C/C++ |
void MidiManagerUsb::DispatchSendMidiData(MidiManagerClient* client,
uint32_t port_index,
const std::vector<uint8>& data,
double timestamp) {
if (port_index >= output_streams_.size()) {
... | vuln | Safe | C/C++ |
function editDomainWindow (request)
{
if (request.readyState==4)
{
if(request.responseText=='failed')
{
message("danger", "The action you performed failed.");
}else
{
var jsonData = currentEditedDomain = JSON.parse(request.responseText);
new Ajax.Request(baseurl+"?p=getOwners",
{
metho... | vuln | Safe | JavaScript |
static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
{
int layno, reslevelno, compno, precno, ok_reslevel, ret;
uint8_t prog_order = tile->codsty[0].prog_order;
uint16_t x;
uint16_t y;
s->bit_index = 8;
switch (prog_order) {
case JPEG2000_PGOD_LRCP:
for (... | vuln | Vulnerable | C/C++ |
static ssize_t _epoll_readv(
oe_fd_t* desc,
const struct oe_iovec* iov,
int iovcnt)
{
ssize_t ret = -1;
epoll_t* file = _cast_epoll(desc);
void* buf = NULL;
size_t buf_size = 0;
size_t data_size = 0;
if (!file || (iovcnt && !iov) || iovcnt < 0 || iovcnt > OE_IOV_MAX)
OE_RAIS... | vuln | Safe | Unknown |
GF_Err Media_CheckDataEntry(GF_MediaBox *mdia, u32 dataEntryIndex)
{
GF_DataEntryURLBox *entry;
GF_DataMap *map;
GF_Err e;
if (!mdia || !dataEntryIndex || dataEntryIndex > gf_list_count(mdia->information->dataInformation->dref->child_boxes)) return GF_BAD_PARAM;
entry = (GF_DataEntryURLBox*)gf_list_get(mdia->inf... | vuln | Vulnerable | C/C++ |
static int
lha_read_file_header_1(struct archive_read *a, struct lha *lha)
{
const unsigned char *p;
size_t extdsize;
int i, err, err2;
int namelen, padding;
unsigned char headersum, sum_calculated;
err = ARCHIVE_OK;
if ((p = __archive_read_ahead(a, H1_FIXED_SIZE, NULL)) == NULL)
return (truncated_error(a));... | vuln | Safe | C/C++ |
static int __init efivar_ssdt_setup(char *str)
{
int ret = security_locked_down(LOCKDOWN_ACPI_TABLES);
if (ret)
return ret;
if (strlen(str) < sizeof(efivar_ssdt))
memcpy(efivar_ssdt, str, strlen(str));
else
pr_warn("efivar_ssdt: name too long: %s\n", str);
return 0;
} | vuln | Safe | Unknown |
'use strict';
const path = require('path');
const execa = require('execa');
const chalk = require('chalk');
const stopProcess = require('./stop-process');
/**
* Gets the package version on npm. Will fail if the package does not exist
* @param {string} packageName Name to look up on npm, may include a specific versi... | vuln | Safe | JavaScript |
function generate_key($size)
{
if (
is_callable('openssl_random_pseudo_bytes')
and !(version_compare(PHP_VERSION, '5.3.4') < 0 and defined('PHP_WINDOWS_VERSION_MAJOR'))
)
{
return substr(
str_replace(
array('+', '/'),
'',
base64_encode(openssl_random_pseudo_bytes($size+... | vuln | Vulnerable | PHP |
void EC_GROUP_clear_free(EC_GROUP *group)
{
if (!group) return;
if (group->meth->group_clear_finish != 0)
group->meth->group_clear_finish(group);
else if (group->meth->group_finish != 0)
group->meth->group_finish(group);
EC_EX_DATA_clear_free_all_data(&group->extra_data);
if (group->generator != NULL)
... | vuln | Safe | Unknown |
MagickBooleanType sixel_decode(unsigned char /* in */ *p, /* sixel bytes */
unsigned char /* out */ **pixels, /* decoded pixels */
size_t /* out */ *pwidth, /* image width */
... | vuln | Vulnerable | Unknown |
OMX_BUFFERHEADERTYPE *OMXNodeInstance::findBufferHeader(OMX::buffer_id buffer) { | vuln | Safe | C/C++ |
private CompilerContainer compileBatch(Collection<? extends JavaFileObject> sources) {
synchronized (mContainer) {
mContainer.initialize(() -> {
if (needsCompile(sources)) {
loadCompile(sources);
} else {
Log.d("JavaCompilerServ... | vuln | Safe | Java |
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator p... | vuln | Vulnerable | Java |
f-10+"px")};Toolbar.prototype.setFontName=function(a){if(null!=this.fontMenu){this.fontMenu.innerHTML="";var b=document.createElement("div");b.style.display="inline-block";b.style.overflow="hidden";b.style.textOverflow="ellipsis";b.style.maxWidth="66px";mxUtils.write(b,a);this.fontMenu.appendChild(b);this.appendDropDow... | vuln | Vulnerable | JavaScript |
create_iovec(BlockBackend *blk, QEMUIOVector *qiov, char **argv, int nr_iov,
int pattern)
{
size_t *sizes = g_new0(size_t, nr_iov);
size_t count = 0;
void *buf = NULL;
void *p;
int i;
for (i = 0; i < nr_iov; i++) {
char *arg = argv[i];
int64_t len;
len = cvtn... | vuln | Vulnerable | C/C++ |
/*
* Ut Video decoder
* Copyright (c) 2011 Konstantin Shishkov
*
* 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
* version 2.1 of the License, o... | vuln | Vulnerable | C/C++ |
private synchronized void updateStatus(String torServiceMsg, String newTorStatus) {
if (!TextUtils.isEmpty(torServiceMsg)) {
if (torServiceMsg.contains(TorServiceConstants.LOG_NOTICE_HEADER)) {
lblStatus.setText(torServiceMsg);
}
mTxtOrbotLog.append(torServi... | vuln | Safe | Java |
Imaging
ImagingNew(const char* mode, int xsize, int ysize)
{
int bytes;
Imaging im;
if (strlen(mode) == 1) {
if (mode[0] == 'F' || mode[0] == 'I')
bytes = 4;
else
bytes = 1;
} else
bytes = strlen(mode); /* close enough */
if ((int64_t) xsize * (int64... | vuln | Vulnerable | C/C++ |
TfLiteStatus SparseToDenseImpl(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* indices;
TF_LITE_ENSURE_OK(context,
GetInputSafe(context, node, kIndicesTensor, &indices));
const TfLiteTensor* output_shape;
TF_LITE_ENSURE_OK(
context, GetInputSafe(context, node, kOutputSh... | vuln | Safe | C/C++ |
private boolean checkAuthorizedScripts(List<SelectionScript> scripts) {
updateAuthorizedScriptsSignatures();
if (authorizedSelectionScripts == null || scripts == null)
return true;
boolean allAuthorized = true;
for (SelectionScript script : scripts) {
allAuthori... | vuln | Safe | Java |
/* PEF support for BFD.
Copyright (C) 1999-2020 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
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 Founda... | vuln | Vulnerable | C/C++ |
static void start_auth_request(PgSocket *client, const char *username)
{
int res;
PktBuf *buf;
/* have to fetch user info from db */
client->pool = get_pool(client->db, client->db->auth_user);
if (!find_server(client)) {
client->wait_for_user_conn = true;
return;
}
slog_noise(client, "Doing auth_conn ... | vuln | Safe | C/C++ |
@Override
public void onRequestPermissionsResult(int requestCode,
String permissions[], int[] grantResults)
{
Log.i(LOG_TAG, String.format("permission result in: %s", requestCode));
switch (requestCode)
{
case MY_PERMISSIONS_REQUEST... | vuln | Vulnerable | Java |
private void configurationCardinal(Context context, Configuration configuration, ThreeDSecureRequest request) {
CardinalEnvironment cardinalEnvironment = CardinalEnvironment.STAGING;
if ("production".equalsIgnoreCase(configuration.getEnvironment())) {
cardinalEnvironment = CardinalEnvironmen... | vuln | Safe | Java |
dwg_encode_add_object (Dwg_Object *restrict obj, Bit_Chain *restrict dat,
unsigned long address)
{
int error = 0;
unsigned long oldpos;
unsigned long end_address = address + obj->size;
oldpos = bit_position (dat);
assert (address);
dat->byte = address;
dat->bit = 0;
LOG_INFO ("O... | vuln | Vulnerable | Unknown |
static int mov_write_hdlr_tag(ByteIOContext *pb, MOVTrack *track)
{
const char *hdlr, *descr = NULL, *hdlr_type = NULL;
int64_t pos = url_ftell(pb);
if (!track) {
hdlr = "dhlr";
hdlr_type = "url ";
descr = "DataHandler";
} else {
hdlr = (track->mode == MODE_MOV) ? "mhlr"... | vuln | Safe | C/C++ |
static void unassign_storage(SCCB *sccb)
{
MemoryRegion *mr = NULL;
AssignStorage *assign_info = (AssignStorage *) sccb;
sclpMemoryHotplugDev *mhd = get_sclp_memory_hotplug_dev();
assert(mhd);
ram_addr_t unassign_addr = (assign_info->rn - 1) * mhd->rzm;
MemoryRegion *sysmem = get_system_memory()... | vuln | Safe | C/C++ |
def self.find_siblings(hierarchy_id, parent_id)
self.find_by_sql("select string as taxon_concept, h1.id, h1.parent_id,
(select count(*) from hierarchy_entries as h2 where h2.parent_id=h1.id)
as siblings_count,
h1.taxon_concept_id
... | vuln | Vulnerable | Ruby |
private int getFluidHeight() {
return height * tank.getFluidInTank(TANK_INDEX).getAmount() / tank.getTankCapacity(TANK_INDEX);
} | vuln | Vulnerable | Java |
void
eigrp_print(netdissect_options *ndo, register const u_char *pptr, register u_int len)
{
const struct eigrp_common_header *eigrp_com_header;
const struct eigrp_tlv_header *eigrp_tlv_header;
const u_char *tptr,*tlv_tptr;
u_int tlen,eigrp_tlv_len,eigrp_tlv_type,tlv_tlen, byte_length, bit_length;
u... | vuln | Safe | C/C++ |
@Override
public void onSaveInstanceState(Bundle outState) {
outState.putLong("fair:account", account);
outState.putBoolean("fair:junk", junk);
outState.putString("fair:searching", searching);
outState.putLong("fair:selected_account", selected_account);
super.onSaveInstanceSt... | vuln | Vulnerable | Java |
QemuConsole *qemu_console_lookup_by_device(DeviceState *dev, uint32_t head)
{
Object *obj;
uint32_t h;
int i;
for (i = 0; i < nb_consoles; i++) {
if (!consoles[i]) {
continue;
}
obj = object_property_get_link(OBJECT(consoles[i]),
... | vuln | Safe | C/C++ |
R_API bool r_io_bank_read_at(RIO *io, const ut32 bankid, ut64 addr, ut8 *buf, int len) {
r_return_val_if_fail (io, false);
RIOBank *bank = r_io_bank_get (io, bankid);
if (!bank) {
return false;
}
RIOSubMap fake_sm = {{0}};
fake_sm.itv.addr = addr;
fake_sm.itv.size = len;
RRBNode *node;
if (R_LIKELY (bank->la... | vuln | Vulnerable | C/C++ |
void WebPluginDelegateProxy::SendUpdateGeometry(
bool bitmaps_changed) {
PluginMsg_UpdateGeometry_Param param;
param.window_rect = plugin_rect_;
param.clip_rect = clip_rect_;
param.windowless_buffer0 = TransportDIB::DefaultHandleValue();
param.windowless_buffer1 = TransportDIB::DefaultHandleValue();
par... | vuln | Vulnerable | C/C++ |
TfLiteStatus ComputeDepthMultiplier(TfLiteContext* context,
const TfLiteTensor* input,
const TfLiteTensor* filter,
int16* depth_multiplier) {
int num_filter_channels = SizeOfDimension(filter, 3);
int num_inpu... | vuln | Safe | C/C++ |
static ssize_t environ_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
char *page;
unsigned long src = *ppos;
int ret = 0;
struct mm_struct *mm = file->private_data;
unsigned long env_start, env_end;
/* Ensure the process spawned far enough to have an environment. */
if (!mm || !mm... | vuln | Safe | C/C++ |
static int load_elf_binary(struct linux_binprm *bprm)
{
struct file *interpreter = NULL; /* to shut gcc up */
unsigned long load_addr = 0, load_bias = 0;
int load_addr_set = 0;
char * elf_interpreter = NULL;
unsigned long error;
struct elf_phdr *elf_ppnt, *elf_phdata, *interp_elf_phdata = NULL;
unsigned long el... | vuln | Safe | C/C++ |
cmsHPROFILE CMSEXPORT cmsCreateLab2ProfileTHR(cmsContext ContextID, const cmsCIExyY* WhitePoint)
{
cmsHPROFILE hProfile;
cmsPipeline* LUT = NULL;
hProfile = cmsCreateRGBProfileTHR(ContextID, WhitePoint == NULL ? cmsD50_xyY() : WhitePoint, NULL, NULL);
if (hProfile == NULL) return NULL;
cmsSetProfi... | vuln | Safe | Unknown |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License") + yo... | vuln | Safe | Java |
static int BuildHuffmanTable(HuffmanCode* const root_table, int root_bits,
const int code_lengths[], int code_lengths_size,
uint16_t sorted[]) {
HuffmanCode* table = root_table; // next available space in table
int total_size = 1 << root_bits; // total siz... | vuln | Vulnerable | C/C++ |
static MagickBooleanType ReadPSDChannelPixels(Image *image,
const size_t channels,const size_t row,const ssize_t type,
const unsigned char *pixels,ExceptionInfo *exception)
{
Quantum
pixel;
register const unsigned char
*p;
register Quantum
*q;
register ssize_t
x;
size_t
packet_size... | vuln | Safe | C/C++ |
public String getOrderBy() {
return SQLUtil.sanitizeSortBy(orderBy);
} | vuln | Safe | Java |
void RequestSender::OnNetworkFetcherComplete(
const GURL& original_url,
std::unique_ptr<std::string> response_body,
int net_error,
const std::string& header_etag,
int64_t xheader_retry_after_sec) {
DCHECK(thread_checker_.CalledOnValidThread());
VLOG(1) << "request completed from url: " << orig... | vuln | Vulnerable | C/C++ |
static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eof)
{
int ret = 0, i;
int repeating = 0;
int eof_reached = 0;
AVPacket avpkt;
if (!ist->saw_first_ts) {
ist->dts = ist->st->avg_frame_rate.num ? - ist->dec_ctx->has_b_frames * AV_TIME_BASE / av_q2d(ist->st->avg_fr... | vuln | Safe | C/C++ |
GetRunner(
const ReferenceHandle& that,
Local<Value> key_handle,
MaybeLocal<Object> maybe_options,
bool inherit
) :
context{that.context},
reference{that.reference},
options{maybe_options, inherit ?
TransferOptions::Type::DeepReference : TransferOptions::Type::Reference},
inherit{inhe... | vuln | Vulnerable | C/C++ |
int insn_get_code_seg_params(struct pt_regs *regs)
{
struct desc_struct *desc;
short sel;
if (v8086_mode(regs))
/* Address and operand size are both 16-bit. */
return INSN_CODE_SEG_PARAMS(2, 2);
sel = get_segment_selector(regs, INAT_SEG_REG_CS);
if (sel < 0)
return sel;
desc = get_desc(sel);
if (!desc)
... | vuln | Vulnerable | Unknown |
static int yop_read_seek(AVFormatContext *s, int stream_index,
int64_t timestamp, int flags)
{
YopDecContext *yop = s->priv_data;
int64_t frame_pos, pos_min, pos_max;
int frame_count;
if (!stream_index)
return -1;
pos_min = s->data_offset;
pos_max =... | vuln | Safe | C/C++ |
def format_errormsg(message: str) -> str:
"""Match account names in error messages and insert HTML links for them."""
match = re.search(ACCOUNT_RE, message)
if not match:
return message
account = match.group()
url = flask.url_for("account", name=account)
return (
message.replace(... | vuln | Vulnerable | Python |
private void internalDeleteSubscriptionForNonPartitionedTopicForcefully(AsyncResponse asyncResponse,
String subName, boolean authoritative) {
validateTopicOwnershipAsync(topicName, authoritative)
.thenRun(() -> validateT... | vuln | Vulnerable | Java |
protected void internalExpireMessagesByPosition(AsyncResponse asyncResponse, String subName, boolean authoritative,
MessageIdImpl messageId, boolean isExcluded, int batchIndex) {
if (topicName.isGlobal()) {
try {
validateGlobalNamespac... | vuln | Vulnerable | Java |
inline size_t codepoint_length(const char *s8, size_t l) {
if (l) {
auto b = static_cast<uint8_t>(s8[0]);
if ((b & 0x80) == 0) {
return 1;
} else if ((b & 0xE0) == 0xC0) {
return 2;
} else if ((b & 0xF0) == 0xE0) {
return 3;
} else if ((b & 0xF8) == 0xF0) {
return 4;
}
... | vuln | Vulnerable | C/C++ |
static int formatIPTCfromBuffer(Image *ofile, char *s, ssize_t len)
{
char
temp[MagickPathExtent];
unsigned int
foundiptc,
tagsfound;
unsigned char
recnum,
dataset;
unsigned char
*readable,
*str;
ssize_t
tagindx,
taglen;
int
i,
tagcount = (int) (sizeof(tags) ... | vuln | Safe | C/C++ |
void jpc_qmfb_split_colres(jpc_fix_t *a, int numrows, int numcols,
int stride, int parity)
{
int bufsize = JPC_CEILDIVPOW2(numrows, 1);
jpc_fix_t splitbuf[QMFB_SPLITBUFSIZE * JPC_QMFB_COLGRPSIZE];
jpc_fix_t *buf = splitbuf;
jpc_fix_t *srcptr;
jpc_fix_t *dstptr;
register jpc_fix_t *srcptr2;
register jpc_fix_t ... | vuln | Safe | C/C++ |
function w(n,t){var r=null==n?0:n.length;return r?k(n,t)/r:Cn} | vuln | Safe | JavaScript |
public static Optional<ItemType> fromString(String typeStr) {
try {
return Optional.of(ItemType.valueOf(typeStr.toUpperCase(Locale.ROOT)));
} catch (IllegalArgumentException e) {
return Optional.empty();
}
} | vuln | Safe | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.