code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
@Override
@Nullable
public SyncStatusInfo getSyncStatusAsUser(Account account, String authority,
ComponentName cname, int userId) {
if (TextUtils.isEmpty(authority)) {
throw new IllegalArgumentException("Authority must not be empty");
}
... | vuln | Safe | Java |
public ResponseEntity<Map<String, Integer>> getInventoryWithHttpInfo() throws RestClientException {
Object postBody = null;
String path = apiClient.expandPath("/store/inventory", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiV... | vuln | Vulnerable | Java |
ast_type_reduce(PyObject *self, PyObject *unused)
{
PyObject *res;
_Py_IDENTIFIER(__dict__);
PyObject *dict = _PyObject_GetAttrId(self, &PyId___dict__);
if (dict == NULL) {
if (PyErr_ExceptionMatches(PyExc_AttributeError))
PyErr_Clear();
else
return NULL;
}
... | vuln | Vulnerable | C/C++ |
static int siff_read_packet(AVFormatContext *s, AVPacket *pkt)
{
SIFFContext *c = s->priv_data;
int size;
if (c->has_video){
if (c->cur_frame >= c->frames)
return AVERROR_EOF;
if (c->curstrm == -1){
c->pktsize = avio_rl32(s->pb) - 4;
c->flags = avio_rl16(s... | vuln | Vulnerable | C/C++ |
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 | Safe | Python |
/* $OpenBSD: monitor.c,v 1.166 2016/09/28 16:33:06 djm Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* Copyright 2002 Markus Friedl <markus@openbsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the... | vuln | Safe | C/C++ |
WebContents* TabsCaptureVisibleTabFunction::GetWebContentsForID(
int window_id,
std::string* error) {
Browser* browser = NULL;
if (!GetBrowserFromWindowID(chrome_details_, window_id, &browser, error))
return nullptr;
WebContents* contents = browser->tab_strip_model()->GetActiveWebContents();
if (!c... | vuln | Safe | C/C++ |
void op_subo (void)
{
target_ulong tmp;
tmp = T0;
T0 = (int32_t)T0 - (int32_t)T1;
if (!((T0 >> 31) ^ (T1 >> 31) ^ (tmp >> 31))) {
CALL_FROM_TB1(do_raise_exception_direct, EXCP_OVERFLOW);
}
RETURN();
} | vuln | Vulnerable | C/C++ |
@SuppressWarnings("deprecation")
public static ICrop getCropFromPlantId(String plantId) {
String[] split = plantId.split(":");
if(split.length > 1) {
String path = split[1];
// We assume the plant id is "<modid>:<resource>_plant"
ResourceLocation location = new Re... | vuln | Safe | Java |
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholi... | vuln | Vulnerable | C/C++ |
r=g.isEventsEnabled();g.setEventsEnabled(!1);var q=this.graph.isEnabled();this.graph.setEnabled(!1);var t=g.getTranslate();g.translate=new mxPoint(a,b);var u=this.graph.cellRenderer.redraw,x=g.states;a=g.scale;if(this.clipping){var A=new mxRectangle((f.x+t.x)*a,(f.y+t.y)*a,f.width*a/p,f.height*a/p),E=this;this.graph.ce... | vuln | Safe | JavaScript |
(function(stylesheet, stencils)
{
// Callbacks:
// mxClientOnLoad is called after the script is loaded with the stylesheet and the function to create a
// graph (wich takes the container as an argument and returns the graph instance that was created).
// mxClientOnCreate is called when a graph has been created... | vuln | Vulnerable | JavaScript |
int ConnectionImpl::StreamImpl::onDataSourceSend(const uint8_t* framehd, size_t length) {
// In this callback we are writing out a raw DATA frame without copying. nghttp2 assumes that we
// "just know" that the frame header is 9 bytes.
// https://nghttp2.org/documentation/types.html#c.nghttp2_send_data_callback
... | vuln | Safe | Unknown |
private void sendAllJSON(HttpExchange pExchange, ParsedUri pParsedUri, JSONAware pJson) throws IOException {
OutputStream out = null;
try {
Headers headers = pExchange.getResponseHeaders();
if (pJson != null) {
headers.set("Content-Type", getMimeType(pParsedUri) +... | vuln | Safe | Java |
static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, int offset)
static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist,
int32_t offset)
{
AHCICmdHdr *cmd = ad->cur_cmd;
uint32_t opts = le32_to_cpu(cmd->opts);
int sglist_alloc_hint = opts >> AHCI... | vuln | Safe | C/C++ |
'use strict';
// //////////////////////////////////////////////////////////////////////////////
// / @brief Foxx service manager
// /
// / @file
// /
// / DISCLAIMER
// /
// / Copyright 2013 triagens GmbH, Cologne, Germany
// /
// / Licensed under the Apache License, Version 2.0 (the "License")
// / you may not use th... | vuln | Safe | C/C++ |
rsvg_paint_server_parse (gboolean * inherit, const RsvgDefs * defs, const char *str,
guint32 current_color)
{
char *name;
guint32 rgb;
if (inherit != NULL)
*inherit = 1;
if (!strcmp (str, "none"))
return NULL;
name = rsvg_get_url_string (str);
if (name) ... | vuln | Safe | Unknown |
/* radare - LGPL - Copyright 2009-2020 - pancake, maijin */
#include <r_core.h>
static const char *help_msg_a[] = {
"Usage:", "a", "[abdefFghoprxstc] [...]",
"a", "", "alias for aai - analysis information",
"a*", "", "same as afl*;ah*;ax*",
"aa", "[?]", "analyze all (fcns + bbs) (aa0 to avoid sub renaming)",
"a8... | vuln | Vulnerable | C/C++ |
static void
process_options(argc, argv)
int argc;
char *argv[];
{
int i, l;
/*
* Process options.
*/
while (argc > 1 && argv[1][0] == '-') {
argv++;
argc--;
l = (int) strlen(*argv);
/* must supply at least 4 chars to match "-XXXgraphics" */
if (l < 4)
... | vuln | Vulnerable | C/C++ |
async function getLatestTag(name) {
try {
const { stdout } = await execAsync(`npm view ${name} dist-tags --json`);
const { latest } = JSON.parse(stdout);
return latest;
} catch (err) {
throw new Error(`Failed to parse output from NPM view - ${err.toString()}`);
}
} | vuln | Vulnerable | JavaScript |
/* $Id: upnpreplyparse.c,v 1.19 2015/07/15 10:29:11 nanard Exp $ */
/* MiniUPnP project
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* (c) 2006-2015 Thomas Bernard
* This software is subject to the conditions detailed
* in the LICENCE file provided within the distribution */
#include <stdlib.h>
#in... | vuln | Vulnerable | C/C++ |
int start_command(struct child_process *cmd)
{
int need_in, need_out, need_err;
int fdin[2], fdout[2], fderr[2];
int failed_errno;
char *str;
if (!cmd->argv)
cmd->argv = cmd->args.argv;
if (!cmd->env)
cmd->env = cmd->env_array.argv;
/*
* In case of errors we must keep the promise to close FDs
* that ha... | vuln | Safe | Unknown |
void get_checksum2(char *buf, int32 len, char *sum)
{
md_context m;
switch (xfersum_type) {
case CSUM_MD5: {
uchar seedbuf[4];
md5_begin(&m);
if (proper_seed_order) {
if (checksum_seed) {
SIVALu(seedbuf, 0, checksum_seed);
md5_update(&m, seedbuf, 4);
}
md5_update(&m, (uchar *)buf, len);
}... | vuln | Vulnerable | Unknown |
/**
* Copyright (c) 2006-2018, JGraph Ltd
* Copyright (c) 2006-2018, Gaudenz Alder
*
* Realtime collaboration for any file.
*/
DrawioFileSync = function(file)
{
mxEventSource.call(this);
this.lastActivity = Date.now();
this.clientId = Editor.guid();
this.ui = file.ui;
this.file = file;
// Listens to on... | vuln | Safe | JavaScript |
@Override
public DublinCoreCatalog getSeries(String seriesId) throws NotFoundException, SeriesServiceDatabaseException {
EntityManager em = emf.createEntityManager();
EntityTransaction tx = em.getTransaction();
try {
tx.begin();
SeriesEntity entity = getSeriesEntity(seriesId, em);
if (en... | vuln | Safe | Java |
static int piv_match_card_continued(sc_card_t *card)
{
int i;
int type = -1;
piv_private_data_t *priv = NULL;
int saved_type = card->type;
/* Since we send an APDU, the card's logout function may be called...
* however it may be in dirty memory */
card->ops->logout = NULL;
/* piv_match_card may be called wi... | vuln | Vulnerable | C/C++ |
int
handle_nsExtendConfigTable(netsnmp_mib_handler *handler,
netsnmp_handler_registration *reginfo,
netsnmp_agent_request_info *reqinfo,
netsnmp_request_info *requests)
{
netsnmp_request_info *request;
netsnmp_table_request_... | vuln | Safe | C/C++ |
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
| Copyrigh... | vuln | Vulnerable | C/C++ |
package auth
import (
"context"
"net/http"
"github.com/concourse/concourse/atc"
"github.com/concourse/concourse/atc/api/accessor"
"github.com/concourse/concourse/atc/db"
)
type CheckPipelineAccessHandlerFactory interface {
HandlerFor(pipelineScopedHandler http.Handler, rejector Rejector) http.Handler
}
type c... | vuln | Vulnerable | Go |
static int
read_packet(int fd, gss_buffer_t buf, int timeout, int first)
{
int ret;
static uint32_t len = 0;
static char len_buf[4];
static int len_buf_pos = 0;
static char * tmpbuf = 0;
static int tmpbuf_pos = 0;
if (first) {
len_buf_pos = 0;
return -2;
}
if (len_buf_pos < 4) {
ret = timed_rea... | vuln | Vulnerable | C/C++ |
function initialize() {
destroy();
if (! window.Clipboard) {
// Insert the content editable at the top to avoid scrolling down in the board view
pasteCatcher = document.createElement('div');
pasteCatcher.id = 'screenshot-pastezone';
pasteCatcher.contentEd... | vuln | Vulnerable | JavaScript |
function trunc_with_tooltip(val){
if (val.length > 10) {
var trunced_val = _.escape(val.substring(0, 10) + "...");
val = '<small data-toggle="tooltip" title="' + _.escape(val) + '">' + trunced_val + '</small>';
}
return val;
} | vuln | Safe | JavaScript |
public DamageSource buildDamageSource(World world, LivingEntity shooter){
shooter = !(shooter instanceof PlayerEntity) ? FakePlayerFactory.getMinecraft((ServerWorld) world) : shooter;
return DamageSource.playerAttack((PlayerEntity) shooter);
} | vuln | Safe | Java |
void fxProxyConstruct(txMachine* the, txSlot* instance, txSlot* arguments, txSlot* newTarget)
{
mxProxyDeclarations(_construct);
if (function) {
/* THIS */
mxPushSlot(handler);
/* FUNCTION */
mxPushSlot(function);
mxCall();
/* ARGUMENTS */
mxPushSlot(target);
mxPushSlot(arguments);
mxPushSlot(newTar... | vuln | Safe | C/C++ |
int cg_mkdir(const char *path, mode_t mode)
{
struct fuse_context *fc = fuse_get_context();
char *fpath = NULL, *path1, *cgdir = NULL, *controller, *next = NULL;
const char *cgroup;
int ret;
if (!fc)
return -EIO;
controller = pick_controller_from_path(fc, path);
if (!controller)
return -EINVAL;
cgroup =... | vuln | Safe | C/C++ |
_gnutls_server_select_suite(gnutls_session_t session, uint8_t * data,
unsigned int datalen)
{
int ret;
unsigned int i, j, cipher_suites_size;
size_t pk_algos_size;
uint8_t cipher_suites[MAX_CIPHERSUITE_SIZE];
int retval;
gnutls_pk_algorithm_t pk_algos[MAX_ALGOS]; /* will hold the pk algorithms
* su... | vuln | Safe | C/C++ |
private boolean preFetchHost(String preHost, Dns dns) throws UnknownHostException {
if (preHost == null || preHost.length() == 0) {
return false;
}
List<IDnsNetworkAddress> preAddressList = addressDictionary.get(preHost);
if (preAddressList != null && preAddressList.size() >... | vuln | Safe | Java |
// Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package repo
import (
"net/http"
"path"
api "github.com/gogs/go-gogs-client"
"github.com/pkg/errors"
log "unknwon.dev/clog/v2"
"gogs.io/gogs/internal... | vuln | Safe | Go |
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 | Vulnerable | Rust |
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
//setIntent(intent);
if (!MobiComUserPreference.getInstance(this).isLoggedIn()) {
//user is not logged in
Utils.printLog(this, "AL", "user is not logged in yet.");
return;
... | vuln | Vulnerable | Java |
protected SSLEngineResult unwrap(SSLEngine sslEngine, ByteBuffer input, ByteBuffer output) throws SSLException
{
return sslEngine.unwrap(input, output);
} | vuln | Vulnerable | Java |
http_client_check_response_cb (SoupSession *session, SoupMessage *msg, gpointer user_data)
{
GError *error;
CheckData *data = user_data;
GTlsCertificateFlags cert_flags;
gboolean op_res;
gboolean using_https;
error = NULL;
op_res = FALSE;
if (msg->status_code == SOUP_STATUS_CANCELLED)
goto out;
... | vuln | Safe | Unknown |
@GET
public Response listAllMyBuckets(@HeaderParam("Authorization") final String authorization) {
return S3RestUtils.call("", () -> {
final String user = getUser(authorization);
List<URIStatus> objects = new ArrayList<>();
try {
objects = mMetaFS.listStatus(new AlluxioURI("/"));
}... | vuln | Safe | Java |
Ins_IUP( INS_ARG )
{
IUP_WorkerRec V;
FT_Byte mask;
FT_UInt first_point; /* first point of contour */
FT_UInt end_point; /* end point (last+1) of contour */
FT_UInt first_touched; /* first touched point in contour */
FT_UInt cur_touched; /* current touched po... | 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 | Python |
size_t HexInStream::overrun(size_t itemSize, size_t nItems, bool wait) {
if (itemSize > bufSize)
throw Exception("HexInStream overrun: max itemSize exceeded");
if (end - ptr != 0)
memmove(start, ptr, end - ptr);
end -= ptr - start;
offset += ptr - start;
ptr = start;
while (end < ptr + itemSize) ... | vuln | Safe | C/C++ |
def check_conn_id_duplicates(session: Session) -> Iterable[str]:
"""
Check unique conn_id in connection table.
:param session: session of the sqlalchemy
"""
from airflow.models.connection import Connection
dups = []
try:
dups = session.execute(
select(Connection.conn_i... | vuln | Vulnerable | Python |
static int net_socket_listen_init(NetClientState *peer,
const char *model,
const char *name,
const char *host_str,
Error **errp)
{
NetClientState *nc;
NetSocketState *s;
st... | vuln | Safe | C/C++ |
ImagingFliDecode(Imaging im, ImagingCodecState state, UINT8 *buf, Py_ssize_t bytes) {
UINT8 *ptr;
int framesize;
int c, chunks, advance;
int l, lines;
int i, j, x = 0, y, ymax;
/* If not even the chunk size is present, we'd better leave */
if (bytes < 4) {
return 0;
}
/* W... | vuln | Vulnerable | C/C++ |
static int get_bitmap_file(struct mddev *mddev, void __user * arg)
{
mdu_bitmap_file_t *file = NULL; /* too big for stack allocation */
char *ptr;
int err;
file = kzalloc(sizeof(*file), GFP_NOIO);
if (!file)
return -ENOMEM;
err = 0;
spin_lock(&mddev->lock);
/* bitmap disabled, zero the first byte and copy o... | vuln | Safe | C/C++ |
static int gdb_get_avr_reg(CPUState *env, uint8_t *mem_buf, int n)
{
if (n < 32) {
#ifdef WORDS_BIGENDIAN
stq_p(mem_buf, env->avr[n].u64[0]);
stq_p(mem_buf+8, env->avr[n].u64[1]);
#else
stq_p(mem_buf, env->avr[n].u64[1]);
stq_p(mem_buf+8, env->avr[n].u64[0]);
#endif
return 16... | vuln | Safe | C/C++ |
}static inline void WriteResourceLong(unsigned char *p,
const unsigned int quantum)
{ | vuln | Vulnerable | C/C++ |
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apach... | vuln | Safe | Java |
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: https://www.espocrm.com
*
* EspoCRM is free software: you can redistribute i... | vuln | Vulnerable | JavaScript |
static inline void mcdc(uint16_t *dst, uint16_t *src, int log2w, int h, int stride, int scale, int dc){
int i;
dc*= 0x10001;
switch(log2w){
case 0:
for(i=0; i<h; i++){
dst[0] = scale*src[0] + dc;
if(scale) src += stride;
dst += stride;
}
break;
... | vuln | Vulnerable | C/C++ |
static int attach_child_main(void* data)
{
struct attach_clone_payload* payload = (struct attach_clone_payload*)data;
int ipc_socket = payload->ipc_socket;
lxc_attach_options_t* options = payload->options;
struct lxc_proc_context_info* init_ctx = payload->init_ctx;
#if HAVE_SYS_PERSONALITY_H
long new_personality;
... | vuln | Safe | Unknown |
static Image *ReadMTVImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
char
buffer[MaxTextExtent];
Image
*image;
MagickBooleanType
status;
register ssize_t
x;
register PixelPacket
*q;
register unsigned char
*p;
ssize_t
count,
y;
unsigned char
*pixel... | vuln | Safe | C/C++ |
static struct pxa2xx_i2s_s *pxa2xx_i2s_init(target_phys_addr_t base,
qemu_irq irq, struct pxa2xx_dma_state_s *dma)
{
int iomemtype;
struct pxa2xx_i2s_s *s = (struct pxa2xx_i2s_s *)
qemu_mallocz(sizeof(struct pxa2xx_i2s_s));
s->base = base;
s->irq = irq;
s->dma = dma;
... | vuln | Vulnerable | C/C++ |
static int komeda_wb_connector_add(struct komeda_kms_dev *kms,
struct komeda_crtc *kcrtc)
{
struct komeda_dev *mdev = kms->base.dev_private;
struct komeda_wb_connector *kwb_conn;
struct drm_writeback_connector *wb_conn;
u32 *formats, n_formats = 0;
int err;
if (!kcrtc->master->wb_layer)
return 0;
kwb_... | vuln | Vulnerable | C/C++ |
static void igmp_heard_query(struct in_device *in_dev, struct sk_buff *skb,
int len)
{
struct igmphdr *ih = igmp_hdr(skb);
struct igmpv3_query *ih3 = igmpv3_query_hdr(skb);
struct ip_mc_list *im;
__be32 group = ih->group;
int max_delay;
int mark = 0;
if (len == 8) {
if (ih->code == 0) {
/* Alas, ... | vuln | Safe | C/C++ |
static void omap_rtc_write(void *opaque, hwaddr addr,
uint64_t value, unsigned size)
{
struct omap_rtc_s *s = (struct omap_rtc_s *) opaque;
int offset = addr & OMAP_MPUI_REG_MASK;
struct tm new_tm;
time_t ti[2];
if (size != 1) {
return omap_badwidth_write8(opaque, ... | vuln | Safe | C/C++ |
bool Performance::PassesTimingAllowCheck(
const ResourceResponse& response,
const SecurityOrigin& initiator_security_origin,
const AtomicString& original_timing_allow_origin,
ExecutionContext* context) {
const KURL& response_url = response.WasFetchedViaServiceWorker()
... | 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 | Vulnerable | C/C++ |
@Override
public Component getName(ItemStack stack) {
LootCrate crate = getCrate(null, stack);
return crate != null && !crate.itemName.isEmpty() ? new TextComponent(crate.itemName) : super.getName(stack);
} | vuln | Vulnerable | Java |
item *do_item_get(const char *key, const size_t nkey, const uint32_t hv) {
//mutex_lock(&cache_lock);
item *it = assoc_find(key, nkey, hv);
if (it != NULL) {
refcount_incr(&it->refcount);
/* Optimization for slab reassignment. prevents popular items from
* jamming in busy wait. Can ... | vuln | Vulnerable | Unknown |
BaseFormatPanel.prototype.createColorOption=function(a,b,f,d,g,e,k,n){var u=document.createElement("div");u.style.padding="3px 0px 3px 0px";u.style.whiteSpace="nowrap";u.style.overflow="hidden";u.style.width="200px";u.style.height="18px";var m=document.createElement("input");m.setAttribute("type","checkbox");m.style.ma... | vuln | Vulnerable | JavaScript |
routeString := func(typ, name string, protected bool) string {
str := `{
"name": "pomerium-` + typ + `-` + name + `",
"match": {
"` + typ + `": "` + name + `"
},
"route": {
"cluster": "pomerium-control-plane-http"
}
`
if !protected {
str += `,
"typedPerFilterConfig": {
"... | vuln | Safe | Go |
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\... | vuln | Vulnerable | C/C++ |
lib_set_system_encoding(self, enc_name)
VALUE self;
VALUE enc_name;
{
#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION > 0)
tcl_stubs_check();
if (NIL_P(enc_name)) {
Tcl_SetSystemEncoding((Tcl_Interp *)NULL, (CONST char *)NULL);
return lib_get_system_encoding(se... | vuln | Vulnerable | Unknown |
function XMLRPCgetUserGroups($groupType=0, $affiliationid=0) {
global $user;
$groups = getUserGroups($groupType, $affiliationid);
// Filter out any groups to which the user does not have access.
$usergroups = array();
foreach($groups as $id => $group){
if($group['ownerid'] == $user['id'] ||... | vuln | Vulnerable | PHP |
static void save_text_if_changed(const char *name, const char *new_value)
{
/* a text value can't be change if the file is not loaded */
/* returns NULL if the name is not found; otherwise nonzero */
if (!g_hash_table_lookup(g_loaded_texts, name))
return;
const char *old_value = g_cd ? problem_... | vuln | Vulnerable | Unknown |
@Override
public boolean isProvisioningAllowed(String action, String packageName) {
Objects.requireNonNull(packageName);
final CallerIdentity caller = getCallerIdentity();
final long ident = mInjector.binderClearCallingIdentity();
try {
final int uidForPackage = mInjecto... | vuln | Vulnerable | Java |
gss_wrap_iov (minor_status,
context_handle,
conf_req_flag,
qop_req,
conf_state,
iov,
iov_count)
OM_uint32 * minor_status;
gss_ctx_id_t context_handle;
int conf_req_flag;
gss_qop_t qop_req;
int * conf_state;
gss_iov_buffer_desc *... | vuln | Vulnerable | C/C++ |
FRIBIDI_ENTRY FriBidiStrIndex
fribidi_remove_bidi_marks (
FriBidiChar *str,
const FriBidiStrIndex len,
FriBidiStrIndex *positions_to_this,
FriBidiStrIndex *position_from_this_list,
FriBidiLevel *embedding_levels
)
{
register FriBidiStrIndex i, j = 0;
fribidi_boolean private_from_this = false;
fribidi_bo... | vuln | Safe | C/C++ |
long Cluster::GetIndex() const
{
return m_index;
} | vuln | Vulnerable | C/C++ |
def self.register_user_defined_tag_type(config_source)
config = YAML.safe_load(config_source, [Symbol])
check_validity_of_config(config)
TagType.register(registered_tag_name = config['tag_name'].to_sym,
config['tag'],
config['iteration_tag'],
... | vuln | Safe | Ruby |
evbuffer_drain(struct evbuffer *buf, size_t len)
{
struct evbuffer_chain *chain, *next;
size_t remaining, old_len;
int result = 0;
EVBUFFER_LOCK(buf);
old_len = buf->total_len;
if (old_len == 0)
goto done;
if (buf->freeze_start) {
result = -1;
goto done;
}
if (len >= old_len && !HAS_PINNED_R(buf)) {
... | vuln | Vulnerable | Unknown |
// Copyright 2019 Istio 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 law or agreed to i... | vuln | Safe | Go |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2017-2018 New Vector Ltd
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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 Licens... | vuln | Safe | Python |
int qemu_fclose(QEMUFile *f)
{
int ret = 0;
qemu_fflush(f);
if (f->close)
ret = f->close(f->opaque);
g_free(f);
return ret;
} | vuln | Vulnerable | C/C++ |
def cluster_enable(params, request, auth_user)
if params[:name]
code, response = send_request_with_token(
auth_user, params[:name], 'cluster_enable', true
)
else
if not allowed_for_local_cluster(auth_user, Permissions::WRITE)
return 403, 'Permission denied'
end
success = enable_clust... | vuln | Safe | Ruby |
@Override
public void setMolangQueries(IAnimatable animatable, double currentTick) {
MolangParser parser = GeckoLibCache.getInstance().parser;
Minecraft minecraftInstance = Minecraft.getInstance();
parser.setValue("query.actor_count", minecraftInstance.level.getEntityCount());
parser.setValue("query.time_of_d... | vuln | Vulnerable | Java |
static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int c_idx)
{
#define PU(x) \
((x) >> s->sps->log2_min_pu_size)
#define MVF(x, y) \
(s->ref->tab_mvf[(x) + (y) * min_pu_width])
#define MVF_PU(x, y) \
MVF(PU(x0 + ((x) << hshift)), PU(y0 + ((y) << vshift)))
#define IS_INTRA(x, y) \
... | vuln | Safe | Unknown |
def on_file(file):
nonlocal file_object
data["file"] = file.file_name.decode()
file_object = file.file_object | vuln | Vulnerable | Python |
/*
* VMware vSockets Driver
*
* Copyright (C) 2007-2013 VMware, Inc. All rights reserved.
*
* 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 version 2 and no later version.
*
* This progr... | vuln | Vulnerable | C/C++ |
v8::Local<v8::Value> V8Debugger::collectionEntries(v8::Local<v8::Context> context, v8::Local<v8::Object> object)
{
if (!enabled()) {
NOTREACHED();
return v8::Undefined(m_isolate);
}
v8::Local<v8::Value> argv[] = { object };
v8::Local<v8::Value> entriesValue = callDebuggerMethod("getCo... | vuln | Vulnerable | 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 | Vulnerable | Java |
def login():
user = flask.request.form["username"]
password = flask.request.form["password"]
api = flask.current_app.config["PYLOAD_API"]
user_info = api.check_auth(user, password)
sanitized_user = user.replace("\n", "\\n").replace("\r", "\\r")
if not user_info:
log.error(f"Login faile... | vuln | Safe | Python |
public void rayTest(Vector3 rayFromWorldGDX, Vector3 rayToWorldGDX, RayResultCallback resultCallback) {
resultCallback.init(this);
btVector3.convert(rayFromWorldGDX, btVector3.TEMP_0);
btVector3 rayFromWorld = btVector3.TEMP_0;
btVector3.convert(rayToWorldGDX, btVector3.TEMP_1);
... | vuln | Safe | Java |
static void do_video_out(AVFormatContext *s,
OutputStream *ost,
AVFrame *next_picture,
double sync_ipts)
{
int ret, format_video_sync;
AVPacket pkt;
AVCodecContext *enc = ost->enc_ctx;
AVCodecContext *mux_enc = ost->st->codec;
... | vuln | Safe | C/C++ |
const AVOption *av_opt_next(void *obj, const AVOption *last)
{
AVClass *class = *(AVClass**)obj;
if (!last && class->option && class->option[0].name)
return class->option;
if (last && last[1].name) return ++last;
return NULL;
} | vuln | Safe | C/C++ |
static WORD_LIST *
glob_expand_word_list (tlist, eflags)
WORD_LIST *tlist;
int eflags;
{
char **glob_array, *temp_string;
register int glob_index;
WORD_LIST *glob_list, *output_list, *disposables, *next;
WORD_DESC *tword;
output_list = disposables = (WORD_LIST *)NULL;
glob_array = (char **)NULL;
... | vuln | Safe | Unknown |
static int iccdomain(i_ctx_t * i_ctx_p, ref *space, float *ptr)
{
int components, i, code = 0;
ref *tempref, ICCdict, valref;
code = array_get(imemory, space, 1, &ICCdict);
if (code < 0)
return code;
code = dict_find_string(&ICCdict, "N", &tempref);
if (code < 0)
return code;
... | vuln | Vulnerable | Unknown |
static MagickBooleanType WriteUILImage(const ImageInfo *image_info,Image *image)
{
#define MaxCixels 92
char
basename[MaxTextExtent],
buffer[MaxTextExtent],
name[MaxTextExtent],
*symbol;
ExceptionInfo
*exception;
int
j;
MagickBooleanType
status,
transparent;
MagickPixelPa... | vuln | Safe | C/C++ |
tiff12_print_page(gx_device_printer * pdev, gp_file * file)
{
gx_device_tiff *const tfdev = (gx_device_tiff *)pdev;
int code;
/* open the TIFF device */
if (gdev_prn_file_is_new(pdev)) {
tfdev->tif = tiff_from_filep(pdev, pdev->dname, file, tfdev->BigEndian, tfdev->UseBigTIFF);
if (!tfd... | vuln | Vulnerable | C/C++ |
public static ProblemContext of(Throwable exception, UriInfo uriInfo) {
try {
return new ProblemContext(exception, (uriInfo == null) ? null : uriInfo.getPath());
} catch (Exception e) { // quarkus-reactive throws ContextNotActiveException or NullPointerException when json request payload is ... | vuln | Safe | Java |
void dns_server_reset_features(DnsServer *s) {
assert(s);
s->verified_feature_level = _DNS_SERVER_FEATURE_LEVEL_INVALID;
s->possible_feature_level = DNS_SERVER_FEATURE_LEVEL_BEST;
s->received_udp_packet_max = DNS_PACKET_UNICAST_SIZE_MAX;
s->packet_bad_opt = false;
s->p... | vuln | Safe | Unknown |
static void coroutine_fn v9fs_xattrcreate(void *opaque)
{
int flags;
int32_t fid;
int64_t size;
ssize_t err = 0;
V9fsString name;
size_t offset = 7;
V9fsFidState *file_fidp;
V9fsFidState *xattr_fidp;
V9fsPDU *pdu = opaque;
v9fs_string_init(&name);
err = pdu_unmarshal(pdu, of... | vuln | Vulnerable | Unknown |
public ITuner openTuner(int moduleId, RadioManager.BandConfig bandConfig,
boolean withAudio, @NonNull ITunerCallback callback) {
synchronized (mLock) {
return nativeOpenTuner(mNativeContext, moduleId, bandConfig, withAudio, callback);
}
} | vuln | Vulnerable | Java |
/*
** vm.c - virtual machine for mruby
**
** See Copyright Notice in mruby.h
*/
#include <mruby.h>
#include <mruby/array.h>
#include <mruby/class.h>
#include <mruby/hash.h>
#include <mruby/irep.h>
#include <mruby/numeric.h>
#include <mruby/proc.h>
#include <mruby/range.h>
#include <mruby/string.h>
#include <mruby/vari... | vuln | Vulnerable | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.