code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
package com.salesmanager.shop.admin.controller.products;
import com.salesmanager.core.business.services.catalog.category.CategoryService;
import com.salesmanager.core.business.services.catalog.product.ProductService;
import com.salesmanager.core.business.utils.ajax.AjaxPageableResponse;
import com.salesmanager.core.bu... | vuln | Safe | Java |
static int nr_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t size, int flags)
{
struct sock *sk = sock->sk;
struct sockaddr_ax25 *sax = (struct sockaddr_ax25 *)msg->msg_name;
size_t copied;
struct sk_buff *skb;
int er;
/*
* This works for seqpacket too. The receiver has ord... | vuln | Vulnerable | C/C++ |
// Copyright (C) 2015 University of Dundee & Open Microscopy Environment.
// All rights reserved.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
//... | vuln | Safe | Python |
private byte[] receiveMessage(final FileDescriptor fd) throws ErrnoException,
InterruptedIOException, EOFException, ProtocolException {
final byte[] lengthBits = new byte[4];
readFully(fd, lengthBits, 0, lengthBits.length);
final ByteBuffer bb = ByteBuffer.wrap(lengthBits);
... | vuln | Safe | Java |
@Override
@Nullable
public String read() {
LOG.info("Trying to read feature toggles from bootstrap file found at {}", path);
try {
File file = getFile(path);
return fileAsString(file);
} catch (FileNotFoundException ioEx) {
LOG.warn("Could not find fil... | vuln | Vulnerable | Java |
public void add(Line line) {
Preconditions.checkState(current == this);
tooltip.add(line);
for (ITooltipComponent component : line.components) {
if (component instanceof PairComponent pair) {
colonOffset = Math.max(pair.key.getWidth(), colonOffset);
br... | vuln | Vulnerable | Java |
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Sof... | vuln | Safe | Java |
static void pnv_chip_realize(DeviceState *dev, Error **errp)
{
PnvChip *chip = PNV_CHIP(dev);
Error *error = NULL;
PnvChipClass *pcc = PNV_CHIP_GET_CLASS(chip);
char *typename = pnv_core_typename(pcc->cpu_model);
size_t typesize = object_type_get_instance_size(typename);
int i, core_hwid;
if... | vuln | Vulnerable | C/C++ |
@Override
public void setSeed(long seed) {
if (Thread.currentThread() != this.owner.get()) throw new ConcurrentModificationException();
super.setSeed(seed);
} | vuln | Vulnerable | Java |
@SubscribeEvent
public void onPacketRead(PacketReadEvent event) {
if (ModConfig.drillFix && Utils.inSkyblock) {
Minecraft mc = Minecraft.getMinecraft();
EntityPlayer player = mc.thePlayer;
boolean isDown = mc.gameSettings.keyBindUseItem.isKeyDown();
if (playe... | vuln | Safe | Java |
import dayjs from 'dayjs'
import customParseFormat from 'dayjs/plugin/customParseFormat'
import { t } from './i18n.js'
import Projects from '../api/projects/projects.js'
import projectUsers from '../api/users/users.js'
import { periodToDates } from './periodHelpers.js'
import { getGlobalSetting, getUserSetting } from '... | vuln | Safe | JavaScript |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2018-2022
* All rights reserved
*
* This file is part of GPAC / RAW PCM reframer filter
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser Gene... | vuln | Vulnerable | C/C++ |
private /* static */ void withinBlockquoteIndividual(StringBuilder out, Spanned text, int start,
int end) {
List<Boolean> levels = new ArrayList<>();
int next = -1;
for (int i = start; i <= end; i = next) {
try {
nex... | vuln | Safe | Java |
void close_connection_now(h2o_http2_conn_t *conn)
{
/* mark as is_closing here to prevent sending any more frames */
conn->state = H2O_HTTP2_CONN_STATE_IS_CLOSING;
h2o_http2_stream_t *stream;
assert(!h2o_timer_is_linked(&conn->_write.timeout_entry));
kh_foreach_value(conn->streams, stream, { h2o_... | vuln | Vulnerable | C/C++ |
int af_get_page(AFFILE *af,int64_t pagenum,unsigned char *data,size_t *bytes)
{
uint32_t arg=0;
size_t page_len=0;
if (af_trace){
fprintf(af_trace,"af_get_page(%p,pagenum=%" I64d ",buf=%p,bytes=%u)\n",af,pagenum,data,(int)*bytes);
}
/* Find out the size of the segment and if it is compressed or n... | vuln | Safe | C/C++ |
static ssize_t ucma_write(struct file *filp, const char __user *buf,
size_t len, loff_t *pos)
{
struct ucma_file *file = filp->private_data;
struct rdma_ucm_cmd_hdr hdr;
ssize_t ret;
if (WARN_ON_ONCE(!ib_safe_file_access(filp)))
return -EACCES;
if (len < sizeof(hdr))
return -EINVAL;
if (copy_fro... | vuln | Safe | C/C++ |
static uint32_t m5206_mbar_readb(void *opaque, target_phys_addr_t offset)
{
m5206_mbar_state *s = (m5206_mbar_state *)opaque;
offset &= 0x3ff;
if (offset > 0x200) {
hw_error("Bad MBAR read offset 0x%x", (int)offset);
}
if (m5206_mbar_width[offset >> 2] > 1) {
uint16_t val;
va... | vuln | Vulnerable | C/C++ |
static void eb_mul_rtnaf_imp(eb_t r, const eb_t p, const bn_t k) {
int i, n;
int8_t tnaf[RLC_FB_BITS + 8], u;
eb_t t[1 << (EB_WIDTH - 2)];
size_t l;
if (eb_curve_opt_a() == RLC_ZERO) {
u = -1;
} else {
u = 1;
}
RLC_TRY {
/* Prepare the precomputation table. */
for (i = 0; i < (1 << (EB_WIDTH - 2)); i+... | vuln | Safe | C/C++ |
void isa_ne2000_init(int base, qemu_irq irq, NICInfo *nd)
{
NE2000State *s;
qemu_check_nic_model(nd, "ne2k_isa");
s = qemu_mallocz(sizeof(NE2000State));
register_ioport_write(base, 16, 1, ne2000_ioport_write, s);
register_ioport_read(base, 16, 1, ne2000_ioport_read, s);
register_ioport_write(bas... | vuln | Safe | C/C++ |
main(int argc, char *argv[])
{
int i, c;
FILE *ifp = 0, *ofp = 0;
const char *ifp_filename = "<stdin>";
const char *ofp_filename = "<stdout>";
const char *set_font_name = 0;
struct font_reader fr;
uint32_t rfork_len;
int raw = 0, macbinary = 1, applesingle = 0, appledouble = 0, binhex = 0;
Clp_Parser... | vuln | Safe | Unknown |
static HENHMETAFILE ReadEnhMetaFile(const char *path,ssize_t *width,
ssize_t *height)
{
#pragma pack( push, 2 )
typedef struct
{
DWORD dwKey;
WORD hmf;
SMALL_RECT bbox;
WORD wInch;
DWORD dwReserved;
WORD wCheckSum;
} APMHEADER, *PAPMHEADER;
#pragma pack( pop )
DWORD
dwSize;
ENH... | vuln | Vulnerable | C/C++ |
private static boolean checkIp(String ip) {
String regex = "^\\s*(((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|... | vuln | Vulnerable | Java |
res_nmkquery(res_state statp,
int op, /* opcode of query */
const char *dname, /* domain name */
int class, int type, /* class and type of query */
const u_char *data, /* resource record data */
int datalen, /* length of data */
const u_char *newrr_in, /* new rr for modify or app... | vuln | Vulnerable | Unknown |
static int nfc_llcp_build_gb(struct nfc_llcp_local *local)
{
u8 *gb_cur, version, version_length;
u8 lto_length, wks_length, miux_length;
u8 *version_tlv = NULL, *lto_tlv = NULL,
*wks_tlv = NULL, *miux_tlv = NULL;
__be16 wks = cpu_to_be16(local->local_wks);
u8 gb_len = 0;
int ret = 0;
version = LLCP_V... | vuln | Safe | C/C++ |
(function (Prism) {
Prism.languages.puppet = {
'heredoc': [
// Matches the content of a quoted heredoc string (subject to interpolation)
{
pattern: /(@\("([^"\r\n\/):]+)"(?:\/[nrts$uL]*)?\).*(?:\r?\n|\r))(?:.*(?:\r?\n|\r(?!\n)))*?[ \t]*\|?[ \t]*-?[ \t]*\2/,
lookbehind: true,
alias: 'string',
in... | vuln | Safe | JavaScript |
e: function (str) {
/* BEGIN MODIFICATION */
// Removed handling of tree.JavaScript
return new(tree.Anonymous)(str);
/* END MODIFICATION */
}, | vuln | Safe | JavaScript |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | vuln | Safe | Python |
jas_matrix_t *jas_seq2d_input(FILE *in)
{
jas_matrix_t *matrix;
int i;
int j;
long x;
int numrows;
int numcols;
int xoff;
int yoff;
if (fscanf(in, "%d %d", &xoff, &yoff) != 2)
return 0;
if (fscanf(in, "%d %d", &numcols, &numrows) != 2)
return 0;
if (!(matrix = jas_seq2d_create(xoff, yoff, xoff + numcols... | vuln | Vulnerable | C/C++ |
void Phase2() final {
Local<Context> context_handle = Deref(context);
Context::Scope context_scope{context_handle};
Local<Value> key_inner = key->CopyInto();
Local<Object> object = Local<Object>::Cast(Deref(reference));
bool allow = [&]() {
if (!inherit) {
if (key_inner->IsName()) {
return... | vuln | Vulnerable | Unknown |
private float staxExtractXsltVersion(final Source xsltStylesheet) throws XPathException {
try {
final XMLInputFactory factory = XMLInputFactory.newInstance();
final XMLEventReader eventReader =
factory.createXMLEventReader(xsltStylesheet);
while (eventRea... | vuln | Vulnerable | Java |
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt)
{
AVFrame *frame = data;
const uint8_t *buf = avpkt->data;
const uint8_t *buf_end = buf + avpkt->size;
KgvContext * const c = avctx->priv_data;
int offsets[8];
uint8_t *out, *prev;... | vuln | Safe | C/C++ |
RC4::RC4(unsigned char const* key_data, int key_len)
{
if (key_len == -1)
{
key_len = strlen(reinterpret_cast<char const*>(key_data));
}
for (int i = 0; i < 256; ++i)
{
key.state[i] = i;
}
key.x = 0;
key.y = 0;
int i1 = 0;
int i2 = 0;
for (int i = 0; i < 256; ++i)
... | vuln | Vulnerable | Unknown |
import difflib
from bs4 import BeautifulSoup
from django.utils.encoding import force_str
from django.utils.html import escape, format_html, format_html_join
from django.utils.safestring import mark_safe
from django.utils.text import capfirst
from django.utils.translation import ugettext_lazy as _
from wagtail.core im... | vuln | Vulnerable | Python |
public static float getRenderWidth(Player player)
{
CarryOnData carry = CarryOnDataManager.getCarryData(player);
if(carry.isCarrying(CarryType.BLOCK))
{
BlockState state = getRenderState(player);
VoxelShape shape = state.getShape(player.level, player.blockPosition());
if(shape == null || shape.isEmpty()... | vuln | Safe | Java |
public static void handleAttack(final Mission mission, final Fleet fleet,
final PlayerInfo info, final Game game) {
if (mission != null && mission.getType() == MissionType.ATTACK) {
if (mission.getPhase() == MissionPhase.PLANNING
&& mission.getTargetPlanet() != null && info.getMissions()
... | vuln | Vulnerable | Java |
def rename(self, ref, to_name):
"""Rename a local file or folder
Return the actualized info object.
"""
new_name = safe_filename(to_name)
source_os_path = self._abspath(ref)
parent = ref.rsplit(u'/', 1)[0]
old_name = ref.rsplit(u'/', 1)[1]
parent = u'/' ... | vuln | Safe | Python |
File getFile(String source) {
if (baseDir == null) {
return Checks.checkAbsolute(source, "source");
}
return FileUtil.resolveFile(baseDir, source);
} | vuln | Vulnerable | Java |
/*
* Copyright 2022 Thoughtworks, Inc.
*
* 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 agr... | vuln | Vulnerable | Java |
const bootbox = require('bootbox');
require('../services/Requisitions');
const RequisitionNode = require('../model/RequisitionNode');
const RequisitionMetaDataEntry = require('../model/RequisitionMetaDataEntry');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(functi... | vuln | Safe | Java |
void
invalidNBits ()
{
throw InputExc ("Error in header for Huffman-encoded data "
"(invalid number of bits).");
} | vuln | Vulnerable | C/C++ |
static void type_initialize(TypeImpl *ti)
{
TypeImpl *parent;
if (ti->class) {
return;
}
ti->class_size = type_class_get_size(ti);
ti->instance_size = type_object_get_size(ti);
ti->class = g_malloc0(ti->class_size);
parent = type_get_parent(ti);
if (parent) {
type_initial... | vuln | Safe | C/C++ |
static void dump_json_image_info(ImageInfo *info)
{
QString *str;
QmpOutputVisitor *ov = qmp_output_visitor_new();
QObject *obj;
visit_type_ImageInfo(qmp_output_get_visitor(ov), NULL, &info,
&error_abort);
obj = qmp_output_get_qobject(ov);
str = qobject_to_json_pretty(ob... | vuln | Safe | C/C++ |
static void usbredir_interrupt_packet(void *priv, uint64_t id,
struct usb_redir_interrupt_packet_header *interrupt_packet,
uint8_t *data, int data_len)
{
USBRedirDevice *dev = priv;
uint8_t ep = interrupt_packet->endpoint;
DPRINTF("interrupt-in status %d ep %02X len %d id %"PRIu64"\n",
i... | vuln | Vulnerable | C/C++ |
@Override
public void afterTextChanged(Editable editable) {
if (cbSecure == null)
return;
Uri uri = Uri.parse(editable.toString());
boolean secure = UriHelper.isSecure(uri);
boolean hyperlink = UriHelper.isHyperLink(uri);
... | vuln | Safe | Java |
function getResourceGroupID($groupdname) {
list($type, $name) = explode('/', $groupdname);
$query = "SELECT g.id "
. "FROM resourcegroup g, "
. "resourcetype t "
. "WHERE g.name = '$name' AND "
. "t.name = '$type' AND "
. "g.resourcetypeid = t.id";
$qh = doQue... | vuln | Vulnerable | PHP |
(function()
{
// Adds Arrow shapes with control points
Sidebar.prototype.addArrows2Palette = function()
{
var s = 'html=1;shadow=0;dashed=0;align=center;verticalAlign=middle;shape=mxgraph.arrows2.';
var s2 = 'html=1;shadow=0;dashed=0;fillColor=none;strokeColor=none;shape=mxgraph.arrows2.';
var gn = 'mxgraph.ar... | vuln | Vulnerable | Java |
def _run_ssh(self, cmd_list, check_exit=True, attempts=1):
utils.check_ssh_injection(cmd_list)
command = ' '. join(cmd_list)
if not self.sshpool:
self.sshpool = utils.SSHPool(self.config.san_ip,
self.config.san_ssh_port,
... | vuln | Safe | Python |
private void unregisterAppInstallReceiver() {
if (appInstallReceiver != null) {
context.unregisterReceiver(appInstallReceiver);
appInstallReceiver = null;
}
} | vuln | Vulnerable | Java |
def fixture(key, opts = {})
memo = Fixtures[key]
return memo if memo
dir = opts[:dir] || File.expand_path('../../fixtures', __FILE__)
yaml = Pathname.new(File.join(dir, "fixture_#{key}.yaml"))
json = Pathname.new(File.join(dir, "fixture_#{key}.json"))
txt = Pathname.new(File.join(dir, "fixture_... | vuln | Safe | Ruby |
int ff_rm_read_mdpr_codecdata(AVFormatContext *s, AVIOContext *pb,
AVStream *st, RMStream *rst,
unsigned int codec_data_size, const uint8_t *mime)
{
unsigned int v;
int size;
int64_t codec_pos;
int ret;
if (codec_data_size > INT_MAX)
... | vuln | Safe | C/C++ |
@WorkerThread
public static void extract(@NonNull @TarType String type, @NonNull File[] sources, @NonNull File dest,
@Nullable String[] filters, @Nullable String[] exclude)
throws IOException, RemoteException {
try (SplitInputStream sis = new SplitInputStream(so... | vuln | Safe | Java |
OMX_ERRORTYPE omx_video::free_buffer(OMX_IN OMX_HANDLETYPE hComp,
OMX_IN OMX_U32 port,
OMX_IN OMX_BUFFERHEADERTYPE* buffer)
{
(void)hComp;
OMX_ERRORTYPE eRet = OMX_ErrorNone;
unsigned int nPortIndex;
DEBUG_PRINT_LOW("In for encoder free_buffer");
if (m_state == OMX_... | vuln | Safe | C/C++ |
@SuppressLint("ClickableViewAccessibility") //We do accessibility manually.
@Override
public boolean onTouch(final View view, MotionEvent event) {
if (!isResumed()) {
Log.w(TAG, "The UI is already gone, no need to update anything; seen on Android 7.1.2");
return false;
}
... | vuln | Safe | Java |
public void close() {
this.open = false;
} | vuln | Vulnerable | Java |
package com.salesmanager.shop.admin.controller.products;
import com.salesmanager.core.business.services.catalog.product.ProductService;
import com.salesmanager.core.business.services.catalog.product.attribute.ProductAttributeService;
import com.salesmanager.core.business.services.catalog.product.attribute.ProductOptio... | vuln | Vulnerable | Java |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | vuln | Vulnerable | Java |
static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define SkipLinesOp 0x01
#define SetColorOp 0x02
#define SkipPixelsOp 0x03
#define ByteDataOp 0x05
#define RunDataOp 0x06
#define EOFOp 0x07
#define ThrowRLEException(exception,message) \
{ \
if (colormap != (unsigned char *) ... | vuln | Safe | Unknown |
@Override
public boolean isInitialized() {
return mSource.isInitialized();
} | vuln | Vulnerable | Java |
static int tcp_get_msgfd(CharDriverState *chr)
{
TCPCharDriver *s = chr->opaque;
return s->msgfd;
} | vuln | Vulnerable | C/C++ |
ossl_cipher_set_key(VALUE self, VALUE key)
{
EVP_CIPHER_CTX *ctx;
int key_len;
StringValue(key);
GetCipher(self, ctx);
key_len = EVP_CIPHER_CTX_key_length(ctx);
if (RSTRING_LEN(key) != key_len)
ossl_raise(rb_eArgError, "key must be %d bytes", key_len);
if (EVP_CipherInit_ex(ctx, NULL, NU... | vuln | Vulnerable | Unknown |
static int init_input_threads(void)
{
int i, ret;
if (nb_input_files == 1)
return 0;
for (i = 0; i < nb_input_files; i++) {
InputFile *f = input_files[i];
if (f->ctx->pb ? !f->ctx->pb->seekable :
strcmp(f->ctx->iformat->name, "lavfi"))
f->non_blocking = 1;
... | vuln | Safe | C/C++ |
/* SSDP responder
*
* Copyright (c) 2017 Joachim Nilsson <troglobit@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWA... | vuln | Safe | C/C++ |
static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define BoundingBox "BoundingBox:"
#define BeginDocument "BeginDocument:"
#define BeginXMPPacket "<?xpacket begin="
#define EndXMPPacket "<?xpacket end="
#define ICCProfile "BeginICCProfile:"
#define CMYKCustomColor "CMYKCustomColor:... | vuln | Vulnerable | C/C++ |
static int flakey_ioctl(struct dm_target *ti, unsigned int cmd, unsigned long arg)
{
struct flakey_c *fc = ti->private;
return __blkdev_driver_ioctl(fc->dev->bdev, fc->dev->mode, cmd, arg);
} | vuln | Vulnerable | C/C++ |
function PMA_queryChart(data, columnNames, settings) {
if ($('#querychart').length === 0) {
return;
}
var jqPlotSettings = {
title : {
text : settings.title,
escapeHtml: true
},
grid : {
drawBorder : false,
shadow : false,
... | vuln | Vulnerable | JavaScript |
static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
char
cache_filename[MagickPathExtent],
id[MagickPathExtent],
keyword[MagickPathExtent],
*options;
const unsigned char
*p;
GeometryInfo
geometry_info;
Image
*image;
int
c;
LinkedListInfo
... | vuln | Vulnerable | C/C++ |
private boolean hasPermission(String sid, Permission permission, RoleType roleType, AccessControlled controlledItem) {
final Set<Permission> permissions = getImplyingPermissions(permission);
final boolean[] hasPermission = { false };
// Walk through the roles, and only add the roles having the given permis... | vuln | Vulnerable | Java |
static av_cold int prores_encode_init(AVCodecContext *avctx)
{
int i;
ProresContext* ctx = avctx->priv_data;
if (avctx->pix_fmt != PIX_FMT_YUV422P10LE) {
av_log(avctx, AV_LOG_ERROR, "need YUV422P10\n");
return -1;
}
if (avctx->width & 0x1) {
av_log(avctx, AV_LOG_ERROR,
... | vuln | Vulnerable | C/C++ |
BaseBackup(void)
{
PGresult *res;
char *sysidentifier;
uint32 latesttli;
uint32 starttli;
char current_path[MAXPGPATH];
char escaped_label[MAXPGPATH];
int i;
char xlogstart[64];
char xlogend[64];
int minServerMajor,
maxServerMajor;
int serverMajor;
/*
* Connect in replication mode to... | vuln | Safe | Unknown |
public ResourceLocation getFrame(int ticks, float partialTicks)
{
int tick = (int) ((ticks + partialTicks) * 5 % this.duration);
int duration = 0;
int index = 0;
for (int delay : this.delays)
{
duration += delay;
if (tick < duration)
{
... | vuln | Vulnerable | Java |
void NuPlayer::GenericSource::notifyPreparedAndCleanup(status_t err) {
if (err != OK) {
mMetaDataSize = -1ll;
mContentType = "";
mSniffedMIME = "";
{
sp<DataSource> dataSource = mDataSource;
sp<NuCachedSource2> cachedSource = mCachedSource;
sp<DataSource> ht... | vuln | Safe | Unknown |
void setMinimumSizeTo(Dimension minSize) {
if (nativePtr != 0) {
nativeSetMinimumSize(nativePtr, minSize.width, minSize.height);
}
} | vuln | Vulnerable | Java |
static AVFilterBufferRef *copy_buffer_ref(AVFilterContext *ctx,
AVFilterBufferRef *ref)
{
AVFilterLink *outlink = ctx->outputs[0];
AVFilterBufferRef *buf;
int channels, data_size, i;
switch (outlink->type) {
case AVMEDIA_TYPE_VIDEO:
buf = avfilter_ge... | vuln | Safe | C/C++ |
static void ahash_op_unaligned_done(struct crypto_async_request *req, int err)
{
struct ahash_request *areq = req->data;
if (err == -EINPROGRESS) {
ahash_notify_einprogress(areq);
return;
}
/*
* Restore the original request, see ahash_op_unaligned() for what
* goes where.
*
* The "struct ahash_request... | vuln | Safe | Unknown |
protected Spanned toSpanned(final int maxLength) {
SpannableStringBuilder spanned = new SpannableStringBuilder();
boolean exceeded = false;
if (maxLength == 0) {
exceeded = true;
} else if (isPlain()) {
CharSequence text = getText();
if (text.length()... | vuln | Vulnerable | Java |
@Override
public TaskQuery caseVariableValueEquals(Object variableValue) {
if (orActive) {
currentOrQueryObject.variableValueEquals(variableValue, ScopeTypes.CMMN);
} else {
variableValueEquals(variableValue, ScopeTypes.CMMN);
}
return this;
} | vuln | Vulnerable | Java |
import { isTestSuiteActive } from "../../support/page_objects/projectConstants";
import { mainPage } from "../../support/page_objects/mainPage";
let formViewURL;
export const genTest = (apiType, dbType) => {
if (!isTestSuiteActive(apiType, dbType)) return;
describe(`${apiType.toUpperCase()} api - FORM view`,... | vuln | Vulnerable | JavaScript |
@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
outState.putString("fair:link", etLink == null ? null : etLink.getText().toString());
super.onSaveInstanceState(outState);
} | vuln | Safe | Java |
public Fn<MediaPackage, Opt<WorkflowInstance>> applyWorkflow(final ConfiguredWorkflow wf) {
return new Fn<MediaPackage, Opt<WorkflowInstance>>() {
@Override public Opt<WorkflowInstance> apply(MediaPackage mp) {
try {
return Opt.some(wfs.start(wf.getWorkflowDefinition(), mp, wf.getParameters(... | vuln | Safe | Java |
def get_by_name(self, name, project):
return (
Person.query.filter(Person.name == name)
.filter(Person.project_id == project.id)
.one()
) | vuln | Safe | Python |
/*
* 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 |
static int ext4_protect_reserved_inode(struct super_block *sb,
struct ext4_system_blocks *system_blks,
u32 ino)
{
struct inode *inode;
struct ext4_sb_info *sbi = EXT4_SB(sb);
struct ext4_map_blocks map;
u32 i = 0, num;
int err = 0, n;
if ((ino < EXT4_ROOT_INO) ||
(ino > le32_to_cpu(sbi... | vuln | Vulnerable | Unknown |
static void follow_dotdot(struct nameidata *nd)
{
if (!nd->root.mnt)
set_root(nd);
while(1) {
struct dentry *old = nd->path.dentry;
if (nd->path.dentry == nd->root.dentry &&
nd->path.mnt == nd->root.mnt) {
break;
}
if (nd->path.dentry != nd->path.mnt->mnt_root) {
/* rare case of legitimate... | vuln | Vulnerable | C/C++ |
static int usb_ehci_initfn(PCIDevice *dev)
{
EHCIState *s = DO_UPCAST(EHCIState, dev, dev);
uint8_t *pci_conf = s->dev.config;
int i;
pci_set_byte(&pci_conf[PCI_CLASS_PROG], 0x20);
pci_set_byte(&pci_conf[PCI_CAPABILITY_LIST], 0x00);
pci_set_byte(&pci_conf[PCI_INTERRUPT_PIN], 4);
p... | vuln | Vulnerable | C/C++ |
kg_unseal_v1(context, minor_status, ctx, ptr, bodysize, message_buffer,
conf_state, qop_state, toktype)
krb5_context context;
OM_uint32 *minor_status;
krb5_gss_ctx_id_rec *ctx;
unsigned char *ptr;
int bodysize;
gss_buffer_t message_buffer;
int *conf_state;
gss_qop_t *qop_sta... | vuln | Safe | Unknown |
QPDFWriter::unparseObject(QPDFObjectHandle object, int level,
int flags, size_t stream_length,
bool compress)
{
QPDFObjGen old_og = object.getObjGen();
int child_flags = flags & ~f_stream;
std::string indent;
for (int i = 0; i < level; ++i)
{
indent += " ";
}
... | vuln | Safe | Unknown |
from __future__ import print_function
import json
import sys
import errno
import argparse
import os
import pipes
import pprint
import re
import shlex
import subprocess
import shutil
import bz2
import io
from distutils.version import StrictVersion
# If not run from node/, cd to node/.
os.chdir(os.path.dirname(__file_... | vuln | Vulnerable | JavaScript |
/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2002-2014 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
*
* OpenNMS(... | vuln | Vulnerable | Java |
static int __key_instantiate_and_link(struct key *key,
struct key_preparsed_payload *prep,
struct key *keyring,
struct key *authkey,
struct assoc_array_edit **_edit)
{
int ret, awaken;
key_check(key);
key_check(keyring);
awaken = 0;
ret = -EBUSY;
mutex_lock(&key_construc... | vuln | Safe | C/C++ |
$contents[] = ['class' => 'text-center', 'text' => tep_draw_bootstrap_button(IMAGE_SAVE, 'fas fa-save', null, 'primary', null, 'btn-success xxx text-white mr-2') . tep_draw_bootstrap_button(IMAGE_CANCEL, 'fas fa-times', tep_href_link('zones.php', 'page=' . (int)$_GET['page']), null, null, 'btn-light')]; | vuln | Safe | PHP |
static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
static long _perf_ioctl(struct perf_event *event, unsigned int cmd, unsigned long arg)
{
void (*func)(struct perf_event *);
u32 flags = arg;
switch (cmd) {
case PERF_EVENT_IOC_ENABLE:
func = _perf_event_enable;
break;
case ... | vuln | Safe | C/C++ |
static void bastardized_rice_decompress(ALACContext *alac,
int32_t *output_buffer,
int output_size,
int readsamplesize,
int rice_initialhistory,
int rice... | vuln | Vulnerable | C/C++ |
from __future__ import absolute_import
import datetime
import logging
import os
import re
import socket
import warnings
from socket import error as SocketError
from socket import timeout as SocketTimeout
from .packages import six
from .packages.six.moves.http_client import HTTPConnection as _HTTPConnection
from .pack... | vuln | Safe | Python |
def _map_vol_to_host(self, volume_name, host_name):
"""Create a mapping between a volume to a host."""
LOG.debug(_('enter: _map_vol_to_host: volume %(volume_name)s to '
'host %(host_name)s')
% {'volume_name': volume_name, 'host_name': host_name})
# Check i... | vuln | Vulnerable | Python |
static void get_info_from_frame (mpeg2ps_stream_t *sptr,
u8 *buffer,
u32 buflen)
{
if (sptr->is_video) {
if (MPEG12_ParseSeqHdr(buffer, buflen,
&sptr->have_mpeg2,
&sptr->h,
&sp... | vuln | Safe | C/C++ |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
twisted.web.util and twisted.web.template merged to avoid cyclic deps
"""
import io
import linecache
import warnings
from collections import OrderedDict
from html import escape
from typing import (
IO,
Any,
AnyStr,
Callable,
... | vuln | Safe | Python |
static void rtas_set_tce_bypass(sPAPREnvironment *spapr, uint32_t token,
uint32_t nargs, target_ulong args,
uint32_t nret, target_ulong rets)
{
VIOsPAPRBus *bus = spapr->vio_bus;
VIOsPAPRDevice *dev;
uint32_t unit, enable;
if (nargs != 2) {... | 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 void redirectToPage(final HttpServletRequest req, final HttpServletResponse res)
throws IOException {
Object originalRequestUrl = req.getSession().getAttribute(REQUESTED_URL);
if (originalRequestUrl != null) {
res.sendRedirect(req.getContextPath() + originalRequestUrl);
} else {
re... | vuln | Safe | Java |
setkey_principal3_2_svc(setkey3_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg;
gss_buffer_desc client_name = GSS_C_EMPTY_BUFFER;
gss_buffer_desc service_name = GSS_C_EMPTY_BUFFER;
OM_uint32 ... | vuln | Safe | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.