code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
@Override
public void onViewCreated(@NonNull final View view, Bundle savedInstance) {
final FragmentActivity activity = getActivity();
if (activity == null) {
return;
}
mFailureListener = new PromisedReply.FailureListener<ServerMessage>() {
@Override
... | vuln | Vulnerable | Java |
static int xen_pt_config_reg_init(XenPCIPassthroughState *s,
XenPTRegGroup *reg_grp, XenPTRegInfo *reg)
{
XenPTReg *reg_entry;
uint32_t data = 0;
int rc = 0;
reg_entry = g_new0(XenPTReg, 1);
reg_entry->reg = reg;
if (reg->init) {
rc = reg->init(... | vuln | Safe | C/C++ |
tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_t tile){
uint16 edge=0;
tsize_t written=0;
unsigned char* buffer=NULL;
tsize_t bufferoffset=0;
unsigned char* samplebuffer=NULL;
tsize_t samplebufferoffset=0;
tsize_t read=0;
uint16 i=0;
ttile_t tilecount=0;
/* tsize_t tilesize=0... | vuln | Vulnerable | Unknown |
eval_lambda(
char_u **arg,
typval_T *rettv,
evalarg_T *evalarg,
int verbose) // give error messages
{
int evaluate = evalarg != NULL
&& (evalarg->eval_flags & EVAL_EVALUATE);
typval_T base = *rettv;
int ret;
rettv->v_type = VAR_UNKNOWN;
if (**arg == '{')
{
// ->{l... | vuln | Vulnerable | C/C++ |
static int sctp_setsockopt_auto_asconf(struct sock *sk, char __user *optval,
unsigned int optlen)
{
int val;
struct sctp_sock *sp = sctp_sk(sk);
if (optlen < sizeof(int))
return -EINVAL;
if (get_user(val, (int __user *)optval))
return -EFAULT;
if (!sctp_is_ep_boundall(sk) && val)
return -EINVAL;
if (... | vuln | Safe | C/C++ |
png_error_callback(png_structp png_read_ptr,
png_const_charp error_msg)
{
LoadContext* lc;
lc = png_get_error_ptr(png_read_ptr);
lc->fatal_error_occurred = TRUE;
/* I don't trust libpng to call the error callback only once,
* so check for al... | vuln | Vulnerable | Unknown |
def on_save(self):
connection = get_connection()
cursor = connection.cursor()
cursor.execute(
"insert into visitors (ip_address, user_agent, referrer, full_path, visit_time) values (%s, %s, %s, %s, %s);",
(str(self.ip_address), str(self.user_agent), str(self.referrer), st... | vuln | Safe | Python |
@Override
public void complete(ScanRequest request, ScanResults results) throws MachinaException {
try {
if (!ScanUtils.empty(results.getOutput())) {
Files.write(Paths.get(new File(request.getFilename()).getCanonicalPath()), results.getOutput().getBytes());
}
... | vuln | Safe | Java |
@AttackVector(
vulnerabilityExposed = {VulnerabilityType.OPEN_REDIRECT_3XX_STATUS_CODE},
description =
"OPEN_REDIRECT_QUERY_PARAM_DIRECTLY_ADD_TO_LOCATION_HEADER_IF_NOT_HTTP_WWW_HTTPS_//_NULL_BYTE_OR_DOMAIN_IS_SAME")
@VulnerableAppRequestMapping(
value = Level... | vuln | Safe | Java |
protected TempFileInputStream processResponse(WebSession sess, HttpServletRequest req, HttpServletResponse resp) throws IOException, Exception
{
int bodylen = req.getContentLength();
switch (req.getRequestURI())
{
case "/datasources/profilesTree":
return new ProfilesTreeXMLResponse(new XMLRequest(sess, ne... | vuln | Vulnerable | Java |
static char *spapr_phb_vfio_get_loc_code(sPAPRPHBState *sphb, PCIDevice *pdev)
{
char *path = NULL, *buf = NULL, *host = NULL;
host = object_property_get_str(OBJECT(pdev), "host", NULL);
if (!host) {
goto err_out;
}
path = g_strdup_printf("/sys/bus/pci/devices/%s/devspec", host);
... | vuln | Safe | C/C++ |
private void updateInputDevice(int deviceId) {
synchronized (mLock) {
if (!mShouldVibrateInputDevices) {
// No need to keep this device vibrator if setting is off.
return;
}
InputDevice device = mInputManager.getInputDevice(deviceId);
... | vuln | Vulnerable | Java |
void InputDispatcher::enqueueDispatchEntryLocked(
const sp<Connection>& connection, EventEntry* eventEntry, const InputTarget* inputTarget,
int32_t dispatchMode) {
int32_t inputTargetFlags = inputTarget->flags;
if (!(inputTargetFlags & dispatchMode)) {
return;
}
inputTargetFlags = (inputTargetFlags & ~InputTa... | vuln | Safe | C/C++ |
@Path("/{group-id}")
@DELETE
void deleteGroup(@PathParam("group-id") String groupId); | vuln | Vulnerable | Java |
const cheerio = require('cheerio');
const got = require('@/utils/got');
module.exports = async (ctx) => {
const url = `http://${ctx.params.column}.bio1000.com/${ctx.params.id}`;
const res = await got.get(url);
const $ = cheerio.load(res.data);
const list = $('.excerpt-1').get();
const out = await ... | vuln | Vulnerable | JavaScript |
static void __skb_complete_tx_timestamp(struct sk_buff *skb,
struct sock *sk,
int tstype,
bool opt_stats)
{
struct sock_exterr_skb *serr;
int err;
BUILD_BUG_ON(sizeof(struct sock_exterr_skb) > sizeof(skb->cb));
serr = SKB_EXT_ERR(skb);
memset(serr, 0, sizeof(*serr));
serr->ee.ee_errno = ENOMSG;
... | vuln | Safe | Unknown |
"use strict";
var osmStream = require('osm-stream'),
reqwest = require('reqwest'),
moment = require('moment'),
_ = require('underscore'),
LRU = require('lru-cache'),
query_string = require('querystring');
var bboxArray = ["-90.0", "-180.0", "90.0", "180.0"];
var mapCenter = [51.505, -0.09];
var fi... | vuln | Vulnerable | JavaScript |
package svg
import (
"bytes"
"fmt"
"io"
"strings"
nanoid "github.com/matoous/go-nanoid/v2"
"github.com/tdewolff/parse/v2"
"github.com/tdewolff/parse/v2/xml"
"github.com/imgproxy/imgproxy/v3/imagedata"
)
var feDropShadowName = []byte("feDropShadow")
const feDropShadowTemplate = `
<feMerge result="dsin-%[1]... | vuln | Safe | Go |
local block_state deflate_huff(s, flush)
deflate_state *s;
int flush;
{
int bflush; /* set if current block must be flushed */
for (;;) {
/* Make sure that we have a literal to write. */
if (s->lookahead == 0) {
fill_window(s);
if (s->lookahead == 0) ... | vuln | Vulnerable | Unknown |
# Copyright (C) 2016 Kristoffer Gronlund <kgronlund@suse.com>
# See COPYING for license information.
#
# Bootstrap:
#
# Supersedes and replaces both the init/add/remove cluster scripts,
# and the ha-cluster-bootstrap scripts.
#
# Implemented as a straight-forward set of python functions for
# simplicity and flexibility... | vuln | Safe | Python |
Status SparseTensorToCSRSparseMatrixCPUFunctor::operator()(
const int64 batch_size, const int num_rows,
TTypes<int64>::ConstMatrix indices, TTypes<int32>::Vec batch_ptr,
TTypes<int32>::Vec csr_row_ptr, TTypes<int32>::Vec csr_col_ind) {
// Validate inputs.
if (batch_ptr.size() != batch_size + 1) {
re... | vuln | Safe | C/C++ |
function prepare(_html, _isHtml)
{
// Free and null the old tooltip_div
hide();
//Generate the tooltip div, set it's text and append it to the body tag
tooltip_div = jQuery(_wnd.document.createElement('div'));
tooltip_div.hide();
if (_isHtml)
{
tooltip_div.append(_html);
}
else
{
tooltip_div... | vuln | Safe | JavaScript |
static int decode_main_header(NUTContext *nut)
{
AVFormatContext *s = nut->avf;
AVIOContext *bc = s->pb;
uint64_t tmp, end, length;
unsigned int stream_count;
int i, j, count, ret;
int tmp_stream, tmp_mul, tmp_pts, tmp_size, tmp_res, tmp_head_idx;
length = get_packetheader(nut, bc, 1, MA... | vuln | Safe | C/C++ |
package certs
import (
"bytes"
"crypto"
"crypto/ecdsa"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/hex"
"encoding/pem"
"errors"
"io/ioutil"
"net/http"
"strings"
"time"
cache "github.com/pmylund/go-cache"
"github.com/sirupsen/logrus"
)
// Storag... | vuln | Vulnerable | Go |
void ext4_es_remove_extent(struct inode *inode, ext4_lblk_t lblk,
ext4_lblk_t len)
{
ext4_lblk_t end;
int err = 0;
int reserved = 0;
struct extent_status *es = NULL;
if (EXT4_SB(inode->i_sb)->s_mount_state & EXT4_FC_REPLAY)
return;
trace_ext4_es_remove_extent(inode, lblk, len);
es_debug("remove [%u/%u)... | vuln | Safe | C/C++ |
/**
httpserver
ResourceHost.cpp
Copyright 2011-2019 Ramsey Kant
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable... | vuln | Vulnerable | C/C++ |
/*
Developed by ESN, an Electronic Arts Inc. studio.
Copyright (c) 2014, Electronic Arts Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyri... | vuln | Safe | Python |
const got = require('@/utils/got');
const cheerio = require('cheerio');
const iconv = require('iconv-lite');
module.exports = async (ctx) => {
const response = await got({
url: 'https://data.163.com',
method: 'get',
responseType: 'buffer',
});
const $ = cheerio.load(iconv.decode(res... | vuln | Vulnerable | JavaScript |
public static MySQLSinkDTO getFromRequest(MySQLSinkRequest request) {
String url = filterSensitive(request.getJdbcUrl());
return MySQLSinkDTO.builder()
.jdbcUrl(url)
.username(request.getUsername())
.password(request.getPassword())
.primary... | vuln | Safe | Java |
/* mongo.c */
/* Copyright 2009-2012 10gen Inc.
*
* 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 b... | vuln | Vulnerable | C/C++ |
static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
Image *image,ExceptionInfo *exception)
{
#if !defined(TIFFDefaultStripSize)
#define TIFFDefaultStripSize(tiff,request) (8192UL/TIFFScanlineSize(tiff))
#endif
const char
*mode,
*option;
CompressionType
compression;
EndianType
... | vuln | Safe | Unknown |
static int audit_netlink_ok(struct sk_buff *skb, u16 msg_type)
{
int err = 0;
/* Only support initial user namespace for now. */
/*
* We return ECONNREFUSED because it tricks userspace into thinking
* that audit was not configured into the kernel. Lots of users
* configure their PAM stack (because that's wha... | vuln | Safe | Unknown |
static int coroutine_fn add_aio_request(BDRVSheepdogState *s, AIOReq *aio_req,
struct iovec *iov, int niov, int create,
enum AIOCBState aiocb_type)
{
int nr_copies = s->inode.nr_copies;
SheepdogObjReq hdr;
unsigned int wlen;
int ret;
uint64_t oid... | vuln | Safe | C/C++ |
t42_parse_charstrings( T42_Face face,
T42_Loader loader )
{
T42_Parser parser = &loader->parser;
PS_Table code_table = &loader->charstrings;
PS_Table name_table = &loader->glyph_names;
PS_Table swap_table = &loader->swap_table;
FT_Memo... | vuln | Vulnerable | C/C++ |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | vuln | Vulnerable | Python |
fill_info_if_stats(void *data, interface_info_t *interface_info)
{
struct info_if_stats **ifsp = (struct info_if_stats **)data;
struct info_if_stats *ifs = *ifsp;
endpt *ep = interface_info->ep;
if (NULL == ifs)
return;
ZERO(*ifs);
if (IS_IPV6(&ep->sin)) {
if (!client_v6_capable)
return;
ifs->v6_fla... | vuln | Safe | Unknown |
void bm_poly(Bitmap *b, BmPoint points[], unsigned int n) {
unsigned int i;
assert(b);
if(n < 2) return;
for(i = 0; i < n - 1; i++) {
bm_line(b, points[i].x, points[i].y, points[i+1].x, points[i+1].y);
}
bm_line(b, points[0].x, points[0].y, points[i].x, points[i].y);
} | vuln | Safe | C/C++ |
xsltResolveSASCallback(xsltAttrElemPtr values, xsltStylesheetPtr style,
const xmlChar *name, const xmlChar *ns,
ATTRIBUTE_UNUSED const xmlChar *ignored) {
xsltAttrElemPtr tmp;
xsltAttrElemPtr refs;
tmp = values;
while (tmp != NULL) {
if (tmp->set != NULL) {
/*
... | vuln | Vulnerable | C/C++ |
def initHeader(self):
"""Initialize the IP header according to the IP format definition.
"""
# Ethernet header
# Retrieve remote MAC address
dstMacAddr = arpreq.arpreq(self.remoteIP)
if dstMacAddr is not None:
dstMacAddr = dstMacAddr.replace(':', '')
... | vuln | Vulnerable | Python |
int alloc_picture(MpegEncContext *s, Picture *pic, int shared){
const int big_mb_num= s->mb_stride*(s->mb_height+1) + 1;
const int mb_array_size= s->mb_stride*s->mb_height;
const int b8_array_size= s->b8_stride*s->mb_height*2;
const int b4_array_size= s->b4_stride*s->mb_height*4;
int i;
int r= ... | vuln | Safe | C/C++ |
@Override
public void run() {
if (!eliteEntity.isValid()){
cancel();
return;
}
counter++;
if (!NonSolidBlockTypes.isPassthrough(eliteEntity.getLivingEntity().getLocation().clone().subtract(new Vector(0, 0... | vuln | Safe | Java |
public static GearItemStack decodeItem(String encoded) {
Matcher m = ENCODED_PATTERN.matcher(encoded);
if (!m.matches()) return null;
String name = ENCODE_NAME ? decodeString(m.group("Name")) : m.group("Name");
int[] ids = decodeNumbers(m.group("Ids"));
int[] powders = m.group("... | vuln | Vulnerable | Java |
static int read_shape_from_file(int *cols, int *rows, int **values, const char *filename,
void *log_ctx)
{
uint8_t *buf, *p, *pend;
size_t size;
int ret, i, j, w;
if ((ret = av_file_map(filename, &buf, &size, 0, log_ctx)) < 0)
return ret;
w = 0;
for (... | vuln | Vulnerable | C/C++ |
write_node(FILE *out, /* I - Output file */
tree_t *t, /* I - Document tree node */
int col) /* I - Current column */
{
int i; /* Looping var */
uchar *ptr, /* Pointer to output string */
*entity, /* Entity string */
*src, /* Source image */
*realsrc, /* Real source image */... | vuln | Safe | C/C++ |
// SPDX-License-Identifier: GPL-2.0
/*
* Core of Xen paravirt_ops implementation.
*
* This file contains the xen_paravirt_ops structure itself, and the
* implementations for:
* - privileged instructions
* - interrupt flags
* - segment operations
* - booting and setup
*
* Jeremy Fitzhardinge <jeremy@xensource.... | vuln | Safe | Go |
private static int moderateGraves(ServerPlayerEntity player) {
if (!player.hasPermissionLevel(4) || !YigdConfig.getConfig().commandToggles.moderateGraves) {
player.sendMessage(new TranslatableText("text.yigd.message.missing_permission").styled(style -> style.withColor(0xFF0000)), false);
... | vuln | Vulnerable | Java |
// Package saml contains a partial implementation of the SAML standard in golang.
// SAML is a standard for identity federation, i.e. either allowing a third party to authenticate your users or allowing third parties to rely on us to authenticate their users.
//
// Introduction
//
// In SAML parlance an Identity Provid... | vuln | Safe | Go |
public boolean checkAttack(final Mob mob, final boolean missile) {
if (mob.isPlayer()) {
Player victim = (Player) mob;
if (getParty() != null && ((Player) mob).getParty() != null && getParty() == ((Player) mob).getParty()) {
message("You can't attack your party members");
return false;
}
if ((inCo... | vuln | Vulnerable | Java |
static int fx_command(effect_handle_t self,
uint32_t cmdCode,
uint32_t cmdSize,
void *pCmdData,
uint32_t *replySize,
void *pReplyData)
{
struct effect_s *effect = (struct effect_s *)self;
if (effect == NULL)
return -EINVAL;
switch (cmdCode) {
case EFFECT_CMD_INIT:
if (pReplyData == ... | vuln | Vulnerable | C/C++ |
add_bwrap (GPtrArray *array,
ScriptExec *script)
{
const char * const usrmerged_dirs[] = { "bin", "lib64", "lib", "sbin" };
int i;
g_return_val_if_fail (script->outdir != NULL, FALSE);
g_return_val_if_fail (script->s_infile != NULL, FALSE);
add_args (array,
"bwrap",
"--ro-bind", "/usr", "/u... | vuln | Safe | Unknown |
static int kvm_s390_get_cmma(struct kvm *kvm, struct kvm_s390_cmma_log *args,
u8 *res, unsigned long bufsize)
{
unsigned long mem_end, cur_gfn, next_gfn, hva, pgstev;
struct kvm_memslots *slots = kvm_memslots(kvm);
struct kvm_memory_slot *ms;
cur_gfn = kvm_s390_next_dirty_cmma(slots, args->start_gfn);
ms ... | vuln | Vulnerable | C/C++ |
int ptrace_get_fpr(struct task_struct *child, int index, unsigned long *data)
{
#ifdef CONFIG_PPC_FPU_REGS
unsigned int fpidx = index - PT_FPR0;
#endif
if (index > PT_FPSCR)
return -EIO;
#ifdef CONFIG_PPC_FPU_REGS
flush_fp_to_thread(child);
if (fpidx < (PT_FPSCR - PT_FPR0))
memcpy(data, &child->thread.TS_FPR(... | vuln | Vulnerable | Unknown |
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
import { saveAs } from 'file-saver'
import { FlowRouter } from 'meteor/ostrio:flow-router-extra'
import { NullXlsx } from '@neovici/nullxlsx'
import bootstrap from 'bootstrap'
import { i18nReady, t } from '../../utils/i18n.js'
import Timecards from '../../api... | vuln | Safe | JavaScript |
DLLEXPORT unsigned char *tjLoadImage(const char *filename, int *width,
int align, int *height, int *pixelFormat,
int flags)
{
int retval = 0, tempc;
size_t pitch;
tjhandle handle = NULL;
tjinstance *this;
j_compress_ptr cinfo = NULL;
... | vuln | Safe | C/C++ |
static int _open_and_activate_luks2(struct crypt_device *cd,
int keyslot,
const char *name,
const char *passphrase,
size_t passphrase_size,
uint32_t flags)
{
crypt_reencrypt_info ri;
int r, rv;
struct luks2_hdr *hdr = &cd->u.luks2.hdr;
struct volume_key *vks = NULL;
ri = LUKS2_reencrypt_status(hdr);
if (ri ... | vuln | Safe | Unknown |
static int get_high_utility_cell(elbg_data *elbg)
{
int i=0;
int r = av_lfg_get(elbg->rand_state)%elbg->utility_inc[elbg->numCB-1] + 1;
while (elbg->utility_inc[i] < r)
i++;
av_assert2(elbg->cells[i]);
return i;
} | vuln | Vulnerable | C/C++ |
public void setupExpandedStatusBar() {
mStackScrollLayout = mView.findViewById(R.id.notification_stack_scroller);
TunerService.Tunable tunable = (key, newValue) -> {
AmbientDisplayConfiguration configuration =
new AmbientDisplayConfiguration(mView.getContext());
... | vuln | Safe | Java |
function createObjectIterator(obj) {
var okeys = obj ? Object.keys(obj) : [];
var i = -1;
var len = okeys.length;
return function next() {
var key = okeys[++i];
return i < len ? {value: obj[key], key} : null;
};
} | vuln | Vulnerable | JavaScript |
GC_INNER GC_bool GC_expand_hp_inner(word n)
{
word bytes;
struct hblk * space;
word expansion_slop; /* Number of bytes by which we expect the */
/* heap to expand soon. */
if (n < MINHINCR) n = MINHINCR;
bytes = n * HBLKSIZE;
/* Make sure... | vuln | Vulnerable | C/C++ |
LOCAL char *value_for_key_as_string(MMDB_entry_s *start, char *key)
{
MMDB_entry_data_s entry_data;
const char *path[] = { key, NULL };
MMDB_aget_value(start, &entry_data, path);
return mmdb_strndup((char *)entry_data.utf8_string, entry_data.data_size);
} | vuln | Vulnerable | Unknown |
dump_sig_subpkt (int hashed, int type, int critical,
const byte * buffer, size_t buflen, size_t length)
{
const char *p = NULL;
int i;
/* The CERT has warning out with explains how to use GNUPG to detect
* the ARRs - we print our old message here when it is a faked ARR
* and add an additional notice. *... | vuln | Vulnerable | Unknown |
int ff_rtsp_send_cmd_with_content(AVFormatContext *s,
const char *method, const char *url,
const char *header,
RTSPMessageHeader *reply,
unsigned char **content_ptr,
... | vuln | Vulnerable | C/C++ |
def get_ports(self):
# First get the active FC ports
out = self._cli_run('showport', None)
# strip out header
# N:S:P,Mode,State,----Node_WWN----,-Port_WWN/HW_Addr-,Type,
# Protocol,Label,Partner,FailoverState
out = out[1:len(out) - 2]
ports = {'FC': [], 'iSCSI'... | vuln | Vulnerable | Python |
static void msix_mmio_write(void *opaque, target_phys_addr_t addr,
uint64_t val, unsigned size)
{
PCIDevice *dev = opaque;
unsigned int offset = addr & (MSIX_PAGE_SIZE - 1) & ~0x3;
int vector = offset / PCI_MSIX_ENTRY_SIZE;
if (vector >= dev->msix_entries_nr) {
r... | vuln | Safe | C/C++ |
private static final Element marshalSpot( final Spot spot, final FeatureModel fm )
{
final Collection< Attribute > attributes = new ArrayList<>();
final Attribute IDattribute = new Attribute( SPOT_ID_ATTRIBUTE_NAME, "" + spot.ID() );
attributes.add( IDattribute );
final Attribute nameAttribute = new Attribute(... | vuln | Safe | Java |
static int caca_write_trailer(AVFormatContext *s)
{
CACAContext *c = s->priv_data;
av_freep(&c->window_title);
caca_free_dither(c->dither);
caca_free_display(c->display);
caca_free_canvas(c->canvas);
return 0;
} | vuln | Vulnerable | C/C++ |
resetPassword(req) {
const config = req.config;
if (!config) {
this.invalidRequest();
}
if (!config.publicServerURL) {
return this.missingPublicServerURL();
}
const { username, new_password, token: rawToken } = req.body;
const token =
rawToken && typeof rawToken !== 'str... | vuln | Safe | JavaScript |
SYSCALL_DEFINE2(osf_getdomainname, char __user *, name, int, namelen)
{
unsigned len;
int i;
if (!access_ok(VERIFY_WRITE, name, namelen))
return -EFAULT;
len = namelen;
if (len > 32)
len = 32;
down_read(&uts_sem);
for (i = 0; i < len; ++i) {
__put_user(utsname()->domainname[i], name + i);
if (utsname(... | vuln | Safe | C/C++ |
ext4_xattr_release_block(handle_t *handle, struct inode *inode,
struct buffer_head *bh)
{
struct mb_cache_entry *ce = NULL;
int error = 0;
struct mb_cache *ext4_mb_cache = EXT4_GET_MB_CACHE(inode);
ce = mb_cache_entry_get(ext4_mb_cache, bh->b_bdev, bh->b_blocknr);
BUFFER_TRACE(bh, "get_write_access");
error ... | vuln | Vulnerable | C/C++ |
Sidebar.prototype.initPalettes = function()
{
var imgDir = GRAPH_IMAGE_PATH;
var dir = STENCIL_PATH;
var signs = this.signs;
var rack = this.rack;
var pids = this.pids;
var cisco = this.cisco;
var sysml = this.sysml;
if (urlParams['createindex'] == '1')
{
this.createdSearchIndex = [];
}
th... | vuln | Vulnerable | JavaScript |
foreach ( $matchA as $occurence => $matchB ) {
if ( $occurence < $call ) {
continue;
}
$match = $matchB[0];
$start = $matchB[1];
if ( $match[strlen( $match ) - 1] == '}' ) {
// template was called without parameters, add new parameter and value
// append parameter and value
$be... | vuln | Safe | PHP |
@Override
public void onResume() {
super.onResume();
if(mCreateError)
return;
updateStatus();
} | vuln | Safe | Java |
int stun_parse_message(stun_msg_t *msg)
{
unsigned len;
int i;
unsigned char *p;
/* parse header first */
p = msg->enc_buf.data;
msg->stun_hdr.msg_type = get16(p, 0);
msg->stun_hdr.msg_len = get16(p, 2);
memcpy(msg->stun_hdr.tran_id, p + 4, STUN_TID_BYTES);
SU_DEBUG_5(("%s: Parse STUN message: Lengt... | vuln | Vulnerable | C/C++ |
@Override
public void filter(ContainerRequestContext containerRequestContext) throws IOException {
if ("OPTIONS".equals(containerRequestContext.getMethod())
|| "swagger.json".equals(containerRequestContext.getUriInfo().getPath())) {
return;
}
String authorizationHeader = containerRequestCon... | vuln | Vulnerable | Java |
static int usb_linux_update_endp_table(USBHostDevice *s)
{
uint8_t *descriptors;
uint8_t devep, type, configuration, alt_interface;
struct usb_ctrltransfer ct;
int interface, ret, length, i;
ct.bRequestType = USB_DIR_IN;
ct.bRequest = USB_REQ_GET_CONFIGURATION;
ct.wValue = 0;
ct.wIndex =... | vuln | Safe | C/C++ |
VOID ixheaacd_esbr_postradixcompute2(WORD32 *ptr_y, WORD32 *ptr_x,
const WORD32 *pdig_rev_tbl,
WORD32 npoints) {
WORD32 i, k;
WORD32 h2;
WORD32 x_0, x_1, x_2, x_3;
WORD32 x_4, x_5, x_6, x_7;
WORD32 x_8, x_9, x_a, x_b, x_c, x_d, x_e, x_f;
WORD32 n0, j0;
WORD32 *x... | vuln | Safe | C/C++ |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from django.http.response import HttpResponseRedirect
from django.... | vuln | Safe | Python |
public ResponseEntity<Void> addPetWithHttpInfo(Pet body) throws RestClientException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' ... | vuln | Safe | Java |
public static @Nullable StatusEffectInstance getRawEffectFromTag(NbtCompound tag, String tagKey) {
if (tag.contains(tagKey, NbtElement.INT_TYPE)) {
var effect = StatusEffect.byRawId(tag.getInt(tagKey));
if (effect != null)
return new StatusEffectInstance(effect, 200, 0);
}
return null;
} | vuln | Vulnerable | Java |
zstatus(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
switch (r_type(op)) {
case t_file:
{
stream *s;
make_bool(op, (file_is_valid(s, op) ? 1 : 0));
}
return 0;
case t_string:
{
gs_parsed_file_name_t pname;
... | vuln | Vulnerable | Unknown |
function escapeArgBash(arg, interpolation, quoted) {
let result = arg.replace(/\u0000/g, "");
if (interpolation) {
result = result
.replace(/\\/g, "\\\\")
.replace(/\n/g, " ")
.replace(/(^|\s)(~|#)/g, "$1\\$2")
.replace(/(\*|\?)/g, "\\$1")
.replace(/(\$|\;|\&|\|)/g, "\\$1")
... | vuln | Vulnerable | JavaScript |
// Copyright (c) 2012-2016 The Revel Framework Authors, All rights reserved.
// Revel Framework source code and usage is governed by a MIT style
// license that can be found in the LICENSE file.
package revel
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"mime/multipart"
"os"
"reflect"
"strconv"
"strings"
... | vuln | Safe | Go |
static int scaling_list_data(GetBitContext *gb, AVCodecContext *avctx, ScalingList *sl, HEVCSPS *sps)
{
uint8_t scaling_list_pred_mode_flag;
int32_t scaling_list_dc_coef[2][6];
int size_id, matrix_id, pos;
int i;
for (size_id = 0; size_id < 4; size_id++)
for (matrix_id = 0; matrix_id < 6; ma... | vuln | Vulnerable | C/C++ |
void Document::open()
{
ASSERT(!importLoader());
if (m_frame) {
if (ScriptableDocumentParser* parser = scriptableDocumentParser()) {
if (parser->isParsing()) {
if (parser->isExecutingScript())
return;
if (!parser->wasCreatedByScript() && ... | vuln | Safe | C/C++ |
async function runApp() {
let app = express();
app.set('port', process.env.PORT ?? 8080);
let sessionStore = new session.MemoryStore();
let secret = Math.random().toString();
app.use(session({store: sessionStore, resave: true, saveUninitialized: true, secret: secret, cookie: { maxAge: 10000 }, key: 'sid'}));
l... | vuln | Safe | JavaScript |
@Override
public void update() {
prevItemRotate = itemRotate;
prevItemBob = itemBob;
if (getWorld().isRemote) {
if (countUp && itemBob <= 20) {
itemBob++;
if (itemBob == 20)
countUp = false;
}
if (!countUp && itemBob >= -20) {
itemBob--;
if (itemBob == -20)
countUp... | vuln | Safe | Java |
void PngImage::readMetadata()
{
#ifdef DEBUG
std::cerr << "Exiv2::PngImage::readMetadata: Reading PNG file " << io_->path() << std::endl;
#endif
if (io_->open() != 0) {
throw Error(kerDataSourceOpenFailed, io_->path(), strError());
}
IoCloser closer(*io_);
if (!is... | vuln | Vulnerable | C/C++ |
void RENAME(interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dest,
unsigned width, unsigned height, int src1Stride,
int src2Stride, int dstStride){
unsigned h;
for(h=0; h < height; h++)
{
unsigned w;
#ifdef HAVE_MMX
#ifdef HAVE_SSE2
asm(
"xor %%"REG_a", %%"REG_a" \n\t"
"1: \n\t"
... | vuln | Vulnerable | C/C++ |
void ide_flush_cache(IDEState *s)
{
if (s->bs == NULL) {
ide_flush_cb(s, 0);
return;
}
s->status |= BUSY_STAT;
bdrv_acct_start(s->bs, &s->acct, 0, BDRV_ACCT_FLUSH);
bdrv_aio_flush(s->bs, ide_flush_cb, s);
} | vuln | Safe | C/C++ |
public TMap readMapBegin() throws TException {
int size = readVarint32();
byte keyAndValueType = size == 0 ? 0 : readByte();
byte keyType = getTType((byte) (keyAndValueType >> 4));
byte valueType = getTType((byte) (keyAndValueType & 0xf));
if (size > 0) {
ensureMapHasEnough(size, keyType, valu... | vuln | Safe | Java |
def file(path):
path = secure_filename(path)
if app.interface.encrypt and isinstance(app.interface.examples, str) and path.startswith(app.interface.examples):
with open(os.path.join(app.cwd, path), "rb") as encrypted_file:
encrypted_data = encrypted_file.read()
file_data = encryptor.... | vuln | Vulnerable | Python |
struct tcp_sock_t *tcp_open(uint16_t port)
{
struct tcp_sock_t *this = calloc(1, sizeof *this);
if (this == NULL) {
ERR("IPv4: callocing this failed");
goto error;
}
// Open [S]ocket [D]escriptor
this->sd = -1;
this->sd = socket(AF_INET, SOCK_STREAM, 0);
if (this->sd < 0) {
ERR("IPv4 socket open failed");... | vuln | Safe | C/C++ |
package jadx.core.export;
import java.io.File;
import java.io.IOException;
import java.io.StringReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerF... | vuln | Vulnerable | Java |
public void show(View parent, View v) {
showPre();
//根据条目选择spanCount
if(menuItems.size() <= 0) {
Log.e("EasePopupWindowHelper", "Span count should be at least 1. Provided " + menuItems.size());
return;
}
if(menuItems.size() < SPAN_COUNT) {
rvMe... | vuln | Safe | Java |
TabsCustomBindings::TabsCustomBindings(ScriptContext* context)
: ObjectBackedNativeHandler(context) {
RouteFunction("OpenChannelToTab",
base::Bind(&TabsCustomBindings::OpenChannelToTab,
base::Unretained(this)));
} | vuln | Vulnerable | C/C++ |
public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int streamDependency,
short weight, boolean exclusive, int padding, boolean endOfStream) throws Http2Exception {
Http2Stream stream = connection.stream(streamId);
boolean allowHalfClosedRemot... | vuln | Vulnerable | Java |
static bool net_tx_pkt_do_sw_fragmentation(struct NetTxPkt *pkt,
NetClientState *nc)
{
struct iovec fragment[NET_MAX_FRAG_SG_LIST];
size_t fragment_len = 0;
bool more_frags = false;
/* some pointers for shorter code */
void *l2_iov_base, *l3_iov_base;
size_t l2_iov_len, l3_iov_len;
int ... | vuln | Vulnerable | C/C++ |
def create_agent(
self, task: str, creation_prompt: str, model: str
) -> tuple[int, str]:
"""Create a new agent and return its key
Args:
task: The task to perform
creation_prompt: Prompt passed to the LLM at creation
model: The model to use to run this ag... | vuln | Safe | Python |
private boolean remove(long key1, long key2, long value1, long value2, int keyHash) {
long stamp = writeLock();
int bucket = signSafeMod(keyHash, capacity);
try {
while (true) {
long storedKey1 = table[bucket];
long storedKey2 ... | vuln | Vulnerable | Java |
package com.salesmanager.shop.admin.controller.payments;
import com.salesmanager.core.business.modules.integration.IntegrationException;
import com.salesmanager.core.business.services.payments.PaymentService;
import com.salesmanager.core.model.merchant.MerchantStore;
import com.salesmanager.core.model.payments.Transac... | vuln | Safe | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.