code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
libxlLoggerOpenFile(libxlLogger *logger,
int id,
const char *name,
const char *domain_config)
{
g_autofree char *path = NULL;
FILE *logFile = NULL;
g_autofree char *domidstr = NULL;
path = g_strdup_printf("%s/%s.log", logger->logDir, name);
... | vuln | Safe | Unknown |
Get the IV size of cipher (Usually the same as the blocksize) */
PHP_FUNCTION(mcrypt_get_iv_size)
{
char *cipher;
char *module;
int cipher_len, module_len;
char *cipher_dir_string;
char *module_dir_string;
MCRYPT td;
MCRYPT_GET_INI
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
&cipher, &ciph... | vuln | Vulnerable | C/C++ |
import dayjs from 'dayjs'
import customParseFormat from 'dayjs/plugin/customParseFormat'
import { t } from './i18n.js'
import Projects from '../api/projects/projects.js'
import projectUsers from '../api/users/users.js'
import { periodToDates } from './periodHelpers.js'
import { getGlobalSetting, getUserSetting } from '... | vuln | Vulnerable | JavaScript |
AnsiUp.prototype.get_next_packet = function () {
var pkt = {
kind: PacketKind.EOS,
text: '',
url: ''
};
var len = this._buffer.length;
if (len == 0)
return pkt;
var pos = this._buffer.indexOf("\x1B");
if (pos == -1) {
... | vuln | Vulnerable | JavaScript |
$user = db_fetch_cell_prepared('SELECT username FROM user_auth WHERE id = ?', array($check['user']), 'username');
form_alternate_row('line' . $check['id']);
$name = get_data_source_title($check['datasource']);
$title = $name;
if (strlen($name) > 50) {
$name = substr($name, 0, 50);
}
form_selectabl... | vuln | Vulnerable | PHP |
/*
* 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.
*/
#include "hermes/VM/Operations.h"
#include "hermes/Support/Conversions.h"
#include "hermes/Support/OSCompat.h"
#include "hermes/... | vuln | Vulnerable | C/C++ |
public void run() {
List<String> selectedCurrencies;
List<String> cryptocurrencies = MbwManager.getInstance(_applicationContext).getWalletManager(false).getCryptocurrenciesSymbols();
synchronized (_requestLock) {
selectedCurrencies = new ArrayList<>(_fiatCurrencies);... | vuln | Safe | Java |
ikev1_t_print(netdissect_options *ndo, u_char tpay _U_,
const struct isakmp_gen *ext, u_int item_len,
const u_char *ep, uint32_t phase _U_, uint32_t doi _U_,
uint32_t proto, int depth _U_)
{
const struct ikev1_pl_t *p;
struct ikev1_pl_t t;
const u_char *cp;
const char *idstr;
const struct attr... | vuln | Safe | C/C++ |
public void count(@Nullable Screen nextScreen) {
if (minecraft.level == null) {
return;
}
boolean excluded = false;
if (nextScreen != null && !(nextScreen instanceof MuiScreen)) {
Class<?> t = nextScreen.getClass();
if (t != null) {
for... | vuln | Safe | Java |
void altivec_unavailable_exception(struct pt_regs *regs)
{
if (user_mode(regs)) {
/* A user program has executed an altivec instruction,
but this kernel doesn't support altivec. */
_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
return;
}
printk(KERN_EMERG "Unrecoverable VMX/Altivec Unavailable ... | vuln | Safe | C/C++ |
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* th... | vuln | Vulnerable | Java |
package graph
import (
"context"
"errors"
"fmt"
v0 "github.com/authzed/authzed-go/proto/authzed/api/v0"
v1_proto "github.com/authzed/authzed-go/proto/authzed/api/v1"
"github.com/rs/zerolog/log"
"github.com/shopspring/decimal"
"github.com/authzed/spicedb/internal/datastore"
"github.com/authzed/spicedb/intern... | vuln | Safe | Go |
def candidate_paths_for_url(self, url):
for root, prefix in self.directories:
if url.startswith(prefix):
yield os.path.join(root, url[len(prefix):]) | vuln | Vulnerable | Python |
public VFSLeaf createChildLeaf(String name) {
File fNewFile = new File(getBasefile(), name);
try {
if(!isInPath(name)) {
log.warn("Could not create a new leaf::{} in container::{} - file out of parent directory", name, getBasefile().getAbsolutePath());
return null;
}
if(!fNewFile.getParentFile().ex... | vuln | Safe | Java |
check_acl(pam_handle_t *pamh,
const char *sense, const char *this_user, const char *other_user,
int noent_code, int debug)
{
struct passwd *pwd;
FILE *fp = NULL;
int i, fd = -1, save_errno;
uid_t fsuid;
struct stat st;
/* Check this user's <sense> file. */
pw... | vuln | Vulnerable | C/C++ |
MagickExport MagickBooleanType OpenBlob(const ImageInfo *image_info,
Image *image,const BlobMode mode,ExceptionInfo *exception)
{
BlobInfo
*magick_restrict blob_info;
char
extension[MagickPathExtent],
filename[MagickPathExtent];
const char
*type;
MagickBooleanType
status;
PolicyRight... | vuln | Safe | C/C++ |
struct clock_source *dce100_clock_source_create(
struct dc_context *ctx,
struct dc_bios *bios,
enum clock_source_id id,
const struct dce110_clk_src_regs *regs,
bool dp_clk_src)
{
struct dce110_clk_src *clk_src =
kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL);
if (!clk_src)
return NULL;
if (dce110_clk_... | vuln | Safe | C/C++ |
def find(uuid, options = {})
if uuid.nil? || uuid.to_s.empty?
raise NotFound, "can't find a record with nil identifier"
end
uri = uuid =~ /^http/ ? uuid : member_path(uuid)
begin
from_response API.get(uri, {}, options)
rescue API::NotFound => e
rais... | vuln | Vulnerable | Ruby |
isAuth() {
return (this.user !== null);
}, | vuln | Vulnerable | JavaScript |
package com.salesmanager.shop.admin.controller.customers;
import com.salesmanager.core.business.services.customer.CustomerService;
import com.salesmanager.core.business.services.customer.attribute.CustomerAttributeService;
import com.salesmanager.core.business.services.customer.attribute.CustomerOptionService;
import ... | vuln | Safe | Java |
public static void register(final CommandDispatcher<ServerCommandSource> commandDispatcher)
{
commandDispatcher.register(
CommandManager.literal("scale")
.requires(commandSource ->
{
return commandSource.hasPermissionLevel(2);
})
.then(CommandManager.literal("debug")
.then(CommandManager.liter... | vuln | Safe | Java |
/*
* ***** BEGIN LICENSE BLOCK *****
* Zimbra Collaboration Suite Server
* Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2014, 2016, 2020 Synacor, Inc.
*
* 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... | vuln | Safe | Java |
static Image *ReadCUTImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
Image *image,*palette;
ImageInfo *clone_info;
MagickBooleanType status;
MagickOffsetType
offset;
size_t EncodedByte;
unsigned char RunCount,RunValue,RunCountMasked;
CUTHeader Header;
CUTPalHeader PalHeader;
ssize... | vuln | Safe | C/C++ |
vorbis_header (AVFormatContext * s, int idx)
{
ogg_t *ogg = s->priv_data;
ogg_stream_t *os = ogg->streams + idx;
AVStream *st = s->streams[idx];
oggvorbis_private_t *priv;
if (os->seq > 2)
return 0;
if (os->seq == 0) {
os->private = av_mallocz(sizeof(oggvorbis_private_t));
... | vuln | Vulnerable | C/C++ |
void *arm_dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
gfp_t gfp, struct dma_attrs *attrs)
{
pgprot_t prot = __get_dma_pgprot(attrs, PAGE_KERNEL);
void *memory;
if (dma_alloc_from_coherent(dev, size, handle, &memory))
return memory;
return __dma_alloc(dev, size, handle, gfp, prot, false,... | vuln | Safe | C/C++ |
static av_cold int decode_close(AVCodecContext *avctx)
{
IVI5DecContext *ctx = avctx->priv_data;
ff_ivi_free_buffers(&ctx->planes[0]);
if (ctx->mb_vlc_cust.table)
free_vlc(&ctx->mb_vlc_cust);
if (ctx->frame.data[0])
avctx->release_buffer(avctx, &ctx->frame);
return 0;
} | vuln | Safe | C/C++ |
"""
Generate files provided by TFTP server based on Cobbler object tree.
This is the code behind 'cobbler sync'.
Copyright 2006-2009, Red Hat, Inc and Others
Michael DeHaan <michael.dehaan AT gmail>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public Licen... | vuln | Vulnerable | Python |
bool decompress_file(rzip_control *control)
{
char *tmp, *tmpoutfile, *infilecopy = NULL;
int fd_in, fd_out = -1, fd_hist = -1;
i64 expected_size = 0, free_space;
struct statvfs fbuf;
if (!STDIN && !IS_FROM_FILE) {
struct stat fdin_stat;
stat(control->infile, &fdin_stat);
if (!S_ISREG(fdin_stat.st_mode) &&... | vuln | Safe | Unknown |
public function shippingMethodSave(Request $request) {
if (is_array($request->get('Address'))) {
$request->merge([
'city'=>$request->get('Address')['city'],
'zip'=>$request->get('Address')['zip'],
'state'=>$request->get('Address')['state'],
... | vuln | Vulnerable | PHP |
AVRational av_get_q(void *obj, const char *name, const AVOption **o_out)
{
int64_t intnum=1;
double num=1;
int den=1;
if (av_get_number(obj, name, o_out, &num, &den, &intnum) < 0)
return (AVRational){-1, 0};
if (num == 1.0 && (int)intnum == intnum)
return (AVRational){intnum, den};
... | vuln | Safe | C/C++ |
pub fn clone_cstring_safely(out_ptr: *const c_char) -> Result<CString> {
if out_ptr.is_null() {
return_errno!(EINVAL, "NULL address is invalid");
}
let cstr = unsafe { CStr::from_ptr(out_ptr) };
let cstring = CString::from(cstr);
if !is_inside_user_space(out_ptr as *... | vuln | Vulnerable | Rust |
static s32 i2c_smbus_xfer_emulated(struct i2c_adapter *adapter, u16 addr,
unsigned short flags,
char read_write, u8 command, int size,
union i2c_smbus_data *data)
{
/* So we need to generate a series of msgs. In the case of writing, we
need to use only one message; when reading, we need two. We... | vuln | Vulnerable | C/C++ |
*/
static void php_wddx_pop_element(void *user_data, const XML_Char *name)
{
st_entry *ent1, *ent2;
wddx_stack *stack = (wddx_stack *)user_data;
HashTable *target_hash;
zend_class_entry **pce;
zval *obj;
zval *tmp;
TSRMLS_FETCH();
/* OBJECTS_FIXME */
if (stack->top == 0) {
return;
}
if (!s... | vuln | Vulnerable | C/C++ |
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its S... | vuln | Safe | C/C++ |
int Effect_command(effect_handle_t self,
uint32_t cmdCode,
uint32_t cmdSize,
void *pCmdData,
uint32_t *replySize,
void *pReplyData){
EffectContext * pContext = (EffectContext *) self;
int retsize;
if(pContext->EffectType == LVM_BASS_BOOST){
}
if(pContext->EffectType == LVM_VIRTUALIZER... | vuln | Safe | C/C++ |
TfLiteStatus EluPrepare(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input = GetInput(context, node, 0);
TfLiteTensor* output = GetOutput(context, node, 0);
OpData* data = reinterpret_cast<OpData*>(node->user_data);
// Use LUT to handle quantized elu path.
if (input->type == kTfLiteInt8) {... | vuln | Vulnerable | C/C++ |
post_process_urlencoded (struct MHD_PostProcessor *pp,
const char *post_data,
size_t post_data_len)
{
char *kbuf = (char *) &pp[1];
size_t poff;
const char *start_key = NULL;
const char *end_key = NULL;
const char *start_value = NULL;
const char *end_value =... | vuln | Vulnerable | Unknown |
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
if (event.getRightClicked().getType() == EntityType.UNKNOWN) {
return;
}
Location location = BukkitUtil.adapt(event.getRightClicked().getL... | vuln | Safe | Java |
public static float getEstimatedHealthIncrement(ItemStack itemStack, FoodValues modifiedFoodValues, PlayerEntity player)
{
if (!isFood(itemStack))
return 0;
if (!player.canFoodHeal())
return 0;
HungerManager stats = player.getHungerManager();
World world = player.getEntityWorld();
int foodLevel = Ma... | vuln | Safe | Java |
bool ResourcePrefetchPredictor::PredictPreconnectOrigins(
const GURL& url,
PreconnectPrediction* prediction) const {
DCHECK(!prediction || prediction->requests.empty());
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (initialization_state_ != INITIALIZED)
return false;
url::Origin url_origin = url::Ori... | vuln | Vulnerable | C/C++ |
static long madvise_remove(struct vm_area_struct *vma,
struct vm_area_struct **prev,
unsigned long start, unsigned long end)
{
loff_t offset;
int error;
struct file *f;
*prev = NULL; /* tell sys_madvise we drop mmap_sem */
if (vma->vm_flags & (VM_LOCKED|VM_NONLINEAR|VM_HUGETLB))
return -EINVAL;
f = v... | vuln | Safe | 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 | Vulnerable | Python |
private ArrayList<MFile> resolveUri(Uri u) {
ArrayList<MFile> mfs = new ArrayList<>();
try (Cursor c = svc.getContentResolver().query(u, new String[]{DocumentsContract.Document.COLUMN_DOCUMENT_ID, DocumentsContract.Document.COLUMN_DISPLAY_NAME,
DocumentsContract.Document.COLUMN_M... | vuln | Vulnerable | Java |
struct xt_table_info *xt_alloc_table_info(unsigned int size)
{
struct xt_table_info *info = NULL;
size_t sz = sizeof(*info) + size;
/* Pedantry: prevent them from hitting BUG() in vmalloc.c --RR */
if ((SMP_ALIGN(size) >> PAGE_SHIFT) + 2 > totalram_pages)
return NULL;
if (sz <= (PAGE_SIZE << PAGE_ALLOC_C... | vuln | Vulnerable | C/C++ |
public function __get($name)
{
$forbidden = array(
'admin', 'staff', 'due_free', 'appears_in_list', 'active',
'row_classes', 'oldness', 'duplicate'
);
if (!defined('GALETTE_TESTS')) {
$forbidden[] = 'password'; //keep that for tests only
}
... | vuln | Vulnerable | PHP |
int venc_dev::venc_output_log_buffers(const char *buffer_addr, int buffer_len)
{
if (venc_handle->is_secure_session()) {
DEBUG_PRINT_ERROR("logging secure output buffers is not allowed!");
return -1;
}
if (!m_debug.outfile) {
int size = 0;
if(m_sVenc_cfg.codectype == V4L... | vuln | Safe | C/C++ |
@Override
public void lock(long[] docIds, String comment) throws ServerException {
Session session = validateSession(getThreadLocalRequest());
// Unlock the document; throws an exception if something
// goes wrong
DocumentManager documentManager = (DocumentManager) Context.get().getBean(DocumentManager.class)... | vuln | Vulnerable | Java |
def resource_ungroup(params, request, session)
if not allowed_for_local_cluster(session, Permissions::WRITE)
return 403, 'Permission denied'
end
unless params[:group_id]
return [400, 'group_id has to be specified.']
end
_, stderr, retval = run_cmd(
session, PCS, 'resource', 'ungroup', params[:... | vuln | Vulnerable | Ruby |
static Image *ReadMVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define BoundingBox "viewbox"
DrawInfo
*draw_info;
Image
*image;
MagickBooleanType
status;
/*
Open image.
*/
assert(image_info != (const ImageInfo *) NULL);
assert(image_info->signature == MagickCoreSig... | vuln | Vulnerable | C/C++ |
@SubscribeEvent
public void onPacketReceive(PacketEvent.Receive event) {
if (event.getStage() != 0) {
return;
}
WurstplusThree.SERVER_MANAGER.onPacketReceived();
if (event.getPacket() instanceof SPacketEntityStatus) {
SPacketEntityStatus packet = event.getPack... | vuln | Vulnerable | Java |
static void exynos4210_fimd_update(void *opaque)
{
Exynos4210fimdState *s = (Exynos4210fimdState *)opaque;
DisplaySurface *surface;
Exynos4210fimdWindow *w;
int i, line;
hwaddr fb_line_addr, inc_size;
int scrn_height;
int first_line = -1, last_line = -1, scrn_width;
bool blend = false;
... | vuln | Safe | C/C++ |
static int ax25_rt_del(struct ax25_routes_struct *route)
{
ax25_route *s, *t, *ax25_rt;
ax25_dev *ax25_dev;
if ((ax25_dev = ax25_addr_ax25dev(&route->port_addr)) == NULL)
return -EINVAL;
write_lock_bh(&ax25_route_lock);
ax25_rt = ax25_route_list;
while (ax25_rt != NULL) {
s = ax25_rt;
ax25_rt = ax2... | vuln | Safe | Unknown |
int
buflist_getfile(
int n,
linenr_T lnum,
int options,
int forceit)
{
buf_T *buf;
win_T *wp = NULL;
pos_T *fpos;
colnr_T col;
buf = buflist_findnr(n);
if (buf == NULL)
{
if ((options & GETF_ALT) && n == 0)
emsg(_(e_no_alternate_file));
else
semsg(_(e_buffer_n... | vuln | Safe | C/C++ |
# Copyright 2017 Vector Creations Ltd
# Copyright 2018 New Vector Ltd
# Copyright 2019 Michael Telatynski <7t3chguy@gmail.com>
#
# 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://w... | vuln | Vulnerable | Python |
def is_blocked(self, max_failed_attempts: int,
inactivation_in_minutes: int):
"""
Check if user can login or if they are temporarily blocked because they
entered a wrong password too often
Parameters
----------
max_failed_attempts: int
Maxi... | vuln | Vulnerable | Python |
resolve: function resolve(hostname) {
var output,
nodeBinary = process.execPath;
if (!isValidHostName(hostname)) {
console.error('Invalid hostname:', hostname);
return null;
}
var scriptPath = path.join(__dirname, "../scripts/dns-lookup-script"),
... | vuln | Safe | JavaScript |
dir_initialize(int argc, VALUE *argv, VALUE dir)
{
struct dir_data *dp;
rb_encoding *fsenc;
VALUE dirname, opt, orig;
static ID keyword_ids[1];
const char *path;
if (!keyword_ids[0]) {
keyword_ids[0] = rb_intern("encoding");
}
fsenc = rb_filesystem_encoding();
rb_scan_args(argc,... | vuln | Safe | Unknown |
int net_get(int s, void *arg, int *len)
{
struct net_hdr nh;
int plen;
if (net_read_exact(s, &nh, sizeof(nh)) == -1)
{
return -1;
}
plen = ntohl(nh.nh_len);
if (!(plen <= *len))
printf("PLEN %d type %d len %d\n",
plen, nh.nh_type, *len);
assert(plen <= *len && plen > 0); /* XXX */
... | vuln | Safe | Unknown |
int test_mod_exp(BIO *bp, BN_CTX *ctx)
{
BIGNUM *a, *b, *c, *d, *e;
int i;
a = BN_new();
b = BN_new();
c = BN_new();
d = BN_new();
e = BN_new();
BN_one(a);
BN_one(b);
BN_zero(c);
if (BN_mod_exp(d, a, b, c, ctx)) {
fprintf(stderr, "BN_mod_exp with zero modulus succee... | vuln | Vulnerable | Unknown |
#ifndef JSI_LITE_ONLY
#ifndef JSI_AMALGAMATION
#include "jsiInt.h"
#endif
#define bits_set(who, mask) ((who) |= (mask))
#define bits_unset(who, mask) ((who) &= (~(mask)))
#define bits_get(who, mask) ((who) & (mask))
#if JSI__MEMDEBUG
void jsi_VALCHK(Jsi_Value *val) {
SIGASSERTV(val,VALUE);
assert(v... | vuln | Vulnerable | C/C++ |
public Value scriptRunCommand(ScriptHost host, BlockPos pos)
{
if (CarpetServer.scriptServer.stopAll)
throw new CarpetExpressionException("SCRIPTING PAUSED", null);
try
{
Context context = new CarpetContext(host, source, origin).
with("x", (c, t) -... | vuln | Vulnerable | Java |
_hivex_get_children (hive_h *h, hive_node_h node,
hive_node_h **children_ret, size_t **blocks_ret,
int flags)
{
if (!IS_VALID_BLOCK (h, node) || !block_id_eq (h, node, "nk")) {
SET_ERRNO (EINVAL, "invalid block or not an 'nk' block");
return -1;
}
struct ntreg_nk... | vuln | Safe | Unknown |
/* 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 | Python |
/* Copyright 2017 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 | Python |
var setValue = function (obj, key, value) {
var o = obj;
var keys = Array.isArray(key) ? key : key.split('.');
for (var x = 1; x < keys.length; ++x) {
var currentKey = keys[x];
var lastKey = keys[x - 1];
if (typeof currentKey === 'number') {
if (!o[lastKey]) {
o[lastKey] = [];
}
... | vuln | Safe | JavaScript |
Graph.prototype.resizeParentStacks=function(b,e,k,n){if(null!=this.layoutManager&&null!=e&&e.constructor==mxStackLayout&&!e.resizeLast){this.model.beginUpdate();try{for(var D=e.horizontal;null!=b&&null!=e&&e.constructor==mxStackLayout&&e.horizontal==D&&!e.resizeLast;){var t=this.getCellGeometry(b),E=this.view.getState(... | vuln | Safe | JavaScript |
static inline int wv_unpack_mono(WavpackFrameContext *s, GetBitContext *gb, void *dst, const int type)
{
int i, j, count = 0;
int last, t;
int A, S, T;
int pos = s->pos;
uint32_t crc = s->sc.crc;
uint32_t crc_extra_bits = s->extra_sc.crc;
int16_t *dst16 = dst;
int32_t *dst32 = dst;
f... | vuln | Safe | C/C++ |
public static void recalculate() {
if (EmiConfig.craftable || BoM.tree != null || EmiFavorites.syntheticFavorites.size() > 0) {
EmiPlayerInventory inv = new EmiPlayerInventory(client.player);
if (!inv.isEqual(lastPlayerInventory)) {
lastPlayerInventory = inv;
if (EmiConfig.craftable) {
EmiSearch.up... | vuln | Vulnerable | Java |
static int snd_ctl_elem_user_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
int change;
struct user_element *ue = kcontrol->private_data;
change = memcmp(&ucontrol->value, ue->elem_data, ue->elem_data_size) != 0;
if (change)
memcpy(ue->elem_data, &ucontrol->value, ue->elem_data_s... | vuln | Vulnerable | C/C++ |
static __poll_t hid_debug_events_poll(struct file *file, poll_table *wait)
{
struct hid_debug_list *list = file->private_data;
poll_wait(file, &list->hdev->debug_wait, wait);
if (!kfifo_is_empty(&list->hid_debug_fifo))
return EPOLLIN | EPOLLRDNORM;
if (!list->hdev->debug)
return EPOLLERR | EPOLLHUP;
return 0;... | vuln | Safe | Unknown |
svc_set_num_threads(struct svc_serv *serv, struct svc_pool *pool, int nrservs)
{
struct svc_rqst *rqstp;
struct task_struct *task;
struct svc_pool *chosen_pool;
int error = 0;
unsigned int state = serv->sv_nrthreads-1;
int node;
if (pool == NULL) {
/* The -1 assumes caller has done a svc_get() */
nrs... | vuln | Vulnerable | C/C++ |
grub_ext4_find_leaf (struct grub_ext2_data *data, char *buf,
struct grub_ext4_extent_header *ext_block,
grub_uint32_t fileblock)
{
struct grub_ext4_extent_idx *index;
while (1)
{
int i;
grub_disk_addr_t block;
index = (struct grub_ext4_extent_idx *) ... | vuln | Vulnerable | C/C++ |
int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
int vnet_hdr_required, int mq_required, Error **errp)
{
char dev[10]="";
int fd;
if( (fd = tap_alloc(dev, sizeof(dev))) < 0 ){
fprintf(stderr, "Cannot allocate TAP device\n");
return -1;
}
pstrcpy(ifname, ifn... | vuln | Vulnerable | C/C++ |
static inline int audit_del_rule(struct audit_entry *entry,
struct list_head *list)
{
struct audit_entry *e;
struct audit_field *inode_f = entry->rule.inode_f;
struct audit_watch *watch, *tmp_watch = entry->rule.watch;
struct audit_tree *tree = entry->rule.tree;
LIST_HEAD(inotify_list);
int h, ret = 0;
#ifd... | vuln | Vulnerable | Unknown |
private void populateRemoveAndProtectedHeaders(RequestContext requestContext) {
Map<String, SecuritySchemaConfig> securitySchemeDefinitions =
requestContext.getMatchedAPI().getSecuritySchemeDefinitions();
// API key headers are considered to be protected headers, such that the header wou... | vuln | Vulnerable | Java |
__rta_reserve(struct sk_buff *skb, int attrtype, int attrlen)
{
struct rtattr *rta;
int size = RTA_LENGTH(attrlen);
rta = (struct rtattr*)skb_put(skb, RTA_ALIGN(size));
rta->rta_type = attrtype;
rta->rta_len = size;
return rta;
} | vuln | Vulnerable | Unknown |
GF_Err BD_DecMFFieldVec(GF_BifsDecoder * codec, GF_BitStream *bs, GF_Node *node, GF_FieldInfo *field, Bool is_mem_com)
{
GF_Err e;
u32 NbBits, nbFields;
u32 i;
GF_ChildNodeItem *last;
u8 qp_local, qp_on, initial_qp;
GF_FieldInfo sffield;
memset(&sffield, 0, sizeof(GF_FieldInfo));
sffield.fieldIndex = field->fi... | vuln | Safe | C/C++ |
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
| Copyrigh... | vuln | Safe | C/C++ |
void qdist_init(struct qdist *dist)
{
dist->entries = g_malloc(sizeof(*dist->entries));
dist->size = 1;
dist->n = 0;
} | vuln | Vulnerable | C/C++ |
static int send_sub_rect(VncState *vs, int x, int y, int w, int h)
{
uint32_t bg = 0, fg = 0;
int colors;
int ret = 0;
#ifdef CONFIG_VNC_JPEG
bool force_jpeg = false;
bool allow_jpeg = true;
#endif
if (!color_count_palette) {
color_count_palette = g_malloc(sizeof(VncPalette));
v... | vuln | Safe | Unknown |
cmark_node_type cmark_syntax_extension_add_node(int is_inline) {
cmark_node_type *ref = !is_inline ? &CMARK_NODE_LAST_BLOCK : &CMARK_NODE_LAST_INLINE;
if ((*ref & CMARK_NODE_VALUE_MASK) == CMARK_NODE_VALUE_MASK) {
assert(false);
return (cmark_node_type) 0;
}
return *ref = (cmark_node_type) ((int) *ref... | vuln | Vulnerable | C/C++ |
void tap_fd_set_offload(int fd, int csum, int tso4,
int tso6, int ecn, int ufo)
{
unsigned int offload = 0;
if (ioctl(fd, TUNSETOFFLOAD, 0) != 0 && errno == EINVAL) {
return;
}
if (csum) {
offload |= TUN_F_CSUM;
if (tso4)
offload |= TUN_F_... | vuln | Safe | C/C++ |
@SuppressWarnings("checkstyle:emptyblock")
private static List<Region> internalParse(
final InputStream input,
final boolean endpointVerification) throws IOException {
Document document;
try {
DocumentBuilderFactory factory =
DocumentBuilderF... | vuln | Vulnerable | Java |
/*
* JBoss, Home of Professional Open Source.
* Copyright 2014 Red Hat, Inc., and individual 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 Licen... | vuln | Vulnerable | Java |
private function _categoriesminmax( $option ) {
if ( is_numeric( $option[0] ) ) {
$this->addWhere( intval( $option[0] ) . ' <= (SELECT count(*) FROM ' . $this->tableNames['categorylinks'] . ' WHERE ' . $this->tableNames['categorylinks'] . '.cl_from=page_id)' );
}
if ( is_numeric( $option[1] ) ) {
$this->add... | vuln | Vulnerable | PHP |
chpass_principal3_2_svc(chpass3_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg;
gss_buffer_desc client_name,
service_name;
OM_uint32 minor_stat;
kadm5_server_handle_t handle;
... | vuln | Vulnerable | C/C++ |
AP_DECLARE(void) ap_increment_counts(ap_sb_handle_t *sb, request_rec *r)
{
worker_score *ws;
apr_off_t bytes;
if (!sb)
return;
ws = &ap_scoreboard_image->servers[sb->child_num][sb->thread_num];
if (pfn_ap_logio_get_last_bytes != NULL) {
bytes = pfn_ap_logio_get_last_bytes(r->connec... | vuln | Vulnerable | C/C++ |
bool parse( char* ptr )
{
bool first = true;
bool ok = true;
FileNode root_collection(fs->getFS(), 0, 0);
for(;;)
{
// 0. skip leading comments and directives and ...
// 1. reach the first item
for(;;)
{
ptr = ... | vuln | Vulnerable | C/C++ |
decode_NXAST_RAW_ENCAP(const struct nx_action_encap *nae,
enum ofp_version ofp_version OVS_UNUSED,
struct ofpbuf *out)
{
struct ofpact_encap *encap;
const struct ofp_ed_prop_header *ofp_prop;
const size_t encap_ofs = out->size;
size_t props_len;
uint16_t... | vuln | Safe | Unknown |
static void neon_store_scratch(int scratch, TCGv var)
{
tcg_gen_st_i32(var, cpu_env, offsetof(CPUARMState, vfp.scratch[scratch]));
dead_tmp(var);
} | vuln | Vulnerable | C/C++ |
static int dr_domain_init_resources(struct mlx5dr_domain *dmn)
{
int ret;
dmn->ste_ctx = mlx5dr_ste_get_ctx(dmn->info.caps.sw_format_ver);
if (!dmn->ste_ctx) {
mlx5dr_err(dmn, "SW Steering on this device is unsupported\n");
return -EOPNOTSUPP;
}
ret = mlx5_core_alloc_pd(dmn->mdev, &dmn->pdn);
if (ret) {
m... | vuln | Safe | C/C++ |
@ModifyVariable(at = @At("HEAD"), method = "addMessage(Lnet/minecraft/network/chat/Component;Lnet/minecraft/network/chat/MessageSignature;ILnet/minecraft/client/GuiMessageTag;Z)V", argsOnly = true)
private Component addMessageName(Component message) {
//get config
int config = Config.CHAT_NAMEPLATE.... | vuln | Safe | Java |
static void cmd_list(char *arg1, char *arg2)
{
if (!arg1)
arg1 = "active";
else
lcase(arg1);
if (!strcmp(arg1, "active")) {
char pattern[MAX_MAILBOX_BUFFER];
struct list_rock lrock;
struct enum_rock erock;
if (!arg2) arg2 = "*";
erock.cmd = "ACTIVE";
erock.wild = xstrdup(arg2); /* make a copy bef... | vuln | Vulnerable | Unknown |
__rta_reserve(struct sk_buff *skb, int attrtype, int attrlen)
{
struct rtattr *rta;
int size = RTA_LENGTH(attrlen);
rta = (struct rtattr*)skb_put(skb, RTA_ALIGN(size));
rta->rta_type = attrtype;
rta->rta_len = size;
memset(RTA_DATA(rta) + attrlen, 0, RTA_ALIGN(size) - size);
return rta;
} | vuln | Safe | Unknown |
/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
* Copyright (c) 2016 Facebook
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in th... | vuln | Safe | C/C++ |
nfa_regmatch(
nfa_regprog_T *prog,
nfa_state_T *start,
regsubs_T *submatch,
regsubs_T *m)
{
int result = FALSE;
size_t size = 0;
int flag = 0;
int go_to_nextline = FALSE;
nfa_thread_T *t;
nfa_list_T list[2];
int listidx;
nfa_list_T *thislist;
nfa_list_T *nextli... | vuln | Vulnerable | Unknown |
Status explain(OperationContext* opCtx,
const OpMsgRequest& opMsgRequest,
ExplainOptions::Verbosity verbosity,
rpc::ReplyBuilderInterface* result) const override {
std::string dbname = opMsgRequest.getDatabase().toString();
const BSONObj& cmdObj =... | vuln | Vulnerable | Unknown |
/* NetHack 3.6 windows.c $NHDT-Date: 1575245096 2019/12/02 00:04:56 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.60 $ */
/* Copyright (c) D. Cohrs, 1993. */
/* NetHack may be freely redistributed. See license for details. */
#include "hack.h"
#ifdef TTY_GRAPHICS
#include "wintty.h"
#endif
#ifdef CURSES_GRAPHICS
e... | vuln | Safe | C/C++ |
void operator()(OpKernelContext* ctx, bool use_cudnn, bool cudnn_use_autotune,
const Tensor& input, const Tensor& filter, int row_dilation,
int col_dilation, int row_stride, int col_stride,
const Padding& padding,
const std::vector<int64>& explicit... | vuln | Vulnerable | Unknown |
static ssize_t exitcode_proc_write(struct file *file,
const char __user *buffer, size_t count, loff_t *pos)
{
char *end, buf[sizeof("nnnnn\0")];
int tmp;
if (copy_from_user(buf, buffer, count))
return -EFAULT;
tmp = simple_strtol(buf, &end, 0);
if ((*end != '\0') && !isspace(*end))
return -EINVAL;
uml_ex... | vuln | Vulnerable | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.