code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
QStringList JlCompress::extractDir(QuaZip &zip, const QString &dir)
{
if(!zip.open(QuaZip::mdUnzip)) {
return QStringList();
}
QString cleanDir = QDir::cleanPath(dir);
QDir directory(cleanDir);
QString absCleanDir = directory.absolutePath();
QStringList extracted;
if (!zip.goToFirstF... | vuln | Safe | C/C++ |
AcpiDsCreateOperands (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *FirstArg)
{
ACPI_STATUS Status = AE_OK;
ACPI_PARSE_OBJECT *Arg;
ACPI_PARSE_OBJECT *Arguments[ACPI_OBJ_NUM_OPERANDS];
UINT32 ArgCount = 0;
UINT32 In... | vuln | Vulnerable | Unknown |
(function (mw, $) {
"use strict";
mw.PluginManager.add('share', mw.KBaseScreen.extend({
defaultConfig: {
parent: "topBarContainer",
order: 5,
align: "right",
tooltip: gM( 'mwe-embedplayer-share' ),
title: gM( 'mwe-embedplayer-share' ),
showTooltip: true,
displayImportance: 'medium',
temp... | vuln | Vulnerable | JavaScript |
package com.salesmanager.shop.admin.controller.user;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
import org.springframework.stereotype.Control... | vuln | Vulnerable | Java |
private static ByteBuf serializeProtobuf(MessageLite msg, ByteBufAllocator allocator) {
int size = msg.getSerializedSize();
// Protobuf serialization is the last step of the netty pipeline. We used to allocate
// a heap buffer while serializing and pass it down to netty library.
// In Ab... | 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") + yo... | vuln | Vulnerable | Java |
this.defaultFilename,!0);q.getHash=function(){return k};this.fileLoaded(q);"csv"==c.format&&this.importCsv(v,mxUtils.bind(this,function(M){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=c.update){var x=null!=c.interval?parseInt(c.interval):6E4,A=null,z=mxUtils.bind(thi... | vuln | Vulnerable | JavaScript |
private Map<String, List<?>> fetchHostAssets(String type) throws Exception {
Map<String, List<?>> procssInfo = new HashMap<>();
List<Map<String, Object>> processList = new ArrayList<>();
List<String> uploadList = new ArrayList<>();
List<Map<String, String>> noPrfileList = new ArrayList... | vuln | Safe | Java |
void AppCacheUpdateJob::OnResponseInfoLoaded(
AppCacheResponseInfo* response_info,
int64_t response_id) {
const net::HttpResponseInfo* http_info =
response_info ? &response_info->http_response_info() : nullptr;
if (internal_state_ == FETCH_MANIFEST) {
if (http_info)
manifest_fetcher_->set_e... | vuln | Vulnerable | C/C++ |
static int encode_frame(FlacEncodeContext *s)
{
int ch, count;
count = count_frame_header(s);
for (ch = 0; ch < s->channels; ch++)
count += encode_residual_ch(s, ch);
count += (8 - (count & 7)) & 7;
count += 16;
return count >> 3;
} | vuln | Vulnerable | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Safe | C/C++ |
/*
* Copyright 2019 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 |
@Override
protected ItemStack onItemUseSuccess(final ItemStack itemStack, final World world, final ServerPlayerEntity player)
{
itemStack.shrink(1);
if (world.rand.nextInt(10) == 0)
{
// Fail
player.sendStatusMessage(new TranslationTextComponent("minecolonies.scr... | vuln | Vulnerable | Java |
Status ImmutableExecutorState::Initialize(const Graph& graph) {
TF_RETURN_IF_ERROR(gview_.Initialize(&graph));
// Build the information about frames in this subgraph.
ControlFlowInfo cf_info;
TF_RETURN_IF_ERROR(BuildControlFlowInfo(&graph, &cf_info));
for (auto& it : cf_info.unique_frame_names) {
Ensure... | vuln | Safe | C/C++ |
private void setQuote(@NonNull MessageRecord current, @NonNull Optional<MessageRecord> previous, @NonNull Optional<MessageRecord> next, boolean isGroupThread, @NonNull ChatColors chatColors) {
boolean startOfCluster = isStartOfMessageCluster(current, previous, isGroupThread);
if (current.isMms() && !current.isM... | vuln | Safe | Java |
static int v4l2_receive_packet(AVCodecContext *avctx, AVPacket *avpkt)
{
V4L2m2mContext *s = ((V4L2m2mPriv*)avctx->priv_data)->context;
V4L2Context *const capture = &s->capture;
V4L2Context *const output = &s->output;
int ret;
if (s->draining)
goto dequeue;
if (!output->streamon) {
... | vuln | Safe | C/C++ |
R_API RBinJavaAttrInfo *r_bin_java_rti_annotations_attr_new(RBinJavaObj *bin, ut8 *buffer, ut64 sz, ut64 buf_offset) {
ut32 i = 0;
ut64 offset = 0;
if (buf_offset + 32 >= sz) {
return NULL;
}
RBinJavaAttrInfo *attr = r_bin_java_default_attr_new (bin, buffer, sz, buf_offset);
offset += 6;
if (attr) {
attr->ty... | vuln | Safe | C/C++ |
func_exists (struct _ESExp *f,
gint argc,
struct _ESExpResult **argv,
gpointer data)
{
EBookBackendLDAPSExpData *ldap_data = data;
ESExpResult *r;
if (argc == 1
&& argv[0]->type == ESEXP_RES_STRING) {
gchar *propname = argv[0]->value.string;
if (!strcmp (propname, "x... | vuln | Safe | Unknown |
int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
int utype, char *free_cont, const ASN1_ITEM *it)
{
ASN1_VALUE **opval = NULL;
ASN1_STRING *stmp;
ASN1_TYPE *typ = NULL;
int ret = 0;
const ASN1_PRIMITIVE_FUNCS *pf;
ASN1_INTEGER **tint;
pf = it->funcs;
... | vuln | Safe | Unknown |
static int
xmlXPathCompOpEvalPositionalPredicate(xmlXPathParserContextPtr ctxt,
xmlXPathStepOpPtr op,
xmlNodeSetPtr set,
int contextSize,
int minPos,
int maxPos,
int hasNsNodes)
{
if (op->ch1 != -1) {
xmlXPathCompExprPtr comp = ctxt->comp;
if (comp->step... | vuln | Safe | C/C++ |
@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 |
def render(self, request):
"""
Send www-authenticate headers to the client
"""
def ensureBytes(s):
return s.encode("ascii") if isinstance(s, str) else s
def generateWWWAuthenticate(scheme, challenge):
lst = []
for k, v in challenge.items():
... | vuln | Vulnerable | Python |
/*
* Copyright © 2016 Red Hat, Inc
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library i... | vuln | Safe | C/C++ |
cib_timeout_handler(gpointer data)
{
struct timer_rec_s *timer = data;
timer_expired = TRUE;
crm_err("Call %d timed out after %ds", timer->call_id, timer->timeout);
/* Always return TRUE, never remove the handler
* We do that after the while-loop in cib_native_perform_op()
*/
return TRUE;
... | vuln | Vulnerable | C/C++ |
ProcRenderAddGlyphs (ClientPtr client)
{
GlyphSetPtr glyphSet;
REQUEST(xRenderAddGlyphsReq);
GlyphNewRec glyphsLocal[NLOCALGLYPH];
GlyphNewPtr glyphsBase, glyphs, glyph_new;
int remain, nglyphs;
CARD32 *gids;
xGlyphInfo *gi;
CARD8 *bits;
unsigned int s... | vuln | Safe | Unknown |
VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::VaapiVP9Accelerator(
VaapiVideoDecodeAccelerator* vaapi_dec,
VaapiWrapper* vaapi_wrapper)
: vaapi_wrapper_(vaapi_wrapper), vaapi_dec_(vaapi_dec) {
DCHECK(vaapi_wrapper_);
DCHECK(vaapi_dec_);
} | vuln | Vulnerable | C/C++ |
static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address,
MMUAccessType access_type, ARMMMUIdx mmu_idx,
hwaddr *phys_ptr, MemTxAttrs *txattrs, int *prot,
target_ulong *page_size_ptr,
... | vuln | Safe | C/C++ |
@Override
protected boolean canPlayAI(Player ai, SpellAbility sa) {
final Cost abCost = sa.getPayCosts();
final Card source = sa.getHostCard();
// TODO: improve this so that the AI can use a flash aura buff as a means of killing opposing creatures
// and gaining card advantage
... | vuln | Safe | Java |
@Override
public final @NonNull IBinder onBind(Intent intent) {
return new IPermissionController.Stub() {
@Override
public void revokeRuntimePermissions(
Bundle bundleizedRequest, boolean doDryRun, int reason,
String callerPackageName, AndroidF... | vuln | Safe | Java |
std::istream& operator>>
(std::istream& is, Nef_polyhedron_2<T,Items,Mark>& NP)
{
typedef typename Nef_polyhedron_2<T,Items,Mark>::Decorator Decorator;
CGAL::PM_io_parser<Decorator> I(is, NP.pm());
if (I.check_sep("Nef_polyhedron_2<") &&
I.check_sep(NP.EK.output_identifier()) &&
I.check_sep(">")) I.... | vuln | Safe | Unknown |
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 | Vulnerable | C/C++ |
def node_standby(params, request, session)
if params[:name]
code, response = send_request_with_token(
session, params[:name], 'node_standby', true, {"node"=>params[:name]}
)
# data={"node"=>params[:name]} for backward compatibility with older versions of pcs/pcsd
else
if not allowed_for_local_... | vuln | Vulnerable | Ruby |
gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr fd) /* {{{ */
{
int BitPixel;
#if 0
int ColorResolution;
int Background;
int AspectRatio;
#endif
int Transparent = (-1);
unsigned char buf[16];
unsigned char c;
unsigned char ColorMap[3][MAXCOLORMAPSIZE];
unsigned char localColorMap[3][MAXCOLORMAPSIZE];
in... | vuln | Vulnerable | C/C++ |
@Override
public int addRampRule(final ImageRampRule rampRule) {
try {
// duplicated rule should be forbidden as client side error, which needs a separate check to
// avoid it falls into normal SQL Exception as server error.
List<ImageRampRule> rampRules = databaseOperator.query(
Fetch... | vuln | Vulnerable | Java |
@EventHandler
public void onStep(final GenericGameEvent event) {
Entity entity = event.getEntity();
if (entity == null) return;
Location eLoc = entity.getLocation();
if (!isLoaded(event.getLocation()) || !isLoaded(eLoc)) return;
Block below = entity.getLocation().getBlock().... | vuln | Safe | Java |
Pl_DCT::decompress(void* cinfo_p, Buffer* b)
{
struct jpeg_decompress_struct* cinfo =
reinterpret_cast<jpeg_decompress_struct*>(cinfo_p);
#if ((defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || \
defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ign... | vuln | Vulnerable | Unknown |
private boolean isServiceVulnerable(NetworkService networkService) {
String targetUri =
NetworkServiceUtils.buildWebApplicationRootUrl(networkService)
+ "cgi-bin/.%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd";
try {
HttpResponse response = httpClient.send(get(targetUri).withEmptyHeaders().build... | vuln | Vulnerable | Java |
int sc_file_set_sec_attr(sc_file_t *file, const u8 *sec_attr,
size_t sec_attr_len)
{
u8 *tmp;
if (!sc_file_valid(file)) {
return SC_ERROR_INVALID_ARGUMENTS;
}
if (sec_attr == NULL) {
if (file->sec_attr != NULL)
free(file->sec_attr);
file->sec_attr = NULL;
file->sec_attr_len = 0;
return 0;
}
tmp... | vuln | Vulnerable | Unknown |
@Override
public void render(ScribesTile tile, float partialTicks, MatrixStack stack, IRenderTypeBuffer bufferIn, int packedLightIn) {
try{
if(tile.getLevel().getBlockState(tile.getBlockPos()).getBlock() != BlockRegistry.SCRIBES_BLOCK)
return;
if(tile.getLevel().getBl... | vuln | Safe | Java |
/*
* 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 | Vulnerable | Java |
static int decode_13(AVCodecContext *avctx, DxaDecContext *c, uint8_t* dst,
int stride, uint8_t *src, uint8_t *ref)
{
uint8_t *code, *data, *mv, *msk, *tmp, *tmp2;
int i, j, k;
int type, x, y, d, d2;
uint32_t mask;
code = src + 12;
data = code + ((avctx->width * avctx->heig... | vuln | Vulnerable | C/C++ |
def main(argv):
parser = ArgumentParser(argv[0], description=__doc__,
formatter_class=lambda prog: HelpFormatter(prog, max_help_position=10, width=120))
parser.add_argument('dataset', type=str, nargs='+',
help='Dataset(s) used for training.')
parser.add_argument('output', type=str,... | vuln | Vulnerable | Python |
static void
dio_input(void)
{
unsigned char *buffer;
uint8_t buffer_length;
rpl_dio_t dio;
uint8_t subopt_type;
int i;
int len;
uip_ipaddr_t from;
memset(&dio, 0, sizeof(dio));
/* Set default values in case the DIO configuration option is missing. */
dio.dag_intdoubl = RPL_DIO_INTERVAL_DOUBLINGS;
... | vuln | Safe | C/C++ |
void BrowserCommandController::TabReplacedAt(TabStripModel* tab_strip_model,
TabContents* old_contents,
TabContents* new_contents,
int index) {
RemoveInterstitialObservers(old_cont... | vuln | Safe | C/C++ |
static NTSTATUS create_file_unixpath(connection_struct *conn,
struct smb_request *req,
struct smb_filename *smb_fname,
uint32_t access_mask,
uint32_t share_access,
uint32_t create_disposition,
uint32_t create_options,
uint32_t file_attributes,
uint... | vuln | Vulnerable | Unknown |
@Override
public void addComputedTypeAnnotations(Element element, AnnotatedTypeMirror type) {
super.addComputedTypeAnnotations(element, type);
if (element != null) {
AnnotatedTypeMirror valueType = getValueAnnotatedTypeFactory().getAnnotatedType(element);
addUpperBoundTypeFromValueType(valueType, ... | vuln | Vulnerable | Java |
'use strict';
// @ts-check
// ==================================================================================
// internet.js
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
// Copyright: (c) 2014 - ... | vuln | Vulnerable | JavaScript |
@Nullable
public Uri getReferrer() {
Intent intent = getIntent();
if (intent != null) {
try {
Uri referrer = intent.getParcelableExtra(Intent.EXTRA_REFERRER);
if (referrer != null) {
return referrer;
}
St... | vuln | Safe | Java |
void tftp_input(struct sockaddr_storage *srcsas, struct mbuf *m)
{
struct tftphdr *hdr = mtod_check(m, sizeof(struct tftphdr));
if (hdr == NULL) {
return;
}
switch (ntohs(hdr->tp_op)) {
case TFTP_RRQ:
tftp_handle_rrq(m->slirp, srcsas,
mtod(m, struct tftp_t *... | vuln | Safe | Unknown |
int main (int argc, char **argv)
{
int ret = 0, got_frame;
if (argc != 4) {
fprintf(stderr, "usage: %s input_file video_output_file audio_output_file\n"
"API example program to show how to read frames from an input file.\n"
"This program reads frames from a file, decodes ... | vuln | Safe | C/C++ |
!function(e){e.languages.haml={"multiline-comment":{pattern:/((?:^|\r?\n|\r)([\t ]*))(?:\/|-#).*(?:(?:\r?\n|\r)\2[\t ]+.+)*/,lookbehind:!0,alias:"comment"},"multiline-code":[{pattern:/((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*,[\t ]*(?:(?:\r?\n|\r)\2[\t ]+.*,[\t ]*)*(?:(?:\r?\n|\r)\2[\t ]+.+)/,lookbehind:!0,inside:e.lan... | vuln | Vulnerable | JavaScript |
/* FTP engine
*
* Copyright (c) 2014-2019 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 SOFTW... | vuln | Vulnerable | C/C++ |
function parseOptions(
{ options: { flagProtection, interpolation, shell }, process: { env } },
{ getDefaultShell, getShellName },
) {
flagProtection = flagProtection ? true : false;
interpolation = interpolation ? true : false;
shell = isString(shell) ? shell : getDefaultShell({ env });
const shellName = ... | vuln | Vulnerable | JavaScript |
require('../services/Requisitions');
import Util from 'lib/util';
const QuickNode = require('../model/QuickNode');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(function() {
'use strict';
const quickAddPanelBasicView = require('../../views/quick-add-panel-basi... | vuln | Safe | Java |
static void kvm_arm_gicv3_realize(DeviceState *dev, Error **errp)
{
GICv3State *s = KVM_ARM_GICV3(dev);
KVMARMGICv3Class *kgc = KVM_ARM_GICV3_GET_CLASS(s);
Error *local_err = NULL;
int i;
DPRINTF("kvm_arm_gicv3_realize\n");
kgc->parent_realize(dev, &local_err);
if (local_err) {
error... | vuln | Safe | C/C++ |
static char *get_geokey_val(int key, int val)
{
char *ap;
if (val == TIFF_GEO_KEY_UNDEFINED)
return av_strdup("undefined");
if (val == TIFF_GEO_KEY_USER_DEFINED)
return av_strdup("User-Defined");
#define RET_GEOKEY_VAL(TYPE, array)\
if (val >= TIFF_##TYPE##_OFFSET &&\
val - TIFF_... | vuln | Safe | C/C++ |
@Override
public HistoricTaskInstanceQuery caseVariableValueEquals(String variableName, Object variableValue) {
if (inOrStatement) {
currentOrQueryObject.scopedVariableValueEquals(variableName, variableValue, ScopeTypes.CMMN);
} else {
this.scopedVariableValueEquals(variableN... | vuln | Safe | Java |
"""
This module provides a client interface for the node to communicate with the
central server.
"""
import jwt
import datetime
import time
from typing import Dict, Tuple
from threading import Thread
from vantage6.common import WhoAmI
from vantage6.client import ClientBase
from vantage6.node.globals import REFRESH_BE... | vuln | Safe | Python |
jpc_ms_t *jpc_getms(jas_stream_t *in, jpc_cstate_t *cstate)
{
jpc_ms_t *ms;
jpc_mstabent_t *mstabent;
jas_stream_t *tmpstream;
if (!(ms = jpc_ms_create(0))) {
return 0;
}
/* Get the marker type. */
if (jpc_getuint16(in, &ms->id) || ms->id < JPC_MS_MIN ||
ms->id > JPC_MS_MAX) {
jpc_ms_destroy(ms);
retu... | vuln | Safe | C/C++ |
@Override
public void afterTextChanged(Editable editable) {
String[] email = editable.toString().split("@");
etDomain.setText(email.length < 2 ? null : email[1]);
} | vuln | Vulnerable | Java |
void play(int num)
{
new Thread( new Runnable() {
@Override
public void run() {
if(channel.get(num).needParse() == Channel.NEEDPARSE_YES) {
try {
channel.get(num).parse();
} catch (JSONException | IOExcep... | vuln | Safe | Java |
static GIOStatus ga_channel_write(GAChannel *c, const char *buf, size_t size,
size_t *count)
{
GIOStatus status;
OVERLAPPED ov = {0};
BOOL ret;
DWORD written;
ov.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
ret = WriteFile(c->handle, buf, size, &written, &ov)... | vuln | Vulnerable | C/C++ |
void LibRaw::parse_exif(int base)
{
unsigned entries, tag, type, len, save, c;
double expo, ape;
unsigned kodak = !strncmp(make, "EASTMAN", 7) && tiff_nifds < 3;
entries = get2();
if (!strncmp(make, "Hasselblad", 10) && (tiff_nifds > 3) && (entries > 512))
return;
INT64 fsize = ifp->size();
while (e... | vuln | Vulnerable | C/C++ |
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_engine.c - QUIC engine
*/
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/queue.h>
#include <time.h>
#ifn... | vuln | Safe | C/C++ |
@Override
public boolean handle(WrapperWorld world, AEntityE_Multipart<?> entity){
if(partItem == null){
entity.removePart(entity.getPartAtLocation(partOffset), null);
}else{
JSONPartDefinition packVehicleDef = entity.getPackDefForLocation(partOffset);
entity.addPart(partItem.createPart(entity, packVehicl... | vuln | Vulnerable | Java |
@Override
public void regenerate(int x, int z) {
clearRegeneratedLists(x, z);
int xx = x * 16;
int zz = z * 16;
BiomeBaseInjector inj = (a, b, c, d) -> {
};
//noinspection deprecation
generateChunkRawData(getComposite().getWorld(), x, z, new TerrainChunk() {
... | vuln | Vulnerable | Java |
async def get_earliest_token_for_stats(self, stats_type: str, id: str) -> int:
"""
Fetch the "earliest token". This is used by the room stats delta
processor to ignore deltas that have been processed between the
start of the background task and any particular room's stats
being c... | vuln | Vulnerable | Python |
package api
import (
"fmt"
)
// Role is the type of a role.
type Role string
const (
// Host is the HOST role.
Host Role = "HOST"
// Admin is the ADMIN role.
Admin Role = "ADMIN"
// NormalUser is the USER role.
NormalUser Role = "USER"
)
func (e Role) String() string {
switch e {
case Host:
return "HOST"... | vuln | Safe | Go |
private static void updateConfig(Path configFile, String name, boolean isExploded) throws Exception {
try (FileInputStream fileInputStream = new FileInputStream(configFile.toFile())) {
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactoryUtil.create();
DocumentBuilder do... | vuln | Safe | Java |
@Override
public List<File> openMultipleDialog(String title, String defaultPath, String filterPatterns, String filterDescription) {
if (useSwing) {
return showFileChooser(OPEN_MULTIPLE, title, defaultPath, filterPatterns, filterDescription);
}
NFDPathSet outPaths =NFDPathSet... | vuln | Vulnerable | Java |
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#in... | vuln | Safe | C/C++ |
compile_nested_function(exarg_T *eap, cctx_T *cctx, char_u **line_to_free)
{
int is_global = *eap->arg == 'g' && eap->arg[1] == ':';
char_u *name_start = eap->arg;
char_u *name_end = to_name_end(eap->arg, TRUE);
int off;
char_u *func_name;
char_u *lambda_name;
ufunc_T *ufunc;
int r = ... | vuln | Safe | C/C++ |
async function audioCaptions() {
const tokenValidation = await AuthTokenValidation
.findOneAsync({ connectionId: this.connection.id });
if (!tokenValidation || tokenValidation.validationStatus !== ValidationStates.VALIDATED) {
Logger.warn(`Publishing AudioCaptions was requested by unauth connection ${this.... | vuln | Safe | JavaScript |
- (NSArray *) _fetchFields: (NSArray *) fields
forComponentOfType: (NSString *) component
{
NSEnumerator *folders, *currentInfos;
SOGoAppointmentFolder *currentFolder;
NSMutableDictionary *newInfo;
NSMutableArray *infos, *newInfoForComponent;
NSNull *marker;
SOGoAppointmentFolders *clientObject;
SOGoUser... | vuln | Safe | JavaScript |
@SuppressWarnings("unchecked")
@Inject(method = "getCodec", at = @At("HEAD"), cancellable = true)
public void onGetCodec(CallbackInfoReturnable<Codec<T>> info) {
GameOptions options = MinecraftClient.getInstance().options;
if (options == null) return;
if ((Object) this == options.getGam... | vuln | Vulnerable | Java |
ProcRenderAddGlyphs (ClientPtr client)
{
GlyphSetPtr glyphSet;
REQUEST(xRenderAddGlyphsReq);
GlyphNewRec glyphsLocal[NLOCALGLYPH];
GlyphNewPtr glyphsBase, glyphs, glyph_new;
int remain, nglyphs;
CARD32 *gids;
xGlyphInfo *gi;
CARD8 *bits;
unsigned int s... | vuln | Vulnerable | Unknown |
int bn_size_bin(const bn_t a) {
dig_t d;
int digits;
digits = (a->used - 1) * (RLC_DIG / 8);
d = a->dp[a->used - 1];
while (d != 0) {
d = d >> 8;
digits++;
}
return digits;
} | vuln | Vulnerable | C/C++ |
void CL_InitRef( void ) {
refimport_t ri;
refexport_t *ret;
#ifdef USE_RENDERER_DLOPEN
GetRefAPI_t GetRefAPI;
char dllName[MAX_OSPATH];
#endif
Com_Printf( "----- Initializing Renderer ----\n" );
#ifdef USE_RENDERER_DLOPEN
cl_renderer = Cvar_Get("cl_renderer", "opengl1", CVAR_ARCHIVE | CVAR_LATCH | CVAR_PROTE... | vuln | Safe | C/C++ |
public static boolean canUpdate() {
return mc != null && mc.world != null && mc.player != null;
} | vuln | Safe | Java |
/* Copyright 2013 Simo Sorce <simo@samba.org>, see COPYING for license */
/* This File implements the NTLM protocol as specified by:
* [MS-NLMP]: NT LAN Manager (NTLM) Authentication Protocol
*
* Additional cross checking with:
* http://davenport.sourceforge.net/ntlm.html
*/
#include <alloca.h>
#include <en... | vuln | Vulnerable | C/C++ |
/*
Conexant cx24116/cx24118 - DVBS/S2 Satellite demod/tuner driver
Copyright (C) 2006-2008 Steven Toth <stoth@hauppauge.com>
Copyright (C) 2006-2007 Georg Acher
Copyright (C) 2007-2008 Darron Broad
March 2007
Fixed some bugs.
Added diseqc support.
Added corrected signal strength support... | vuln | Vulnerable | C/C++ |
def get_current_state(chat_id):
settings = sqlite3.connect(os.path.abspath(os.path.dirname(__file__))+"\\bases\\settings.db")
conn = settings.cursor()
conn.execute("select * from users where chat_id = ?", (str(chat_id),))
name = conn.fetchone()
if name != None:
return name[4]
else:
... | vuln | Safe | Python |
static int php_session_destroy(TSRMLS_D) /* {{{ */
{
int retval = SUCCESS;
if (PS(session_status) != php_session_active) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to destroy uninitialized session");
return FAILURE;
}
if (PS(mod)->s_destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) {
retval = ... | vuln | Vulnerable | Unknown |
static int add_doubles_metadata(int count,
const char *name, const char *sep,
TiffContext *s)
{
char *ap;
int i;
double *dp;
if (count >= INT_MAX / sizeof(int64_t) || count <= 0)
return AVERROR_INVALIDDATA;
if (bytestream2_get_b... | vuln | Vulnerable | C/C++ |
// SPDX-FileCopyrightText: 2010-2020 nibble <nibble.ds@gmail.com>
// SPDX-FileCopyrightText: 2010-2020 pancake <pancake@nopcode.org>
// SPDX-License-Identifier: LGPL-3.0-only
#include <stdio.h>
#include <rz_types.h>
#include <rz_util.h>
#include "mach0.h"
#include <rz_hash.h>
#include "mach0_utils.inc"
// TODO: depr... | vuln | Vulnerable | C/C++ |
gpgsm_get_short_fingerprint (ksba_cert_t cert, unsigned long *r_high)
{
unsigned char digest[20];
gpgsm_get_fingerprint (cert, GCRY_MD_SHA1, digest, NULL);
if (r_high)
*r_high = (((unsigned long)digest[12]<<24)
|(digest[13]<<16)
|(digest[14]<< 8)
|digest[15]);
r... | vuln | Vulnerable | Unknown |
def _setup_environment_vars(self, algorithm_env: dict,
database: str = 'default') -> dict:
""""
Set environment variables required to run the algorithm
Parameters
----------
algorithm_env: dict
Dictionary with additional environment va... | vuln | Vulnerable | Python |
static int MP4_ReadBox_String( stream_t *p_stream, MP4_Box_t *p_box )
{
MP4_READBOX_ENTER( MP4_Box_data_string_t );
if( p_box->i_size < 8 || p_box->i_size > SIZE_MAX )
MP4_READBOX_EXIT( 0 );
p_box->data.p_string->psz_text = malloc( p_box->i_size + 1 - 8 ); /* +\0, -name, -size */
if( p_box->da... | vuln | Safe | C/C++ |
sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
{
void __user *p = (void __user *)arg;
int __user *ip = p;
int result, val, read_only;
Sg_device *sdp;
Sg_fd *sfp;
Sg_request *srp;
unsigned long iflags;
if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)))
return -ENXIO;... | vuln | Vulnerable | C/C++ |
static void imx6_defer_clear_reset_bit(int cpuid,
IMX6SRCState *s,
unsigned long reset_shift)
{
struct SRCSCRResetInfo *ri;
CPUState *cpu = arm_get_cpu_by_id(cpuid);
if (!cpu) {
return;
}
ri = g_malloc(sizeof(struc... | vuln | Safe | C/C++ |
TfLiteStatus CheckInputTensorDimensions(TfLiteContext* context,
TfLiteNode* node, int n_input,
int n_output, int n_cell,
bool is_layer_norm_lstm) {
const auto* params = reinterpret_cast<TfLiteLSTMPa... | vuln | Safe | C/C++ |
private void evaluateTextDisplay(final int count, final boolean exists, final String deviceName) {
if (deviceManager == null) {
return;
}
menuConfig.evaluateTextDisplay(deviceName);
final CursorRemoteControlsPage remotes = cursorDeviceControl.getRemotes();
if (remotes != null) {
if (!exists || deviceNam... | vuln | Vulnerable | Java |
@Override
public void onError(Exception e) {
AndroidUtilities.runOnUIThread(() -> {
if (firstTranslation) {
dismiss();
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.showBulletin, Bulletin.TYP... | vuln | Safe | Java |
static Image *ReadARTImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
const unsigned char
*pixels;
Image
*image;
QuantumInfo
*quantum_info;
QuantumType
quantum_type;
MagickBooleanType
status;
size_t
length;
ssize_t
count,
y;
/*
Open image file.
*... | vuln | Safe | C/C++ |
static int read_gab2_sub(AVFormatContext *s, AVStream *st, AVPacket *pkt)
{
if (pkt->size >= 7 &&
pkt->size < INT_MAX - AVPROBE_PADDING_SIZE &&
!strcmp(pkt->data, "GAB2") && AV_RL16(pkt->data + 5) == 2) {
uint8_t desc[256];
int score = AVPROBE_SCORE_EXTENSION, ret;
AVISt... | vuln | Vulnerable | Unknown |
static int
ip_printts(netdissect_options *ndo,
register const u_char *cp, u_int length)
{
register u_int ptr;
register u_int len;
int hoplen;
const char *type;
if (length < 4) {
ND_PRINT((ndo, "[bad length %u]", length));
return (0);
}
ND_PRINT((ndo, " TS{"));
hoplen = ((cp[3]&0xF) != IPOPT_TS_T... | vuln | Safe | C/C++ |
evbuffer_ptr_set(struct evbuffer *buf, struct evbuffer_ptr *pos,
size_t position, enum evbuffer_ptr_how how)
{
size_t left = position;
struct evbuffer_chain *chain = NULL;
int result = 0;
EVBUFFER_LOCK(buf);
switch (how) {
case EVBUFFER_PTR_SET:
chain = buf->first;
pos->pos = position;
position = 0;
... | vuln | Safe | Unknown |
private SearchResult lookupUser(String accountName) throws NamingException {
InitialDirContext context = initContext();
String searchString = searchFilter.replace(":login", encodeForLdap(accountName));
SearchControls searchControls = new SearchControls();
String[] attributeFilter = {id... | vuln | Safe | Java |
#include "LogHandler.hpp"
INITIALIZE_EASYLOGGINGPP
namespace et {
el::Configurations LogHandler::setupLogHandler(int *argc, char ***argv) {
// easylogging parse verbose arguments, see [Application Arguments]
// in https://github.com/muflihun/easyloggingpp/blob/master/README.md
START_EASYLOGGINGPP(*argc, *argv);... | vuln | Vulnerable | C/C++ |
def create_event(self, title, start_time, time_zone, server_id, description):
sql = """
INSERT INTO events (title, start_time, time_zone, server_id, description)
VALUES (%s, %s, %s, %s, %s)
"""
self.cur.execute(sql, (title, start_time, time_zone, server_id, desc... | vuln | Safe | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.