code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
pub async fn mksnap(handle: &CoreDB, con: &mut Connection, act: ActionGroup) -> TResult<()> {
let howmany = act.howmany();
if howmany == 0 {
if !handle.is_snapshot_enabled() {
// Since snapshotting is disabled, we can't create a snapshot!
// We'll just return an error returning t... | vuln | Safe | Rust |
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unl... | vuln | Safe | Java |
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.services.catalog.product.relationship.ProductRelationshipService... | vuln | Vulnerable | Java |
it "doesn't log in the user when not approved" do
SiteSetting.must_approve_users = true
post "/session/email-login/#{email_token.token}.json"
expect(response.status).to eq(200)
expect(JSON.parse(response.body)["error"]).to eq(I18n.t("login.not_approved"))
expect(session[:curre... | vuln | Safe | Ruby |
function Br(e){return y.List.isList(e)?e:(0,d.default)(e)?(0,y.fromJS)(e):(0,y.List)()} | vuln | Safe | JavaScript |
static av_always_inline void filter_mb_dir(const H264Context *h, H264SliceContext *sl,
int mb_x, int mb_y,
uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr,
unsigned int linesize, unsigned in... | vuln | Vulnerable | C/C++ |
int MapOpenSSLErrorSSL() {
unsigned long error_code;
do {
error_code = ERR_get_error();
if (error_code == 0)
return ERR_SSL_PROTOCOL_ERROR;
} while (ERR_GET_LIB(error_code) != ERR_LIB_SSL);
DVLOG(1) << "OpenSSL SSL error, reason: " << ERR_GET_REASON(error_code)
<< ", name: " << ERR_err... | vuln | Vulnerable | C/C++ |
ngx_mail_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
{
ngx_mail_core_srv_conf_t *prev = parent;
ngx_mail_core_srv_conf_t *conf = child;
ngx_conf_merge_msec_value(conf->timeout, prev->timeout, 60000);
ngx_conf_merge_msec_value(conf->resolver_timeout, prev->resolver_timeout,
... | vuln | Safe | Unknown |
static int sctp_getsockopt_local_auth_chunks(struct sock *sk, int len,
char __user *optval, int __user *optlen)
{
struct sctp_authchunks __user *p = (void __user *)optval;
struct sctp_authchunks val;
struct sctp_association *asoc;
struct sctp_chunks_param *ch;
u32 num_chunks = 0;
char __user *to;
if ... | vuln | Safe | Unknown |
package com.salesmanager.shop.admin.model.permission;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPrope... | vuln | Vulnerable | Java |
dump_threads(void)
{
FILE *fp;
char time_buf[26];
element e;
vrrp_t *vrrp;
char *file_name;
file_name = make_file_name("/tmp/thread_dump.dat",
"vrrp",
#if HAVE_DECL_CLONE_NEWNET
global_data->network_namespace,
#else
NULL,
#endif
global_data->instance_name);
fp = fopen_safe(file_name, "a");
... | vuln | Safe | Unknown |
module.exports = Extract;
var Parse = require('./parse');
var Writer = require('fstream').Writer;
var util = require('util');
var path = require('path');
util.inherits(Extract, Parse);
function Extract (opts) {
if (!(this instanceof Extract))
return new Extract(opts);
var self = this;
Parse.call(self,opt... | vuln | Vulnerable | JavaScript |
static void vfio_start_irqfd_injection(SysBusDevice *sbdev, qemu_irq irq)
{
VFIOPlatformDevice *vdev = VFIO_PLATFORM_DEVICE(sbdev);
VFIOINTp *intp;
if (!kvm_irqfds_enabled() || !kvm_resamplefds_enabled() ||
!vdev->irqfd_allowed) {
goto fail_irqfd;
}
QLIST_FOREACH(intp, &vdev->intp_li... | vuln | Vulnerable | C/C++ |
long ContentEncoding::ParseEncryptionEntry(long long start, long long size,
IMkvReader* pReader,
ContentEncryption* encryption) {
assert(pReader);
assert(encryption);
long long pos = start;
const long long stop = start + size;
while (pos < stop) {
long long id, size;
const long status = ParseElementHeader(... | vuln | Vulnerable | C/C++ |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/* Copyright (c) 2015 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE.chrome file.
*/
/* Updated for C style, David Shue */
/*
* Replace "kDERCert" t... | vuln | Vulnerable | C/C++ |
bool Item_equal::create_pushable_equalities(THD *thd,
List<Item> *equalities,
Pushdown_checker checker,
uchar *arg,
bool clone_const)
{
Item *... | vuln | Safe | Unknown |
static av_cold int cook_decode_init(AVCodecContext *avctx)
{
COOKContext *q = avctx->priv_data;
const uint8_t *edata_ptr = avctx->extradata;
const uint8_t *edata_ptr_end = edata_ptr + avctx->extradata_size;
int extradata_size = avctx->extradata_size;
int s = 0;
unsigned int channel_mask = 0;
... | vuln | Vulnerable | C/C++ |
function wrapmessage(title, message, count, ago, persistent, seeAlso) {
let html = $('<div><div><hr><p><b class="adminNotifyTitle"></b></p><p class="adminNotifyMessage"></p></div><p class="adminNotifyMessageAdditionalInfo"></p></div>');
html.find('.adminNotifyTitle').text(title);
html.find('.adminNotifyMess... | vuln | Safe | JavaScript |
public IBrush setCurrentBrush(Class<? extends IBrush> brush) {
Preconditions.checkNotNull(brush, "Can't set brush to null.");
IBrush brushInstance = brushes.get(brush);
if (brushInstance == null) {
brushInstance = instanciateBrush(brush);
Preconditions.checkNotNull(brushI... | vuln | Vulnerable | Java |
QPDF::checkLinearizationInternal()
{
// All comments referring to the PDF spec refer to the spec for
// version 1.4.
std::list<std::string> errors;
std::list<std::string> warnings;
// Check all values in linearization parameter dictionary
LinParameters& p = this->m->linp;
// L: file size... | vuln | Vulnerable | Unknown |
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/
/*
* Copyright 2020 Amazo... | vuln | Safe | Go |
static inline int decode_subframe(FLACContext *s, int channel)
{
int32_t *decoded = s->decoded[channel];
int type, wasted = 0;
int bps = s->flac_stream_info.bps;
int i, tmp, ret;
if (channel == 0) {
if (s->ch_mode == FLAC_CHMODE_RIGHT_SIDE)
bps++;
} else {
if (s->ch_m... | vuln | Vulnerable | C/C++ |
static void aio_read_done(void *opaque, int ret)
{
struct aio_ctx *ctx = opaque;
struct timeval t2;
gettimeofday(&t2, NULL);
if (ret < 0) {
printf("readv failed: %s\n", strerror(-ret));
goto out;
}
if (ctx->Pflag) {
void *cmp_buf = g_malloc(ctx->qiov.size);
memset... | vuln | Vulnerable | C/C++ |
negotiate_handshake_newstyle_options (struct connection *conn)
{
struct new_option new_option;
size_t nr_options;
uint64_t version;
uint32_t option;
uint32_t optlen;
char data[MAX_OPTION_LENGTH+1];
struct new_handshake_finish handshake_finish;
const char *optname;
for (nr_options = 0; nr_options < MA... | vuln | Safe | Unknown |
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unl... | vuln | Vulnerable | Java |
$(function () {
function UserSettingsViewModel(parameters) {
var self = this;
self.loginState = parameters[0];
self.access = parameters[1];
self.users = self.access.users;
self.userSettingsDialog = undefined;
var auto_locale = {
language: "_default",
... | vuln | Vulnerable | Python |
def prepare_vocab(args: argparse.Namespace):
num_words, num_words_other = args.num_words
num_words = num_words if num_words > 0 else None
num_words_other = num_words_other if num_words_other > 0 else None
utils.check_condition(num_words == num_words_other,
"Vocabulary CLI only ... | vuln | Safe | Python |
def get_song_relations(id):
top = request.args.get('top')
song = Song.query.filter_by(id=id).first()
if not song:
return route_not_found(song)
return make_response(jsonify(song.get_related_songs_json(top)), 200) | vuln | Vulnerable | Python |
def get_node_status(auth_user, cib_dom)
node_status = {
:cluster_name => $cluster_name,
:groups => [],
:constraints => {
# :rsc_location => [],
# :rcs_colocation => [],
# :rcs_order => []
},
:cluster_settings => {},
:need_ring1_address => need_ring1_ad... | vuln | Safe | Ruby |
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.... | vuln | Safe | Java |
static int pkey_GOST_ECcp_decrypt(EVP_PKEY_CTX *pctx, unsigned char *key,
size_t *key_len, const unsigned char *in,
size_t in_len)
{
const unsigned char *p = in;
EVP_PKEY *priv = EVP_PKEY_CTX_get0_pkey(pctx);
GOST_KEY_TRANSPORT *gkt = NULL;
int ret =... | vuln | Safe | Unknown |
static void parse_xattrmap(struct lo_data *lo)
{
const char *map = lo->xattrmap;
const char *tmp;
lo->xattr_map_nentries = 0;
while (*map) {
XattrMapEntry tmp_entry;
char sep;
if (isspace(*map)) {
map++;
continue;
}
/* The separator is th... | vuln | Vulnerable | Unknown |
@Override
protected List<ListElement> getNextChildElements(LayoutManager childLM, LayoutContext context,
LayoutContext childLC, int alignment, Stack lmStack, Position restartPosition,
LayoutManager restartAtLM) {
childLC.copyPendingMarksFrom(context);
if (childLM instanceof L... | vuln | Vulnerable | Java |
@Override
protected boolean checkApiLogic(final Player ai, final SpellAbility sa) {
sa.resetTargets();
final Card source = sa.getHostCard();
// everything is defined or targeted above, can't do anything there?
if (sa.hasParam("Defined") && !sa.usesTargeting()) {
// TODO ... | vuln | Vulnerable | Java |
static int neigh_fill_info(struct sk_buff *skb, struct neighbour *n,
u32 pid, u32 seq, int event, unsigned int flags)
{
unsigned long now = jiffies;
unsigned char *b = skb->tail;
struct nda_cacheinfo ci;
int locked = 0;
u32 probes;
struct nlmsghdr *nlh = NLMSG_NEW(skb, pid, seq, event,
sizeof(struct n... | vuln | Safe | Unknown |
e1000e_ring_empty(E1000ECore *core, const E1000E_RingInfo *r)
{
return core->mac[r->dh] == core->mac[r->dt];
} | vuln | Vulnerable | C/C++ |
void ElectronBrowserClient::RegisterBrowserInterfaceBindersForFrame(
content::RenderFrameHost* render_frame_host,
mojo::BinderMapWithContext<content::RenderFrameHost*>* map) {
map->Add<network_hints::mojom::NetworkHintsHandler>(
base::BindRepeating(&BindNetworkHintsHandler));
map->Add<blink::mojom::Ba... | vuln | Safe | Unknown |
void TEMPLATE(process_block_dec)(decoder_info_t *decoder_info,int size,int yposY,int xposY,int sub)
{
int width = decoder_info->width;
int height = decoder_info->height;
stream_t *stream = decoder_info->stream;
frame_type_t frame_type = decoder_info->frame_info.frame_type;
int split_flag = 0;
if (yposY >= ... | vuln | Vulnerable | C/C++ |
TfLiteStatus LessEqualEval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input1;
TF_LITE_ENSURE_OK(context,
GetInputSafe(context, node, kInputTensor1, &input1));
const TfLiteTensor* input2;
TF_LITE_ENSURE_OK(context,
GetInputSafe(context, node, kInputTen... | vuln | Safe | C/C++ |
public boolean checkIfDrawableNameExists(String name, DrawableData... exclusions) {
var exclusionArray = new Array<>(exclusions);
boolean returnValue = false;
for (DrawableData drawable : getDrawables()) {
if (!exclusionArray.contains(drawable, true) && drawable.name.equals(... | vuln | Vulnerable | Java |
# Copyright 2014-2016 OpenMarket Ltd
#
# 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 agreed to in w... | vuln | Vulnerable | Python |
$masteroption->delete();
}
// delete the mastergroup
$db->delete('optiongroup', 'optiongroup_master_id='.$mastergroup->id);
$mastergroup->delete();
expHistory::back();
} | vuln | Vulnerable | PHP |
struct resource_pool *dce110_create_resource_pool(
uint8_t num_virtual_links,
struct dc *dc,
struct hw_asic_id asic_id)
{
struct dce110_resource_pool *pool =
kzalloc(sizeof(struct dce110_resource_pool), GFP_KERNEL);
if (!pool)
return NULL;
if (construct(num_virtual_links, dc, pool, asic_id))
return &pool-... | vuln | Vulnerable | C/C++ |
func apiCallbacksStreams(w http.ResponseWriter, r *http.Request) {
challenge := r.URL.Query().Get("hub.challenge")
if challenge != "" {
fmt.Fprint(w, challenge)
fmt.Println("Responding to streams")
return
}
fmt.Printf("Streams response xd \n")
fmt.Printf("Streams response xd \n")
fmt.Printf("Streams respon... | vuln | Vulnerable | Go |
make_weights (PixopsFilter *filter,
PixopsInterpType interp_type,
double scale_x,
double scale_y)
{
switch (interp_type)
{
case PIXOPS_INTERP_NEAREST:
default:
g_assert_not_reached ();
return FALSE;
case PIXOPS_INTERP_TILES:
if ... | vuln | Safe | Unknown |
av_cold int ff_mpv_common_init(MpegEncContext *s)
{
int i;
int nb_slices = (HAVE_THREADS &&
s->avctx->active_thread_type & FF_THREAD_SLICE) ?
s->avctx->thread_count : 1;
clear_context(s);
if (s->encoding && s->avctx->slices)
nb_slices = s->avctx->slices;
... | vuln | Safe | C/C++ |
__alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
struct alloc_context *ac)
{
bool can_direct_reclaim = gfp_mask & __GFP_DIRECT_RECLAIM;
const bool costly_order = order > PAGE_ALLOC_COSTLY_ORDER;
struct page *page = NULL;
unsigned int alloc_flags;
unsigned long did_some_progress;
enum compact_prior... | vuln | Safe | Unknown |
/*
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 2013, Digium, Inc.
*
* Kevin Harwell <kharwell@digium.com>
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the proje... | vuln | Safe | C/C++ |
void bdrv_drain(BlockDriverState *bs)
{
bool busy = true;
bdrv_drain_recurse(bs);
while (busy) {
bdrv_flush_io_queue(bs);
busy = bdrv_requests_pending(bs);
busy |= aio_poll(bdrv_get_aio_context(bs), busy); | vuln | Vulnerable | C/C++ |
static void lsi_command_complete(SCSIBus *bus, int reason, uint32_t tag,
uint32_t arg)
{
LSIState *s = DO_UPCAST(LSIState, dev.qdev, bus->qbus.parent);
int out;
out = (s->sstat1 & PHASE_MASK) == PHASE_DO;
if (reason == SCSI_REASON_DONE) {
DPRINTF("Command complet... | vuln | Vulnerable | C/C++ |
def read_primary_locale_file
primary_file = "#{self.locales_config_path}/#{self.primary_locale_name}.yml"
File.exists?(primary_file) ? flat_hash(YAML::load(IO.read(primary_file))[self.primary_locale_name]) : {}
end | vuln | Vulnerable | Ruby |
void jswrap_spi_send4bit(JsVar *parent, JsVar *srcdata, int bit0, int bit1, Pin nss_pin) {
NOT_USED(parent);
IOEventFlags device = jsiGetDeviceFromClass(parent);
if (!DEVICE_IS_SPI(device)) {
jsExceptionHere(JSET_ERROR, "SPI.send4bit only works on hardware SPI");
return;
}
jshSPISet16(device, true); ... | vuln | Vulnerable | C/C++ |
void scsi_req_cancel_async(SCSIRequest *req, Notifier *notifier)
{
trace_scsi_req_cancel(req->dev->id, req->lun, req->tag);
if (notifier) {
notifier_list_add(&req->cancel_notifiers, notifier);
}
if (req->io_canceled) {
assert(req->aiocb);
return;
}
scsi_req_... | vuln | Safe | C/C++ |
@Override
public void drawGradientRoundedRect(long vg, float x, float y, float width, float height, int color, int color2, float radius) {
NVGPaint bg = NVGPaint.create();
nvgBeginPath(vg);
nvgRoundedRect(vg, x, y, width, height, radius);
NVGColor nvgColor = color(vg, color);
... | vuln | Safe | Java |
protected void switchToConversation(Contact contact) {
Conversation conversation = xmppConnectionService.findOrCreateConversation(contact.getAccount(), contact.getJid(), false, true);
switchToConversation(conversation);
} | vuln | Safe | Java |
bool hfi1_mmu_rb_remove_unless_exact(struct mmu_rb_handler *handler,
unsigned long addr, unsigned long len,
struct mmu_rb_node **rb_node)
{
struct mmu_rb_node *node;
unsigned long flags;
bool ret = false;
spin_lock_irqsave(&handler->lock, flags);
node = __mmu_rb_search(handler, addr, len);
if (... | vuln | Vulnerable | Unknown |
void update_rate_histogram(struct rate_hist *hist,
const vpx_codec_enc_cfg_t *cfg,
const vpx_codec_cx_pkt_t *pkt) {
int i;
int64_t then = 0;
int64_t avg_bitrate = 0;
int64_t sum_sz = 0;
const int64_t now = pkt->data.frame.pts * 1000 *
(uint64_t)cfg->g_timebase.num /
(uint64_t)cfg->g_timebase.den;
int idx = h... | vuln | Vulnerable | C/C++ |
function PMA_cleanupPathInfo()
{
global $PMA_PHP_SELF;
$PMA_PHP_SELF = PMA_getenv('PHP_SELF');
if (empty($PMA_PHP_SELF)) {
$PMA_PHP_SELF = urldecode(PMA_getenv('REQUEST_URI'));
}
$_PATH_INFO = PMA_getenv('PATH_INFO');
if (! empty($_PATH_INFO) && ! empty($PMA_PHP_SELF)) {
$path_i... | vuln | Safe | PHP |
rpl_daoack_print(netdissect_options *ndo,
const u_char *bp, u_int length)
{
const struct nd_rpl_daoack *daoack = (const struct nd_rpl_daoack *)bp;
const char *dagid_str = "<elided>";
ND_TCHECK2(*daoack, ND_RPL_DAOACK_MIN_LEN);
if (length < ND_RPL_DAOACK_MIN_LEN)
... | vuln | Vulnerable | C/C++ |
static char *theme_format_compress_colors(THEME_REC *theme, const char *format)
{
GString *str;
char *ret;
char last_fg, last_bg;
str = g_string_new(NULL);
last_fg = last_bg = '\0';
while (*format != '\0') {
if (*format == '$') {
/* $variable, skrip it entirely */
theme_format_appen... | vuln | Safe | Unknown |
protected function _add_comment_log( $id, $action, $comment = null ) {
if ( is_null( $comment ) )
$comment = get_comment( $id );
aal_insert_log( array(
'action' => $action,
'object_type' => 'Comments',
'object_subtype' => get_post_type( $comment->comment_post_ID ),
'object_name' => g... | vuln | Vulnerable | PHP |
xfs_attr_shortform_to_leaf(
struct xfs_da_args *args,
struct xfs_buf **leaf_bp)
{
xfs_inode_t *dp;
xfs_attr_shortform_t *sf;
xfs_attr_sf_entry_t *sfe;
xfs_da_args_t nargs;
char *tmpbuffer;
int error, i, size;
xfs_dablk_t blkno;
struct xfs_buf *bp;
xfs_ifork_t *ifp;
trace_xfs_attr_sf_to_leaf(args);
dp = ... | vuln | Safe | C/C++ |
public static Map<String, Object> getAnalysisResultList(Map<String, Object> map) {
String analysisResultListPath = (String) map.get("analysisResultListPath");
Map<String, Object> readData = new HashMap<>();
File file = new File(analysisResultListPath);
if(!file.exists()) {
log.error("파일정보를 찾을 수 없습니다. file... | vuln | Safe | Java |
OMX_ERRORTYPE SoftMPEG4Encoder::internalGetParameter(
OMX_INDEXTYPE index, OMX_PTR params) {
switch (index) {
case OMX_IndexParamVideoBitrate:
{
OMX_VIDEO_PARAM_BITRATETYPE *bitRate =
(OMX_VIDEO_PARAM_BITRATETYPE *) params;
if (!isValidOMXParam(bitRate)) {
... | vuln | Safe | C/C++ |
private boolean launchConfirmationActivity(int request, CharSequence title, CharSequence header,
CharSequence message, Class<?> activityClass, boolean returnCredentials,
boolean external, boolean forceVerifyPath, int userId,
@Nullable CharSequence alternateButton, boolean allowAnyUse... | vuln | Vulnerable | Java |
static ssize_t module_gzip_decompress(struct load_info *info,
const void *buf, size_t size)
{
struct z_stream_s s = { 0 };
size_t new_size = 0;
size_t gzip_hdr_len;
ssize_t retval;
int rc;
gzip_hdr_len = module_gzip_header_len(buf, size);
if (!gzip_hdr_len) {
pr_err("not a gzip compressed module\n")... | vuln | Vulnerable | C/C++ |
'use strict';
// @ts-check
// ==================================================================================
// internet.js
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
// Copyright: (c) 2014 - ... | vuln | Safe | JavaScript |
private void onCloseAnimationEnd() {
if (transitionAnimationInProgress && onCloseAnimationEndRunnable != null) {
if (currentAnimation != null) {
AnimatorSet animatorSet = currentAnimation;
currentAnimation = null;
animatorSet.cancel();
}
... | vuln | Vulnerable | Java |
static int genl_family_rcv_msg(struct genl_family *family,
struct sk_buff *skb,
struct nlmsghdr *nlh)
{
const struct genl_ops *ops;
struct net *net = sock_net(skb->sk);
struct genl_info info;
struct genlmsghdr *hdr = nlmsg_data(nlh);
struct nlattr **attrbuf;
int hdrlen, err;
/* this family d... | vuln | Safe | Unknown |
void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/)
{
if (keylen <= 16)
keylen = 16;
else if (keylen >= 32)
keylen = 32;
else if (keylen != 24)
keylen = 24;
rounds_ = keylen/4 + 6;
word32 temp, *rk = key_;
unsigned int i=0;
GetUserKey(BigE... | vuln | Safe | Unknown |
void bindCompanionApplication(@UserIdInt int userId, @NonNull String packageName) {
if (DEBUG) Log.i(TAG, "bind() u" + userId + "/" + packageName);
final List<ComponentName> companionServices =
mCompanionServicesRegister.forPackage(userId, packageName);
final List<CompanionDevic... | vuln | Vulnerable | Java |
function wp_statistics_get_site_title( $url ) {
//Get ody Page
$html = wp_statistics_get_html_page( $url );
if ( $html === false ) {
return false;
}
//Get Page Title
if ( class_exists( 'DOMDocument' ) ) {
$dom = new DOMDocument;
@$dom->loadHTML( $html );
$title = '';
if ( isset( $dom ) and $dom->getEl... | vuln | Safe | PHP |
/* packet-nfs.c
* Routines for nfs dissection
* Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de>
* Copyright 2000-2004, Mike Frisch <frisch@hummingbird.com> (NFSv4 decoding)
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* Copied from pack... | vuln | Safe | C/C++ |
static void
delete_buff_tail(buffheader_T *buf, int slen)
{
int len;
if (buf->bh_curr == NULL || buf->bh_curr->b_str == NULL)
return; // nothing to delete
len = (int)STRLEN(buf->bh_curr->b_str);
if (len >= slen)
{
buf->bh_curr->b_str[len - slen] = NUL;
buf->bh_space += slen;
}
} | vuln | Safe | C/C++ |
/*
* 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 |
static XMLReader createParser() {
try {
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setNamespaceAware(true);
factory.setValidating(false);
factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
... | vuln | Vulnerable | Java |
public Map<String, String> handleCorsPreflightRequest(String pOrigin, String pRequestHeaders) {
Map<String,String> ret = new HashMap<String, String>();
if (pOrigin != null && backendManager.isCorsAccessAllowed(pOrigin)) {
// CORS is allowed, we set exactly the origin in the header, so there ... | vuln | Vulnerable | Java |
public static void square(int[] x, int[] zz)
{
long x_0 = x[0] & M;
long zz_1;
int c = 0, w;
{
int i = 7, j = 16;
do
{
long xVal = (x[i--] & M);
long p = xVal * xVal;
zz[--j] = (c << 31) | (int)(p >>... | vuln | Vulnerable | Java |
static inline char *modname_normalize(char *modname, char buf[NAME_MAX],
size_t *len)
{
char *c;
size_t s;
if (buf) {
buf[NAME_MAX] = '\0';
modname = strncpy(buf, modname, NAME_MAX - 1);
}
for (c = modname, s = 0; *c != '\0' && *c != '.'; c++) {
if (*c == '-')
*c = '_';
s++;
}
if (len)
*l... | vuln | Vulnerable | C/C++ |
private void deleteKernelTagData(int uid) {
try {
mCookieTagMap.forEach((key, value) -> {
if (value.uid == uid) {
try {
mCookieTagMap.deleteEntry(key);
} catch (ErrnoException e) {
logErrorIfNotEr... | vuln | Vulnerable | Java |
load_image (const gchar *filename,
GError **error)
{
gchar *name;
gint fd;
BrushHeader bh;
guchar *brush_buf = NULL;
gint32 image_ID;
gint32 layer_ID;
GimpParasite *parasite;
GimpDrawable *drawable;
GimpPix... | vuln | Vulnerable | C/C++ |
@Inject(method = "add(Lnet/minecraft/world/entity/EntityLike;)V", at = @At("RETURN"))
private void onEntityAdded(T entityLike, CallbackInfo ci) {
if (this.pushableEntities != null) {
if (!this.status.shouldTrack()) {
this.stopFilteringPushableEntities();
} else {
... | vuln | Vulnerable | Java |
void ZRLE_ENCODE_TILE(PIXEL_T* data, int w, int h, zrleOutStream* os,
int zywrle_level, int *zywrleBuf, void *paletteHelper)
{
/* First find the palette and the number of runs */
zrlePaletteHelper *ph;
int runs = 0;
int singlePixels = 0;
rfbBool useRle;
rfbBool usePalette;
int estimatedBytes;
int ... | vuln | Safe | Unknown |
open_log_file(const char *name, const char *prog, const char *namespace, const char *instance)
{
char *file_name;
if (log_file) {
fclose(log_file);
log_file = NULL;
}
if (!name)
return;
file_name = make_file_name(name, prog, namespace, instance);
log_file = fopen(file_name, "a");
if (log_file) {
int ... | vuln | Vulnerable | C/C++ |
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// 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 ... | vuln | Safe | Go |
function g(){if(f&&l&&(x("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+w.DefaultDelimiter+"'"),l=!1),v.skipEmptyLines)for(var t=0;t<f.data.length;t++)y(f.data[t])&&f.data.splice(t--,1);return m()&&function(){if(!f)return;function t(t,e){H(v.transformHeader)&&(t=v.trans... | vuln | Safe | JavaScript |
public static boolean deleteFile(String filePath) {
boolean flag = false;
File file = new File(filePath);
if (file.isFile() && file.exists()) {
boolean deleteResult = file.delete();
log.info("deleteFile deleteResult:{}", deleteResult);
flag = true;
}
... | vuln | Vulnerable | Java |
Curves16Data* CurvesAlloc(cmsContext ContextID, int nCurves, int nElements, cmsToneCurve** G)
{
int i, j;
Curves16Data* c16;
c16 = _cmsMallocZero(ContextID, sizeof(Curves16Data));
if (c16 == NULL) return NULL;
c16 ->nCurves = nCurves;
c16 ->nElements = nElements;
c16 ->Curves = _cmsCalloc... | vuln | Vulnerable | C/C++ |
dot24_print_page (gx_device_printer *pdev, gp_file *prn_stream, char *init_string, int init_len)
{
int xres = (int)pdev->x_pixels_per_inch;
int yres = (int)pdev->y_pixels_per_inch;
int x_high = (xres == 360);
int y_high = (yres == 360);
int bits_per_column = (y_high ? 48 : 24);
uint line_size = gdev_prn_ras... | vuln | Vulnerable | C/C++ |
clone (gitUrl, options, callback) {
if (typeof options === "function") {
callback = options;
options = "";
}
return this.exec("clone " + gitUrl + " " + options, callback);
} | vuln | Vulnerable | JavaScript |
static Image *ReadJP2Image(const ImageInfo *image_info,ExceptionInfo *exception)
{
const char
*option;
Image
*image;
int
jp2_status;
MagickBooleanType
status;
opj_codec_t
*jp2_codec;
opj_codestream_index_t
*codestream_index = (opj_codestream_index_t *) NULL;
opj_dparameters_t... | vuln | Safe | C/C++ |
void JPXStream::init()
{
Object oLen, cspace, smaskInData;
if (getDict()) {
oLen = getDict()->lookup("Length");
cspace = getDict()->lookup("ColorSpace");
smaskInData = getDict()->lookup("SMaskInData");
}
int bufSize = BUFFER_INITIAL_SIZE;
if (oLen.isInt() && oLen.getInt() > 0) bufSize = oLen.getI... | vuln | Safe | Unknown |
public static MathTransform create(final int dimension, final int wraparoundDimension, final double period,
final double sourceMedian, final double targetMedian)
{
ArgumentChecks.ensureStrictlyPositive("dimension", dimension);
ArgumentChecks.ensureBetween("wrap... | vuln | Vulnerable | Java |
krb5_encode_krbsecretkey(krb5_key_data *key_data_in, int n_key_data,
krb5_kvno mkvno) {
struct berval **ret = NULL;
int currkvno;
int num_versions = 1;
int i, j, last;
krb5_error_code err = 0;
krb5_key_data *key_data;
if (n_key_data <= 0)
return NULL;
/... | vuln | Vulnerable | C/C++ |
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
| Copyrigh... | vuln | Safe | C/C++ |
inline static int push_frame(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
AVFilterLink *inlink = ctx->inputs[0];
ShowWavesContext *showwaves = outlink->src->priv;
int nb_channels = inlink->channels;
int ret, i;
if ((ret = ff_filter_frame(outlink, showwaves->outpicref)) >= 0)
... | vuln | Vulnerable | C/C++ |
def _check_signature(self, decoded_xml, item, node_name=NODE_NAME, origdoc=None, id_attr='', must=False, only_valid_cert=False, issuer=None):
try:
_issuer = item.issuer.text.strip()
except AttributeError:
_issuer = None
if _issuer is None:
try:
... | vuln | Safe | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.