code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
//
// PDF value functions for PDFio.
//
// Copyright © 2021 by Michael R Sweet.
//
// Licensed under Apache License v2.0. See the file "LICENSE" for more
// information.
//
//
// Include necessary headers...
//
#include "pdfio-private.h"
//
// '_pdfioValueCopy()' - Copy a value to a PDF file.
//
_pdfio_value_t *
... | vuln | Vulnerable | C/C++ |
public static void main(String[] args) {
if (args.length != 2) {
System.err.println("Invalid number of arguments.");
usage();
System.exit(ERROR_STATUS);
}
File fromFile = new File(args[0]);
File toFile = new File(args[1]);
try {
spd... | vuln | Vulnerable | Java |
int line6_probe(struct usb_interface *interface,
const struct usb_device_id *id,
const char *driver_name,
const struct line6_properties *properties,
int (*private_init)(struct usb_line6 *, const struct usb_device_id *id),
size_t data_size)
{
struct usb_device *usbdev = interface_to_usbdev(interface);
struct... | vuln | Safe | Unknown |
public function validateReference()
{
$docElem = $this->sigNode->ownerDocument->documentElement;
if (! $docElem->isSameNode($this->sigNode)) {
if ($this->sigNode->parentNode != null) {
$this->sigNode->parentNode->removeChild($this->sigNode);
}
}
... | vuln | Safe | PHP |
static void aio_fsync_work(struct work_struct *work)
{
struct fsync_iocb *req = container_of(work, struct fsync_iocb, work);
int ret;
ret = vfs_fsync(req->file, req->datasync);
aio_complete(container_of(req, struct aio_kiocb, fsync), ret, 0);
} | vuln | Safe | Unknown |
async def saml_response_to_remapped_user_attributes(
failures: int,
) -> UserAttributes:
"""
Call the mapping provider to map a SAML response to user attributes and coerce the result into the standard form.
This is backwards compatibility for abstraction for the ... | vuln | Vulnerable | Python |
int main_loop(void *opaque)
{
struct pollfd ufds[3], *pf, *serial_ufd, *net_ufd, *gdb_ufd;
int ret, n, timeout, serial_ok;
uint8_t ch;
CPUState *env = global_env;
if (!term_inited) {
term_inited = 1;
term_init();
}
serial_ok = 1;
for(;;) {
ret = cpu_x86_e... | vuln | Safe | C/C++ |
public Point findClosestPoint(CombatStack st, CombatStack tgt) {
if (!st.canMove())
return null;
int targetDist = st.optimalFiringRange(tgt);
if (tgt.isColony() && st.hasBombs())
targetDist = 1;
float maxDist = st.movePointsTo(tgt.x,tgt.y);
if (maxDist <... | vuln | Vulnerable | Java |
private void doFree(final DownloadLink link, final boolean resumable, final int maxchunks) throws Exception, PluginException {
final boolean isDangerousFile = link.getBooleanProperty(PROPERTY_DANGEROUS_FILE, false);
if (isDangerousFile && (StringUtils.isEmpty(downloadURL) || !this.getPluginConfig().getB... | vuln | Safe | Java |
/********************************************************************\
* BitlBee -- An IRC to other IM-networks gateway *
* *
* Copyright 2010 Wilmer van der Gaast <wilmer@gaast.net> *
\***********************************... | vuln | Safe | C/C++ |
def check_ratelimit(
delay=3600, limit=25, return_status=429, logout=False, scope=None, methods=None, debug=False, hit=1, **conf
):
"""
Verify the ratelimit. By default return a 429 HTTP error code (Too Many Request). After 25 request within the same hour.
Arguments:
delay: Time window ... | vuln | Safe | Python |
static void puv3_load_kernel(const char *kernel_filename)
{
int size;
if (kernel_filename == NULL && qtest_enabled()) {
return;
}
if (kernel_filename == NULL) {
error_report("kernel parameter cannot be empty");
exit(1);
}
size = load_image_targphys(kernel_filename, K... | vuln | Safe | C/C++ |
static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid, int bitdepth)
{
if (cid != ctx->cid) {
const CIDEntry *cid_table = ff_dnxhd_get_cid_table(cid);
if (!cid_table) {
av_log(ctx->avctx, AV_LOG_ERROR, "unsupported cid %"PRIu32"\n", cid);
return AVERROR(ENOSYS);
... | vuln | Vulnerable | C/C++ |
void s390_pci_iommu_enable(S390PCIBusDevice *pbdev)
{
uint64_t size = pbdev->pal - pbdev->pba + 1;
memory_region_init_iommu(&pbdev->iommu_mr, OBJECT(&pbdev->mr),
&s390_iommu_ops, "iommu-s390", size);
memory_region_add_subregion(&pbdev->mr, pbdev->pba, &pbdev->iommu_mr);
pbde... | vuln | Vulnerable | C/C++ |
public void recalcModWarnings(JModPanelCheckBoxList parent)
{
info.statusMsg = " ";
checkBox.setBackground(Color.WHITE);
infoPanel.setBackground(Color.WHITE);
if (info.MTS_Version.compareTo(Loader.MTS_VERSION) > 0) {
checkBox.setEnabled(false);
checkBox.setBa... | vuln | Vulnerable | Java |
void Compute(OpKernelContext* ctx) override {
const Tensor& gradient = ctx->input(0);
const Tensor& input = ctx->input(1);
Tensor* input_backprop = nullptr;
OP_REQUIRES_OK(ctx,
ctx->allocate_output(0, input.shape(), &input_backprop));
OP_REQUIRES(
ctx, axis_ >= -1,
... | vuln | Vulnerable | C/C++ |
vba_read_project_strings(int fd, int big_endian)
{
unsigned char *buf = NULL;
uint16_t buflen = 0;
int ret = 0;
for(;;) {
off_t offset;
uint16_t length;
char *name;
if(!read_uint16(fd, &length, big_endian))
break;
if (length < 6) {
lseek(fd, -2, SEEK_CUR);
break;
}
if(length > buflen) {
... | vuln | Safe | C/C++ |
qcrypto_tls_creds_x509_load(QCryptoTLSCredsX509 *creds,
Error **errp)
{
char *cacert = NULL, *cacrl = NULL, *cert = NULL,
*key = NULL, *dhparams = NULL;
int ret;
int rv = -1;
trace_qcrypto_tls_creds_x509_load(creds,
creds->parent_obj.dir ? creds->parent_ob... | vuln | Safe | C/C++ |
private static void extractZipEntry(ZipFile zf, ZipEntry zipEntry, File dir) throws Exception {
File destFile = new File(dir, zipEntry.getName());
if (zipEntry.isDirectory())
destFile.mkdirs();
else {
destFile.getParentFile().mkdirs();
destFile.createNewFile()... | vuln | Vulnerable | Java |
static void i82374_init(I82374State *s)
{
DMA_init(1, NULL);
memset(s->commands, 0, sizeof(s->commands));
} | vuln | Vulnerable | C/C++ |
/*
* linux/fs/ext4/super.c
*
* Copyright (C) 1992, 1993, 1994, 1995
* Remy Card (card@masi.ibp.fr)
* Laboratoire MASI - Institut Blaise Pascal
* Universite Pierre et Marie Curie (Paris VI)
*
* from
*
* linux/fs/minix/inode.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*
* Big-endian to little-endian... | vuln | Safe | C/C++ |
std::string decodeBase64(
const std::string& encoded) {
if (encoded.size() == 0) {
// special case, to prevent an integer overflow down below.
return std::string();
}
int padding = 0;
for (auto it = encoded.rbegin();
padding < 2 && it != encoded.rend() && *it == '=';
++it) {
++pa... | vuln | Safe | Unknown |
# -*- coding: utf-8 -*-
# rdiffweb, A web interface to rdiff-backup repositories
# Copyright (C) 2012-2021 rdiffweb contributors
#
# 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 ... | vuln | Safe | Python |
static char ** split(const char *arg, const char *delim) {
char *copy = dupstr(arg);
char **result = NULL;
int i = 0;
for (char *cptr = strtok(copy, delim); cptr; cptr = strtok(NULL, delim)) {
char **tmp = realloc (result, sizeof *result * (i + 1));
if (!tmp && result) {
while (i > 0) {
free(res... | vuln | Safe | C/C++ |
# -*- coding: utf-8 -*-
# rdiffweb, A web interface to rdiff-backup repositories
# Copyright (C) 2012-2021 rdiffweb contributors
#
# 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 ... | vuln | Vulnerable | Python |
private NettyH2HeadersToHttpHeaders h2HeadersToH1HeadersServer(Http2Headers h2Headers,
@Nullable HttpRequestMethod httpMethod,
boolean fullRequest) {
CharSequence value = h2Heade... | vuln | Safe | Java |
def filter_pattern_validator(value: str) -> None:
regex = re.compile(r"^(?:(?:[\w\-#_= /:]*|[+]|[!])(\(\?P<\w+>.+\)))+$")
error_msg = _("Invalid linkifier pattern. Valid characters are {}.").format(
"[ a-zA-Z_#=/:+!-]",
)
if not regex.match(str(value)):
raise ValidationError(error_msg)... | vuln | Vulnerable | Python |
int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
struct rq_map_data *map_data,
const struct iov_iter *iter, gfp_t gfp_mask)
{
bool copy = false;
unsigned long align = q->dma_pad_mask | queue_dma_alignment(q);
struct bio *bio = NULL;
struct iov_iter i;
int ret;
if (map_data)
copy ... | vuln | Vulnerable | C/C++ |
static int parse_bsfs(void *log_ctx, const char *bsfs_spec,
AVBitStreamFilterContext **bsfs)
{
char *bsf_name, *buf, *saveptr;
int ret = 0;
if (!(buf = av_strdup(bsfs_spec)))
return AVERROR(ENOMEM);
while (bsf_name = av_strtok(buf, ",", &saveptr)) {
AVBitStreamFilte... | vuln | Vulnerable | C/C++ |
bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex)
{
// Check it again in case a previous version let a bad block in
if (!CheckBlock())
return false;
// Do not allow blocks that contain transactions which 'overwrite' older transactions,
// unless those are already completely spent.
... | vuln | Safe | Unknown |
static struct rmap_item *scan_get_next_rmap_item(struct page **page)
{
struct mm_struct *mm;
struct mm_slot *slot;
struct vm_area_struct *vma;
struct rmap_item *rmap_item;
if (list_empty(&ksm_mm_head.mm_list))
return NULL;
slot = ksm_scan.mm_slot;
if (slot == &ksm_mm_head) {
/*
* A number of pages can h... | vuln | Vulnerable | C/C++ |
error_t tcpAddOption(TcpHeader *segment, uint8_t kind, const void *value,
uint8_t length)
{
error_t error;
size_t i;
size_t paddingSize;
TcpOption *option;
//The option-length counts the two octets of option-kind and option-length
//as well as the option-data octets (refer to RFC 793, section 3.1)... | vuln | Safe | C/C++ |
static void change_port_settings(struct tty_struct *tty,
struct edgeport_port *edge_port, struct ktermios *old_termios)
{
struct device *dev = &edge_port->port->dev;
struct ump_uart_config *config;
int baud;
unsigned cflag;
int status;
int port_number = edge_port->port->port_number;
config = kmalloc (sizeof (... | vuln | Safe | C/C++ |
package com.salesmanager.core.business.utils;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Currency;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
... | vuln | Vulnerable | Java |
@Override
public void run() {
Context context = getContext();
if (context instanceof MainActivity) {
SQLiteDatabase db = MainActivity.getDatabaseHelper().getReadableDatabase();
Map<String, OdyseeCollection> collectionsMap = DatabaseHelp... | vuln | Safe | Java |
static int isr_rx_pdu(struct lll_conn *lll, struct pdu_data *pdu_data_rx,
struct node_tx **tx_release, u8_t *is_rx_enqueue)
{
/* Ack for tx-ed data */
if (pdu_data_rx->nesn != lll->sn) {
struct node_tx *tx;
memq_link_t *link;
/* Increment serial number */
lll->sn++;
#if defined(CONFIG_BT_PERIPHERAL)... | vuln | Safe | C/C++ |
int processCommand(client *c) {
if (!server.lua_timedout) {
/* Both EXEC and EVAL call call() directly so there should be
* no way in_exec or in_eval or propagate_in_transaction is 1.
* That is unless lua_timedout, in which case client may run
* some commands. */
serverAss... | vuln | Vulnerable | C/C++ |
XML_GetBuffer(XML_Parser parser, int len)
{
if (len < 0) {
errorCode = XML_ERROR_NO_MEMORY;
return NULL;
}
switch (ps_parsing) {
case XML_SUSPENDED:
errorCode = XML_ERROR_SUSPENDED;
return NULL;
case XML_FINISHED:
errorCode = XML_ERROR_FINISHED;
return NULL;
default: ;
}
if (len... | vuln | Safe | C/C++ |
static int ogg_read_header(AVFormatContext *avfcontext, AVFormatParameters *ap)
{
OggContext *context = avfcontext->priv_data;
ogg_packet op ;
char *buf ;
ogg_page og ;
AVStream *ast ;
AVCodecContext *codec;
uint8_t *p;
int i;
ogg_sync_init(&context->oy) ;
buf = ogg_syn... | vuln | Safe | C/C++ |
function ame_ajax_toggle_showinvisposts( status ) {
jQuery("#ame_toggle_showinvisposts").prop("value", ameAjaxL10n.pleaseWait);
var ame_sack = new sack( ajaxurl );
ame_sack.execute = 1;
ame_sack.method = 'POST';
ame_sack.setVar( "action", "ame_toggle_showinvisposts" );
ame_sack.setVar( "security", ameAjaxSec.ajax... | vuln | Safe | JavaScript |
nfsd4_verify_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
stateid_t *src_stateid, struct file **src,
stateid_t *dst_stateid, struct file **dst)
{
__be32 status;
status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->save_fh,
src_stateid, RD_STATE, src, NULL);
if (status) {... | vuln | Vulnerable | Unknown |
static int lz4_uncompress(const char *source, char *dest, int osize)
{
const BYTE *ip = (const BYTE *) source;
const BYTE *ref;
BYTE *op = (BYTE *) dest;
BYTE * const oend = op + osize;
BYTE *cpy;
unsigned token;
size_t length;
size_t dec32table[] = {0, 3, 2, 3, 0, 0, 0, 0};
#if LZ4_ARCH64
size_t dec64table[] ... | vuln | Safe | C/C++ |
def delete_playlist(id, db):
db.execute("DELETE FROM playlist where id={id};".format(id=id)) | vuln | Vulnerable | Python |
void Compute(OpKernelContext* ctx) override {
const Tensor& input = ctx->input(kInputTensorIndex);
const Tensor& input_min = ctx->input(kInputMinIndex);
const Tensor& input_max = ctx->input(kInputMaxIndex);
const size_t depth = input_max.NumElements();
OP_REQUIRES(
ctx, input_min.dim_size(0... | vuln | Safe | C/C++ |
def student_view_data(self, context=None):
"""
Get the configuration data for the student_view.
The configuration is all the settings defined by the author, except for correct answers
and feedback.
"""
def items_without_answers():
"""
Removes feed... | vuln | Safe | Python |
/*
*
* (C) 2013-17 - ntop.org
*
*
* 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
* (at your option) any later version.
*
* This program is distribu... | vuln | Safe | C/C++ |
mxTooltipHandler.prototype.reset=function(a,b,c){if(!this.ignoreTouchEvents||mxEvent.isMouseEvent(a.getEvent()))if(this.resetTimer(),c=null!=c?c:this.getStateForEvent(a),b&&this.isEnabled()&&null!=c&&(null==this.div||"hidden"==this.div.style.visibility)){var d=a.getSource(),e=a.getX(),f=a.getY(),g=a.isSource(c.shape)||... | vuln | Vulnerable | JavaScript |
TfLiteRegistration CancelOpRegistration() {
TfLiteRegistration reg = {nullptr, nullptr, nullptr, nullptr};
// Set output size to the input size in CancelOp::Prepare(). Code exists to
// have a framework in Prepare. The input and output tensors are not used.
reg.prepare = [](TfLiteContext* context, TfLi... | vuln | Safe | C/C++ |
static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
{
XlnxZynqMPState *s = XLNX_ZYNQMP(dev);
MemoryRegion *system_memory = get_system_memory();
uint8_t i;
const char *boot_cpu = s->boot_cpu ? s->boot_cpu : "apu-cpu[0]";
qemu_irq gic_spi[GIC_NUM_SPI_INTR];
Error *err = NULL;
... | vuln | Safe | C/C++ |
psutil_pids(PyObject *self, PyObject *args) {
kinfo_proc *proclist = NULL;
kinfo_proc *orig_address = NULL;
size_t num_processes;
size_t idx;
PyObject *py_pid = NULL;
PyObject *py_retlist = PyList_New(0);
if (py_retlist == NULL)
return NULL;
if (psutil_get_proc_list(&proclist, ... | vuln | Vulnerable | Unknown |
native_handle* Parcel::readNativeHandle() const
{
int numFds, numInts;
status_t err;
err = readInt32(&numFds);
if (err != NO_ERROR) return 0;
err = readInt32(&numInts);
if (err != NO_ERROR) return 0;
native_handle* h = native_handle_create(numFds, numInts);
if (!h) {
return 0;
}
... | vuln | Safe | C/C++ |
static const uint8_t *parse_opus_ts_header(const uint8_t *start, int *payload_len, int buf_len)
{
const uint8_t *buf = start + 1;
int start_trim_flag, end_trim_flag, control_extension_flag, control_extension_length;
uint8_t flags;
GetByteContext gb;
bytestream2_init(&gb, buf, buf_len);
flags = b... | vuln | Vulnerable | C/C++ |
void HELPER(vfp_set_fpscr)(CPUState *env, uint32_t val)
{
int i;
uint32_t changed;
changed = env->vfp.xregs[ARM_VFP_FPSCR];
env->vfp.xregs[ARM_VFP_FPSCR] = (val & 0xffc8ffff);
env->vfp.vec_len = (val >> 16) & 7;
env->vfp.vec_stride = (val >> 20) & 3;
changed ^= val;
if (changed & (3 << 2... | vuln | Safe | C/C++ |
@Override
public void doActivate() {
if (menuConfig != null) {
menuConfig.setDeviceManager(deviceManager);
}
} | vuln | Safe | Java |
static int update_wrap_reference(AVFormatContext *s, AVStream *st, int stream_index, AVPacket *pkt)
{
int64_t ref = pkt->dts;
if (ref == AV_NOPTS_VALUE)
ref = pkt->pts;
if (ref == AV_NOPTS_VALUE)
return 0;
ref &= (1LL<<st->pts_wrap_bits)-1;
if (s->correct_ts_overflow && st->pts_wrap_... | vuln | Vulnerable | C/C++ |
static struct db_sys_list *_db_rule_gen_64(const struct arch_def *arch,
const struct db_api_rule_list *rule)
{
unsigned int iter;
struct db_sys_list *s_new;
const struct db_api_arg *chain = rule->args;
struct db_arg_chain_tree *c_iter[3] = { NULL, NULL, NULL };
struct db_arg_chain_tree *c_prev[3] = { NULL,... | vuln | Safe | Unknown |
BOOL license_read_scope_list(wStream* s, SCOPE_LIST* scopeList)
{
UINT32 i;
UINT32 scopeCount;
if (Stream_GetRemainingLength(s) < 4)
return FALSE;
Stream_Read_UINT32(s, scopeCount); /* ScopeCount (4 bytes) */
if (scopeCount > Stream_GetRemainingLength(s) / 4) /* every blob is at least 4 bytes */
return FALS... | vuln | Safe | Unknown |
static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
void *data, int *data_size,
const uint8_t *buf, int buf_size)
{
FlicDecodeContext *s = avctx->priv_data;
GetByteContext g2;
int pixel_ptr;
unsigned char pale... | vuln | Safe | C/C++ |
int
user_matches(const struct sudoers_parse_tree *parse_tree,
const struct passwd *pw, const struct member *m)
{
const struct sudoers_context *ctx = parse_tree->ctx;
const char *lhost = parse_tree->lhost ? parse_tree->lhost : ctx->runas.host;
const char *shost = parse_tree->shost ? parse_tree->shost : c... | vuln | Vulnerable | C/C++ |
@Override
public void onCreate(Bundle savedInstanceState) {
Log.i("Create " + this + " saved=" + (savedInstanceState != null));
super.onCreate(savedInstanceState);
if (savedInstanceState == null) {
Bundle args = getArguments();
if (args == null && !isStateSaved())
... | vuln | Safe | Java |
CKEDITOR.htmlDataProcessor = function( editor ) {
var dataFilter, htmlFilter,
that = this;
this.editor = editor;
/**
* Data filter used when processing input by {@link #toHtml}.
*
* @property {CKEDITOR.htmlParser.filter}
*/
this.dataFilter = dataFilter = new CKEDITOR.htmlParser.filter();
/**... | vuln | Vulnerable | JavaScript |
private void initialAcl() {
if (!this.serverConfig.isRopAclEnable()) {
log.info("The broker dose not enable acl");
return;
}
String authToken = this.serverConfig.getBrokerClientAuthenticationParameters();
getRemotingServer().registerRPCHook(new RPCHook() {
... | vuln | Safe | Java |
function refresh()
{
changed = true;
if (plugins.length == 0)
{
inner.innerHTML = mxUtils.htmlEntities(mxResources.get('noPlugins'));
}
else
{
inner.innerText = '';
for (var i = 0; i < plugins.length; i++)
{
var span = document.createElement('span');
span.style.whiteSpace = 'nowrap... | vuln | Safe | JavaScript |
static inline int pmd_large(pmd_t pte)
{
return pmd_flags(pte) & _PAGE_PSE;
} | vuln | Safe | Unknown |
@Override
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
Project project = ProjectManager.getInstance().getCurrentProject();
if (mCurrentFile.exists()) {
String text;
try {
tex... | vuln | Vulnerable | Java |
def _collateral(
self,
project_uuid: str,
pipeline_uuid: str,
old_path: str,
new_path: str,
):
"""Move a pipeline to another path, i.e. rename it."""
if not is_valid_project_relative_path(project_uuid, new_path):
raise error.OutOfProjectError(
... | vuln | Safe | Python |
public static void add(Line line) {
Preconditions.checkState(started);
TOOLTIP.add(line);
for (ITooltipComponent component : line.components) {
if (component instanceof PairComponent pair) {
colonOffset = Math.max(pair.key.getWidth(), colonOffset);
bre... | vuln | Safe | Java |
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, mobconf = require('./routes/mobileconfig')
, http = require('http')
, path = require('path');
var cookieParser = require('cookie-parser')
var app = express();
// all environments
app.set('port', process.env.... | vuln | Safe | JavaScript |
static int dvvideo_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
DVVideoContext *s = avctx->priv_data;
s->sys = dv_frame_profile(buf);
if (!s->sys || buf_size < s->sys->frame_size)
retur... | vuln | Vulnerable | C/C++ |
$event = mysqli_fetch_assoc($result);
if($queue == "active"){
$ged_command = "-drop -type $ged_type_nbr -queue $queue ";
foreach ($array_ged_packets as $key => $value) {
if($value["key"] == true){
$ged_command .= "\"".$event[$key]."\" ";
}
}
$ged_command = trim($ged_command, " ");
shell_... | vuln | Vulnerable | PHP |
ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
handle_t *handle, unsigned int reserv_clstrs)
{
struct buffer_head *bitmap_bh = NULL;
struct ext4_group_desc *gdp;
struct buffer_head *gdp_bh;
struct ext4_sb_info *sbi;
struct super_block *sb;
ext4_fsblk_t block;
int err, len;
BUG_ON(ac->ac_st... | vuln | Vulnerable | Unknown |
@app.route('/get_markets')
def get_markets():
asset_id = request.args.get('asset_id')
if not isObject(asset_id):
ws.send('{"id":1, "method":"call", "params":[0,"lookup_asset_symbols",[["' + asset_id + '"], 0]]}')
result_l = ws.recv()
j_l = json.loads(result_l)
asset_id = j_l["re... | vuln | Vulnerable | Python |
.catch(error => {
// There was an error with the session token
const result = {};
if (error && error.code === Parse.Error.INVALID_SESSION_TOKEN) {
result.error = error;
this.authCache.set(
sessionToken,
Promise.resolve(result),
this.config.... | vuln | Safe | JavaScript |
static int hfi1_file_close(struct inode *inode, struct file *fp)
{
struct hfi1_filedata *fdata = fp->private_data;
struct hfi1_ctxtdata *uctxt = fdata->uctxt;
struct hfi1_devdata *dd = container_of(inode->i_cdev,
struct hfi1_devdata,
user_cdev);
unsigned long flags, *ev;
fp->private_data =... | vuln | Safe | Unknown |
public SVNSSHAuthentication createSVNAuthentication(String kind) throws SVNException {
if(kind.equals(ISVNAuthenticationManager.SSH)) {
try {
Channel channel = Channel.current();
String privateKey;
if(channel!=nu... | vuln | Safe | Java |
public static void remove(ResourceLocation location)
{
biomeProviders.remove(location);
biomeIndices.clear();
indexResetListeners.forEach(listener -> listener.run());
TerraBlender.LOGGER.info("Removed biome provider " + location);
} | vuln | Vulnerable | Java |
static
char *url_canonize2(char *d, char const * const s, size_t n,
unsigned syn33,
unsigned m32, unsigned m64, unsigned m96)
{
size_t i = 0;
if (d == s)
for (;s[i] && i < n; d++, i++)
if (s[i] == '%')
break;
for (;s[i] && i < n; d++, i++) {
unsigned char c = s[i], h1, h2;
if (c ... | vuln | Vulnerable | C/C++ |
private JSONObject stdPeopleMessage(String actionType, Object properties)
throws JSONException {
final JSONObject dataObj = new JSONObject();
final String distinctId = getDistinctId(); // TODO ensure getDistinctId is thread safe
final String anonymousId = getAnonymous... | vuln | Vulnerable | Java |
def delete(self, path=None):
"""
Delete file or folder
"""
if not self.validate_request('delete'):
return unauthorized(self.ERROR_NOT_ALLOWED['Error'])
if self.shared_dir:
the_dir = self.shared_dir
else:
the_dir = self.dir if self.dir i... | vuln | Vulnerable | Python |
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2021 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except... | vuln | Safe | C/C++ |
bool cephx_verify_authorizer(CephContext *cct, KeyStore *keys,
bufferlist::iterator& indata,
CephXServiceTicketInfo& ticket_info,
std::unique_ptr<AuthAuthorizerChallenge> *challenge,
bufferlist& reply_bl)
{
__u8 authorizer_v;
uint32_t service_id;
uint64_t global_id;
CryptoKey ser... | vuln | Safe | Unknown |
/*
* 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 | Safe | Java |
int rsa_private( rsa_context *ctx,
int (*f_rng)(void *, unsigned char *, size_t),
void *p_rng,
const unsigned char *input,
unsigned char *output )
{
int ret;
size_t olen;
mpi T, T1, T2, Vi, Vf;
mpi_init( &T ); mpi_init( &T1 ); mpi_init... | vuln | Safe | Unknown |
search_in_range(regex_t* reg, const UChar* str, const UChar* end,
const UChar* start, const UChar* range, /* match start range */
const UChar* data_range, /* subject string range */
OnigRegion* region,
OnigOptionType option, OnigMatchParam* mp)
{
int r;
... | vuln | Vulnerable | C/C++ |
void netdev_del_completion(ReadLineState *rs, int nb_args, const char *str)
{
int len, count, i;
NetClientState *ncs[MAX_QUEUE_NUM];
if (nb_args != 2) {
return;
}
len = strlen(str);
readline_set_completion_index(rs, len);
count = qemu_find_net_clients_except(NULL, ncs, NET_CLIENT_OPT... | vuln | Safe | C/C++ |
@Override
public Future<Boolean> isConnectionDurationLimitReached(
final TenantObject tenant,
final SpanContext spanContext) {
Objects.requireNonNull(tenant);
final Span span = createSpan("verify connection duration limit", spanContext, tenant);
final Map<String, Ob... | vuln | Vulnerable | Java |
static av_cold int XAVS_init(AVCodecContext *avctx)
{
XavsContext *x4 = avctx->priv_data;
x4->sei_size = 0;
xavs_param_default(&x4->params);
x4->params.pf_log = XAVS_log;
x4->params.p_log_private = avctx;
x4->params.i_keyint_max = avctx->gop_size;
if (avctx->bit_... | vuln | Vulnerable | C/C++ |
// Copyright 2014 The Macaron 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 agree... | vuln | Vulnerable | Go |
GF_Err trak_box_size(GF_Box *s)
{
u32 pos=0;
GF_TrackBox *ptr = (GF_TrackBox *)s;
if (ptr->sample_encryption && ptr->sample_encryption->load_needed) {
if (!ptr->moov || !!ptr->moov->mov || !ptr->moov->mov->movieFileMap)
return GF_ISOM_INVALID_FILE;
GF_Err e = senc_Parse(ptr->moov->mov->movieFileMap->bs, ptr,... | vuln | Safe | C/C++ |
static BROTLI_INLINE void GetBlockLengthPrefixCode(uint32_t len, size_t* code,
uint32_t* n_extra, uint32_t* extra) {
*code = BlockLengthPrefixCode(len);
*n_extra = _kBrotliPrefixCodeRanges[*code].nbits;
*extra = len - _kBrotliPrefixCodeRanges[*code].offset;
} | vuln | Safe | Unknown |
static String applicationTagHeader(ApplicationInfo applicationInfo) {
String[][] tags = {
{"applicationId", "application-id", applicationInfo.getApplicationId()},
{"applicationVersion", "application-version", applicationInfo.getApplicationVersion()},
};
List<String> parts = new ArrayList<>();
... | vuln | Vulnerable | Java |
package com.salesmanager.shop.admin.controller.configurations;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
imp... | vuln | Vulnerable | Java |
static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_idx, InputStream *ist, int in_program)
{
AVStream *stream = ist->st;
AVCodecParameters *par;
AVCodecContext *dec_ctx;
char val_str[128];
const char *s;
AVRational sar, dar;
AVBPrint pbuf;
const AVCodecDescripto... | vuln | Vulnerable | Unknown |
private void setChoices(String... choices) {
this.originalInput = "";
this.choiceIndex = -1;
this.choices = choices;
} | vuln | Safe | Java |
package io.github.karlatemp.unsafeaccessor;
import org.jetbrains.annotations.Contract;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Field;
import java.util.function.Consumer;
/**
* JVM Root Access.
*
* @since 1.1.0... | vuln | Vulnerable | Java |
static int wc_RsaFunctionSync(const byte* in, word32 inLen, byte* out,
word32* outLen, int type, RsaKey* key, WC_RNG* rng)
{
#ifndef WOLFSSL_SP_MATH
#ifdef WOLFSSL_SMALL_STACK
mp_int* tmp = NULL;
#ifdef WC_RSA_BLINDING
mp_int* rnd = NULL;
mp_int* rndi = NULL;
#endif
#else
mp_in... | vuln | Vulnerable | C/C++ |
static void xilinx_spips_realize(DeviceState *dev, Error **errp)
{
XilinxSPIPS *s = XILINX_SPIPS(dev);
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
XilinxSPIPSClass *xsc = XILINX_SPIPS_GET_CLASS(s);
int i;
DB_PRINT_L(0, "realized spips\n");
s->spi = g_new(SSIBus *, s->num_busses);
for (i = 0; i ... | vuln | Vulnerable | C/C++ |
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build ignore
/*
Input to cgo -godefs. See README.md
*/
// +godefs map struct_in_addr [4]byte /* in_addr */
// +godefs map struct_in6_addr [16]byte /* in6... | vuln | Vulnerable | Go |
static void pci_nic_uninit(PCIDevice *pci_dev)
{
EEPRO100State *s = DO_UPCAST(EEPRO100State, dev, pci_dev);
vmstate_unregister(&pci_dev->qdev, s->vmstate, s);
g_free(s->vmstate);
eeprom93xx_free(&pci_dev->qdev, s->eeprom);
qemu_del_nic(s->nic);
} | vuln | Safe | C/C++ |
static Image *ReadTIFFImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
const char
*option;
float
*chromaticity,
x_position,
y_position,
x_resolution,
y_resolution;
Image
*image;
int
tiff_status;
MagickBooleanType
status;
MagickSizeType
number_pixe... | vuln | Safe | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.