code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
"""Admin API."""
from django import http
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext as _
from django_filters import rest_framework as dj_filters
from drf_spectacular.utils import extend_schema, extend_schema_view
from rest_framework import filters, rendere... | vuln | Vulnerable | Python |
static pj_status_t decode_uint_attr(pj_pool_t *pool,
const pj_uint8_t *buf,
const pj_stun_msg_hdr *msghdr,
void **p_attr)
{
pj_stun_uint_attr *attr;
PJ_UNUSED_ARG(msghdr);
/* Create the attribute... | vuln | Safe | C/C++ |
pixFillMapHoles(PIX *pix,
l_int32 nx,
l_int32 ny,
l_int32 filltype)
{
l_int32 w, h, y, nmiss, goodcol, i, j, found, ival, valtest;
l_uint32 val, lastval;
NUMA *na; /* indicates if there is any data in the column */
PIX *pixt;
PROCNAME("pixFillMapH... | vuln | Vulnerable | C/C++ |
kadm5_create_principal_3(void *server_handle,
kadm5_principal_ent_t entry, long mask,
int n_ks_tuple, krb5_key_salt_tuple *ks_tuple,
char *password)
{
krb5_db_entry *kdb;
osa_princ_ent_rec adb;
kadm5_policy_en... | vuln | Safe | C/C++ |
int setenv(const char *name, const char *value, int overwrite)
{
int result = 0;
if (overwrite || !getenv(name)) {
size_t length = strlen(name) + strlen(value) + 2;
char *string = g_malloc(length);
snprintf(string, length, "%s=%s", name, value);
result = putenv(string);
}
... | vuln | Vulnerable | C/C++ |
void qmp_drive_mirror(const char *device, const char *target,
bool has_format, const char *format,
enum MirrorSyncMode sync,
bool has_mode, enum NewImageMode mode,
bool has_speed, int64_t speed,
bool has_on_sou... | vuln | Safe | C/C++ |
/* vi:set ts=8 sts=4 sw=4 noet:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
#include "vim.h"
/*
* Vim originated fro... | vuln | Safe | C/C++ |
def handler(*args, **kwargs):
if cherrypy.request.method not in ('GET', 'HEAD'):
return None
filename = os.path.join(path, *args)
assert filename.startswith(path)
if not os.path.isfile(filename):
return None
return serve_file(filename, content_type) | vuln | Safe | Python |
static int v4l2_receive_frame(AVCodecContext *avctx, AVFrame *frame)
{
V4L2m2mContext *s = avctx->priv_data;
V4L2Context *const capture = &s->capture;
V4L2Context *const output = &s->output;
AVPacket avpkt = {0};
int ret;
ret = ff_decode_get_packet(avctx, &avpkt);
if (ret < 0 && ret != AVERR... | vuln | Vulnerable | C/C++ |
bool CSPSourceList::matches(const KURL& url, ContentSecurityPolicy::RedirectStatus redirectStatus) const
{
if (m_allowStar)
return true;
KURL effectiveURL = m_policy->selfMatchesInnerURL() && SecurityOrigin::shouldUseInnerURL(url) ? SecurityOrigin::extractInnerURL(url) : url;
if (m_allowSelf... | vuln | Vulnerable | C/C++ |
int virtio_load(VirtIODevice *vdev, QEMUFile *f)
{
int i, ret;
uint32_t num;
uint32_t features;
uint32_t supported_features;
BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
if (k->load_config) {
ret = k->load_config(qbus->parent, f... | vuln | Vulnerable | Unknown |
import namedavatar from 'namedavatar'
import { QuillDeltaToHtmlConverter } from 'quill-delta-to-html'
import './projectchart.html'
import Projects, { ProjectStats } from '../../api/projects/projects.js'
import projectUsers from '../../api/users/users.js'
import { getUserSetting, getUserTimeUnitVerbose } from '../../uti... | vuln | Safe | JavaScript |
# Copyright 2018 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 applica... | vuln | Vulnerable | Python |
/* +------------------------------------+
* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
* InspIRCd: (C) 2002-2010 InspIRCd Development Team
* See: http://wiki.inspircd.org/Credits
*
* This program is free but copyrighted software; see
* the fil... | vuln | Safe | C/C++ |
from django.template import Library
from django.template.defaultfilters import stringfilter
from rest_framework.reverse import reverse
from openforms.config.models import GlobalConfiguration
from ..context_processors import sdk_urls
register = Library()
@register.simple_tag(takes_context=True)
def api_base_url(co... | vuln | Vulnerable | Python |
@Override
public void fetchUserAttributes(
@NonNull Consumer<List<AuthUserAttribute>> onSuccess,
@NonNull Consumer<AuthException> onError
) {
awsMobileClient.getUserAttributes(new Callback<Map<String, String>>() {
@Override
public void onResult(Map<String,... | vuln | Vulnerable | Java |
TPMT_TK_VERIFIED_Unmarshal(TPMT_TK_VERIFIED *target, BYTE **buffer, INT32 *size)
{
TPM_RC rc = TPM_RC_SUCCESS;
TPM_ST orig_tag = target->tag; // libtpms added
if (rc == TPM_RC_SUCCESS) {
rc = TPM_ST_Unmarshal(&target->tag, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
if (target->tag != TPM_ST... | vuln | Safe | Unknown |
# -----------------------------------------------------------------------------
# Copyright (c) Jupyter Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
# ------------------------------------------------------------... | vuln | Safe | Python |
static int ecdsa_sign_det_restartable( mbedtls_ecp_group *grp,
mbedtls_mpi *r, mbedtls_mpi *s,
const mbedtls_mpi *d, const unsigned char *buf, size_t blen,
mbedtls_md_type_t md_alg,
mbedtls_ecdsa_restart_ctx *rs_ctx )
{
int ret;
mbe... | vuln | Vulnerable | C/C++ |
static bool
ResolveStateAndPredicate(ExprDef *expr, enum xkb_match_operation *pred_rtrn,
xkb_mod_mask_t *mods_rtrn, CompatInfo *info)
{
if (expr == NULL) {
*pred_rtrn = MATCH_ANY_OR_NONE;
*mods_rtrn = MOD_REAL_MASK_ALL;
return true;
}
*pred_rtrn = MATCH_EXAC... | vuln | Safe | C/C++ |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
//===----------------------------------------------------------------------===//
/// \file
/// ES7 22.2 TypedArray
//===---------... | vuln | Vulnerable | C/C++ |
SSH_PACKET_CALLBACK(ssh_packet_dh_reply){
int rc;
(void)type;
(void)user;
SSH_LOG(SSH_LOG_PROTOCOL,"Received SSH_KEXDH_REPLY");
if(session->session_state!= SSH_SESSION_STATE_DH &&
session->dh_handshake_state != DH_STATE_INIT_SENT){
ssh_set_error(session,SSH_FATAL,"ssh_packet_dh_reply called in wrong s... | vuln | Vulnerable | C/C++ |
void MemBackendImpl::EvictIfNeeded() {
if (current_size_ <= max_size_)
return;
int target_size = std::max(0, max_size_ - kDefaultEvictionSize);
base::LinkNode<MemEntryImpl>* entry = lru_list_.head();
while (current_size_ > target_size && entry != lru_list_.end()) {
MemEntryImpl* to_doom = entry->va... | vuln | Vulnerable | C/C++ |
package com.salesmanager.core.model.catalog.product.price;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* Transient entity used to display
* different price information in the catalogue
* @author Carl Samson
*
*/
public class FinalPrice implements Se... | vuln | Safe | Java |
static void fw_cfg_common_realize(DeviceState *dev, Error **errp)
{
FWCfgState *s = FW_CFG(dev);
MachineState *machine = MACHINE(qdev_get_machine());
uint32_t version = FW_CFG_VERSION;
if (!fw_cfg_find()) {
error_setg(errp, "at most one %s device is permitted", TYPE_FW_CFG);
return;
... | vuln | Safe | C/C++ |
private void performRequest (boolean force) {
if (isDoneInProgress() && !force) {
return;
}
final Args args = getArgumentsStrict();
final TdApi.ChatMemberStatus newStatus;
if (args.mode == MODE_CHAT_PERMISSIONS) {
if (Td.equalsTo(targetRestrict.permissions, tdlib.chatPermissions(args.cha... | vuln | Vulnerable | Java |
D);null!=T&&K.setAttribute("backgroundImage",JSON.stringify(T));K.setAttribute("math",this.graph.mathEnabled?"1":"0");K.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(T=this.graph.extFonts.map(function(N){return N.name+"^"+N.url}),K.setAttribute("extFon... | vuln | Safe | JavaScript |
onShow: function () {
/* Remove preview */
imgPreview.getElement().setHtml('');
(t = this), (orgWidth = null), (orgHeight = null), (imgScal = 1), (lock = true);
/* selected image or null */
selectedImg = editor.getSelection();
if (selectedImg) selectedImg = selectedImg.getSelectedElement();
if (!... | vuln | Vulnerable | JavaScript |
static uint32_t calc_gc_buffer_size(zend_generator *generator) /* {{{ */
{
uint32_t size = 4; /* value, key, retval, values */
if (generator->execute_data) {
zend_execute_data *execute_data = generator->execute_data;
zend_op_array *op_array = &EX(func)->op_array;
/* Compiled variables */
if (!(EX_CALL_INFO()... | vuln | Vulnerable | Unknown |
@Override
public boolean mouseClicked(double mouseX, double mouseY, int mouseState) {
boolean result = super.mouseClicked(mouseX, mouseY, mouseState);
if (state.is(EXPORTING_IMAGE)) {
return result;
}
if (result) {
return true;
}
// close atl... | vuln | Safe | Java |
archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
struct archive_acl *abstract_acl, __LA_MODE_T mode)
{
int ret = ARCHIVE_OK;
(void)mode; /* UNUSED */
if ((archive_acl_types(abstract_acl)
& ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) {
/* Solaris writes POSIX.1e access and default ACLs... | vuln | Safe | Unknown |
static int krb5_authenticate(struct ksmbd_work *work)
{
struct smb2_sess_setup_req *req = work->request_buf;
struct smb2_sess_setup_rsp *rsp = work->response_buf;
struct ksmbd_conn *conn = work->conn;
struct ksmbd_session *sess = work->sess;
char *in_blob, *out_blob;
struct channel *chann = NULL;
u64 prev_sess_i... | vuln | Safe | C/C++ |
static int mem_cgroup_move_charge_pte_range(pmd_t *pmd,
unsigned long addr, unsigned long end,
struct mm_walk *walk)
{
int ret = 0;
struct vm_area_struct *vma = walk->private;
pte_t *pte;
spinlock_t *ptl;
split_huge_page_pmd(walk->mm, pmd);
if (pmd_trans_unstable(pmd))
return 0;
retry:
pte = pte_... | vuln | Safe | C/C++ |
static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
Image *image, *image2=NULL,
*rotated_image;
register Quantum *q;
unsigned int status;
MATHeader MATLAB_HDR;
size_t size;
size_t CellType;
QuantumInfo *quantum_info;
ImageInfo *clone_info;
int i;
ssize_t ldblk;
u... | vuln | Safe | C/C++ |
PgDatabase *add_database(const char *name)
{
PgDatabase *db = find_database(name);
/* create new object if needed */
if (db == NULL) {
db = slab_alloc(db_cache);
if (!db)
return NULL;
list_init(&db->head);
safe_strcpy(db->name, name, sizeof(db->name));
put_in_order(&db->head, &database_list, cmp_datab... | vuln | Vulnerable | Unknown |
int
sshkey_load_file(int fd, struct sshbuf *blob)
{
u_char buf[1024];
size_t len;
struct stat st;
int r, dontmax = 0;
if (fstat(fd, &st) < 0)
return SSH_ERR_SYSTEM_ERROR;
if ((st.st_mode & (S_IFSOCK|S_IFCHR|S_IFIFO)) == 0 &&
st.st_size > MAX_KEY_FILE_SIZE)
return SSH_ERR_INVALID_FORMAT;
/*
* Pre-allo... | vuln | Safe | C/C++ |
static ssize_t node_read_numastat(struct device *dev,
struct device_attribute *attr, char *buf)
{
return sprintf(buf,
"numa_hit %lu\n"
"numa_miss %lu\n"
"numa_foreign %lu\n"
"interleave_hit %lu\n"
"local_node %lu\n"
"other_node %lu\n",
sum_zone_numa_st... | vuln | Vulnerable | Unknown |
@SubscribeEvent
void onRenderTick(@Nonnull TickEvent.RenderTickEvent event) {
if (event.phase == TickEvent.Phase.START) {
final long lastFrameTime = mFrameTimeMillis;
mFrameTimeMillis = RenderCore.timeMillis();
mElapsedTimeMillis += mFrameTimeMillis - lastFrameTime;
... | vuln | Safe | Java |
private int getRepairCount(ItemStack itemStack) {
return NBTHelper.getTag(itemStack).getInt(repairCountKey);
} | vuln | Vulnerable | Java |
/*!
Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
package com.rebuild.core.configuration;
import cn.devezhao.commons.CodecUt... | vuln | Vulnerable | Java |
static void destroy_surface(struct swaylock_surface *surface) {
wl_list_remove(&surface->link);
if (surface->layer_surface != NULL) {
zwlr_layer_surface_v1_destroy(surface->layer_surface);
}
if (surface->ext_session_lock_surface_v1 != NULL) {
ext_session_lock_surface_v1_destroy(surface->ext_session_lock_surface... | vuln | Safe | Unknown |
static MagickBooleanType WritePICTImage(const ImageInfo *image_info,
Image *image)
{
#define MaxCount 128
#define PictCropRegionOp 0x01
#define PictEndOfPictureOp 0xff
#define PictJPEGOp 0x8200
#define PictInfoOp 0x0C00
#define PictInfoSize 512
#define PictPixmapOp 0x9A
#define PictPICTOp 0x98
#define PictVer... | vuln | Safe | Unknown |
static inline int target_to_host_errno(int err)
{
if (err >= 0 && err < ERRNO_TABLE_SIZE &&
target_to_host_errno_table[err]) {
return target_to_host_errno_table[err];
}
return err;
} | vuln | Safe | C/C++ |
static int xc2028_set_config(struct dvb_frontend *fe, void *priv_cfg)
{
struct xc2028_data *priv = fe->tuner_priv;
struct xc2028_ctrl *p = priv_cfg;
int rc = 0;
tuner_dbg("%s called\n", __func__);
mutex_lock(&priv->lock);
/*
* Copy the config data.
* For the firmware name, keep a local... | vuln | Vulnerable | Unknown |
vorbis_comment(AVFormatContext * as, uint8_t *buf, int size)
{
const uint8_t *p = buf;
const uint8_t *end = buf + size;
unsigned n, j;
int s;
if (size < 8)
return -1;
s = bytestream_get_le32(&p);
if (end - p - 4 < s || s < 0)
return -1;
p += s;
n = bytestream_get_le3... | vuln | Safe | C/C++ |
static int module_clone(int argc, const char **argv, const char *prefix)
{
const char *name = NULL, *url = NULL, *depth = NULL;
int quiet = 0;
int progress = 0;
char *p, *path = NULL, *sm_gitdir;
struct strbuf sb = STRBUF_INIT;
struct string_list reference = STRING_LIST_INIT_NODUP;
int require_init = 0;
char *s... | vuln | Vulnerable | Unknown |
#include <qpdf/Pl_AES_PDF.hh>
#include <qpdf/QUtil.hh>
#include <cstring>
#include <assert.h>
#include <stdexcept>
#include <qpdf/QIntC.hh>
#include <qpdf/QPDFCryptoProvider.hh>
#include <string>
#include <stdlib.h>
bool Pl_AES_PDF::use_static_iv = false;
Pl_AES_PDF::Pl_AES_PDF(char const* identifier, Pipeline* next,... | vuln | Safe | C/C++ |
static int ram_load_postcopy(QEMUFile *f)
{
int flags = 0, ret = 0;
bool place_needed = false;
bool matching_page_sizes = qemu_host_page_size == TARGET_PAGE_SIZE;
MigrationIncomingState *mis = migration_incoming_get_current();
void *postcopy_host_page = postcopy_get_tmp_page(mis);
void *las... | vuln | Safe | C/C++ |
static BlockEntity getWorldTileEntityUnchecked(Level level, BlockPos pos) {
if (level.isOutsideBuildHeight(pos)) {
return null;
} else {
//Note: this should handle the pending entities that we manually did via world in 1.16
return level.getChunkAt(pos).getBlockEntity(... | vuln | Vulnerable | Java |
void backup_start(const char *job_id, BlockDriverState *bs,
BlockDriverState *target, int64_t speed,
MirrorSyncMode sync_mode, BdrvDirtyBitmap *sync_bitmap,
BlockdevOnError on_source_error,
BlockdevOnError on_target_error,
BlockCo... | vuln | Safe | C/C++ |
static int
sudoers_lookup_check(struct sudo_nss *nss, struct sudoers_context *ctx,
unsigned int *validated, struct cmnd_info *info, time_t now,
sudoers_lookup_callback_fn_t callback, void *cb_data,
struct cmndspec **matching_cs, struct defaults_list **defs)
{
struct cmndspec *cs;
struct privilege *p... | vuln | Vulnerable | C/C++ |
package com.salesmanager.shop.model.catalog.product.attribute;
import java.io.Serializable;
import com.salesmanager.shop.model.entity.Entity;
public class ProductOption extends Entity implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private String code;
private Stri... | vuln | Vulnerable | Java |
public List<String> buildOpToNameList() throws HiddenAPIsError {
Integer opNum = getNumOps();
if (opNum == null) {
return null;
}
List<String> appOpsList = new ArrayList<>();
for (int i = 0; i < opNum; i++) {
appOpsList.add(mHiddenAPIs.opToName(i));
}
return appOpsList;
} | vuln | Vulnerable | Java |
static int JBIGDecode(TIFF* tif, uint8* buffer, tmsize_t size, uint16 s)
{
struct jbg_dec_state decoder;
int decodeStatus = 0;
unsigned char* pImage = NULL;
unsigned long decodedSize;
(void) s;
if (isFillOrder(tif, tif->tif_dir.td_fillorder))
{
TIFFReverseBits(tif->tif_rawcp, tif->tif_rawcc);
}
jbg_dec_ini... | vuln | Safe | C/C++ |
static void __io_req_task_work_add(struct io_kiocb *req,
struct io_uring_task *tctx,
struct io_wq_work_list *list)
{
struct io_ring_ctx *ctx = req->ctx;
struct io_wq_work_node *node;
unsigned long flags;
bool running;
spin_lock_irqsave(&tctx->task_lock, flags);
wq_list_add_tail(&req->io_task_work.n... | vuln | Safe | Unknown |
tgs_make_reply(krb5_context context,
krb5_kdc_configuration *config,
KDC_REQ_BODY *b,
krb5_const_principal tgt_name,
const EncTicketPart *tgt,
const krb5_keyblock *replykey,
int rk_is_subkey,
const EncryptionKey *serverkey,
const krb5_keyblock *sessionkey,... | vuln | Vulnerable | C/C++ |
def close_or_open(request, pk, close=True):
# todo: moderators should be able to close it
poll = get_object_or_404(
CommentPoll,
pk=pk,
comment__user=request.user
)
if close:
close_at = timezone.now()
else:
close_at = None
(CommentPoll.objects
.filt... | vuln | Vulnerable | Python |
evbuffer_copyout(struct evbuffer *buf, void *data_out, size_t datlen)
{
/*XXX fails badly on sendfile case. */
struct evbuffer_chain *chain;
char *data = data_out;
size_t nread;
ev_ssize_t result = 0;
EVBUFFER_LOCK(buf);
chain = buf->first;
if (datlen >= buf->total_len)
datlen = buf->total_len;
if (datle... | vuln | Safe | Unknown |
def get(self, key):
"""
Gets the object specified by key. It will also unserialize the object
before returning if it is serialized in memcache with JSON, or if it
is pickled and unpickling is allowed.
:param key: key
:returns: value of the key in memcache
"""
... | vuln | Safe | Python |
@Override
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
renderBackground(matrices);
Render2DHelper.INSTANCE.fillAndBorder(matrices, (width / 2.f) - 154, 45, (width / 2.f) + 156, 263, 0xff000000, 0x50cccccc, 1);
Scissor.INSTANCE.cut(0, 60, width, 200);
... | vuln | Safe | Java |
connection.query("SELECT * FROM Skills WHERE soc = ?", [soc], function(err, rows, fields) {
if (err === null && rows.length == 1) {
successNext(rows[0]);
} else {
successNext(null);
}
}); | vuln | Safe | JavaScript |
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distribute... | vuln | Safe | Java |
enum SCP_SERVER_STATES_E scp_v1s_accept(struct SCP_CONNECTION *c, struct SCP_SESSION **s, int skipVchk)
{
enum SCP_SERVER_STATES_E result;
struct SCP_SESSION *session;
tui32 version;
tui32 size;
tui16 cmdset;
tui16 cmd;
(*s) = NULL;
if (!skipVchk)
{
if (0 == scp_tcp_force_... | vuln | Safe | C/C++ |
NO_INLINE JsVar *jspeFactor() {
if (lex->tk==LEX_ID) {
JsVar *a = jspGetNamedVariable(jslGetTokenValueAsString(lex));
JSP_ASSERT_MATCH(LEX_ID);
#ifndef SAVE_ON_FLASH
if (lex->tk==LEX_TEMPLATE_LITERAL)
jsExceptionHere(JSET_SYNTAXERROR, "Tagged template literals not supported");
else if (lex->tk==... | vuln | Safe | Unknown |
$chrootPath = realpath($chrootPath);
if ($chrootPath !== false && strpos($realfile, $chrootPath) === 0) {
$chrootValid = true;
break;
}
}
if ($chrootValid !== true) {
... | vuln | Vulnerable | PHP |
/** @odoo-module **/
import { registry } from "@web/core/registry";
import {
Many2OneAvatarUserField,
KanbanMany2OneAvatarUserField,
many2OneAvatarUserField,
kanbanMany2OneAvatarUserField,
} from "@mail/web/fields/many2one_avatar_user_field/many2one_avatar_user_field";
export class Many2OneAvatarEmplo... | vuln | Vulnerable | C/C++ |
package com.salesmanager.shop.admin.controller;
/**
* Interface contain constant for Controller.These constant will be used throughout
* sm-shop to providing constant values to various Controllers being used in the
* application.
* @author Umesh A
*
*/
public interface ControllerConstants
{
interface Tiles... | vuln | Safe | Java |
@Override
protected void handleProducer(final CommandProducer cmdProducer) {
checkArgument(state == State.Connected);
final long producerId = cmdProducer.getProducerId();
final long requestId = cmdProducer.getRequestId();
// Use producer name provided by client if present
fin... | vuln | Safe | Java |
@Environment(value = EnvType.CLIENT)
@Override
public Rectangle3f getRenderBoundingBox(BlockState state) {
BakedSkin bakedSkin = BakedSkin.of(getDescriptor());
if (bakedSkin == null) {
return null;
}
float f = 1 / 16f;
Rectangle3f box = bakedSkin.getRenderBoun... | vuln | Vulnerable | Java |
def update(self,
table,
record,
next=DEFAULT,
onvalidation=DEFAULT,
onaccept=DEFAULT,
ondelete=DEFAULT,
log=DEFAULT,
message=DEFAULT,
deletable=DEFAULT,
formname=DEFAULT,... | vuln | Safe | Python |
static int pcpu_need_to_extend(struct pcpu_chunk *chunk, bool is_atomic)
{
int margin, new_alloc;
lockdep_assert_held(&pcpu_lock);
if (is_atomic) {
margin = 3;
if (chunk->map_alloc <
chunk->map_used + PCPU_ATOMIC_MAP_MARGIN_LOW) {
if (list_empty(&chunk->map_extend_list)) {
list_add_tail(&chunk->m... | vuln | Safe | Unknown |
def get_first_ranked_month(db, scene, player):
sql = "select date from ranks where scene='{}' and player='{}' order by date limit 1;".format(scene, player)
res = db.exec(sql)
date = res[0][0]
return date | vuln | Vulnerable | Python |
def move(path, dest, replace=False):
"""Rename a file. `dest` may not be a directory. If `dest` already
exists, raises an OSError unless `replace` is True. Has no effect if
`path` is the same as `dest`. If the paths are on different
filesystems (or the rename otherwise fails), a copy is attempted
in... | vuln | Vulnerable | Python |
@Override
protected void initialize() {
mSmpProtocol = new SmpProtocolSession(mHandler);
// Request as high MTU as possible. As SMP protocol is fairly slow, requires a
// notification for each packet sent, make sure the packets are as big as possible.
// If Data ... | vuln | Safe | Java |
nfs3svc_decode_readlinkargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd3_readlinkargs *args)
{
p = decode_fh(p, &args->fh);
if (!p)
return 0;
args->buffer = page_address(*(rqstp->rq_next_page++));
return xdr_argsize_check(rqstp, p);
} | vuln | Vulnerable | C/C++ |
R_API RBinJavaAttrInfo *r_bin_java_stack_map_table_attr_new(RBinJavaObj *bin, ut8 *buffer, ut64 sz, ut64 buf_offset) {
ut32 i = 0;
ut64 offset = 0;
if (sz < 8) {
return NULL;
}
RBinJavaStackMapFrame *stack_frame = NULL, *new_stack_frame = NULL;
if (sz < 10) {
return NULL;
}
RBinJavaAttrInfo *attr = r_bin_ja... | vuln | Safe | C/C++ |
/**
* Set given `path`
*
* @param {Object} obj
* @param {String} path
* @param {Mixed} val
* @return {Object}
* @api public
*/
exports.set = function(obj, path, val) {
var segs = path.split('.');
var attr = segs.pop();
var src = obj;
for (var i = 0; i < segs.length; i++) {
var seg = segs[i];
i... | vuln | Safe | JavaScript |
static int assigned_device_pci_cap_init(PCIDevice *pci_dev, Error **errp)
{
AssignedDevice *dev = DO_UPCAST(AssignedDevice, dev, pci_dev);
PCIRegion *pci_region = dev->real_device.regions;
int ret, pos;
Error *local_err = NULL;
pci_set_byte(pci_dev->config + PCI_CAPABILITY_LIST, 0);
pci_set... | vuln | Vulnerable | C/C++ |
@PayloadRoot(localPart = "RemoveFirmwareRequest", namespace = NAMESPACE)
@ResponsePayload
public RemoveFirmwareResponse removedFirmware(
@OrganisationIdentification final String organisationIdentification,
@RequestPayload final RemoveFirmwareRequest request)
throws OsgpException {
LOGGER.info... | vuln | Safe | Java |
static int read_mdisk(metric_disk *mdisk)
{
mdisk_header md_header;
uint32_t busy;
uint32_t sig;
int fd;
char *path;
DIR* dir;
struct dirent* entry;
dir = opendir(SYS_BLOCK);
if (dir == NULL)
goto error;
while((entry = readdir(dir))) {
retry:
#ifndef DEBUG_FROM_DOM0
if (strc... | vuln | Vulnerable | C/C++ |
public String createToStringExplainingOwnedCacheKey(ConcurrencyManager concurrencyManager) {
String cacheKeyClass = concurrencyManager.getClass().getCanonicalName();
Thread activeThreadObj = concurrencyManager.getActiveThread();
String activeThread = activeThreadObj != null ? activeThreadObj.get... | vuln | Safe | Java |
show(text, options) {
options = options || {}
options.timeout = (!options.timeout) ? TOAST_PERMANENT_TIMEOUT : options.timeout
const toast = showMessage(text, options)
toast.toastElement.toastify = toast
return $(toast.toastElement)
} | vuln | Vulnerable | JavaScript |
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 | Vulnerable | Unknown |
_gcry_ecc_eddsa_sign (gcry_mpi_t input, ECC_secret_key *skey,
gcry_mpi_t r_r, gcry_mpi_t s, int hashalgo, gcry_mpi_t pk)
{
int rc;
mpi_ec_t ctx = NULL;
int b;
unsigned int tmp;
unsigned char *digest = NULL;
gcry_buffer_t hvec[3];
const void *mbuf;
size_t mlen;
unsigned char *rawm... | vuln | Vulnerable | Unknown |
header_cache_t *imap_hcache_open(struct ImapData *idata, const char *path)
{
struct ImapMbox mx;
struct Url url;
char cachepath[PATH_MAX];
char mbox[PATH_MAX];
if (path)
imap_cachepath(idata, path, mbox, sizeof(mbox));
else
{
if (!idata->ctx || imap_parse_path(idata->ctx->path, &mx) < 0)
re... | vuln | Safe | C/C++ |
import parseUrl from './parseUrl';
import fromLocation from './fromLocation';
import fromObject from './fromObject';
import toObject from './toObject';
import { NIL, defProp, is_domain, is_url, getDomainName } from './helpers';
/**
* URL parser.
*
* @license MIT
* @version 2.0.0
* @author Dumitru Uzun (DUzun.... | vuln | Vulnerable | JavaScript |
/** @file common.c
*
* @brief common tools functions
*
* @example common.c
* Common functions for tools
*
* Copyright (c) 2016 Bartek Fabiszewski
* http://www.fabiszewski.net
*
* Licensed under LGPL, either version 3, or any later.
* See <http://www.gnu.org/licenses/>
*/
#include <stdlib.h>
#include <ctype... | vuln | Vulnerable | C/C++ |
void
xmlParsePEReference(xmlParserCtxtPtr ctxt)
{
const xmlChar *name;
xmlEntityPtr entity = NULL;
xmlParserInputPtr input;
if (RAW != '%')
return;
NEXT;
name = xmlParseName(ctxt);
if (name == NULL) {
xmlFatalErrMsg(ctxt, XML_ERR_PEREF_NO_NAME, "PEReference: no name\n");
return;
... | vuln | Vulnerable | C/C++ |
PROCESS_THREAD(snmp_process, ev, data)
{
PROCESS_BEGIN();
snmp_packet_t snmp_packet;
/* new connection with remote host */
snmp_udp_conn = udp_new(NULL, 0, NULL);
udp_bind(snmp_udp_conn, SNMP_SERVER_PORT);
LOG_DBG("Listening on port %u\n", uip_ntohs(snmp_udp_conn->lport));
while(1) {
PROCESS_YIELD(... | vuln | Safe | C/C++ |
dao_input_nonstoring(void)
{
#if RPL_WITH_NON_STORING
uip_ipaddr_t dao_sender_addr;
uip_ipaddr_t dao_parent_addr;
rpl_dag_t *dag;
rpl_instance_t *instance;
unsigned char *buffer;
uint16_t sequence;
uint8_t instance_id;
uint8_t lifetime;
uint8_t prefixlen;
uint8_t flags;
uint8_t subopt_type;
uip_... | vuln | Safe | Unknown |
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | vuln | Safe | Java |
/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2009-2014 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
*
* OpenNMS(... | vuln | Vulnerable | Java |
public function delete($id)
{
$ret = $this->get($id);
if (!$ret) {
/* get() already logged */
return self::ID_NOT_EXITS;
}
if ($this->isUsed($id)) {
$this->errors[] = _T("Cannot delete this label: it's still used");
return false;
... | vuln | Safe | PHP |
/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2009-2014 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
*
* OpenNMS(... | vuln | Safe | Java |
int ext4_setattr(struct dentry *dentry, struct iattr *attr)
{
struct inode *inode = d_inode(dentry);
int error, rc = 0;
int orphan = 0;
const unsigned int ia_valid = attr->ia_valid;
error = inode_change_ok(inode, attr);
if (error)
return error;
if (is_quota_modification(inode, attr)) {
error = dquot_initia... | vuln | Vulnerable | C/C++ |
/* Copyright 2020 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++ |
static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *dest, int dest_len, char **error TSRMLS_DC) /* {{{ */
{
php_stream_statbuf ssb;
int len;
php_stream *fp;
char *fullpath;
const char *slash;
mode_t mode;
cwd_state new_state;
char *filename;
size_t filename_len;
if (entry->is_moun... | vuln | Vulnerable | C/C++ |
PageInfoUI::GetSecurityDescription(const IdentityInfo& identity_info) const {
std::unique_ptr<PageInfoUI::SecurityDescription> security_description(
new PageInfoUI::SecurityDescription());
switch (identity_info.identity_status) {
case PageInfo::SITE_IDENTITY_STATUS_INTERNAL_PAGE:
#if defined(OS_AND... | vuln | Safe | C/C++ |
format_cb_pane_tabs(struct format_tree *ft, struct format_entry *fe)
{
struct window_pane *wp = ft->wp;
struct evbuffer *buffer;
u_int i;
int size;
if (wp == NULL)
return;
buffer = evbuffer_new();
if (buffer == NULL)
fatalx("out of memory");
for (i = 0; i < wp->base.grid->sx; i++) {
if (!bit_test... | vuln | Safe | Unknown |
// Copyright 2011 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.
// HTTP reverse proxy handler
package httputil
import (
"context"
"fmt"
"io"
"log"
"net"
"net/http"
"net/http/internal/ascii"
"net/textproto"
"net/ur... | vuln | Vulnerable | Go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.