code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
it "updates to a mongo advanced selector" do
stats = Support::Stats.collect do
users.find(scope: scope).sort(_id: 1).explain
end
operation = stats[node_for_reads].grep(Moped::Protocol::Query).last
operation.selector.should eq(
"$query" => { scope: scope }... | vuln | Safe | Ruby |
private void load(File folder) {
this.folder = folder;
this.userService = loadUsers(folder);
System.out.println(Constants.baseFolder$ + " set to " + folder);
if (userService == null) {
JOptionPane.showMessageDialog(this, MessageFormat.format("Sorry, {0} doesn't look like a Gitblit GO installation.", folder))... | vuln | Vulnerable | Java |
public String ldapLogin(String userId, String userPwd) {
Properties searchEnv = getManagerLdapEnv();
try {
//Connect to the LDAP server and Authenticate with a service user of whom we know the DN and credentials
LdapContext ctx = new InitialLdapContext(searchEnv, null);
... | vuln | Vulnerable | Java |
SocketBackend(StringInfo inBuf)
{
int qtype;
/*
* Get message type code from the frontend.
*/
HOLD_CANCEL_INTERRUPTS();
pq_startmsgread();
qtype = pq_getbyte();
if (qtype == EOF) /* frontend disconnected */
{
if (IsTransactionState())
ereport(COMMERROR,
(errcode(ERRCODE_CONNECTION_FAILURE),
... | vuln | Safe | Unknown |
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <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 the
* <a href="http://www.apache... | vuln | Safe | Java |
#ifndef IGNOREALL
/*
dcraw.c -- Dave Coffin's raw photo decoder
Copyright 1997-2015 by Dave Coffin, dcoffin a cybercom o net
This is a command-line ANSI C program to convert raw photos from
any digital camera on any computer running any operating system.
No license is required to download and use dcraw... | vuln | Safe | C/C++ |
public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset,
byte[] ciphertext, int ciphertextOffset, int length)
throws ShortBufferException {
int space;
if (ciphertextOffset > ciphertext.length)
space = 0;
else
space = ciphertext.length - ciphertextOffset;
if (keySpec == null) {
/... | vuln | Vulnerable | Java |
void SessionModelAssociator::PopulateSessionWindowFromSpecifics(
const std::string& session_tag,
const sync_pb::SessionWindow& specifics,
int64 mtime,
SessionWindow* session_window,
SyncedSessionTracker* tracker) {
if (specifics.has_window_id())
session_window->window_id.set_id(specifics.... | vuln | Safe | C/C++ |
xps_finish_image_path(gx_device_vector *vdev)
{
gx_device_xps *xps = (gx_device_xps *)vdev;
char line[300];
const char *fmt;
gs_matrix matrix;
/* Path is started. Do the image brush image brush and close the path */
write_str_to_current_page(xps, "\t<Path.Fill>\n");
write_str_to_current_pa... | vuln | Vulnerable | Unknown |
@Override
protected boolean checkExtraStartConditions(ServerLevel level, Predator entity)
{
return PredatorAi.getDistanceFromHomeSqr(entity) < SLEEP_ACCEPTED_DISTANCE && super.checkExtraStartConditions(level, entity);
} | vuln | Safe | Java |
OM_uint32 KRB5_CALLCONV
gss_export_sec_context(minor_status,
context_handle,
interprocess_token)
OM_uint32 * minor_status;
gss_ctx_id_t * context_handle;
gss_buffer_t interprocess_token;
{
OM_uint32 status;
OM_uint32 length;
gss_union_ctx_id_t ctx = NULL... | vuln | Vulnerable | C/C++ |
@RequiresApi(Build.VERSION_CODES.O)
public static List<ShortcutInfo> getShortcuts(Context context, String packageName) {
List<ShortcutInfo> shortcutInfoList = new ArrayList<>();
UserManager manager = (UserManager) context.getSystemService(Context.USER_SERVICE);
LauncherApps launcherApps = (... | vuln | Safe | Java |
void notifyConfigured(int width, int height, boolean active, boolean maximized) {
final long wlSurfacePtr = getWLSurface(nativePtr);
// TODO: this needs to be done only once after wlSetVisible(true)
surfaceData.assignSurface(wlSurfacePtr);
if (width != 0 && height != 0) performUnlocked((... | vuln | Safe | Java |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_mini_conn_ietf.c -- Mini connection used by the IETF QUIC
*/
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <limits.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <sys/queue.h>
#inclu... | vuln | Vulnerable | C/C++ |
@Inject(method = "getPlayers", at = @At("TAIL"), cancellable = true)
private void postGetPlayersWatchingChunk(final ChunkPos chunkPos, final boolean onlyOnWatchDistanceEdge,
final CallbackInfoReturnable<Stream<ServerPlayer>> cir) {
final Iterator<IPlayer> playersWatchingShipChunk =
VSGa... | vuln | Vulnerable | Java |
static void xen_read_physmap(XenIOState *state)
{
XenPhysmap *physmap = NULL;
unsigned int len, num, i;
char path[80], *value = NULL;
char **entries = NULL;
snprintf(path, sizeof(path),
"/local/domain/0/device-model/%d/physmap", xen_domid);
entries = xs_directory(state->xenstore, 0, ... | vuln | Vulnerable | C/C++ |
PrintPreviewUI::PrintPreviewUI(content::WebUI* web_ui)
: ConstrainedWebDialogUI(web_ui),
initial_preview_start_time_(base::TimeTicks::Now()),
handler_(NULL),
source_is_modifiable_(true),
tab_closed_(false) {
Profile* profile = Profile::FromWebUI(web_ui);
ChromeURLDataManager::AddDat... | vuln | Vulnerable | C/C++ |
function addEntryHandler(cat, entry, subCat)
{
mxEvent.addListener(entry, 'click', function()
{
if (currentEntry != entry)
{
currentEntry.style.backgroundColor = '';
currentEntry = entry;
currentEntry.style.backgroundColor = leftHighlight;
div.scrollTop = 0;
div.innerText ... | vuln | Safe | JavaScript |
PJ_DEF(void) pjmedia_rtcp_rx_rtcp( pjmedia_rtcp_session *sess,
const void *pkt,
pj_size_t size)
{
pj_uint8_t *p, *p_end;
p = (pj_uint8_t*)pkt;
p_end = p + size;
while (p < p_end) {
pjmedia_rtcp_common *common = (pjmedia_rtcp_common*)p;
unsigned len;
len = (pj_ntohs((pj_uint16_t)common... | vuln | Vulnerable | Unknown |
public ResponseEntity<Client> testClientModelWithHttpInfo(Client body) throws RestClientException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required par... | vuln | Safe | Java |
/*
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2002-2016, Open Source Geospatial Foundation (OSGeo)
*
* This library 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 ... | vuln | Vulnerable | Java |
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build ignore
// Generate system call table for DragonFly, NetBSD,
// FreeBSD, OpenBSD or Darwin from master list
// (for example, /usr/src/sys/kern/syscall... | vuln | Vulnerable | Go |
def get_previous_yields(self, inverter_serial):
query = '''
SELECT TimeStamp, EToday, ETotal
FROM Inverters
WHERE Serial = '%s'
''' % (inverter_serial)
self.c.execute(query)
data = self.c.fetchone()
return data[0], data[1], data[2] | vuln | Vulnerable | Python |
static inline abi_long host_to_target_cmsg(struct target_msghdr *target_msgh,
struct msghdr *msgh)
{
struct cmsghdr *cmsg = CMSG_FIRSTHDR(msgh);
abi_long msg_controllen;
abi_ulong target_cmsg_addr;
struct target_cmsghdr *target_cmsg, *target_cmsg_start;
soc... | vuln | Vulnerable | C/C++ |
rsvg_new_group (void)
{
RsvgNodeGroup *group;
group = g_new (RsvgNodeGroup, 1);
_rsvg_node_init (&group->super);
group->super.draw = _rsvg_node_draw_children;
group->super.set_atts = rsvg_node_group_set_atts;
return &group->super;
} | vuln | Vulnerable | Unknown |
int sanity_check_ckpt(struct f2fs_sb_info *sbi)
{
unsigned int total, fsmeta;
struct f2fs_super_block *raw_super = F2FS_RAW_SUPER(sbi);
struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi);
unsigned int ovp_segments, reserved_segments;
unsigned int main_segs, blocks_per_seg;
int i;
total = le32_to_cpu(raw_super->segme... | vuln | Safe | C/C++ |
static int nbd_errno_to_system_errno(int err)
{
switch (err) {
case NBD_SUCCESS:
return 0;
case NBD_EPERM:
return EPERM;
case NBD_EIO:
return EIO;
case NBD_ENOMEM:
return ENOMEM;
case NBD_ENOSPC:
return ENOSPC;
default:
TRACE("Squashing unexpec... | vuln | Safe | C/C++ |
def setup_shadow_filesystem(virtual_documents_uri: str):
if not virtual_documents_uri.startswith("file:/"):
raise ShadowFilesystemError( # pragma: no cover
'Virtual documents URI has to start with "file:/", got '
+ virtual_documents_uri
)
initialized = False
failure... | vuln | Vulnerable | Python |
static int get_device_guid(
char *name,
int name_size,
char *actual_name,
int actual_name_size)
{
LONG status;
HKEY control_net_key;
DWORD len;
int i = 0;
int stop = 0;
status = RegOpenKeyEx(
HKEY_LOCAL_MACHINE,
NETWORK_CONNECTIONS_KEY,
0,
KEY_READ... | vuln | Safe | C/C++ |
int string_rfind(const char *input, int len, const char *s, int s_len,
int pos, bool case_sensitive) {
assertx(input);
assertx(s);
if (!s_len || pos < -len || pos > len) {
return -1;
}
void *ptr;
if (case_sensitive) {
if (pos >= 0) {
ptr = bstrrstr(input + pos, len - pos, s, s... | vuln | Vulnerable | C/C++ |
static int map_modify_do_local(struct map_context *ac)
{
struct ldb_request *local_req;
struct ldb_context *ldb;
int ret;
ldb = ldb_module_get_ctx(ac->module);
if (ac->local_dn == NULL) {
/* No local record present, add it instead */
/* Add local 'IS_MAPPED' */
/* TODO: use GUIDs here instead */
ret = ld... | vuln | Safe | Unknown |
@Nonnull
@Override
public ItemStack quickMoveStack(@Nonnull Player player, int index) {
ItemStack result = ItemStack.EMPTY;
Slot slot = this.slots.get(index);
if (slot.hasItem()) {
ItemStack stack = slot.getItem();
result = stack.copy();
if (index <=... | vuln | Vulnerable | Java |
static int mov_write_trailer(AVFormatContext *s)
{
MOVMuxContext *mov = s->priv_data;
AVIOContext *pb = s->pb;
int res = 0;
int i;
int64_t moov_pos = avio_tell(pb);
if (!(mov->flags & FF_MOV_FLAG_FRAGMENT)) {
if (mov->mdat_size + 8 <= UINT32_MAX) {
avio_seek(pb, mov-... | vuln | Vulnerable | C/C++ |
def __init__(self, container: Container, filename: str, report: Report):
self.report = report
self.container = container
self.filename = filename
task = Task.get(report.job_id, report.task_id)
if not task:
raise ValueError(f"invalid task {report.task_id}")
job... | vuln | Vulnerable | Python |
cJSON *cJSON_CreateStringArray( const char **strings, int count )
{
int i;
cJSON *n = 0, *p = 0, *a = cJSON_CreateArray();
for ( i = 0; a && i < count; ++i ) {
n = cJSON_CreateString( strings[i] );
if ( ! i )
a->child = n;
else
suffix_object( p, n );
p = n;
}
return a;
} | vuln | Vulnerable | C/C++ |
public HttpRequest.Builder addAuth(HttpRequest.Builder requestBuilder, String uri) {
if ( authModifiers.isEmpty() )
return requestBuilder;
// Convert to the key for authentication handlers.
String endpointURL = HttpLib.endpoint(uri);
AuthRequestModifier mod = authModifiers.ge... | vuln | Safe | Java |
static void perf_syscall_enter(void *ignore, struct pt_regs *regs, long id)
{
struct syscall_metadata *sys_data;
struct syscall_trace_enter *rec;
struct hlist_head *head;
int syscall_nr;
int rctx;
int size;
syscall_nr = trace_get_syscall_nr(current, regs);
if (syscall_nr < 0)
return;
if (!test_bit(syscall_n... | vuln | Vulnerable | Unknown |
public void renderFace(BlockFacing blockFacing, float brightness, boolean windAnimate, float[] matrix)
{
Project project = getProject();
if (project == null) return;
TextureEntry entry = project.getTextureEntryByCode(textureCode);
GL11.glPushMatrix();
{
if (!isInBackdropProject) GL11.glLoadName(openG... | vuln | Safe | Java |
/** @file
Somfy io-homecontrol.
Copyright (C) 2021 Christian W. Zuckschwerdt <zany@triq.net>
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 2 of the License, or
... | vuln | Vulnerable | C/C++ |
TfLiteRegistration FakeFusedRegistration() {
TfLiteRegistration reg = {nullptr};
reg.custom_name = "fake_fused_op";
// Different flavors of the delegate kernel's Invoke(), dependent on
// testing parameters.
if (fail_delegate_node_invoke_) {
reg.invoke = [](TfLiteContext* context,... | vuln | Vulnerable | C/C++ |
ProcScreenSaverUnsetAttributes(ClientPtr client)
{
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
REQUEST(xScreenSaverUnsetAttributesReq);
PanoramiXRes *draw;
int rc, i;
rc = dixLookupResourceByClass((void **) &draw, stuff->drawable,
XRC_DRA... | vuln | Vulnerable | C/C++ |
static void save_bits(WMAProDecodeCtx *s, GetBitContext* gb, int len,
int append)
{
int buflen;
if (!append) {
s->frame_offset = get_bits_count(gb) & 7;
s->num_saved_bits = s->frame_offset;
init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE);
}
buflen =... | vuln | Safe | C/C++ |
static void task_done(h2_mplx *m, h2_task *task)
{
h2_stream *stream;
ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c,
"h2_mplx(%ld): task(%s) done", m->id, task->id);
out_close(m, task);
task->worker_done = 1;
task->done_at = apr_time_now();
ap_log_cerror(APLOG_MARK,... | vuln | Safe | Unknown |
static rpmfi initIter(rpmfiles files, int itype, int link)
{
rpmfi fi = NULL;
if (files && itype>=0 && itype<=RPMFILEITERMAX) {
fi = xcalloc(1, sizeof(*fi));
fi->i = -1;
fi->files = link ? rpmfilesLink(files) : files;
fi->next = nextfuncs[itype];
fi->i = -1;
if (itype == RPMFI_ITER_BACK) {
fi->i = ... | vuln | Vulnerable | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Safe | C/C++ |
public static Pair<Boolean, ITextComponent> applyToDialogue(ITextComponent component) {
List<ITextComponent> siblings = component.getSiblings();
List<ITextComponent> dialogue = new ArrayList<>();
if (inDialogue && TextFormatting.getTextWithoutFormattingCodes(McIf.getUnformattedText(component)).e... | vuln | Safe | Java |
void add_param_to_argv(char *parsestart, int line)
{
int quote_open = 0, escaped = 0, param_len = 0;
char param_buffer[1024], *curchar;
/* After fighting with strtok enough, here's now
* a 'real' parser. According to Rusty I'm now no
} else {
param_buffer[param_len++] = *curchar;
for (curchar = parse... | vuln | Vulnerable | C/C++ |
void usb_generic_async_ctrl_complete(USBDevice *s, USBPacket *p)
{
if (p->len < 0) {
s->setup_state = SETUP_STATE_IDLE;
}
switch (s->setup_state) {
case SETUP_STATE_SETUP:
if (p->len < s->setup_len) {
s->setup_len = p->len;
}
s->setup_state = SETUP_STATE_DATA;... | vuln | Vulnerable | C/C++ |
SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags)
{
struct fs_struct *fs, *new_fs = NULL;
struct files_struct *fd, *new_fd = NULL;
struct cred *new_cred = NULL;
struct nsproxy *new_nsproxy = NULL;
int do_sysvsem = 0;
int err;
/*
* If unsharing a user namespace must also unshare the thread.
*/
if (unsh... | vuln | Vulnerable | C/C++ |
##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | vuln | Safe | Python |
static ssize_t _hostsock_recv(
oe_fd_t* sock_,
void* buf,
size_t count,
int flags)
{
ssize_t ret = -1;
sock_t* sock = _cast_sock(sock_);
oe_errno = 0;
/*
* According to the POSIX specification, when the count is greater
* than SSIZE_MAX, the result is implementation-defined. ... | vuln | Safe | Unknown |
jp2_box_t *jp2_box_get(jas_stream_t *in)
{
jp2_box_t *box;
jp2_boxinfo_t *boxinfo;
jas_stream_t *tmpstream;
uint_fast32_t len;
uint_fast64_t extlen;
bool dataflag;
box = 0;
tmpstream = 0;
if (!(box = jp2_box_create0())) {
goto error;
}
if (jp2_getuint32(in, &len) || jp2_getuint32(in, &box->type)) {... | vuln | Safe | C/C++ |
private static synchronized Class<?> injectJarJava11(File jar, String mainClass) throws MalformedURLException, ReflectiveOperationException {
final ClassLoader loader = URLClassLoader.newInstance(new URL[]{ jar.toURI().toURL() },
PluginLoader.class.getClassLoader());
return Class.forName... | vuln | Vulnerable | Java |
duint32 dwgCompressor::longCompressionOffset(){
duint32 cont = 0;
duint8 ll = bufC[pos++];
while (ll == 0x00){
cont += 0xFF;
ll = bufC[pos++];
}
cont += ll;
return cont;
} | vuln | Vulnerable | Unknown |
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below).
*
* 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 ... | vuln | Vulnerable | Java |
#include "git-compat-util.h"
#include "strbuf.h"
#include "utf8.h"
/* This code is originally from http://www.cl.cam.ac.uk/~mgk25/ucs/ */
static const char utf16_be_bom[] = {'\xFE', '\xFF'};
static const char utf16_le_bom[] = {'\xFF', '\xFE'};
static const char utf32_be_bom[] = {'\0', '\0', '\xFE', '\xFF'};
static co... | vuln | Safe | C/C++ |
sec_recv(uint8 * rdpver)
{
uint32 sec_flags;
uint16 channel;
STREAM s;
while ((s = mcs_recv(&channel, rdpver)) != NULL)
{
if (rdpver != NULL)
{
if (*rdpver != 3)
{
if (*rdpver & 0x80)
{
in_uint8s(s, 8); /* signature */
sec_decrypt(s->p, s->end - s->p);
}
return s;
}
}
if... | vuln | Vulnerable | Unknown |
static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
{
u32 intr_info = vmcs_read32(VM_EXIT_INTR_INFO);
struct vcpu_vmx *vmx = to_vmx(vcpu);
struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
u32 exit_reason = vmx->exit_reason;
trace_kvm_nested_vmexit(kvm_rip_read(vcpu), exit_reason,
vmcs_readl(EXIT_QUALIFICATION... | vuln | Vulnerable | Unknown |
static void add_bytes_c(uint8_t *dst, uint8_t *src, int w){
long i;
for(i=0; i<=w-(int)sizeof(long); i+=sizeof(long)){
long a = *(long*)(src+i);
long b = *(long*)(dst+i);
*(long*)(dst+i) = ((a&pb_7f) + (b&pb_7f)) ^ ((a^b)&pb_80);
}
for(; i<w; i++)
dst[i+0] += src[i+0];
} | vuln | Safe | Unknown |
void *g_try_malloc(size_t size)
{
return g_try_malloc_n(1, size);
} | vuln | Safe | C/C++ |
static __latent_entropy struct task_struct *copy_process(
struct pid *pid,
int trace,
int node,
struct kernel_clone_args *args)
{
int pidfd = -1, retval;
struct task_struct *p;
struct multiprocess_signals delayed;
struct file *pidfile = NULL;
u64 clone_flags = args->flags;
struct nsproxy *nsp ... | vuln | Safe | C/C++ |
xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt, int inputchk) {
xmlElementContentPtr ret = NULL, cur = NULL, n;
const xmlChar *elem = NULL;
GROW;
if (CMP7(CUR_PTR, '#', 'P', 'C', 'D', 'A', 'T', 'A')) {
SKIP(7);
SKIP_BLANKS;
SHRINK;
if (RAW == ')') {
if ((ctxt->validate) && (ctxt->input-... | vuln | Vulnerable | C/C++ |
static inline unsigned int ScaleQuantumToMap(const Quantum quantum)
{
if (quantum >= (Quantum) MaxMap)
return((unsigned int) MaxMap);
#if !defined(MAGICKCORE_HDRI_SUPPORT)
return((unsigned int) quantum);
#else
if ((IsNaN(quantum) != MagickFalse) || (quantum <= 0.0))
return(0U);
return((unsigned int) (qu... | vuln | Safe | Unknown |
def get_parser():
# Get global config argument parser
parser = configargparse.ArgumentParser(
prog='rdiffweb',
description='Web interface to browse and restore rdiff-backup repositories.',
default_config_files=['/etc/rdiffweb/rdw.conf', '/etc/rdiffweb/rdw.conf.d/*.conf'],
add_env... | vuln | Vulnerable | Python |
/************************************************************************
* 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 |
private void saveAll() {
List<File> items = mAdapter.getItems();
for (File file : items) {
CodeEditorFragment fragment = (CodeEditorFragment) getChildFragmentManager().findFragmentByTag(
"f" + file.getAbsolutePath().hashCode()
);
if (fragment != nu... | vuln | Vulnerable | Java |
MOBI_RET mobi_build_opf_metadata(OPF *opf, const MOBIData *m, const MOBIRawml *rawml) {
if (m == NULL) {
debug_print("%s\n", "Initialization failed");
return MOBI_INIT_FAILED;
}
opf->metadata = calloc(1, sizeof(OPFmetadata));
if (opf->metadata == NULL) {
debug_print("%s\n", "Mem... | vuln | Vulnerable | C/C++ |
static int hva_to_pfn_remapped(struct vm_area_struct *vma,
unsigned long addr, bool *async,
bool write_fault, bool *writable,
kvm_pfn_t *p_pfn)
{
kvm_pfn_t pfn;
pte_t *ptep;
spinlock_t *ptl;
int r;
r = follow_pte(vma->vm_mm, addr, &ptep, &ptl);
if (r) {
/*
* get_user_pages fail... | vuln | Vulnerable | C/C++ |
void xt_compat_target_from_user(struct xt_entry_target *t, void **dstptr,
unsigned int *size)
{
const struct xt_target *target = t->u.kernel.target;
struct compat_xt_entry_target *ct = (struct compat_xt_entry_target *)t;
int pad, off = xt_compat_target_offset(target);
u_int16_t tsize = ct->u.user.target_size;
... | vuln | Vulnerable | Unknown |
static V9fsSynthNode *v9fs_add_dir_node(V9fsSynthNode *parent, int mode,
const char *name,
V9fsSynthNodeAttr *attr, int inode)
{
V9fsSynthNode *node;
mode = ((mode & 0777) | S_IFDIR) & ~(S_IWUSR | S_IWGRP | S_IWOTH);
node =... | vuln | Vulnerable | C/C++ |
static int ipmovie_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
IPMVEContext *ipmovie = (IPMVEContext *)s->priv_data;
ByteIOContext *pb = &s->pb;
int ret;
ret = process_ipmovie_chunk(ipmovie, pb, pkt);
if (ret == CHUNK_BAD)
ret = AVERROR_INVALIDDATA;
el... | vuln | Vulnerable | C/C++ |
def is_image(self):
return any(self.file.name.lower().endswith(e) for e in settings.FILE_UPLOAD_EXTENSIONS_QUESTION_IMAGE) | vuln | Safe | Python |
public static void updateAppWidgetOptionsAndView(AppWidgetManager appWidgetManager,
Context context, int appWidgetId, PeopleSpaceTile tile) {
AppWidgetOptionsHelper.setPeopleTile(appWidgetManager, appWidgetId, tile);
if (DEBUG) Log.d(TAG, "Widget: " + appWidgetId + ", " + tile.getUserName()... | vuln | Vulnerable | Java |
static int http_buf_read(URLContext *h, uint8_t *buf, int size)
{
HTTPContext *s = h->priv_data;
int len;
/* read bytes from input buffer first */
len = s->buf_end - s->buf_ptr;
if (len > 0) {
if (len > size)
len = size;
memcpy(buf, s->buf_ptr, len);
s->buf_ptr +=... | vuln | Safe | C/C++ |
@WorkerThread
private @NonNull MessageDetails getRecipientDeliveryStatusesInternal(@NonNull MessageRecord messageRecord) {
List<RecipientDeliveryStatus> recipients = new LinkedList<>();
if (!messageRecord.getRecipient().isGroup() && !messageRecord.getRecipient().isDistributionList()) {
recipients.add(n... | vuln | Vulnerable | Java |
int
midi_synth_load_patch(int dev, int format, const char __user *addr,
int offs, int count, int pmgr_flag)
{
int orig_dev = synth_devs[dev]->midi_dev;
struct sysex_info sysex;
int i;
unsigned long left, src_offs, eox_seen = 0;
int first_byte = 1;
int hdr... | vuln | Vulnerable | C/C++ |
static int mov_read_wide(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
{
int err;
uint32_t type;
#ifdef DEBUG
print_atom("wide", atom);
debug_indent++;
#endif
if (atom.size < 8)
return 0;
if (get_be32(pb) != 0) {
url_fskip(pb, atom.size - 4);
return 0;
}
at... | vuln | Vulnerable | C/C++ |
xmlRemoveID(xmlDocPtr doc, xmlAttrPtr attr) {
xmlIDTablePtr table;
xmlIDPtr id;
xmlChar *ID;
if (doc == NULL) return(-1);
if (attr == NULL) return(-1);
table = (xmlIDTablePtr) doc->ids;
if (table == NULL)
return(-1);
ID = xmlNodeListGetString(doc, attr->children, 1);
if (I... | vuln | Vulnerable | Unknown |
public static String getColourFromName(String name) {
return "§" + DankersSkyblockMod.data.get("colourednames").getAsJsonObject().get(name).getAsString();
} | vuln | Vulnerable | Java |
xsltAttrListTemplateProcess(xsltTransformContextPtr ctxt,
xmlNodePtr target, xmlAttrPtr attrs)
{
xmlAttrPtr attr, copy, last;
xmlNodePtr oldInsert, text;
xmlNsPtr origNs = NULL, copyNs = NULL;
const xmlChar *value;
xmlChar *valueAVT;
if ((ctxt == NULL) || (target == NULL) ... | vuln | Vulnerable | Unknown |
int dd_delete_item(struct dump_dir *dd, const char *name)
{
if (!dd->locked)
error_msg_and_die("dump_dir is not opened"); /* bug */
if (!str_is_correct_filename(name))
error_msg_and_die("Cannot delete item. '%s' is not a valid file name", name);
int res = unlinkat(dd->dd_fd, name, /*only f... | vuln | Safe | Unknown |
private JsonNode yamlStreamToJson(InputStream yamlStream) {
Yaml reader = new Yaml();
ObjectMapper mapper = new ObjectMapper();
return mapper.valueToTree(reader.load(yamlStream));
} | vuln | Vulnerable | Java |
static inline int opsize_bytes(int opsize)
{
switch (opsize) {
case OS_BYTE: return 1;
case OS_WORD: return 2;
case OS_LONG: return 4;
case OS_SINGLE: return 4;
case OS_DOUBLE: return 8;
default:
g_assert_not_reached();
}
} | vuln | Safe | C/C++ |
package org.platformlambda.automation.models;
public class WsInfo {
public String appName, authService, userService;
public WsInfo(String appName, String authService, String userService) {
this.appName = appName;
this.authService = authService;
this.userService = userService;
}
}
| vuln | Vulnerable | Java |
static void xcopy_pt_undepend_remotedev(struct xcopy_op *xop)
{
struct se_device *remote_dev;
if (xop->op_origin == XCOL_SOURCE_RECV_OP)
remote_dev = xop->dst_dev;
else
remote_dev = xop->src_dev;
pr_debug("Calling configfs_undepend_item for"
" remote_dev: %p remote_dev->dev_group: %p\n",
remote_dev, &... | vuln | Vulnerable | Unknown |
spnego_gss_unwrap(
OM_uint32 *minor_status,
gss_ctx_id_t context_handle,
gss_buffer_t input_message_buffer,
gss_buffer_t output_message_buffer,
int *conf_state,
gss_qop_t *qop_state)
{
OM_uint32 ret;
spnego_gss_ctx_id_t sc = (spnego_gss_ctx_id_t)context_handle;
if (sc->ctx_handle == GSS_C_NO_CONTEXT)
... | vuln | Safe | C/C++ |
cmdopts_t *cmdopts_parse(int argc, char **argv)
{
enum {
CMDOPT_HELP = 0,
CMDOPT_VERBOSE,
CMDOPT_QUIET,
CMDOPT_INFILE,
CMDOPT_INFMT,
CMDOPT_INOPT,
CMDOPT_OUTFILE,
CMDOPT_OUTFMT,
CMDOPT_OUTOPT,
CMDOPT_VERSION,
CMDOPT_DEBUG,
CMDOPT_CMPTNO,
CMDOPT_SRGB,
CMDOPT_MAXMEM,
CMDOPT_LIST_ENABLED_COD... | vuln | Vulnerable | C/C++ |
TEE_Result crypto_acipher_alloc_dh_keypair(struct dh_keypair *s,
size_t key_size_bits)
{
memset(s, 0, sizeof(*s));
s->g = crypto_bignum_allocate(key_size_bits);
if (!s->g)
goto err;
s->p = crypto_bignum_allocate(key_size_bits);
if (!s->p)
goto err;
s->y = crypto_bignum_allocate(key_size_bits);
if (!s... | vuln | Safe | C/C++ |
@Inject(method = "clickSlot", at = @At("HEAD"), cancellable = true)
private void onClickSlot(int syncId, int slotId, int button, SlotActionType actionType, PlayerEntity player, CallbackInfo ci) {
if (MinecraftScriptEvents.ON_CLICK_SLOT.run(NumberValue.of(slotId))) {
ci.cancel();
}
} | vuln | Vulnerable | Java |
static void dvbsub_parse_region_segment(AVCodecContext *avctx,
const uint8_t *buf, int buf_size)
{
DVBSubContext *ctx = avctx->priv_data;
const uint8_t *buf_end = buf + buf_size;
int region_id, object_id;
int av_unused version;
DVBSubRegion *region;
DVBSub... | vuln | Safe | C/C++ |
public void stop(boolean error) {
Log.i(TAG, "Transfer stopped");
try {
MainService.remotes.get(remoteUUID).stopTransfer(this, error);
} catch (NullPointerException ignored) {} //Service stopped and remotes cleared -> there must be a better solution
onStopped(error);
} | vuln | Safe | Java |
async function createVerificationObjects(signatureList, literalDataList, keys, date=new Date()) {
return Promise.all(signatureList.map(async function(signature) {
return createVerificationObject(signature, literalDataList, keys, date);
}));
} | vuln | Vulnerable | JavaScript |
@Inject(method = "handleSystemMessage", at = @At("HEAD"), cancellable = true)
private void onHandleSystemMessage(Component message, boolean overlay, CallbackInfo info) {
if (message instanceof MutableComponent mutable && message.getContents() instanceof TranslatableContents translatable) {
if (translatable.getKey... | vuln | Vulnerable | Java |
QInt8() : value(0) {} | vuln | Safe | C/C++ |
/*
* NET An implementation of the SOCKET network access protocol.
*
* Version: @(#)socket.c 1.1.93 18/02/95
*
* Authors: Orest Zborowski, <obz@Kodak.COM>
* Ross Biro
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
*
* Fixes:
* Anonymous : NOTSOCK/BADF cleanup. Error fix in
* shutdown()
* Alan Co... | vuln | Vulnerable | C/C++ |
void llc_conn_handler(struct llc_sap *sap, struct sk_buff *skb)
{
struct llc_addr saddr, daddr;
struct sock *sk;
llc_pdu_decode_sa(skb, saddr.mac);
llc_pdu_decode_ssap(skb, &saddr.lsap);
llc_pdu_decode_da(skb, daddr.mac);
llc_pdu_decode_dsap(skb, &daddr.lsap);
sk = __llc_lookup(sap, &saddr, &daddr);
if (!sk)
... | vuln | Vulnerable | C/C++ |
// +build linux
/*
Copyright The containerd 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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable... | vuln | Safe | Go |
static __init int hardware_setup(void)
{
int r = -ENOMEM, i, msr;
rdmsrl_safe(MSR_EFER, &host_efer);
for (i = 0; i < ARRAY_SIZE(vmx_msr_index); ++i)
kvm_define_shared_msr(i, vmx_msr_index[i]);
vmx_io_bitmap_a = (unsigned long *)__get_free_page(GFP_KERNEL);
if (!vmx_io_bitmap_a)
return r;
vmx_io_bitmap_b =... | vuln | Vulnerable | C/C++ |
arguments):(this.addOp(this.lineOp,O,R),this.lastX=O,this.lastY=R)};p.prototype.moveTo=function(O,R){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,O,R),this.lastX=O,this.lastY=R,this.firstX=O,this.firstY=R)};p.prototype.close=function(){this.passThrough?this.originalClose.app... | vuln | Safe | JavaScript |
(function(window) {
"use strict";
window.ls.container.get("view").add({
selector: "data-forms-code",
controller: function(element, alerts) {
let lang = element.dataset["formsCode"] || "json";
let div = document.createElement("div");
let pre = document.createElement("pre");
let code ... | vuln | Safe | JavaScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.