code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
public static ItemStack oldItemStackToNew(ItemStack stack, int meta) {
boolean copiedTag = false;
Item newItem = OLD_ITEM_TO_NEW.get(Pair.of(stack.getItem(), meta));
if (newItem != null && newItem != stack.getItem()) {
ItemStack newStack = new ItemStack(newItem, stack.getCount());
... | vuln | Safe | Java |
static int bgp_attr_check(struct peer *peer, struct attr *attr,
bgp_size_t length)
{
uint8_t type = 0;
/* BGP Graceful-Restart End-of-RIB for IPv4 unicast is signaled as an
* empty UPDATE. Treat-as-withdraw, otherwise if we just ignore it,
* we will pass it to be processed as a normal UPDATE without mandato... | vuln | Vulnerable | C/C++ |
// imagew-main.c
// Part of ImageWorsener, Copyright (c) 2011 by Jason Summers.
// For more information, see the readme.txt file.
#include "imagew-config.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "imagew-internals.h"
// Given a color type having an alpha channel, returns the index of th... | vuln | Vulnerable | C/C++ |
def variables_import(args, session):
"""Import variables from a given file."""
if not os.path.exists(args.file):
raise SystemExit("Missing variables file.")
with open(args.file) as varfile:
try:
var_json = json.load(varfile)
except JSONDecodeError:
raise Syste... | vuln | Safe | Python |
static bool vexpress_cfgctrl_read(arm_sysctl_state *s, unsigned int dcc,
unsigned int function, unsigned int site,
unsigned int position, unsigned int device,
uint32_t *val)
{
if (dcc != 0 || position != 0 ||
... | vuln | Safe | C/C++ |
def _redirect_safe(self, url, default=None):
"""Redirect if url is on our PATH
Full-domain redirects are allowed if they pass our CORS origin checks.
Otherwise use default (self.base_url if unspecified).
"""
if default is None:
default = self.base_url
# prot... | vuln | Safe | Python |
static enum XML_Error
addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
const XML_Char *uri, BINDING **bindingsPtr) {
static const XML_Char xmlNamespace[]
= {ASCII_h, ASCII_t, ASCII_t, ASCII_p, ASCII_COLON,
ASCII_SLASH, ASCII_SLASH, ASCII_w, ASCI... | vuln | Vulnerable | C/C++ |
void EC_GROUP_clear_free(EC_GROUP *group)
{
if (!group) return;
if (group->meth->group_clear_finish != 0)
group->meth->group_clear_finish(group);
else if (group->meth->group_finish != 0)
group->meth->group_finish(group);
EC_EX_DATA_clear_free_all_data(&group->extra_data);
if (group->generator != NULL)
... | vuln | Vulnerable | Unknown |
void ProfilingService::DumpProcessesForTracing(
bool keep_small_allocations,
bool strip_path_from_mapped_files,
DumpProcessesForTracingCallback callback) {
memory_instrumentation::MemoryInstrumentation::GetInstance()
->GetVmRegionsForHeapProfiler(base::Bind(
&ProfilingService::OnGetVmRe... | vuln | Vulnerable | C/C++ |
void CLASS apply_tiff()
{
int max_samp=0, raw=-1, thm=-1, i;
struct jhead jh;
thumb_misc = 16;
if (thumb_offset) {
fseek (ifp, thumb_offset, SEEK_SET);
if (ljpeg_start (&jh, 1)) {
if((unsigned)jh.bits<17 && (unsigned)jh.wide < 0x10000 && (unsigned)jh.high < 0x10000)
{
thumb_misc... | vuln | Safe | C/C++ |
@Override
public void onAdapterPrepared() {
super.onAdapterPrepared();
IntentFilter intentFilter = new IntentFilter();
relatedReceiver = new CallBackReceiver(new BaseReceiver.CallBack() {
@Override
public void onReceive(Context context, Intent intent) {
... | vuln | Safe | Java |
private void ensureCapacityFor(@NotNull final FloatBuffer valuesToAdd) {
if(!valuesToAdd.hasRemaining()) {
return;
}
final int currentCapacity = targetBuffer.capacity();
final int currentPosition = targetBuffer.position();
final int requiredCapacity = currentPosition... | vuln | Vulnerable | Java |
static inline void ModulateHSB(const double percent_hue,
const double percent_saturation,const double percent_brightness,double *red,
double *green,double *blue)
{
double
brightness,
hue,
saturation;
/*
Increase or decrease color brightness, saturation, or hue.
*/
ConvertRGBToHSB(*red,*gree... | vuln | Safe | Unknown |
static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table TSRMLS_DC)
{
size_t length;
int tag, format, components;
char *value_ptr, tagname[64], cbuf[32], *outside=NULL;
size_t b... | vuln | Vulnerable | Unknown |
static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt)
{
MXFContext *mxf = s->priv_data;
AVIOContext *pb = s->pb;
AVStream *st = s->streams[pkt->stream_index];
MXFStreamContext *sc = st->priv_data;
MXFIndexEntry ie = {0};
int err;
if (!mxf->edit_unit_byte_count && !(mxf->edit_units_c... | vuln | Safe | C/C++ |
int SeekHead::GetCount() const
{
return m_entry_count;
} | vuln | Vulnerable | C/C++ |
int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
const ASN1_ITEM *it,
int tag, int aclass, char opt, ASN1_TLC *ctx)
{
const ASN1_TEMPLATE *tt, *errtt = NULL;
const ASN1_COMPAT_FUNCS *cf;
const ASN1_EXTERN_FUNCS *ef;
const ASN1_AUX *aux... | vuln | Vulnerable | Unknown |
public void addNotification(ExpandableNotificationRow row, int childIndex) {
int newIndex = childIndex < 0 ? mAttachedChildren.size() : childIndex;
mAttachedChildren.add(newIndex, row);
addView(row);
row.setUserLocked(mUserLocked);
View divider = inflateDivider();
addVie... | vuln | Vulnerable | Java |
package providers
import (
"context"
"crypto/rsa"
"encoding/json"
"encoding/xml"
"github.com/TykTechnologies/tyk/certs"
"net/http"
"net/url"
"strings"
"sync"
"github.com/markbates/goth"
"github.com/crewjam/saml"
"github.com/crewjam/saml/samlsp"
logger "github.com/TykTechnologies/tyk-identity-broker/lo... | vuln | Vulnerable | Go |
static void set_ntacl_dacl(struct user_namespace *user_ns,
struct smb_acl *pndacl,
struct smb_acl *nt_dacl,
unsigned int aces_size,
const struct smb_sid *pownersid,
const struct smb_sid *pgrpsid,
struct smb_fattr *fattr)
{
struct smb_ace *ntace, *pndace;
int nt_num_aces = le32_to_c... | vuln | Safe | C/C++ |
db.get("SELECT id,note FROM notes WHERE id = '"+data.id+"'",function(err,row){
var newval;
if(row){
newval = row.note;
} else {
newval= "";
}
var op = data.op;
if(op.d!==null) {
newval = newval.slice(0,op.p)+newval.slice(op.p+op.d);
}
if(op.i!==nul... | vuln | Vulnerable | JavaScript |
public Text2D setText(String newText) {
text = newText;
setMetrics(FastJEngine.getCanvas().getGraphics());
return this;
} | vuln | Vulnerable | Java |
public void addPersistentPreferredActivity(WatchedIntentFilter filter, ComponentName activity,
int userId) {
int callingUid = Binder.getCallingUid();
if (callingUid != Process.SYSTEM_UID) {
throw new SecurityException(
"addPersistentPreferredActivity can only ... | vuln | Safe | Java |
/*
* 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 |
package com.salesmanager.shop.model.catalog.product.product.definition;
import java.util.ArrayList;
import java.util.List;
import com.salesmanager.shop.model.catalog.category.ReadableCategory;
import com.salesmanager.shop.model.catalog.manufacturer.ReadableManufacturer;
import com.salesmanager.shop.model.catalog.prod... | vuln | Vulnerable | Java |
/************************************************************************
* edit.c
* nodau console note taker
* Copyright (C) Lisa Milne 2010-2013 <lisa@ltmnet.com>
*
* edit.c 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 Softwa... | vuln | Vulnerable | C/C++ |
# Generated by Django 3.0.5 on 2020-04-20 09:40
import InvenTree.fields
import InvenTree.models
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('company', '00... | vuln | Safe | Python |
evbuffer_add_file(struct evbuffer *outbuf, int fd,
ev_off_t offset, ev_off_t length)
{
#if defined(USE_SENDFILE) || defined(_EVENT_HAVE_MMAP)
struct evbuffer_chain *chain;
struct evbuffer_chain_fd *info;
#endif
#if defined(USE_SENDFILE)
int sendfile_okay = 1;
#endif
int ok = 1;
if (offset < 0 || length < 0 ||... | vuln | Safe | Unknown |
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++ |
static int mpage_da_map_blocks(struct mpage_da_data *mpd)
{
int err, blks, get_blocks_flags;
struct buffer_head new;
sector_t next = mpd->b_blocknr;
unsigned max_blocks = mpd->b_size >> mpd->inode->i_blkbits;
loff_t disksize = EXT4_I(mpd->inode)->i_disksize;
handle_t *handle = NULL;
/*
* We consider only non-... | vuln | Vulnerable | Unknown |
bool GDataRootDirectory::ParseFromString(const std::string& serialized_proto) {
scoped_ptr<GDataRootDirectoryProto> proto(
new GDataRootDirectoryProto());
bool ok = proto->ParseFromString(serialized_proto);
if (ok) {
const GDataEntryProto& entry_proto =
proto->gdata_directory().gdata_entry();... | vuln | Safe | C/C++ |
protected JSONObject payloadToJSONObject() throws JSONException {
JSONObject obj = new JSONObject();
try {
if (responseTypes != null && !responseTypes.isEmpty()) {
if (responseTypes.size() == 1) {
ResponseType responseType = responseTypes.get(0);
... | vuln | Safe | Java |
def process_delta(data, delta):
if not delta.specific.delta:
return data
if delta.specific.delta == 'cat':
datalines = data.split('\n')
for line in delta.data.split('\n'):
if not line:
continue
if line[0] == '+':
datalines.append(li... | vuln | Vulnerable | Python |
static int get_sot(Jpeg2000DecoderContext *s, int n)
{
Jpeg2000TilePart *tp;
uint16_t Isot;
uint32_t Psot;
uint8_t TPsot;
if (bytestream2_get_bytes_left(&s->g) < 8)
Isot = bytestream2_get_be16u(&s->g);
if (Isot) {
avpriv_request_sample(s->avctx, "Support for more than one til... | vuln | Vulnerable | C/C++ |
void PrintingMessageFilter::OnCheckForCancel(const std::string& preview_ui_addr,
void PrintingMessageFilter::OnCheckForCancel(int32 preview_ui_id,
int preview_request_id,
bool* cancel) {
PrintPreviewUI::GetCurrentPrintPreviewS... | vuln | Safe | C/C++ |
int redisContextConnectUnix(redisContext *c, const char *path, const struct timeval *timeout) {
int blocking = (c->flags & REDIS_BLOCK);
struct sockaddr_un *sa;
long timeout_msec = -1;
if (redisCreateSocket(c,AF_UNIX) < 0)
return REDIS_ERR;
if (redisSetBlocking(c,0) != REDIS_OK)
ret... | vuln | Safe | C/C++ |
// Copyright 2013 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 or at
// https://developers.google.com/open-source/licenses/bsd.
// Package gosrc fetches Go package source code from version control services.
package gosrc
... | vuln | Safe | Go |
function growl(msg, options, fn) {
var image
, args
, options = options || {}
, fn = fn || function(){};
if (options.exec) {
cmd = {
type: "Custom"
, pkg: options.exec
, range: []
};
}
// noop
if (!cmd) return fn(new Error('growl not supported on this platform'));
a... | vuln | Vulnerable | JavaScript |
char *redisProtocolToLuaType_Aggregate(lua_State *lua, char *reply, int atype) {
char *p = strchr(reply+1,'\r');
long long mbulklen;
int j = 0;
string2ll(reply+1,p-reply-1,&mbulklen);
if (server.lua_client->resp == 2 || atype == '*') {
p += 2;
if (mbulklen == -1) {
lua_p... | vuln | Safe | Unknown |
public static function getParent($parent='', $menuid = ''){
if(isset($menuid)){
$where = " AND `menuid` = '{$menuid}'";
}else{
$where = '';
}
$sql = sprintf("SELECT * FROM `menus` WHERE `parent` = '%s' %s", $parent, $where);
$menu = Db::result($sql);
... | vuln | Vulnerable | PHP |
protected void handleIdentityProviderWithDynamicContent(final RequestContext requestContext,
final IndirectClient client,
final RedirectionAction action) throws Exception {
val seeOtherAction ... | vuln | Safe | Java |
/*
** codegen.c - mruby code generator
**
** See Copyright Notice in mruby.h
*/
#include <mruby.h>
#include <mruby/compile.h>
#include <mruby/proc.h>
#include <mruby/dump.h>
#include <mruby/numeric.h>
#include <mruby/string.h>
#include <mruby/debug.h>
#include <mruby/presym.h>
#include "node.h"
#include <mruby/opcode.... | vuln | Vulnerable | C/C++ |
duint32 dwgCompressor::longCompressionOffset(){
duint32 cont = 0;
duint8 ll = compressedByte();
while (ll == 0x00 && compressedGood) {
cont += 0xFF;
ll = compressedByte();
}
cont += ll;
return cont;
} | vuln | Safe | Unknown |
static int epaf_read_header(AVFormatContext *s)
{
int le, sample_rate, codec, channels;
AVStream *st;
avio_skip(s->pb, 4);
if (avio_rl32(s->pb))
return AVERROR_INVALIDDATA;
le = avio_rl32(s->pb);
if (le && le != 1)
return AVERROR_INVALIDDATA;
if (le) {
sample_rate = a... | vuln | Safe | C/C++ |
static void
gif_out_code(
gif_t /* in */ *g,
unsigned short /* in */ code
)
{
/* recurse to decode the prefixes, since the linked-list is backwards,
and working backwards through an interleaved image would be nasty */
if (g->codes[code].prefix >= 0) {
gif_out_code(g, (unsigned ... | vuln | Safe | C/C++ |
/*
* Copyright (C) 2016 Southern Storm Software, Pty Ltd.
*
* 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 |
static int get_registers(rtl8150_t * dev, u16 indx, u16 size, void *data)
{
void *buf;
int ret;
buf = kmalloc(size, GFP_NOIO);
if (!buf)
return -ENOMEM;
ret = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0),
RTL8150_REQ_GET_REGS, RTL8150_REQT_READ,
indx, 0, buf, size, 500);
if (ret ... | vuln | Safe | C/C++ |
static void mv88w8618_eth_write(void *opaque, hwaddr offset,
uint64_t value, unsigned size)
{
mv88w8618_eth_state *s = opaque;
switch (offset) {
case MP_ETH_SMIR:
s->smir = value;
break;
case MP_ETH_PCXR:
s->vlan_header = ((value >> MP_ETH_PCXR_2BS... | vuln | Vulnerable | C/C++ |
/*****************************************************************************/
/* LibreDWG - free implementation of the DWG file format */
/* */
/* Copyright (C) 2009,2018-2019 Free Software Foundation, Inc. */
... | vuln | Safe | C/C++ |
HttpStateData::continueAfterParsingHeader()
{
if (flags.handling1xx) {
debugs(11, 5, HERE << "wait for 1xx handling");
Must(!flags.headers_parsed);
return false;
}
if (!flags.headers_parsed && !eof) {
debugs(11, 9, "needs more at " << inBuf.length());
flags.do_next_r... | vuln | Vulnerable | Unknown |
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
{
AVFilterContext *ctx = inlink->dst;
VolumeContext *vol = inlink->dst->priv;
AVFilterLink *outlink = inlink->dst->outputs[0];
int nb_samples = buf->nb_samples;
AVFrame *out_buf;
int64_t pos;
AVFrameSideData *sd = av_frame... | vuln | Safe | C/C++ |
private void handlePeerHandshakeFailed(PeerEvent.PeerHandshakeFailed peerHandshakeFailed) {
synchronized (lock) {
final var maybeFuture = this.pendingChannels.remove(peerHandshakeFailed.getUri().getNodeId());
if (maybeFuture != null) {
maybeFuture.completeExceptionally(new IOException("Peer connection faile... | vuln | Vulnerable | Java |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite/handler/pkce (interfaces: PKCERequestStorage)
// Package internal is a generated GoMock package.
package internal
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
fosite "github.com/ory/fosite"
)
// M... | vuln | Safe | Go |
import os
import socket
from flask import current_app, make_response, request
from flask import send_file, render_template
from .redis_config import DecodedRedis
from .redis_conn import FlaskRedis
# from flaskapi.core.worker import celery
# import celery.states as states
from flask import Blueprint
route_blueprint ... | vuln | Vulnerable | Python |
fgetwln(FILE *stream, size_t *lenp)
{
struct filewbuf *fb;
wint_t wc;
size_t wused = 0;
/* Try to diminish the possibility of several fgetwln() calls being
* used on different streams, by using a pool of buffers per file. */
fb = &fb_pool[fb_pool_cur];
if (fb->fp != stream && fb->fp != NULL) {
fb_pool_cur++;... | vuln | Vulnerable | C/C++ |
@Override
public int drainWater(int max, boolean execute) {
if(this.isMultiBlockOrigin()) {
return super.drainWater(max, execute);
} else {
TileEntityIrrigationTank origin = this.getMultiBlockOrigin();
if(origin != null) {
// origin can be null if ... | vuln | Safe | Java |
nfs4_xdr_dec_getacl(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
struct nfs_getaclres *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
if (status)
goto out;
status = decode_sequence(xdr, &res->seq_res, rqstp);
if (status)
goto out;
status = decode_putfh(xdr);
i... | vuln | Safe | Unknown |
def update
id = params[:id]
return unless access_granted?(id)
@article = Article.find(id)
if params[:article][:draft]
fetch_fresh_or_existing_draft_for_article
else
@article = Article.find(@article.parent_id) unless @article.parent_id.nil?
end
update_article_attributes
if... | vuln | Safe | Ruby |
int net_init_tap(const Netdev *netdev, const char *name,
NetClientState *peer, Error **errp)
{
const NetdevTapOptions *tap;
int fd, vnet_hdr = 0, i = 0, queues;
const char *script = NULL;
const char *downscript = NULL;
Error *err = NULL;
const char *vhostfdname;
char i... | vuln | Vulnerable | C/C++ |
int
dlt_ieee80211_decode(tcpeditdlt_t *ctx, const u_char *packet, const int pktlen)
{
int l2len;
assert(ctx);
assert(packet);
l2len = dlt_ieee80211_l2len(ctx, packet, pktlen);
if (l2len == -1 || pktlen < l2len)
return TCPEDIT_ERROR;
dbgx(3, "Decoding 802.11 packet " COUNTER_SPEC, ctx... | vuln | Safe | C/C++ |
// +build !windows
/*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | vuln | Safe | Go |
static Image *ReadPANGOImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
cairo_font_options_t
*font_options;
cairo_surface_t
*surface;
char
*caption,
*property;
cairo_t
*cairo_image;
const char
*option;
DrawInfo
*draw_info;
Image
*image;
MagickBoolea... | vuln | Vulnerable | C/C++ |
xb_rcrypt_result_t
xb_crypt_read_chunk(xb_rcrypt_t *crypt, void **buf, size_t *olen, size_t *elen,
void **iv, size_t *ivlen, my_bool *hash_appended)
{
uchar tmpbuf[XB_CRYPT_CHUNK_MAGIC_SIZE + 8 + 8 + 8 + 4];
uchar *ptr;
ulonglong tmp;
ulong checksum, checksum_exp, version;
size_t bytesread;
xb_rcrypt_r... | vuln | Safe | C/C++ |
@Override
public void onCreate() {
super.onCreate();
appRecorder = ARApplication.getInjector().provideAppRecorder();
colorMap = ARApplication.getInjector().provideColorMap();
fileRepository = ARApplication.getInjector().provideFileRepository();
appRecorderCallback = new AppRecorderCallback() {
boolean ch... | vuln | Safe | Java |
/**
* Testing dockable windows.
*/
EditorUi.windowed = urlParams['windows'] != '0';
/**
* Code for the minimal UI theme.
*/
EditorUi.initMinimalTheme = function()
{
// Disabled in lightbox and chromeless mode
if (urlParams['lightbox'] == '1' || urlParams['chrome'] == '0' || typeof window.Format === 'undefined' |... | vuln | Vulnerable | JavaScript |
sdhci_write(void *opaque, hwaddr offset, uint64_t val, unsigned size)
{
SDHCIState *s = (SDHCIState *)opaque;
unsigned shift = 8 * (offset & 0x3);
uint32_t mask = ~(((1ULL << (size * 8)) - 1) << shift);
uint32_t value = val;
value <<= shift;
switch (offset & ~0x3) {
case SDHC_SYSAD:
... | vuln | Safe | C/C++ |
"use strict";
const protectedSessionService = require('../../services/protected_session');
const utils = require('../../services/utils');
const log = require('../../services/log');
const noteRevisionService = require('../../services/note_revisions');
const tmp = require('tmp');
const fs = require('fs');
const { Readab... | vuln | Vulnerable | JavaScript |
protected boolean readXrefStream(long ptr) throws IOException {
while (ptr != -1) {
tokens.seek(ptr);
if (!tokens.nextToken()) {
return false;
}
if (tokens.getTokenType() != PdfTokenizer.TokenType.Number) {
return false;
... | vuln | Vulnerable | Java |
module.exports = function (packageName, { registry = '', timeout = null } = {}) {
try {
if (/[`$&{}[;|]/g.test(packageName) || /[`$&{}[;|]/g.test(registry)) {
return null
}
let version;
const config = {
stdio: ['pipe', 'pipe', 'ignore']
};
if... | vuln | Safe | JavaScript |
public static ValueAnimator createSplitAuxiliarySurfacesAnimator(
RemoteAnimationTargetCompat[] nonApps, boolean shown,
Consumer<ValueAnimator> animatorHandler) {
if (nonApps == null || nonApps.length == 0) {
return null;
}
SurfaceControl.Transaction t = new ... | vuln | Vulnerable | Java |
void Sys_SetBinaryPath(const char *path)
{
Q_strncpyz(binaryPath, path, sizeof(binaryPath));
} | vuln | Vulnerable | C/C++ |
private void handleAuthenticationException(AuthenticationException authenticationException, HttpServletResponse response) throws IOException {
response.setStatus(HttpStatus.UNAUTHORIZED.value());
if (authenticationException instanceof BadCredentialsException || authenticationException instanceof Usernam... | vuln | Safe | Java |
parse_toshiba_packet(FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf,
int *err, gchar **err_info)
{
union wtap_pseudo_header *pseudo_header = &phdr->pseudo_header;
char line[TOSHIBA_LINE_LENGTH];
int num_items_scanned;
guint pkt_len;
int pktnum, hr, min, sec, csec;
char channel[10], direction[10];
int ... | vuln | Vulnerable | C/C++ |
GF_Err url_box_read(GF_Box *s, GF_BitStream *bs)
{
GF_DataEntryURLBox *ptr = (GF_DataEntryURLBox *)s;
if (ptr->size) {
ptr->location = (char*)gf_malloc((u32) ptr->size);
if (! ptr->location) return GF_OUT_OF_MEM;
gf_bs_read_data(bs, ptr->location, (u32)ptr->size);
}
return GF_OK;
} | vuln | Vulnerable | Unknown |
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.... | vuln | Vulnerable | Java |
struct scm_fp_list *scm_fp_dup(struct scm_fp_list *fpl)
{
struct scm_fp_list *new_fpl;
int i;
if (!fpl)
return NULL;
new_fpl = kmalloc(sizeof(*fpl), GFP_KERNEL);
if (new_fpl) {
INIT_LIST_HEAD(&new_fpl->list);
for (i=fpl->count-1; i>=0; i--)
get_file(fpl->fp[i]);
memcpy(new_fpl, fpl, sizeof(*fpl));
}
... | vuln | Safe | Unknown |
private NodeSet doSelectNodes(Criteria criteria, Client client) {
boolean hasScripts = criteria.getScripts() != null && criteria.getScripts().size() > 0;
boolean loggerIsDebugEnabled = logger.isDebugEnabled();
if (loggerIsDebugEnabled) {
logger.debug(client + " requested " + criteria... | vuln | Safe | Java |
/* 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 | C/C++ |
@Override
public float getEnchantPowerBonus() {
float tPoints = 0;
for (int i = 0; i < mDisplay.length; i++) if (slotHas(i)) {
if (BooksGT.BOOKS_ENCHANTED.contains(slot(i), T)) {tPoints += 2; continue;}
if (BooksGT.BOOKS_NORMAL .contains(slot(i), T)) {tPoints += 1; continue;}
}
return (mMaterial.contai... | vuln | Safe | Java |
public boolean verify(final Evidence evidence) {
if (evidence instanceof X509PeerCertificateChainEvidence) {
final X509PeerCertificateChainEvidence peerCertificateChainEvidence = (X509PeerCertificateChainEvidence) evidence;
try {
return getAlgorithm().equals(peerCertifica... | vuln | Vulnerable | Java |
soread(so)
struct socket *so;
{
int n, nn, lss, total;
struct sbuf *sb = &so->so_snd;
int len = sb->sb_datalen - sb->sb_cc;
struct iovec iov[2];
int mss = so->so_tcpcb->t_maxseg;
DEBUG_CALL("soread");
DEBUG_ARG("so = %lx", (long )so);
len = sb->sb_datalen - sb->sb_cc;
iov[0].iov_base = sb->sb_wptr;
... | vuln | Safe | C/C++ |
mlx5_rx_burst_mprq(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
{
struct mlx5_rxq_data *rxq = dpdk_rxq;
const uint32_t strd_n = RTE_BIT32(rxq->log_strd_num);
const uint32_t strd_sz = RTE_BIT32(rxq->log_strd_sz);
const uint32_t cq_mask = (1 << rxq->cqe_n) - 1;
const uint32_t wq_mask = (1 << rxq->elts_n)... | vuln | Safe | Unknown |
@Inject(method = "push(DDD)V", at = @At(value = "HEAD"), cancellable = true)
public void ignorePushingWhileInactive(double x, double y, double z, CallbackInfo ci) {
if (this.isInactive && !this.level.isClientSide) {
ci.cancel();
}
} | vuln | Safe | Java |
dhcp6opt_print(netdissect_options *ndo,
const u_char *cp, const u_char *ep)
{
const struct dhcp6opt *dh6o;
const u_char *tp;
size_t i;
uint16_t opttype;
size_t optlen;
uint8_t auth_proto;
u_int authinfolen, authrealmlen;
int remain_len; /* Length of remaining options */
int label_len; /* Labe... | vuln | Safe | C/C++ |
CharDriverState *qemu_chr_new_from_opts(QemuOpts *opts,
void (*init)(struct CharDriverState *s),
Error **errp)
{
CharDriver *cd;
CharDriverState *chr;
GSList *i;
if (qemu_opts_id(opts) == NULL) {
error_setg(errp, "chardev: n... | vuln | Safe | C/C++ |
#include "extensions/filters/common/expr/context.h"
#include "absl/strings/numbers.h"
#include "absl/time/time.h"
namespace Envoy {
namespace Extensions {
namespace Filters {
namespace Common {
namespace Expr {
namespace {
absl::optional<CelValue> convertHeaderEntry(const Http::HeaderEntry* header) {
if (header =... | vuln | Vulnerable | C/C++ |
static void aead_release(void *private)
{
struct aead_tfm *tfm = private;
crypto_free_aead(tfm->aead);
crypto_put_default_null_skcipher2();
kfree(tfm);
} | vuln | Safe | Unknown |
private void addFilesOrDirectory() {
// Can't use FileUtils.selectFilesForOpen() because it doesn't support
// selecting directories, or adding custom components to the dialog
JFileChooser fileChooser = new JFileChooser();
Configuration config = Configuration.getInstance();
if ((... | vuln | Vulnerable | Java |
@SuppressLint("SdCardPath")
private void startNewUpload(
User user,
List<String> requestedUploads,
boolean onWifiOnly,
boolean whileChargingOnly,
NameCollisionPolicy nameCollisionPolicy,
int localAction,
boolean isCreateRemoteFolder,
int createdBy,
... | vuln | Vulnerable | Java |
package com.salesmanager.shop.admin.model.reference;
import java.io.Serializable;
public class Size implements Serializable {
/**
*
*/
private static final long serialVersionUID = -4737272153685816396L;
private String code;
private String name;
public String getCode() {
return code;
}
public void se... | vuln | Vulnerable | Java |
void
ex_history(exarg_T *eap)
{
histentry_T *hist;
int histype1 = HIST_CMD;
int histype2 = HIST_CMD;
int hisidx1 = 1;
int hisidx2 = -1;
int idx;
int i, j, k;
char_u *end;
char_u *arg = eap->arg;
if (hislen == 0)
{
msg(_("'history' option is zero"));
return;
}
... | 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 | Safe | Java |
def destroy
Log.add_info(request, params.inspect)
return unless request.post?
if params[:check_user].nil?
list
render(:action => 'list')
return
end
count = 0
params[:check_user].each do |user_id, value|
if value == '1'
SqlHelper.validate_token([user_id])
... | vuln | Safe | Ruby |
package data_loader
import (
"crypto/tls"
"encoding/json"
"github.com/TykTechnologies/tyk-identity-broker/tap"
"github.com/sirupsen/logrus"
"gopkg.in/mgo.v2"
"net"
"time"
)
var mongoPrefix = "mongo"
var ProfilesCollectionName = "profilesCollection"
// MongoLoaderConf is the configuration struct for a MongoLoa... | vuln | Vulnerable | Go |
static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define RMT_EQUAL_RGB 1
#define RMT_NONE 0
#define RMT_RAW 2
#define RT_STANDARD 1
#define RT_ENCODED 2
#define RT_FORMAT_RGB 3
typedef struct _SUNInfo
{
unsigned int
magic,
width,
height,
depth,
... | vuln | Vulnerable | C/C++ |
// mkerrors.sh -marm
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build arm,netbsd
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -marm _const.go
package unix
import "syscall"
const (
AF_APPLETALK = 0x10
AF_ARP = 0x1... | vuln | Vulnerable | Go |
def fromstring(*args, **kwargs):
"""
Helper func to provide easy access to the (possibly) moving target that is
C{ET}.
"""
global ET
_bootstrap()
kwargs.setdefault('forbid_dtd', True)
kwargs.setdefault('forbid_entities', True)
return ET.fromstring(*args, **kwargs) | vuln | Safe | Python |
DECLAREcpFunc(cpDecodedStrips)
{
tsize_t stripsize = TIFFStripSize(in);
tdata_t buf = _TIFFmalloc(stripsize);
(void) imagewidth; (void) spp;
if (buf) {
tstrip_t s, ns = TIFFNumberOfStrips(in);
uint32 row = 0;
_TIFFmemset(buf, 0, stripsize);
for (s = 0; s < ns; s++) {
tsize_t cc = (row + rowsperstrip > ... | vuln | Vulnerable | C/C++ |
private boolean setDataSourceImpl(MediaPlayer player, String path) {
MusicPlaybackService musicService = mService.get();
if (musicService != null) {
try {
player.reset();
player.setOnPreparedListener(null);
if (path.star... | vuln | Vulnerable | Java |
@Override
public void authenticate(Set<Object> publicCredentials, Set<Object> privateCredentials,
Set<Principal> identifiedPrincipals, Set<Restriction> restrictions)
throws AuthenticationException {
List<String> tokens = privateCredentials.stream()
.filter(BearerTokenCreden... | vuln | Vulnerable | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.