code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
memxor(void *dst_in, const void *src_in, size_t n)
{
unsigned char *dst = dst_in;
const unsigned char *src = src_in;
if (n >= WORD_T_THRESH)
{
unsigned i;
unsigned offset;
size_t nwords;
/* There are at least some bytes to compare. No need to test
for N == 0 in this alignment loop.... | vuln | Safe | Unknown |
static int whereIndexExprTransColumn(Walker *p, Expr *pExpr){
if( pExpr->op==TK_COLUMN ){
IdxExprTrans *pX = p->u.pIdxTrans;
if( pExpr->iTable==pX->iTabCur && pExpr->iColumn==pX->iTabCol ){
assert( pExpr->y.pTab!=0 );
pExpr->affExpr = sqlite3TableColumnAffinity(pExpr->y.pTab,pExpr->iColumn);
... | vuln | Safe | C/C++ |
public void updateFighterDesign() {
ShipDesignLab lab = lab();
// recalculate current design's damage vs. current targets
ShipDesign currDesign = lab.fighterDesign();
// if we don't have any faster engines
if (currDesign.engine() == lab.fastestEngine() && currDesign.acti... | vuln | Safe | Java |
static int decode_trns_chunk(AVCodecContext *avctx, PNGDecContext *s,
uint32_t length)
{
int v, i;
if (s->color_type == PNG_COLOR_TYPE_PALETTE) {
if (length > 256 || !(s->state & PNG_PLTE))
return AVERROR_INVALIDDATA;
for (i = 0; i < length; i++) {
... | vuln | Vulnerable | C/C++ |
def zmi_page_request(self, *args, **kwargs):
request = self.REQUEST
RESPONSE = request.RESPONSE
SESSION = request.SESSION
self._zmi_page_request()
RESPONSE.setHeader('Expires',DateTime(request['ZMI_TIME']-10000).toZone('GMT+1').rfc822())
RESPONSE.setHeader('Cache-Control', 'no-cache'... | vuln | Vulnerable | Python |
static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
{
/*
This is how the time string is formatted:
snprintf(p, sizeof(p), "%02d%02d%02d%02d%02d%02dZ",ts->tm_year%100,
ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec);
*/
time_t ret;
struct tm thetime;
char * strbuf;
... | vuln | Safe | C/C++ |
static struct hlist_head *rds_conn_bucket(const struct in6_addr *laddr,
const struct in6_addr *faddr)
{
static u32 rds6_hash_secret __read_mostly;
static u32 rds_hash_secret __read_mostly;
u32 lhash, fhash, hash;
net_get_random_once(&rds_hash_secret, sizeof(rds_hash_secret));
net_get_random_once(&rds6_has... | vuln | Vulnerable | C/C++ |
int meth_get_head(struct transaction_t *txn, void *params)
{
struct meth_params *gparams = (struct meth_params *) params;
const char **hdr;
struct mime_type_t *mime = NULL;
int ret = 0, r = 0, precond, rights;
const char *data = NULL;
unsigned long datalen = 0, offset = 0;
struct buf msg_buf... | vuln | Safe | Unknown |
int dbd_db_login(SV* dbh, imp_dbh_t* imp_dbh, char* dbname, char* user,
char* password) {
#ifdef dTHR
dTHR;
#endif
dTHX;
D_imp_xxh(dbh);
if (DBIc_TRACE_LEVEL(imp_xxh) >= 2)
PerlIO_printf(DBIc_LOGPIO(imp_xxh),
"imp_dbh->connect: dsn = %s, uid = %s, pwd = %s\n",
dbname ? dbname : "NULL",
user... | vuln | Vulnerable | 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 | Vulnerable | Python |
@Override
public void follow() {
Building core = player.closestCore();
if (core == null) return;
Item item = items.min(i -> indexer.hasOre(i) && player.unit().canMine(i), i -> core.items.get(i));
if (item == null) return;
if (player.unit().maxAccepted(item) == 0) { // drop o... | vuln | Safe | Java |
base::ProcessHandle StartProcessWithAccess(CommandLine* cmd_line,
const FilePath& exposed_dir) {
const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
content::ProcessType type;
std::string type_str = cmd_line->GetSwitchValueASCII(switches::kProces... | vuln | Vulnerable | C/C++ |
function convertPageToImage() {
exec(convertCommand, function (err, stdout, stderr) {
if (err) {
return reject({
message: "Failed to convert page to image",
error: err,
stdout: stdout,
stderr: stderr
});
}
... | vuln | Vulnerable | JavaScript |
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: https://www.espocrm.com
*
* EspoCRM is free software: you can redistribute i... | vuln | Vulnerable | JavaScript |
static int snd_hrtimer_start(struct snd_timer *t)
{
struct snd_hrtimer *stime = t->private_data;
atomic_set(&stime->running, 0);
hrtimer_cancel(&stime->hrt);
hrtimer_start(&stime->hrt, ns_to_ktime(t->sticks * resolution),
HRTIMER_MODE_REL);
atomic_set(&stime->running, 1);
return 0;
} | vuln | Vulnerable | Unknown |
static av_cold int rv30_decode_init(AVCodecContext *avctx)
{
RV34DecContext *r = avctx->priv_data;
int ret;
r->rv30 = 1;
if ((ret = ff_rv34_decode_init(avctx)) < 0)
return ret;
if(avctx->extradata_size < 2){
av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n");
return -1;... | vuln | Safe | C/C++ |
static int decode_font(ASS_Track *track)
{
unsigned char *p;
unsigned char *q;
size_t i;
size_t size; // original size
size_t dsize; // decoded size
unsigned char *buf = 0;
ass_msg(track->library, MSGL_V, "Font: %d bytes encoded data",
track->p... | vuln | Vulnerable | C/C++ |
load_header (XwdLoader *loader)
{
XwdHeader *h = &loader->header;
XwdHeader in;
const XwdHeader *inp;
if (!file_mapping_taste (loader->mapping, &in, 0, sizeof (in)))
return FALSE;
inp = ∈
UNPACK_FIELD_U32 (h, inp, header_size);
UNPACK_FIELD_U32 (h, inp, file_version);
UNPAC... | vuln | Safe | C/C++ |
static int mkv_write_chapters(AVFormatContext *s)
{
MatroskaMuxContext *mkv = s->priv_data;
AVIOContext *pb = s->pb;
ebml_master chapters, editionentry;
AVRational scale = {1, 1E9};
int i, ret;
if (!s->nb_chapters || mkv->wrote_chapters)
return 0;
ret = mkv_add_seekhead_entry(mkv->ma... | vuln | Vulnerable | C/C++ |
static int mod_session_init (void *instance, eap_handler_t *handler)
{
pwd_session_t *session;
eap_pwd_t *inst = (eap_pwd_t *)instance;
VALUE_PAIR *vp;
pwd_id_packet_t *packet;
if (!inst || !handler) {
ERROR("rlm_eap_pwd: Initiate, NULL data provided");
return 0;
}
/*
* make sure the server's been configu... | vuln | Vulnerable | Unknown |
function setGuestLobbyMessage(message) {
try {
check(message, String);
const { meetingId, requesterUserId } = extractCredentials(this.userId);
check(meetingId, String);
check(requesterUserId, String);
const payload = { message: parseMessage(message) };
Logger.info(`User=${requesterUserId} s... | vuln | Safe | JavaScript |
static int journal_unmap_buffer(journal_t *journal, struct buffer_head *bh)
{
transaction_t *transaction;
struct journal_head *jh;
int may_free = 1;
int ret;
BUFFER_TRACE(bh, "entry");
/*
* It is safe to proceed here without the j_list_lock because the
* buffers cannot be stolen by try_to_free_buffers as lo... | vuln | Vulnerable | C/C++ |
md(str, opt = {}) {
this._state = {};
str = this._xmlEscape(str);
str = this._nbsp(str);
if (!opt.raw) str = this._mdLink(str);
if (!opt.raw) str = this._plainUrlToLink(str);
if (!opt.raw) str = this._extendedFormatting(str);
if (!opt.raw) str = this._mdCode(str);
if (!opt.raw) str = thi... | vuln | Vulnerable | JavaScript |
public static List<String> getPermissions(String packageName, Context context) {
List<String> perms = new ArrayList<>();
try {
if (getPermissionsGranted(packageName, context).size() > 1) {
perms.addAll(getPermissionsGranted(packageName, context));
}
if... | vuln | Safe | Java |
function Me(n){if(typeof n=="string"||wu(n))return n;var t=n+"";return"0"==t&&1/n==-$?"-0":t} | vuln | Vulnerable | JavaScript |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Safe | C/C++ |
protected static Document loadXmlDoc(String uri) throws Exception {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(uri);
return doc;
} | vuln | Safe | Java |
public function formatItem( Article $article, $pageText = null ) {
$item = '';
if ( $pageText !== null ) {
//Include parsed/processed wiki markup content after each item before the closing tag.
$item .= $pageText;
}
$item = $this->getItemStart() . $item . $this->getItemEnd();
$item = $this->replaceTa... | vuln | Vulnerable | PHP |
def _deploy_image_loaded_to_local_registry(
build_ver: str,
docker_repository: str,
image_id: str,
auth_method: AuthorizationType,
vault_endpoint: str | None = None,
vault_endpoint_verify: str | bool | None = None,
vault_secret: str | None = None,
) -> str:
docker_image = docker_reposito... | vuln | Safe | Python |
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */
#line 2 "ls-sfparser.c"
#line 2 "ls-sfparser.l"
/*
MIT License
Copyright (c) 2020 LiteSpeed Technologies Inc
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "... | vuln | Safe | C/C++ |
/*
* Copyright (c) 2014-2018 Hayaki Saito
*
* 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, modify, merge, p... | vuln | Vulnerable | C/C++ |
const bootbox = require('bootbox');
require('../services/Requisitions');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(function() {
'use strict';
const policyView = require('../../views/policy.html');
const moveView = require('../../views/move.html');
cons... | vuln | Vulnerable | Java |
public static Map<String, ReconciledPackage> reconcilePackages(
final ReconcileRequest request, SharedLibrariesImpl sharedLibraries,
KeySetManagerService ksms, Settings settings)
throws ReconcileFailure {
final Map<String, ScanResult> scannedPackages = request.mScannedPackage... | vuln | Vulnerable | Java |
FileReaderLoader::FileReaderLoader(ReadType read_type,
FileReaderLoaderClient* client)
: read_type_(read_type),
client_(client),
handle_watcher_(FROM_HERE, mojo::SimpleWatcher::ArmingPolicy::AUTOMATIC),
binding_(this) {} | vuln | Vulnerable | C/C++ |
// SPDX-License-Identifier: GPL-2.0-only
/*
* Bluetooth Software UART Qualcomm protocol
*
* HCI_IBS (HCI In-Band Sleep) is Qualcomm's power management
* protocol extension to H4.
*
* Copyright (C) 2007 Texas Instruments, Inc.
* Copyright (c) 2010, 2012, 2018 The Linux Foundation. All rights reserved.
*
* ... | vuln | Vulnerable | 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 |
image_load_bmp(image_t *img, /* I - Image to load into */
FILE *fp, /* I - File to read from */
int gray, /* I - Grayscale image? */
int load_data)/* I - 1 = load image data, 0 = just info */
{
int info_size, /* Size of info header */
depth, /* Depth of image (bits... | vuln | Vulnerable | C/C++ |
static freelist_idx_t next_random_slot(union freelist_init_state *state)
{
if (state->pos >= state->count)
state->pos = 0;
return state->list[state->pos++];
} | vuln | Safe | C/C++ |
vm_fault_t gru_fault(struct vm_fault *vmf)
{
struct vm_area_struct *vma = vmf->vma;
struct gru_thread_state *gts;
unsigned long paddr, vaddr;
unsigned long expires;
vaddr = vmf->address;
gru_dbg(grudev, "vma %p, vaddr 0x%lx (0x%lx)\n",
vma, vaddr, GSEG_BASE(vaddr));
STAT(nopfn);
/* The following check ensur... | vuln | Vulnerable | C/C++ |
static unsigned int read_sbr_data(AACContext *ac, SpectralBandReplication *sbr,
GetBitContext *gb, int id_aac)
{
unsigned int cnt = get_bits_count(gb);
if (id_aac == TYPE_SCE || id_aac == TYPE_CCE) {
read_sbr_single_channel_element(ac, sbr, gb);
} else if (id_aac ==... | vuln | Vulnerable | C/C++ |
static void ahci_init_d2h(AHCIDevice *ad)
{
IDEState *ide_state = &ad->port.ifs[0];
AHCIPortRegs *pr = &ad->port_regs;
if (ad->init_d2h_sent) {
return;
}
if (ahci_write_fis_d2h(ad)) {
ad->init_d2h_sent = true;
pr->sig = (ide_state->hcyl << 24) |
(ide_stat... | vuln | Vulnerable | C/C++ |
/*
* Copyright 2012-2023 the original author or 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | vuln | Safe | Java |
static <T extends MapstructBaseReference> PsiReference[] create(PsiElement psiElement,
ReferenceCreator<T> creator, boolean supportsNested) {
String targetValue;
Function<String, TextRange> rangeCreator;
if ( psiElement instanceof PsiReferenceExpression ) {
PsiElement resolve... | vuln | Safe | Java |
private void parseOnHit(String powerString) {
CustomBossReinforcement customBossReinforcement = new CustomBossReinforcement();
customBossReinforcement.summonType = SummonType.ON_HIT;
String[] strings = powerString.split(":");
customBossReinforcement.summonChance = Double.parseDouble(stri... | vuln | Vulnerable | Java |
@Override
public String toString()
{
final StringBuilder result = new StringBuilder( getUinfo() );
if ( !Strings.isNullOrEmpty( getPackaging() ) )
{
result.append( "[" ).append( getPackaging() ).append( "]" );
}
return result.toString();
} | vuln | Vulnerable | Java |
static void restore_median(uint8_t *src, int step, int stride,
int width, int height, int slices, int rmode)
{
int i, j, slice;
int A, B, C;
uint8_t *bsrc;
int slice_start, slice_height;
const int cmask = ~rmode;
for (slice = 0; slice < slices; slice++) {
slice... | vuln | Safe | C/C++ |
static void virtio_balloon_save(QEMUFile *f, void *opaque)
{
VirtIOBalloon *s = opaque;
virtio_save(&s->vdev, f);
qemu_put_be32(f, s->num_pages);
qemu_put_be32(f, s->actual);
qemu_put_buffer(f, (uint8_t *)&s->stats_vq_elem, sizeof(VirtQueueElement));
qemu_put_buffer(f, (uint8_t *)&s->stats_vq_of... | vuln | Vulnerable | C/C++ |
static int nr_getname(struct socket *sock, struct sockaddr *uaddr,
int *uaddr_len, int peer)
{
struct full_sockaddr_ax25 *sax = (struct full_sockaddr_ax25 *)uaddr;
struct sock *sk = sock->sk;
struct nr_sock *nr = nr_sk(sk);
lock_sock(sk);
if (peer != 0) {
if (sk->sk_state != TCP_ESTABLISHED) {
release_sock(... | vuln | Vulnerable | C/C++ |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2012
* All rights reserved
*
* This file is part of GPAC / Media Tools sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser Gene... | vuln | Safe | C/C++ |
static int set_params(AVFilterContext *ctx, const char *params)
{
Frei0rContext *frei0r = ctx->priv;
int i;
if (!params)
return 0;
for (i = 0; i < frei0r->plugin_info.num_params; i++) {
f0r_param_info_t info;
char *param;
int ret;
frei0r->get_param_info(&info, i);... | vuln | Safe | C/C++ |
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This 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
* th... | vuln | Vulnerable | Java |
static void spapr_phb_realize(DeviceState *dev, Error **errp)
{
sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_machine());
SysBusDevice *s = SYS_BUS_DEVICE(dev);
sPAPRPHBState *sphb = SPAPR_PCI_HOST_BRIDGE(s);
PCIHostState *phb = PCI_HOST_BRIDGE(s);
sPAPRPHBClass *info = SPAPR_PCI_HOST_BRIDGE_GET... | vuln | Safe | C/C++ |
private static Document useSAXParser(Reader reader, boolean validate) throws JDOMException, IOException {
var saxBuilder = validate ? new SAXBuilder(XSD_FACTORY) : new SAXBuilder();
return saxBuilder.build(reader);
} | vuln | Vulnerable | Java |
private AuthSession newSession(
Map<String, String> credentials, Map<String, String> properties, AuthSession parent) {
if (credentials != null) {
// use the bearer token without exchanging
if (credentials.containsKey(OAuth2Properties.TOKEN)) {
return AuthSession.fromAccessToken(
... | vuln | Vulnerable | Java |
// SPDX-License-Identifier: GPL-2.0+
/*
* (C) Copyright 2008 Semihalf
*
* (C) Copyright 2000-2004
* DENX Software Engineering
* Wolfgang Denk, wd@denx.de
*
* Updated-by: Prafulla Wadaskar <prafulla@marvell.com>
* FIT image specific code abstracted from mkimage.c
* some functions added to address abstraction
... | vuln | Vulnerable | C/C++ |
@Override
public void work() {
needRunning = true;
InMemoryDirectoryServerConfig config = null;
try {
config = new InMemoryDirectoryServerConfig("dc=example,dc=com");
config.setListenerConfigs(new InMemoryListenerConfig(
"listen", //$NON-NLS-1$
... | vuln | Vulnerable | Java |
function chart_legend_options(item){
if(item.data('series').length == 1) return {show: false};
var options = item.data('legend-options');
switch (options)
{
case "external":
return {show: true,
noColumns:4,
container:"#legendContainer",
labelFormatter: function(label, series) {... | vuln | Safe | JavaScript |
void HELPER(v7m_msr)(CPUARMState *env, uint32_t reg, uint32_t val)
{
if (arm_current_el(env) == 0 && reg > 7) {
return;
}
switch (reg) {
case 0 ... 7:
if (reg & 4) {
xpsr_write(env, val, 0xf8000000);
}
break;
case 8:
if (env->v... | vuln | Safe | C/C++ |
def set_pre_prov_vars
@layout = "miq_request_vm"
@edit = {}
@edit[:explorer] = @explorer
@edit[:vm_sortdir] ||= "ASC"
@edit[:vm_sortcol] ||= "name"
@edit[:prov_type] = "VM Provision"
@edit[:hide_deprecated_templates] = true if request.parameters[:controller] == "vm_cloud"
unless %w(imag... | vuln | Safe | Ruby |
public void flag(boolean devAlerts, String information, Object... variables) {
flag(devAlerts, 100000000, information, variables);
} | vuln | Safe | Java |
static inline abi_long target_to_host_semarray(int semid, unsigned short **host_array,
abi_ulong target_addr)
{
int nsems;
unsigned short *array;
union semun semun;
struct semid_ds semid_ds;
int i, ret;
semun.buf = &semid_ds;
ret = semctl(semid,... | vuln | Safe | C/C++ |
/*******************************************************************************
* 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 | Safe | Java |
private void onBlockClick(PlayerInteractEvent.LeftClickBlock event) {
PlayerEntity player = event.getPlayer();
BlockPos pos = event.getPos();
PlayerInventoryProvider.runOnBackpacks(player, (backpack, inventoryHandlerName, slot) -> backpack.getCapability(CapabilityBackpackWrapper.getCapabilityInstance())
.map(... | vuln | Vulnerable | Java |
static int mv_read_packet(AVFormatContext *avctx, AVPacket *pkt)
{
MvContext *mv = avctx->priv_data;
AVIOContext *pb = avctx->pb;
AVStream *st = avctx->streams[mv->stream_index];
const AVIndexEntry *index;
int frame = mv->frame[mv->stream_index];
int64_t ret;
uint64_t pos;
if (frame < st... | vuln | Safe | C/C++ |
int avpriv_unlock_avformat(void)
{
if (lockmgr_cb) {
if ((*lockmgr_cb)(&avformat_mutex, AV_LOCK_RELEASE))
return -1;
}
return 0;
} | vuln | Vulnerable | C/C++ |
int _libssh2_transport_read(LIBSSH2_SESSION * session)
{
int rc;
struct transportpacket *p = &session->packet;
int remainbuf;
int remainpack;
int numbytes;
int numdecrypt;
unsigned char block[MAX_BLOCKSIZE];
int blocksize;
int encrypted = 1;
size_t total_num;
/* default clea... | vuln | Safe | Unknown |
enum_func_status
php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval ** fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
zend_bool as_int_or_float, zend_bool copy_data, MYSQLND_STATS * stats TSRMLS_DC)
{
unsigned int i;
zend_bool last_field_... | vuln | Safe | C/C++ |
void ff_xface_generate_face(uint8_t *dst, uint8_t * const src)
{
int h, i, j, k, l, m;
for (j = 0; j < XFACE_HEIGHT; j++) {
for (i = 0; i < XFACE_WIDTH; i++) {
h = i + j * XFACE_WIDTH;
k = 0;
for (l = i - 2; l <= i + 2; l++) {
for (m = j -... | vuln | Safe | C/C++ |
def verify(self, **kwargs):
super().verify(**kwargs)
if "id_token" in self:
# replace the JWT with the verified IdToken instance
self["id_token"] = verify_id_token(self, **kwargs)
return True | vuln | Vulnerable | Python |
static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table)
{
size_t length;
unsigned int tag, format, components;
char *value_ptr, tagname[64], cbuf[32], *outside=NULL;
size_t by... | vuln | Vulnerable | Unknown |
@Override
public void registerAuthenticationHandlerWithPrincipalResolver(final AuthenticationHandler handler, final PrincipalResolver principalResolver) {
if (principalResolver == null) {
LOGGER.trace("Registering handler [{}] with no principal resolver into the execution plan", handler.getName(... | vuln | Vulnerable | Java |
public Font createFont(Style baseStyle) {
Font f = name == null ? baseStyle.getFont() : Font.createTrueTypeFont(name, file);
if (f == null || (getSize() != null && !f.isTTFNativeFont())) {
f = Font.createTrueTypeFont(Font.NATIVE_MAIN_REGULAR, Font.NATIVE_MAIN_REGULAR);
... | vuln | Vulnerable | Java |
public function render()
{
$languageService = $this->getLanguageService();
$options = $this->data['renderData']['fieldControlOptions'];
$title = $options['title'] ?? 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.edit';
$parameterArray = $this->data['parameterAr... | vuln | Safe | PHP |
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* 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.apach... | vuln | Vulnerable | Java |
def _get_curr_info(cls, package):
# Only allow processing of a single package
package = re.split("\s+|;|&&|\|", package.splitlines()[0], 1)[0].rstrip()
# Ensure the package exists before fetching the details directly from dpkg
if not cls._package_exists(package):
return ''
... | vuln | Safe | Python |
static inline void free_ep_req(struct usb_ep *ep, struct usb_request *req)
{
kfree(req->buf);
usb_ep_free_request(ep, req);
} | vuln | Vulnerable | Unknown |
static void io_async_task_func(struct callback_head *cb)
{
struct io_kiocb *req = container_of(cb, struct io_kiocb, task_work);
struct async_poll *apoll = req->apoll;
struct io_ring_ctx *ctx = req->ctx;
trace_io_uring_task_run(req->ctx, req->opcode, req->user_data);
if (io_poll_rewait(req, &apoll->poll)) {
spi... | vuln | Safe | Unknown |
static char getsymbol(uint8_t code, bool urlsafe)
{
if (!IS_ACTIVE(MODULE_BASE64URL)) {
urlsafe = false;
}
if (urlsafe && code == BASE64_UNDERLINE) {
return '_';
}
if (urlsafe && code == BASE64_MINUS) {
return '-';
}
if (!urlsafe && code == BASE64_SLASH) {
... | vuln | Safe | C/C++ |
public void output(OutputStream os)
throws TransformerConfigurationException, TransformerException {
TransformerFactory tranFactory = TransformerFactory.newInstance();
Transformer aTransformer = tranFactory.newTransformer();
Source src = new DOMSource(mDoc);
Result dest = new... | vuln | Vulnerable | Java |
static int qemu_gluster_create(const char *filename,
QemuOpts *opts, Error **errp)
{
struct glfs *glfs;
struct glfs_fd *fd;
int ret = 0;
int prealloc = 0;
int64_t total_size = 0;
char *tmp = NULL;
GlusterConf *gconf = g_new0(GlusterConf, 1);
glfs = qemu_glu... | vuln | Safe | C/C++ |
int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
const BIGNUM *order, const BIGNUM *cofactor)
{
if (generator == NULL) {
ECerr(EC_F_EC_GROUP_SET_GENERATOR, ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
if (group->generator == NULL) {
grou... | vuln | Vulnerable | Unknown |
(function()
{
Sidebar.prototype.addInfographicPalette = function()
{
var w = 100;
var h = 100;
var s = 'whiteSpace=wrap;html=1;shape=mxgraph.infographic.';
var s2 = mxConstants.STYLE_VERTICAL_LABEL_POSITION + '=bottom;' + mxConstants.STYLE_VERTICAL_ALIGN + '=top;html=1;shape=mxgraph.infographic.';
var s3 = ... | vuln | Safe | Java |
def cli_node_new_configuration(name: str, system_folders: bool) -> None:
"""Create a new configation file.
Checks if the configuration already exists. If this is not the case
a questionaire is invoked to create a new configuration file.
"""
# select configuration name if none supplied
if not na... | vuln | Safe | Python |
@Override
public void chunkUnload() {
if (villager != null)
villager.remove();
if (getNpCsConfigFields().getTimeout() > 0) return;
simplePersistentEntity = new SimplePersistentEntity(this);
if (villager != null)
villager.remove();
} | vuln | Safe | Java |
protected void showCreateContactDialog(final String prefilledJid, final Invite invite) {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
Fragment prev = getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG_DIALOG);
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null... | vuln | Safe | Java |
"""
django-helpdesk - A Django powered ticket tracker for small enterprise.
(c) Copyright 2008 Jutda. All Rights Reserved. See LICENSE for details.
lib.py - Common functions (eg multipart e-mail)
"""
import logging
import mimetypes
from django.conf import settings
from django.utils.encoding import smart_text
from ... | vuln | Safe | Python |
import { isTestSuiteActive } from "../../support/page_objects/projectConstants";
import { mainPage } from "../../support/page_objects/mainPage";
let storedURL = "";
export const genTest = (apiType, dbType) => {
if (!isTestSuiteActive(apiType, dbType)) return;
describe(`${apiType.toUpperCase()} api - FORM vie... | vuln | Safe | JavaScript |
long Cluster::ParseBlockGroup(
long long payload_size,
long long& pos,
long& len)
{
const long long payload_start = pos;
const long long payload_stop = pos + payload_size;
IMkvReader* const pReader = m_pSegment->m_pReader;
long long total, avail;
long status = pReader->Length(&tota... | vuln | Vulnerable | C/C++ |
package server
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
"time"
"github.com/pkg/errors"
"github.com/usememos/memos/api"
"github.com/usememos/memos/common"
metric "github.com/usememos/memos/plugin/metrics"
"github.com/labstack/echo/v4"
)
const (
// The max fi... | vuln | Vulnerable | Go |
////////////////////////////////////////////////////////////////////////////
// **** WAVPACK **** //
// Hybrid Lossless Wavefile Compressor //
// Copyright (c) 1998 - 2016 David Bryant. //
// ... | vuln | Vulnerable | C/C++ |
/* Copyright 2016 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 void calc_coeff(double mu[4], const int index[4], int prefilter, double r2, double mul)
{
double mul2 = mul * mul, mul3 = mul2 * mul;
double kernel[] = {
(5204 + 2520 * mul + 1092 * mul2 + 3280 * mul3) / 12096,
(2943 - 210 * mul - 273 * mul2 - 2460 * mul3) / 12096,
( 486 - 924 ... | vuln | Vulnerable | C/C++ |
public CardCollection chooseCardsForEffect(CardCollectionView pool, SpellAbility sa, int min, int max, boolean isOptional, Map<String, Object> params) {
if (sa == null || sa.getApi() == null) {
throw new UnsupportedOperationException();
}
CardCollection result = new CardCollection();... | vuln | Vulnerable | Java |
@Override
public void setApplicationEnabledSetting(
String pkg, int state, int flags, int userId, String callingPkg) throws HiddenAPIsException {
try {
mIPackageManager.setApplicationEnabledSetting(pkg, state, flags, userId, callingPkg);
} catch (RemoteException | SecurityException e) {
thro... | vuln | Vulnerable | Java |
accountsApi.update = async function (req, res) {
const username = req.params.username
const postData = req.body
if (!username || !postData) return apiUtil.sendApiError_InvalidPostData(res)
let passwordUpdated = false
try {
// SETTINGS
const SettingsUtil = require('../../../settings/settingsUtil')
... | vuln | Safe | JavaScript |
SchedulerObject::_continue(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 | Vulnerable | C/C++ |
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: https://www.espocrm.com
*
* EspoCRM is free software: you can redistribute i... | vuln | Safe | JavaScript |
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 |
generate_mail_credentials = function() {
var div = $('.mail-infoblock').clone();
div.find('#mail_configuration').remove();
var pass=div.find('#v_password').text();
if (pass=="") div.find('#v_password').text(' ');
var output = div.text();
output=output.replace(/(?:\r\n|\r|\n|\t)/g, "|");
outp... | vuln | Safe | JavaScript |
package com.salesmanager.shop.admin.controller.content;
import com.salesmanager.core.business.services.content.ContentService;
import com.salesmanager.core.business.utils.ajax.AjaxResponse;
import com.salesmanager.core.model.content.FileContentType;
import com.salesmanager.core.model.content.InputContentFile;
import c... | vuln | Safe | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.