code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
private void measureTime(MessageObject messageObject) {
CharSequence signString;
long fromId = messageObject.getFromChatId();
if (messageObject.scheduled) {
signString = null;
} else if (messageObject.messageOwner.post_author != null) {
if (isMegagroup && messageO... | vuln | Vulnerable | Java |
package config
import (
"errors"
"fmt"
"reflect"
"runtime"
"github.com/libp2p/go-libp2p-core/pnet"
"github.com/libp2p/go-libp2p-core/connmgr"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/transport"
)
var errorType = reflect.TypeOf((*error)(nil)).Elem()
// checks if a function r... | vuln | Vulnerable | Go |
static @Nonnull Map<String,String> findResources(@Nonnull CpsFlowExecution execution, @Nonnull String name, @CheckForNull String encoding) throws IOException, InterruptedException {
Map<String,String> resources = new TreeMap<>();
Queue.Executable executable = execution.getOwner().getExecutable();
... | vuln | Safe | Java |
int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc)
{
struct scsi_device *SDev;
struct scsi_sense_hdr sshdr;
int result, err = 0, retries = 0;
SDev = cd->device;
retry:
if (!scsi_block_when_processing_errors(SDev)) {
err = -ENODEV;
goto out;
}
result = scsi_execute(SDev, cgc->cmd, ... | vuln | Vulnerable | C/C++ |
def default(self, action=None, **kwargs):
# Delete session on form submit
form = RevokeSessionForm()
if form.is_submitted():
if form.validate():
session = SessionObject.query.filter(
SessionObject.username == self.app.currentuser.username, SessionO... | vuln | Safe | Python |
*/
static void php_wddx_pop_element(void *user_data, const XML_Char *name)
{
st_entry *ent1, *ent2;
wddx_stack *stack = (wddx_stack *)user_data;
HashTable *target_hash;
zend_class_entry **pce;
zval *obj;
zval *tmp;
TSRMLS_FETCH();
/* OBJECTS_FIXME */
if (stack->top == 0) {
return;
}
if (!s... | vuln | Safe | Unknown |
private void processSecurityConstraints(WebApplication webApplication, WebXml webXml) {
AuthenticationManager manager = webApplication.getManager(AuthenticationManager.class);
for (WebXmlSecurityConstraint constraint : webXml.getSecurityConstraints()) {
for (WebXmlSecurityConstraint.WebResou... | vuln | Vulnerable | Java |
static TPM_RESULT
SWTPM_NVRAM_CheckHeader(unsigned char *data, uint32_t length,
uint32_t *dataoffset, uint16_t *hdrflags,
uint8_t *hdrversion, bool quiet)
{
blobheader *bh = (blobheader *)data;
if (length < sizeof(bh)) {
if (!quiet)
logprintf(... | vuln | Vulnerable | C/C++ |
static int xen_pt_bar_reg_read(XenPCIPassthroughState *s, XenPTReg *cfg_entry,
uint32_t *value, uint32_t valid_mask)
{
XenPTRegInfo *reg = cfg_entry->reg;
uint32_t valid_emu_mask = 0;
uint32_t bar_emu_mask = 0;
int index;
index = xen_pt_bar_offset_to_index(reg->of... | vuln | Safe | C/C++ |
PHP_HASH_API void PHP_HAVAL160Final(unsigned char *digest, PHP_HAVAL_CTX * context)
{
unsigned char bits[10];
unsigned int index, padLen;
/* Version, Passes, and Digest Length */
bits[0] = (PHP_HASH_HAVAL_VERSION & 0x07) |
((context->passes & 0x07) << 3) |
((context->output & 0x03) << 6);
bits[1] = (conte... | vuln | Vulnerable | Unknown |
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2000-2006 Silicon Graphics, Inc.
* All Rights Reserved.
*/
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_shared.h"
#include "xfs_format.h"
#include "xfs_log_format.h"
#include "xfs_trans_resv.h"
#include "xfs_mount.h"
#include "xfs_defer.h"
#include "xfs_in... | vuln | Vulnerable | C/C++ |
int
virDomainGetTime(virDomainPtr dom,
long long *seconds,
unsigned int *nseconds,
unsigned int flags)
{
VIR_DOMAIN_DEBUG(dom, "seconds=%p, nseconds=%p, flags=%x",
seconds, nseconds, flags);
virResetLastError();
virCheckDomainReturn(d... | vuln | Vulnerable | C/C++ |
def close(self):
self.lock.release() | vuln | Vulnerable | Python |
static void qmp_input_type_int(Visitor *v, int64_t *obj, const char *name,
Error **errp)
{
QmpInputVisitor *qiv = to_qiv(v);
QInt *qint = qobject_to_qint(qmp_input_get_object(qiv, name, true));
if (!qint) {
error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "n... | vuln | Safe | C/C++ |
void ConnPoolImplBase::onConnectionEvent(ActiveClient& client, absl::string_view failure_reason,
Network::ConnectionEvent event) {
if (client.state() == ActiveClient::State::CONNECTING) {
ASSERT(connecting_stream_capacity_ >= client.effectiveConcurrentStreamLimit());
c... | vuln | Vulnerable | Unknown |
results_differ(const char *testname, const char *resultsfile, const char *default_expectfile)
{
char expectfile[MAXPGPATH];
char diff[MAXPGPATH];
char cmd[MAXPGPATH * 3];
char best_expect_file[MAXPGPATH];
FILE *difffile;
int best_line_count;
int i;
int l;
const char *platform_expectfile;
/*
* ... | vuln | Safe | Unknown |
void uverbs_user_mmap_disassociate(struct ib_uverbs_file *ufile)
{
struct rdma_umap_priv *priv, *next_priv;
lockdep_assert_held(&ufile->hw_destroy_rwsem);
while (1) {
struct mm_struct *mm = NULL;
/* Get an arbitrary mm pointer that hasn't been cleaned yet */
mutex_lock(&ufile->umap_lock);
while (!list_emp... | vuln | Vulnerable | C/C++ |
/*
* tls.c - TLS/TLS/DTLS dissector
*
* Copyright (C) 2016-21 - ntop.org
*
* nDPI 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 3 of the License, or
* (at your option) any later... | vuln | Safe | C/C++ |
@Override
public boolean isInitialized() {
return mSource != null && mSource.isInitialized();
} | vuln | Safe | Java |
public void preGenerateSolDerivationAddress() {
AppExecutors.getInstance().diskIO().execute(() -> {
String masterFingerPrint = new GetMasterFingerprintCallable().call();
String preDerivationPaths = Utilities.getSolDerivationPaths(getApplication());
if (!TextUtils.isEmpty(preD... | vuln | Vulnerable | Java |
static int
fuzzy_match_recursive(
char_u *fuzpat,
char_u *str,
int_u strIdx,
int *outScore,
char_u *strBegin,
int strLen,
int_u *srcMatches,
int_u *matches,
int maxMatches,
int nextMatch,
int *recursionCount)
{
// Recursion params
int recursiveMatch = FALSE;
int_u bestRecursiveMatches... | vuln | Safe | C/C++ |
static av_always_inline void idct(uint8_t *dst, int stride, int16_t *input, int type)
{
int16_t *ip = input;
int A, B, C, D, Ad, Bd, Cd, Dd, E, F, G, H;
int Ed, Gd, Add, Bdd, Fd, Hd;
int i;
for (i = 0; i < 8; i++) {
if ( ip[0] | ip[1] | ip[2] | ip[3] | ip[4] | ip[5] | ip[6] | i... | vuln | Safe | C/C++ |
static size_t WritePSDChannel(const PSDInfo *psd_info,
const ImageInfo *image_info,Image *image,Image *next_image,
const QuantumType quantum_type, unsigned char *compact_pixels,
MagickOffsetType size_offset,const MagickBooleanType separate,
const CompressionType compression,ExceptionInfo *exception)
{
MagickB... | vuln | Safe | C/C++ |
static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS)
static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS)
{
const char* loc_name = NULL;
int loc_name_len = 0;
const char* disp_loc_name = NULL;
int disp_loc_name_... | vuln | Safe | C/C++ |
@FieldHook("menuOptionsCount")
@Inject
public static void onMenuOptionsChanged(int idx)
{
int tmpOptionsCount = tmpMenuOptionsCount;
int optionCount = client.getMenuOptionCount();
tmpMenuOptionsCount = optionCount;
if (optionCount < tmpOptionsCount)
{
for (int i = optionCount; i < tmpOptionsCount; ++i... | vuln | Vulnerable | Java |
public String getDisplayValue() {
if (values == null || values.length==0) {
return "";
}
if (values.length == 1) {
return values[0];
}
StringBuilder sb = new StringBuilder(values[0]);
for (int i = 1; i < values.length; i++) {
sb.append(", ").append(values[i]);
}
return sb.toString();
} | vuln | Vulnerable | Java |
Pl_DCT::compress(void* cinfo_p, Buffer* b)
{
struct jpeg_compress_struct* cinfo =
reinterpret_cast<jpeg_compress_struct*>(cinfo_p);
#if ((defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || \
defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "... | vuln | Safe | Unknown |
def getKey(client):
"""Retrieves the specified key for the specified client
Returns an error if the key doesn't exist, obviously.
"""
global SERVER_JWT_PRIVATE_KEY
global BAD_REQUEST
validateClient(client)
client_pub_key = loadClientRSAKey(client)
token_data = decodeRequestToken(request.data, client_pub_key)
... | vuln | Vulnerable | Python |
AzureBlobServiceClient createClient(
AzureStorageSettings settings,
LocationMode locationMode,
RequestRetryOptions retryOptions,
ProxyOptions proxyOptions,
BiConsumer<String, URL> successfulRequestConsumer
) {
if (closed) {
throw new IllegalStateException(... | vuln | Safe | Java |
@Override
public void onPageFinished(WebView view, String url){
Log.d(TAG, "onPageFinished url=" + url);
// first we want to know if url is just a hashchange
// in which case we will NOT do anyhing special
if(currentUrl!=null && webviewMainPageLoaded) {
//Log.d(TAG, "onPageFinished current... | vuln | Safe | Java |
#
# Copyright (c) 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of... | vuln | Safe | Python |
target_ulong helper_add_suov(CPUTriCoreState *env, target_ulong r1,
target_ulong r2)
{
int64_t t1 = extract64(r1, 0, 32);
int64_t t2 = extract64(r2, 0, 32);
int64_t result = t1 + t2;
return suov32_pos(env, result);
} | vuln | Safe | C/C++ |
private void buildDialog(Context context) {
LayoutInflater inflater = LayoutInflater.from(context);
setCursorFrequencyView = inflater.inflate(R.layout.dialog_set_cursor_freq, null);
et_cursor_freq = setCursorFrequencyView.findViewById(R.id.et_cursor_freq);
AlertDialog.Builder setCursorFr... | vuln | Safe | Java |
constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
{
GObject *object;
NMAGConfConnectionPrivate *priv;
NMConnection *connection;
GError *error = NULL;
object = G_OBJECT_CLASS (nma_gconf_connection_parent_class)->constructor (type, n_construct_params, construct_pa... | vuln | Vulnerable | Unknown |
private boolean findMember(String host, int port, String dnSearchIn, boolean useSsl, String dnFind, boolean recursiveSearch) throws NamingException {
Hashtable<String,Object> env = new Hashtable<String,Object>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
String provUrl = retrie... | vuln | Safe | Java |
void* Type_LUTB2A_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsUInt32Number* nItems, cmsUInt32Number SizeOfTag)
{
cmsUInt8Number inputChan; // Number of input channels
cmsUInt8Number outputChan; // Number of output channels
cmsUInt32Number BaseOffset; // Actu... | vuln | Safe | Unknown |
TfLiteStatus Prepare(KernelType kernel_type, TfLiteContext* context,
TfLiteNode* node) {
auto* params = reinterpret_cast<TfLiteConvParams*>(node->builtin_data);
OpData* data = reinterpret_cast<OpData*>(node->user_data);
bool has_bias = node->inputs->size == 3;
// Check number of inputs/out... | vuln | Vulnerable | C/C++ |
var fs = require('fs')
var path = require('path')
var request = require('teeny-request').teenyRequest
var urlgrey = require('urlgrey')
var jsYaml = require('js-yaml')
var walk = require('ignore-walk')
var execSync = require('child_process').execSync
var detectProvider = require('./detect')
var version = 'v' + require... | vuln | Safe | JavaScript |
static int scaling_list_data(GetBitContext *gb, AVCodecContext *avctx, ScalingList *sl, HEVCSPS *sps)
{
uint8_t scaling_list_pred_mode_flag;
int32_t scaling_list_dc_coef[2][6];
int size_id, matrix_id, pos;
int i;
for (size_id = 0; size_id < 4; size_id++)
for (matrix_id = 0; matrix_id < 6; ma... | vuln | Safe | C/C++ |
create_pty_only(term_T *term, jobopt_T *opt)
{
if (create_vterm(term, term->tl_rows, term->tl_cols) == FAIL)
return FAIL;
term->tl_job = job_alloc();
if (term->tl_job == NULL)
return FAIL;
++term->tl_job->jv_refcount;
/* behave like the job is already finished */
term->tl_job->jv_status = JO... | vuln | Safe | Unknown |
public static boolean canConvertBlock(EntityPlayer player, World world, BlockPos pos, IBlockState state, int affected) throws LittleActionException {
if (LittleTiles.CONFIG.build.get(player).limitAffectedBlocks && LittleTiles.CONFIG.build.get(player).maxAffectedBlocks < affected)
throw new NotAllowe... | vuln | Vulnerable | Java |
static noinline int btrfs_mksubvol(struct path *parent,
char *name, int namelen,
struct btrfs_root *snap_src,
u64 *async_transid, bool readonly,
struct btrfs_qgroup_inherit **inherit)
{
struct inode *dir = parent->dentry->d_inode;
struct dentry *dentry;
int error;
mutex_lock_nested(&di... | vuln | Vulnerable | C/C++ |
static int copy_to_user_auth(struct xfrm_algo_auth *auth, struct sk_buff *skb)
{
struct xfrm_algo *algo;
struct nlattr *nla;
nla = nla_reserve(skb, XFRMA_ALG_AUTH,
sizeof(*algo) + (auth->alg_key_len + 7) / 8);
if (!nla)
return -EMSGSIZE;
algo = nla_data(nla);
strncpy(algo->alg_name, auth->alg_name, sizeo... | vuln | Safe | C/C++ |
Prism.languages.hcl = {
'comment': /(?:\/\/|#).*|\/\*[\s\S]*?(?:\*\/|$)/,
'heredoc': {
pattern: /<<-?(\w+)[\s\S]*?^\s*\1/m,
greedy: true,
alias: 'string'
},
'keyword': [
{
pattern: /(?:resource|data)\s+(?:"(?:\\[\s\S]|[^\\"])*")(?=\s+"[\w-]+"\s+{)/i,
inside: {
'type': {
pattern: /(resource|da... | vuln | Safe | JavaScript |
static bool dccp_new(struct nf_conn *ct, const struct sk_buff *skb,
unsigned int dataoff, unsigned int *timeouts)
{
struct net *net = nf_ct_net(ct);
struct dccp_net *dn;
struct dccp_hdr _dh, *dh;
const char *msg;
u_int8_t state;
dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &dh);
BUG_ON(dh == NU... | vuln | Vulnerable | C/C++ |
includeFile (FileInfo * nested, CharsString * includedFile)
{
/*Implement include opcode*/
int k;
char includeThis[MAXSTRING];
for (k = 0; k < includedFile->length; k++)
includeThis[k] = (char) includedFile->chars[k];
includeThis[k] = 0;
return compileFile (includeThis);
} | vuln | Vulnerable | Unknown |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Safe | C/C++ |
def get_activity_progress(user_id):
"""Returns the progress of the learners - the explorations, collections,
stories and learnt_topics completed by the user and those in progress.
Args:
user_id: str. The id of the learner.
Returns:
(LearnerProgress, dict).
The first return valu... | vuln | Vulnerable | Python |
DECLAREContigPutFunc(putcontig8bitYCbCr21tile)
{
(void) y;
fromskew = (fromskew * 4) / 2;
do {
x = w>>1;
while(x>0) {
int32 Cb = pp[2];
int32 Cr = pp[3];
YCbCrtoRGB(cp[0], pp[0]);
YCbCrtoRGB(cp[1], pp[1]);
cp += 2;
pp += 4;
x --;
}
if( (w&1) != 0 )
{
int32 Cb = pp[2];
int32 Cr... | vuln | Safe | Unknown |
miniflow_extract(struct dp_packet *packet, struct miniflow *dst)
{
const struct pkt_metadata *md = &packet->md;
const void *data = dp_packet_data(packet);
size_t size = dp_packet_size(packet);
ovs_be32 packet_type = packet->packet_type;
uint64_t *values = miniflow_values(dst);
struct mf_ctx mf =... | vuln | Safe | Unknown |
proto_read_attribute_buffer (p11_rpc_message *msg,
CK_ATTRIBUTE_PTR *result,
CK_ULONG *n_result)
{
CK_ATTRIBUTE_PTR attrs;
uint32_t n_attrs, i;
uint32_t value;
assert (msg != NULL);
assert (result != NULL);
assert (n_result != NULL);
assert (msg->input !... | vuln | Safe | Unknown |
private synchronized void step3(boolean restarting, Lock lock) throws InterruptedException, IOException {
logger.debug("Start Step 3");
crashIfRequired(MergeRunnableStopPoint.STEP3_START);
// index the new file
HDT newHdt = HDTManager.mapIndexedHDT(hybridStoreFiles.getHDTNewIndex(), hybr... | vuln | Vulnerable | Java |
static void __net_exit xfrm6_tunnel_net_exit(struct net *net)
{
struct xfrm6_tunnel_net *xfrm6_tn = xfrm6_tunnel_pernet(net);
unsigned int i;
xfrm_flush_gc();
xfrm_state_flush(net, IPSEC_PROTO_ANY, false, true);
for (i = 0; i < XFRM6_TUNNEL_SPI_BYADDR_HSIZE; i++)
WARN_ON_ONCE(!hlist_empty(&xfrm6_tn->spi_byaddr... | vuln | Vulnerable | Unknown |
GF_Err adts_dmx_process(GF_Filter *filter)
{
GF_ADTSDmxCtx *ctx = gf_filter_get_udta(filter);
GF_FilterPacket *pck, *dst_pck;
u8 *data, *output;
u8 *start;
u32 pck_size, remain, prev_pck_size;
u64 cts = GF_FILTER_NO_TS;
//always reparse duration
if (!ctx->duration.num)
adts_dmx_check_dur(filter, ctx);
if (... | vuln | Safe | C/C++ |
static int kvm_vm_ioctl_set_pit2(struct kvm *kvm, struct kvm_pit_state2 *ps)
{
int start = 0;
int i;
u32 prev_legacy, cur_legacy;
mutex_lock(&kvm->arch.vpit->pit_state.lock);
prev_legacy = kvm->arch.vpit->pit_state.flags & KVM_PIT_FLAGS_HPET_LEGACY;
cur_legacy = ps->flags & KVM_PIT_FLAGS_HPET_LEGACY;
if (!p... | vuln | Safe | C/C++ |
async def verify_token(self, token):
""" verify session token """
try:
async with aiopg.create_pool(self.dsn) as pool:
async with pool.acquire() as conn:
async with conn.cursor() as cur:
table = self.manager_type
... | vuln | Safe | Python |
public void test_like_startsWith() {
Entity from = from(Entity.class);
where(from.getCode()).like().startsWith("test");
Query<Entity> select = select(from);
assertEquals("select entity_0 from Entity entity_0 where entity_0.code like :code_1", select.getQuery());
assertEquals("test%", select.getParameters().g... | vuln | Safe | Java |
protected static ControlsCategory copyFrom(ControlsCategory source) {
if (source == null)
return null;
try {
return (ControlsCategory) source.clone();
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
}
} | vuln | Safe | Java |
int do_netdev_add(Monitor *mon, const QDict *qdict, QObject **ret_data)
{
QemuOpts *opts;
int res;
opts = qemu_opts_from_qdict(&qemu_netdev_opts, qdict);
if (!opts) {
return -1;
res = net_client_init(mon, opts, 1);
return res; | vuln | Vulnerable | C/C++ |
MemoryRegion *memory_map_ptr(struct uc_struct *uc, hwaddr begin, size_t size, uint32_t perms, void *ptr)
{
MemoryRegion *ram = g_new(MemoryRegion, 1);
memory_region_init_ram_ptr(uc, ram, size, ptr);
ram->perms = perms;
if (ram->addr == -1) {
// out of memory
return NULL;
}
memo... | vuln | Vulnerable | C/C++ |
protected double unloadingPhase(double time) {
int strength = worker.getNaturalAttributeManager().getAttribute(NaturalAttributeType.STRENGTH);
double strengthModifier = .1D + (strength * .018D);
double amountUnloading = UNLOAD_RATE * strengthModifier * time;
Inventory vehicleInv = vehicle.getInventory();
if... | vuln | Vulnerable | Java |
def join_ssh(seed_host):
"""
SSH configuration for joining node.
"""
if not seed_host:
error("No existing IP/hostname specified (use -c option)")
utils.start_service("sshd.service", enable=True)
configure_local_ssh_key()
swap_public_ssh_key(seed_host)
# This makes sure the seed... | vuln | Vulnerable | Python |
void FrameLoader::Trace(blink::Visitor* visitor) {
visitor->Trace(frame_);
visitor->Trace(progress_tracker_);
visitor->Trace(document_loader_);
visitor->Trace(provisional_document_loader_);
} | vuln | Vulnerable | C/C++ |
public static long[] getSongListForLastAdded(Context context) {
String[] args = {Long.toString(System.currentTimeMillis() / 1000 - 2419200)};
Cursor cursor = context.getContentResolver().query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
TRACK_COLUMNS, LAST_ADDED_SELECTION, args, LastAdd... | vuln | Safe | Java |
static int do_token_out(USBDevice *s, USBPacket *p)
{
if (p->devep != 0)
return s->info->handle_data(s, p);
switch(s->setup_state) {
case SETUP_STATE_ACK:
if (s->setup_buf[0] & USB_DIR_IN) {
s->setup_state = SETUP_STATE_IDLE;
} else {
}
... | vuln | Safe | C/C++ |
@Override
public void onViewCreated(@NonNull View view, Bundle savedInstance) {
final FragmentActivity activity = getActivity();
if (activity == null) {
return;
}
mMembersAdapter = new MembersAdapter();
mFailureListener = new UiUtils.ToastFailureListener(activity... | vuln | Safe | Java |
# -*- coding: utf-8 -*-
import os
from django import forms
from .models import Finding, FINDING_SEVERITIES
ENGINE_TYPES = (
('json', 'json'),
('nessus', 'Nessus'),
)
def validate_file_extension(value):
ext = os.path.splitext(value.name)[1]
valid_extensions = ['.xml', '.nessus', '.json']
if ext n... | vuln | Safe | Python |
void uwbd_stop(struct uwb_rc *rc)
{
if (rc->uwbd.task)
kthread_stop(rc->uwbd.task);
uwbd_flush(rc);
} | vuln | Safe | C/C++ |
function isObject (o, allowArray) {
return o && 'object' === typeof o && (allowArray || !Array.isArray(o))
}
function isBasic (b) {
return 'string' === typeof b || 'number' === typeof b
}
function get (obj, path, dft) {
if(!isObject(obj, true)) return dft
if(isBasic(path)) return obj[path]
for(var i = 0; i ... | vuln | Safe | JavaScript |
CryptSymmetricDecrypt(
BYTE *dOut, // OUT: decrypted data
TPM_ALG_ID algorithm, // IN: the symmetric algorithm
UINT16 keySizeInBits, // IN: key size in bits
const BYTE *key, // IN: key buffer. The size of this buffer
... | vuln | Safe | Unknown |
__poll_t psi_trigger_poll(void **trigger_ptr,
struct file *file, poll_table *wait)
{
__poll_t ret = DEFAULT_POLLMASK;
struct psi_trigger *t;
if (static_branch_likely(&psi_disabled))
return DEFAULT_POLLMASK | EPOLLERR | EPOLLPRI;
t = smp_load_acquire(trigger_ptr);
if (!t)
return DEFAULT_POLLMASK | EPOLLER... | vuln | Safe | Unknown |
static void iscsi_timed_check_events(void *opaque)
{
IscsiLun *iscsilun = opaque;
iscsi_service(iscsilun->iscsi, 0);
if (iscsilun->request_timed_out) {
iscsilun->request_timed_out = false;
iscsi_reconnect(iscsilun->iscsi);
}
iscsi_set_events(iscsilun);
timer_mod(iscsilu... | vuln | Safe | C/C++ |
function get_file($file) {
$files['radiusd'] = FREERADIUS_RADDB . "/radiusd.conf";
$files['eap'] = FREERADIUS_MODSENABLED . "/eap";
$files['sql'] = FREERADIUS_MODSENABLED . "/sql";
$files['clients'] = FREERADIUS_RADDB . "/clients.conf";
$files['users'] = FREERADIUS_RADDB . "/users";
$files['macs'] = FREERADIUS_RA... | vuln | Vulnerable | PHP |
exsltCryptoRc4DecryptFunction (xmlXPathParserContextPtr ctxt, int nargs) {
int key_len = 0;
int str_len = 0, bin_len = 0, ret_len = 0;
xmlChar *key = NULL, *str = NULL, *padkey = NULL, *bin =
NULL, *ret = NULL;
xsltTransformContextPtr tctxt = NULL;
if (nargs != 2) {
xmlXPathSetArityError (ct... | vuln | Safe | C/C++ |
@Override
public void setValueFromString(String value) {
Double doubleValue = EssentialUtils.catchAsNull(() -> Double.parseDouble(value));
if (doubleValue == null) {
this.cannotSetValue(value);
return;
}
this.setValue(doubleValue);
} | vuln | Safe | Java |
/**
* Copyright (c) 2006-2017, JGraph Ltd
* Copyright (c) 2006-2017, Gaudenz Alder
*/
(function()
{
if (typeof html4 !== 'undefined')
{
/**
* Enables paste from Lucidchart
*/
html4.ATTRIBS['span::data-lucid-content'] = 0;
html4.ATTRIBS['span::data-lucid-type'] = 0;
/**
* Enables custom fonts in... | vuln | Safe | JavaScript |
static void host_signal_handler(int host_signum, siginfo_t *info,
void *puc)
{
int sig;
target_siginfo_t tinfo;
if (host_signum == SIGSEGV || host_signum == SIGBUS) {
if (cpu_signal_handler(host_signum, info, puc))
return;
}
sig = host_t... | vuln | Safe | C/C++ |
unsigned int bm_picker(Bitmap *b, int x, int y) {
assert(b);
if(x < 0 || x >= b->w || y < 0 || y >= b->h)
return 0;
b->color = bm_get(b, x, y);
return b->color;
} | vuln | Safe | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Vulnerable | C/C++ |
int prepare_binprm(struct linux_binprm *bprm)
{
umode_t mode;
struct inode * inode = bprm->file->f_path.dentry->d_inode;
int retval;
mode = inode->i_mode;
if (bprm->file->f_op == NULL)
return -EACCES;
/* clear any previous set[ug]id data from a previous binary */
bprm->cred->euid = current_euid();
bprm->cre... | vuln | Safe | Unknown |
int
main(int argc, char **argv)
{
int flag = 0;
int index = 0;
int argerr = 0;
attrd_init_mainloop();
crm_log_preinit(NULL, argc, argv);
crm_set_options(NULL, "[options]", long_options,
"Daemon for aggregating and atomically storing node attribute updates into the CIB");
... | vuln | Vulnerable | C/C++ |
private void interact() {
Block block = mc.world.getBlockState(entity.getBlockPos()).getBlock();
Block bottom = mc.world.getBlockState(entity.getBlockPos().down()).getBlock();
if (block == Blocks.WATER || bottom == Blocks.WATER || bottom == Blocks.DIRT_PATH) return;
if (block == Blocks.G... | vuln | Vulnerable | Java |
private boolean doSameNameLogic(Player aiPlayer, SpellAbility sa) {
final Game game = aiPlayer.getGame();
final Card source = sa.getHostCard();
final TargetRestrictions tgt = sa.getTargetRestrictions();
final ZoneType origin = ZoneType.listValueOf(sa.getParam("Origin")).get(0);
C... | vuln | Safe | Java |
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onInteract(PlayerInteractEvent event) {
Action eventAction = event.getAction();
Player player = event.getPlayer();
Block clicked = event.getClickedBlock();
if (eventAction != Action.RIGHT_CLICK_BLOCK... | vuln | Safe | Java |
static int ffm_read_data(AVFormatContext *s,
uint8_t *buf, int size, int header)
{
FFMContext *ffm = s->priv_data;
AVIOContext *pb = s->pb;
int fill_size, size1, frame_offset;
uint32_t id;
ptrdiff_t len;
int64_t last_pos = -1;
size1 = size;
while (size > 0) {
... | vuln | Safe | C/C++ |
void recovery_delete_character(void)
{
if (!recovery_started) {
recovery_abort();
fsm_sendFailure(FailureType_Failure_UnexpectedMessage, "Not in Recovery mode");
layoutHome();
return;
}
if(strlen(mnemonic) > 0)
{
mnemonic[strlen(mnemonic) - 1] = '\0';
}
... | vuln | Safe | C/C++ |
/* Copyright 2015 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 | Safe | C/C++ |
IDNSpoofChecker::IDNSpoofChecker() {
UErrorCode status = U_ZERO_ERROR;
checker_ = uspoof_open(&status);
if (U_FAILURE(status)) {
checker_ = nullptr;
return;
}
uspoof_setRestrictionLevel(checker_, USPOOF_HIGHLY_RESTRICTIVE);
SetAllowedUnicodeSet(&status);
int32_t checks = uspoof_getChecks(check... | vuln | Vulnerable | C/C++ |
package providers
import (
"encoding/json"
"errors"
"github.com/TykTechnologies/tyk-identity-broker/constants"
"github.com/TykTechnologies/tyk-identity-broker/tap"
identityHandlers "github.com/TykTechnologies/tyk-identity-broker/tap/identity-handlers"
"github.com/TykTechnologies/tyk-identity-broker/tyk-api"
"g... | vuln | Safe | Go |
protected final void start(Params params) {
final File baseFolder = getBaseFolder(params);
FileSettings settings = params.FILESETTINGS;
if (!StringUtils.isEmpty(params.settingsfile)) {
if (new File(params.settingsfile).exists()) {
settings = new FileSettings(params.settingsfile);
}
}
if (params.dai... | vuln | Vulnerable | Java |
static int
validate_event(struct pmu_hw_events *hw_events,
struct perf_event *event)
{
struct arm_pmu *armpmu = to_arm_pmu(event->pmu);
struct pmu *leader_pmu = event->group_leader->pmu;
if (is_software_event(event))
return 1;
if (event->pmu != leader_pmu || event->state < PERF_EVENT_STATE_OFF)
return... | vuln | Safe | C/C++ |
def manipulate_reservation_action(request: HttpRequest, default_foreward_url: str):
"""
This function is used to alter the reservation beeing build inside
a cookie. This function automatically crafts the required response.
"""
js_string: str = ""
r: GroupReservation = None
u: Profile = get_c... | vuln | Safe | Python |
static int activate(AVFilterContext *ctx)
{
PreMultiplyContext *s = ctx->priv;
if (s->inplace) {
AVFrame *frame = NULL;
AVFrame *out = NULL;
int ret, status;
int64_t pts;
if ((ret = ff_inlink_consume_frame(ctx->inputs[0], &frame)) > 0) {
if ((ret = filter_fram... | vuln | Vulnerable | C/C++ |
long fuse_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg,
unsigned int flags)
{
struct fuse_file *ff = file->private_data;
struct fuse_conn *fc = ff->fc;
struct fuse_ioctl_in inarg = {
.fh = ff->fh,
.cmd = cmd,
.arg = arg,
.flags = flags
};
struct fuse_ioctl_out outarg;
struct fuse_r... | vuln | Safe | C/C++ |
static int rle_unpack(const unsigned char *src, unsigned char *dest,
int src_len, int dest_len)
{
const unsigned char *ps;
unsigned char *pd;
int i, l;
unsigned char *dest_end = dest + dest_len;
ps = src;
pd = dest;
if (src_len & 1)
*pd++ = *ps++;
src_len >>= 1;
i = 0;
... | vuln | Vulnerable | C/C++ |
public JsonObject getBackpackData(JsonObject backpack_contents_json, JsonObject backpack_icons) {
JsonArray contents = new JsonArray();
String[] backpackArray = new String[0];
//Create backpack array which sizes up
for(Map.Entry<String, JsonElement> backpackIcon : back... | vuln | Vulnerable | Java |
int bdrv_open_image(BlockDriverState **pbs, const char *filename,
QDict *options, const char *bdref_key, int flags,
bool allow_none, Error **errp)
{
QDict *image_options;
int ret;
char *bdref_key_dot;
const char *reference;
assert(pbs);
assert(*pbs == NULL... | vuln | Safe | C/C++ |
psutil_proc_threads(PyObject *self, PyObject *args) {
HANDLE hThread;
THREADENTRY32 te32 = {0};
long pid;
int pid_return;
int rc;
FILETIME ftDummy, ftKernel, ftUser;
HANDLE hThreadSnap = NULL;
PyObject *py_tuple = NULL;
PyObject *py_retlist = PyList_New(0);
if (py_retlist == NUL... | vuln | Vulnerable | Unknown |
public final synchronized void exec(String sql, boolean autoCommit) throws SQLException {
long pointer = 0;
try {
pointer = prepare(sql);
int rc = step(pointer);
switch (rc) {
case SQLITE_DONE:
ensureAutoCommit(autoCommit);
... | vuln | Vulnerable | Java |
HandleCoRREBPP (rfbClient* client, int rx, int ry, int rw, int rh)
{
rfbRREHeader hdr;
int i;
CARDBPP pix;
uint8_t *ptr;
int x, y, w, h;
if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbRREHeader))
return FALSE;
hdr.nSubrects = rfbClientSwap32IfLE(hdr.nSubrects);
if (!ReadFromRFBSe... | vuln | Vulnerable | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.