code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static void build_file_streams(void)
{
FFStream *stream, *stream_next;
AVFormatContext *infile;
int i;
for(stream = first_stream; stream != NULL; stream = stream_next) {
stream_next = stream->next;
if (stream->stream_type == STREAM_TYPE_LIVE &&
!stream->feed) {
... | vuln | Vulnerable | C/C++ |
def private_messages_for(user, type)
options = @options
options.reverse_merge!(per_page: per_page_setting)
result = Topic.includes(:allowed_users)
result = result.includes(:tags) if SiteSetting.tagging_enabled
if type == :group
result = result.joins(
"INNER JOIN topic_a... | vuln | Vulnerable | Ruby |
int ssl23_get_client_hello(SSL *s)
{
char buf_space[11]; /* Request this many bytes in initial read.
* We can detect SSL 3.0/TLS 1.0 Client Hellos
* ('type == 3') correctly only when the following
* is in a single record, which is not guaranteed by
... | vuln | Vulnerable | C/C++ |
static int
mptctl_readtest (MPT_ADAPTER *ioc, unsigned long arg)
{
struct mpt_ioctl_test __user *uarg = (void __user *) arg;
struct mpt_ioctl_test karg;
if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_test))) {
printk(KERN_ERR MYNAM "%s@%d::mptctl_readtest - "
"Unable to read in mpt_ioctl_test struct ... | vuln | Safe | C/C++ |
@Override
public boolean handle(WrapperWorld world, AEntityB_Existing entity, WrapperPlayer player){
switch(guiRequested){
case INSTRUMENTS: InterfaceGUI.openGUI(new GUIInstruments((EntityVehicleF_Physics) entity)); break;
case INVENTORY_CHEST: InterfaceGUI.openGUI(new GUIInventoryContainer(((TileEntityChest) ... | vuln | Vulnerable | Java |
qcow_co_pwritev_compressed(BlockDriverState *bs, uint64_t offset,
uint64_t bytes, QEMUIOVector *qiov)
{
BDRVQcowState *s = bs->opaque;
QEMUIOVector hd_qiov;
struct iovec iov;
z_stream strm;
int ret, out_len;
uint8_t *buf, *out_buf;
uint64_t cluster_offset;
buf ... | vuln | Safe | C/C++ |
static int parse_fade(struct sbg_parser *p, struct sbg_fade *fr)
{
struct sbg_fade f;
if (lex_char(p, '<'))
f.in = SBG_FADE_SILENCE;
else if (lex_char(p, '-'))
f.in = SBG_FADE_SAME;
else if (lex_char(p, '='))
f.in = SBG_FADE_ADAPT;
else
return 0;
if (lex_char(p, '... | vuln | Vulnerable | C/C++ |
static void parseServerMonitors(HttpRoute *route, cchar *key, MprJson *prop)
{
MprJson *child;
MprTicks period;
cchar *counter, *expression, *limit, *relation, *defenses;
int ji;
for (ITERATE_CONFIG(route, prop, child, ji)) {
defenses = mprGetJson(child, "defenses");
... | vuln | Vulnerable | C/C++ |
void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
{
session_t peer_id = pkt->getPeerId();
RemotePlayer *player = m_env->getPlayer(peer_id);
if (player == NULL) {
errorstream <<
"Server::ProcessData(): Canceling: No player for peer_id=" <<
peer_id << " disconnecting peer!" << std::endl;
Discon... | vuln | Safe | C/C++ |
String getString(Context context, String key, String fallback) {
SharedPreferences sharedPreferences = getSharedPreferences(context);
if (sharedPreferences != null) {
try {
return sharedPreferences.getString(key, fallback);
} catch (SecurityException ignored) {
... | vuln | Safe | Java |
/** @odoo-module **/
import { registry } from "@web/core/registry";
import {
Many2OneAvatarUserField,
KanbanMany2OneAvatarUserField,
many2OneAvatarUserField,
kanbanMany2OneAvatarUserField,
} from "@mail/web/fields/many2one_avatar_user_field/many2one_avatar_user_field";
export class Many2OneAvatarEmplo... | vuln | Safe | C/C++ |
T1_Get_Private_Dict( T1_Parser parser,
PSAux_Service psaux )
{
FT_Stream stream = parser->stream;
FT_Memory memory = parser->root.memory;
FT_Error error = FT_Err_Ok;
FT_ULong size;
if ( parser->in_pfb )
{
/* in the case of the PFB format, the private... | vuln | Safe | Unknown |
/*
* fs/f2fs/acl.c
*
* Copyright (c) 2012 Samsung Electronics Co., Ltd.
* http://www.samsung.com/
*
* Portions of this code from linux/fs/ext2/acl.c
*
* Copyright (C) 2001-2003 Andreas Gruenbacher, <agruen@suse.de>
*
* This program is free software; you can redistribute it and/or modify
* it unde... | vuln | Safe | C/C++ |
function lu(n,t){return n===t||n!==n&&t!==t;
} | vuln | Vulnerable | JavaScript |
static void ImportCbYCrYQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const unsigned char *magick_restrict p,
Quantum *magick_restrict q,ExceptionInfo *exception)
{
QuantumAny
range;
register ssize_t
x;
unsigned int
pixel;
assert(image != (Image *) N... | vuln | Safe | C/C++ |
static void sdhci_do_adma(SDHCIState *s)
{
unsigned int begin, length;
const uint16_t block_size = s->blksize & BLOCK_SIZE_MASK;
ADMADescr dscr = {};
int i;
if (s->trnmod & SDHC_TRNS_BLK_CNT_EN && !s->blkcnt) {
/* Stop Multiple Transfer */
sdhci_end_transfer(s);
return;
... | vuln | Safe | Unknown |
int zsetAdd(robj *zobj, double score, sds ele, int *flags, double *newscore) {
/* Turn options into simple to check vars. */
int incr = (*flags & ZADD_INCR) != 0;
int nx = (*flags & ZADD_NX) != 0;
int xx = (*flags & ZADD_XX) != 0;
*flags = 0; /* We'll return our response flags. */
double curscor... | vuln | Vulnerable | Unknown |
compile_nested_function(exarg_T *eap, cctx_T *cctx)
{
int is_global = *eap->arg == 'g' && eap->arg[1] == ':';
char_u *name_start = eap->arg;
char_u *name_end = to_name_end(eap->arg, TRUE);
char_u *lambda_name;
ufunc_T *ufunc;
int r = FAIL;
compiletype_T compile_type;
if (eap->forcei... | vuln | Vulnerable | C/C++ |
static int multipart_process_boundary(modsec_rec *msr, int last_part, char **error_log) {
/* if there was a part being built finish it */
if (msr->mpd->mpp != NULL) {
/* close the temp file */
if ((msr->mpd->mpp->type == MULTIPART_FILE)
&&(msr->mpd->mpp->tmp_file_name != NULL)
... | vuln | Safe | C/C++ |
sraSpanRemove(sraSpan *span) {
if(span) {
span->_prev->_next = span->_next;
span->_next->_prev = span->_prev;
}
} | vuln | Safe | C/C++ |
public Key parseKeyWithLegacyFallback(
ProtoKeySerialization protoKeySerialization, SecretKeyAccess access)
throws GeneralSecurityException {
if (access == null) {
throw new NullPointerException("access cannot be null");
}
if (!hasParserForKey(protoKeySerialization)) {
try {
... | vuln | Safe | Java |
param_expand (string, sindex, quoted, expanded_something,
contains_dollar_at, quoted_dollar_at_p, had_quoted_null_p,
pflags)
char *string;
int *sindex, quoted, *expanded_something, *contains_dollar_at;
int *quoted_dollar_at_p, *had_quoted_null_p, pflags;
{
char *temp, *temp1, uerror[3], *... | vuln | Vulnerable | Unknown |
void UTFstring::UpdateFromUTF8()
{
delete [] _Data;
// find the size of the final UCS-2 string
size_t i;
for (_Length=0, i=0; i<UTF8string.length(); _Length++) {
uint8 lead = static_cast<uint8>(UTF8string[i]);
if (lead < 0x80)
i++;
else if ((lead >> 5) == 0x6)
i += 2;
else if ((lead ... | vuln | Vulnerable | C/C++ |
int apparmor_bprm_set_creds(struct linux_binprm *bprm)
{
struct aa_task_cxt *cxt;
struct aa_profile *profile, *new_profile = NULL;
struct aa_namespace *ns;
char *buffer = NULL;
unsigned int state;
struct file_perms perms = {};
struct path_cond cond = {
bprm->file->f_path.dentry->d_inode->i_uid,
bprm->file->f... | vuln | Vulnerable | Unknown |
static void IBusBusNameOwnerChangedCallback(
IBusBus* bus,
const gchar* name, const gchar* old_name, const gchar* new_name,
gpointer user_data) {
DCHECK(name);
DCHECK(old_name);
DCHECK(new_name);
DLOG(INFO) << "Name owner is changed: name=" << name
<< ", old_name=" <<... | vuln | Vulnerable | C/C++ |
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright 2021 Google LLC.
*/
#include <linux/init.h>
#include <linux/highmem.h>
#include <linux/kobject.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include <linux/vmalloc.h>
#include "internal.h"
static int ... | vuln | Vulnerable | C/C++ |
Response ServiceWorkerHandler::DeliverPushMessage(
const std::string& origin,
const std::string& registration_id,
const std::string& data) {
if (!enabled_)
return CreateDomainNotEnabledErrorResponse();
if (!process_)
return CreateContextErrorResponse();
int64_t id = 0;
if (!base::Strin... | vuln | Vulnerable | C/C++ |
void MediaStreamDispatcherHost::DoOpenDevice(
int32_t page_request_id,
const std::string& device_id,
MediaStreamType type,
OpenDeviceCallback callback,
MediaDeviceSaltAndOrigin salt_and_origin) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!MediaStreamManager::IsOriginAllowed(render_process_id_,... | vuln | Safe | C/C++ |
wl_map_reserve_new(struct wl_map *map, uint32_t i)
{
union map_entry *start;
uint32_t count;
struct wl_array *entries;
if (i < WL_SERVER_ID_START) {
if (map->side == WL_MAP_CLIENT_SIDE) {
errno = EINVAL;
return -1;
}
entries = &map->client_entries;
} else {
if (map->side == WL_MAP_SERVER_SIDE) {
... | vuln | Vulnerable | Unknown |
// Copyright 2009 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.
// Package exec runs external commands. It wraps os.StartProcess to make it
// easier to remap stdin and stdout, connect I/O with pipes, and do other
// adjustm... | vuln | Safe | Go |
xmlRemoveID(xmlDocPtr doc, xmlAttrPtr attr) {
xmlIDTablePtr table;
xmlIDPtr id;
xmlChar *ID;
if (doc == NULL) return(-1);
if (attr == NULL) return(-1);
table = (xmlIDTablePtr) doc->ids;
if (table == NULL)
return(-1);
ID = xmlNodeListGetString(doc, attr->children, 1);
if (I... | vuln | Safe | Unknown |
pub fn parse_script(script_str: &str) -> Result<ast::Script> {
let stripped_string = &strip_comments(script_str);
let parser = syntax::ScriptParser::new();
match parser.parse(stripped_string) {
Ok(script) => Ok(script),
Err(e) => handle_error(e, script_str),
}
} | vuln | Vulnerable | Rust |
function message_options($id, $mode, $global_privmsgs_rules, $global_rule_conditions)
{
global $phpbb_root_path, $phpEx, $user, $template, $auth, $config, $db;
$redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=options");
add_form_key('ucp_pm_options');
// Change "full folder" setting - wha... | vuln | Safe | PHP |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | vuln | Safe | Python |
void big_key_describe(const struct key *key, struct seq_file *m)
{
size_t datalen = (size_t)key->payload.data[big_key_len];
seq_puts(m, key->description);
if (key_is_positive(key))
seq_printf(m, ": %zu [%s]",
datalen,
datalen > BIG_KEY_FILE_THRESHOLD ? "file" : "buff");
} | vuln | Safe | C/C++ |
static int read_highpass(AVCodecContext *avctx, uint8_t *ptr, int plane, AVFrame *frame)
{
PixletContext *ctx = avctx->priv_data;
ptrdiff_t stride = frame->linesize[plane] / 2;
int i, ret;
for (i = 0; i < ctx->levels * 3; i++) {
int32_t a = bytestream2_get_be32(&ctx->gb);
int32_t b = byt... | vuln | Safe | C/C++ |
public synchronized void mountWritable(String label, String location, IWritableMount mount) throws FileSystemException {
if (mount == null) {
throw new NullPointerException();
}
location = sanitizePath(location);
if (location.contains("..")) {
throw new FileSystem... | vuln | Vulnerable | Java |
function buildHttpOptions(installerfileURL)
{
var options = {
host: url.parse(installerfileURL).host,
port: 80,
path: url.parse(installerfileURL).pathname
};
var proxyStr;
var child = exec('npm config get proxy', function(error, st... | vuln | Vulnerable | JavaScript |
juniper_pppoe_atm_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, register const u_char *p)
{
struct juniper_l2info_t l2info;
uint16_t extracted_ethertype;
l2info.pictype = DLT_JUNIPER_PPPOE_ATM;
if (juniper_parse_header(ndo, p, h, &l2info) == 0)
... | vuln | Safe | C/C++ |
static void v9fs_walk(void *opaque)
{
int name_idx;
V9fsFidState *newfidp = NULL;
V9fsPDU *pdu = opaque;
V9fsState *s = pdu->s;
err = pdu_unmarshal(pdu, offset, "ddw", &fid, &newfid, &nwnames);
if (err < 0) {
pdu_complete(pdu, err);
return ;
}
V9fsFidState *newfidp = ... | vuln | Vulnerable | C/C++ |
@Override
public void startCasting(CastDevice device) {
if (device == null || !(device.tag instanceof RouteInfo)) return;
final RouteInfo route = (RouteInfo) device.tag;
if (DEBUG) Log.d(TAG, "startCasting: " + routeToString(route));
mMediaRouter.selectRoute(ROUTE_TYPE_REMOTE_DISPLAY... | vuln | Safe | Java |
@Override
public final IBinder onBind(Intent intent) {
if (mDebug) Slog.v(mTag, "onBind() intent = " + intent);
mDreamServiceWrapper = new DreamServiceWrapper();
final ComponentName overlayComponent = intent.getParcelableExtra(
EXTRA_DREAM_OVERLAY_COMPONENT, ComponentName.cla... | vuln | Safe | Java |
from django.contrib import admin
from .models import MFAKey
@admin.register(MFAKey)
class MFAKeyAdmin(admin.ModelAdmin):
list_display = ['name', 'user', 'method']
| vuln | Vulnerable | Python |
def parse_native_url(url):
"""
Support https://maker.ifttt.com/use/WEBHOOK_ID/EVENT_ID
"""
result = re.match(
r'^https?://maker\.ifttt\.com/use/'
r'(?P<webhook_id>[A-Z0-9_-]+)'
r'((?P<events>(/[A-Z0-9_-]+)+))?'
r'/?(?P<params>\?.+)?$', url... | vuln | Safe | Python |
static int rndis_set_response(struct rndis_params *params,
rndis_set_msg_type *buf)
{
u32 BufLength, BufOffset;
rndis_set_cmplt_type *resp;
rndis_resp_t *r;
BufLength = le32_to_cpu(buf->InformationBufferLength);
BufOffset = le32_to_cpu(buf->InformationBufferOffset);
if ((BufLength > RNDIS_MAX_TOTAL_SIZE... | vuln | Safe | C/C++ |
@Override
public void stopProgramListUpdates() throws RemoteException {
mLogger.logRadioEvent("Stop programList updates");
if (!RadioServiceUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG,
"Cannot stop program list updates on AIDL HAL client from non-current use... | vuln | Safe | Java |
function fromUrl (giturl, opts) {
if (giturl == null || giturl === '') return
var url = fixupUnqualifiedGist(
isGitHubShorthand(giturl) ? 'github:' + giturl : giturl
)
var parsed = parseGitUrl(url)
var shortcutMatch = url.match(new RegExp('^([^:]+):(?:(?:[^@:]+(?:[^@]+)?@)?([^/]*))[/](.+?)(?:[.]git)?($|#)... | vuln | Vulnerable | JavaScript |
fn load_constant64_full(&mut self, value: u64) -> Reg {
// If the top 32 bits are zero, use 32-bit `mov` operations.
let (num_half_words, size, negated) = if value >> 32 == 0 {
(2, OperandSize::Size32, (!value << 32) >> 32)
} else {
(4, OperandSize::Size64, !value)
... | vuln | Vulnerable | Rust |
$item = array();
$item['id'] = $incident->id;
$item['title'] = $incident->incident_title;
$item['link'] = $site_url.'reports/view/'.$incident->id;
$item['description'] = $incident->incident_description;
$item['date'] = $incident->incident_date;
$item['categories'] = $categories;
if
... | vuln | Vulnerable | PHP |
@PayloadRoot(localPart = "AddManufacturerRequest", namespace = NAMESPACE)
@ResponsePayload
public AddManufacturerResponse addManufacturer(
@OrganisationIdentification final String organisationIdentification,
@RequestPayload final AddManufacturerRequest request)
throws OsgpException {
LOGGER.i... | vuln | Safe | Java |
static void
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *yyscanner, RE_LEX_ENVIRONMENT *lex_env)
{
YYUSE (yyvaluep);
YYUSE (yyscanner);
YYUSE (lex_env);
if (!yymsg)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
s... | vuln | Safe | C/C++ |
static int iowarrior_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{
struct usb_device *udev = interface_to_usbdev(interface);
struct iowarrior *dev = NULL;
struct usb_host_interface *iface_desc;
struct usb_endpoint_descriptor *endpoint;
int i;
int retval = -ENOMEM;
/* allocate me... | vuln | Vulnerable | C/C++ |
unsigned long lh_char_hash(const void *k)
{
static volatile int random_seed = -1;
if (random_seed == -1) {
int seed;
/* we can't use -1 as it is the unitialized sentinel */
while ((seed = json_c_get_random_seed()) == -1);
#if defined __GNUC__
__sync_val_compare_and_swap(&random_seed, -1, seed);
#elif defined... | vuln | Safe | Unknown |
QPDF::makeIndirectObject(QPDFObjectHandle oh)
{
int max_objid = getObjectCount();
QPDFObjGen next(max_objid + 1, 0);
this->m->obj_cache[next] =
ObjCache(QPDFObjectHandle::ObjAccessor::getObject(oh), -1, -1);
return QPDFObjectHandle::Factory::newIndirect(
this, next.getObj(), next.getGen());
} | vuln | Vulnerable | Unknown |
public void realTick() {
shouldUpdateOverlay = shouldUpdate();
if (shouldUpdateOverlay) {
boolean currentTabState =
Keyboard.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindPlayerList.getKeyCode());
if (lastTabState != currentTabState) {
lastTabState = currentTabState;
update();
}
}
} | vuln | Vulnerable | Java |
static void calc_diffs(const DecimateContext *dm, struct qitem *q,
const AVFrame *f1, const AVFrame *f2)
{
int64_t maxdiff = -1;
int64_t *bdiffs = dm->bdiffs;
int plane, i, j;
memset(bdiffs, 0, dm->bdiffsize * sizeof(*bdiffs));
for (plane = 0; plane < (dm->chroma && f1->data[2... | vuln | Safe | C/C++ |
CacheManager::start(const Comm::ConnectionPointer &client, HttpRequest *request, StoreEntry *entry, const AccessLogEntry::Pointer &ale)
{
debugs(16, 3, "CacheManager::Start: '" << entry->url() << "'" );
Mgr::Command::Pointer cmd = ParseUrl(entry->url());
if (!cmd) {
const auto err = new ErrorState(... | vuln | Vulnerable | Unknown |
static void pc_init1(ram_addr_t ram_size,
const char *boot_device,
const char *kernel_filename,
const char *kernel_cmdline,
const char *initrd_filename,
const char *cpu_model,
int pci_enabled)
{... | vuln | Vulnerable | C/C++ |
@Override
public void render(int mouseX, int mouseY, float partialTicks) {
VersionedFunctions.drawDarkBackground(0, 0, height, width);
// Old chunks
int minX = MathHelper.floor(displayXToChunkX(0) / 32.0);
int maxX = MathHelper.floor(displayXToChunkX(width) / 32.0);
int minZ = MathHelper.floor(displayZToChu... | vuln | Vulnerable | Java |
private static < T extends RealType< T > & NativeType< T > > Spot refineSpotPosition( final Spot spot, final ImgPlus< T > img, final CloseGapsParams params, final Logger logger )
{
if ( params.method == Method.LINEAR_INTERPOLATION )
return spot; // All done already.
// Check time.
final int frame = spot.getF... | vuln | Safe | Java |
private void updateWindowGeometry() {
// From xdg-shell.xml:
// "The window geometry of a surface is its "visible bounds" from the
// user's perspective. Client-side decorations often have invisible
// portions like drop-shadows which should be ignored for the
// purposes of alig... | vuln | Safe | Java |
static int common_bind(struct common *c)
{
uint64_t val;
xen_pfn_t mfn;
if (xenstore_read_fe_uint64(&c->xendev, "page-ref", &val) == -1)
return -1;
mfn = (xen_pfn_t)val;
assert(val == mfn);
if (xenstore_read_fe_int(&c->xendev, "event-channel", &c->xendev.remote_port) == -1)
return -1;
c->p... | vuln | Safe | C/C++ |
public static Double parseDouble(String key, Object value, String scriptName) {
try {
return (Double) value;
} catch (Exception ex) {
parsingErrorMessage(key, value, scriptName);
return null;
}
} | vuln | Vulnerable | Java |
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: https://www.espocrm.com
*
* EspoCRM is free software: you can redistribute i... | vuln | Vulnerable | JavaScript |
static int io_close_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
{
/*
* If we queue this for async, it must not be cancellable. That would
* leave the 'file' in an undeterminate state, and here need to modify
* io_wq_work.flags, so initialize io_wq_work firstly.
*/
io_req_init_async(req);
req->... | vuln | Vulnerable | Unknown |
private void updateOutcome(String lockToken, Delivery delivery) {
final DeliveryState remoteState = delivery.getRemoteState();
logger.atVerbose()
.addKeyValue(LOCK_TOKEN_KEY, lockToken)
.addKeyValue(DELIVERY_STATE_KEY, remoteState)
.log("Received update disposition d... | vuln | Vulnerable | Java |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | vuln | Vulnerable | Python |
void arp_table_add(Slirp *slirp, uint32_t ip_addr, uint8_t ethaddr[ETH_ALEN])
{
const uint32_t broadcast_addr =
~slirp->vnetwork_mask.s_addr | slirp->vnetwork_addr.s_addr;
ArpTable *arptbl = &slirp->arp_table;
int i;
DEBUG_CALL("arp_table_add");
DEBUG_ARG("ip = 0x%x", ip_addr);
DEBUG_ARG... | vuln | Vulnerable | C/C++ |
/*
* JBoss, Home of Professional Open Source.
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify i... | vuln | Vulnerable | Java |
nfs4_callback_svc(void *vrqstp)
{
int err;
struct svc_rqst *rqstp = vrqstp;
set_freezable();
while (!kthread_should_stop()) {
/*
* Listen for a request on the socket
*/
err = svc_recv(rqstp, MAX_SCHEDULE_TIMEOUT);
if (err == -EAGAIN || err == -EINTR)
continue;
svc_process(rqstp);
}
re... | vuln | Vulnerable | C/C++ |
int ssl3_get_server_hello(SSL *s)
{
STACK_OF(SSL_CIPHER) *sk;
SSL_CIPHER *c;
unsigned char *p,*d;
int i,al,ok;
unsigned int j;
long n;
#ifndef OPENSSL_NO_COMP
SSL_COMP *comp;
#endif
n=s->method->ssl_get_message(s,
SSL3_ST_CR_SRVR_HELLO_A,
SSL3_ST_CR_SRVR_HELLO_B,
-1,
20000, /* ?? */
&ok);
if (!ok)... | vuln | Safe | Unknown |
static int xfrm_alloc_replay_state_esn(struct xfrm_replay_state_esn **replay_esn,
struct xfrm_replay_state_esn **preplay_esn,
struct nlattr *rta)
{
struct xfrm_replay_state_esn *p, *pp, *up;
int klen, ulen;
if (!rta)
return 0;
up = nla_data(rta);
klen = xfrm_replay_state_esn_len(up);
ule... | vuln | Safe | C/C++ |
/**
* Copyright (c) 2006-2012, JGraph Ltd
*/
/**
* Constructs a new graph editor
*/
EditorUi = function(editor, container, lightbox)
{
mxEventSource.call(this);
this.destroyFunctions = [];
this.editor = editor || new Editor();
this.container = container || document.body;
var graph = this.editor.graph;
gra... | vuln | Safe | JavaScript |
const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
let { type, host } = ctx.params;
type = type === 'all' ? '' : type;
host = host ? host : 'gitlab.com';
const typename = {
trending: 'Trending',
starred: 'Most stars',
all: '... | vuln | Vulnerable | JavaScript |
private void onSymbolRates(int[] rate) {
if (mScanCallbackExecutor != null && mScanCallback != null) {
mScanCallbackExecutor.execute(() -> mScanCallback.onSymbolRatesReported(rate));
}
} | vuln | Vulnerable | Java |
/*
* Copyright 2019 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apach... | vuln | Safe | Java |
guestfs___first_line_of_file (guestfs_h *g, const char *filename)
{
CLEANUP_FREE char **lines = NULL; /* sic: not CLEANUP_FREE_STRING_LIST */
int64_t size;
char *ret;
/* Don't trust guestfs_head_n not to break with very large files.
* Check the file size is something reasonable first.
*/
size = guestfs... | vuln | Vulnerable | C/C++ |
bool asn1_check_enumerated(struct asn1_data *data, int v)
{
uint8_t b;
if (!asn1_start_tag(data, ASN1_ENUMERATED)) return false;
if (!asn1_read_uint8(data, &b)) return false;
if (!asn1_end_tag(data)) return false;
if (v != b)
data->has_error = false;
return !data->has_error;
} | vuln | Safe | Unknown |
static int authenticate_nss_2_3 (
struct crypto_instance *instance,
unsigned char *buf,
int *buf_len)
{
if (hash_to_nss[instance->crypto_hash_type]) {
unsigned char tmp_hash[hash_len[instance->crypto_hash_type]];
int datalen = *buf_len - hash_len[instance->crypto_hash_type];
if (calculate_nss_has... | vuln | Vulnerable | Unknown |
int propagate_mnt(struct mount *dest_mnt, struct mountpoint *dest_mp,
struct mount *source_mnt, struct hlist_head *tree_list)
{
struct mount *m, *n;
int ret = 0;
/*
* we don't want to bother passing tons of arguments to
* propagate_one(); everything is serialized by namespace_sem,
* so globals will do j... | vuln | Vulnerable | Unknown |
gboolean
flatpak_dir_deploy_appstream (FlatpakDir *self,
const char *remote,
const char *arch,
gboolean *out_changed,
GCancellable *cancellable,
... | vuln | Vulnerable | C/C++ |
/*
* Copyright (C) 2017 The Android Open Source Project
*
* 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 app... | vuln | Safe | Java |
public void setView(View view, WindowManager.LayoutParams attrs, View panelParentView,
int userId) {
synchronized (this) {
if (mView == null) {
mView = view;
mViewLayoutDirectionInitial = mView.getRawLayoutDirection();
mFallbackEventHandle... | vuln | Safe | Java |
void Compute(OpKernelContext* context) override {
const Tensor& image = context->input(0);
OP_REQUIRES(context, image.dims() == 3,
errors::InvalidArgument("image must be 3-dimensional",
image.shape().DebugString()));
OP_REQUIRES(context, image.NumEleme... | vuln | Safe | C/C++ |
public synchronized boolean getToken(boolean setupDojo) {
if(!APITokenRequired()) {
return true;
}
String _url = SamouraiWallet.getInstance().isTestNet() ? WebUtil.SAMOURAI_API2_TESTNET : SAMOURAI_API2;
if(DojoUtil.getInstance(context).getDojoParams() != null || setupDo... | vuln | Safe | Java |
static ut64 estimate_slide(RBinFile *bf, RDyldCache *cache, ut64 value_mask, ut64 value_add) {
ut64 slide = 0;
if (cache->n_hdr > 1) {
return slide;
}
ut64 *classlist = malloc (64);
if (!classlist) {
goto beach;
}
RListIter *iter;
RDyldBinImage *bin;
r_list_foreach (cache->bins, iter, bin) {
bool found_... | vuln | Vulnerable | Unknown |
static void update_refcount_discard(BlockDriverState *bs,
uint64_t offset, uint64_t length)
{
BDRVQcowState *s = bs->opaque;
Qcow2DiscardRegion *d, *p, *next;
QTAILQ_FOREACH(d, &s->discards, next) {
uint64_t new_start = MIN(offset, d->offset);
uint64_t new... | vuln | Safe | C/C++ |
static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
Image
*chroma_image,
*image,
*resize_image;
InterlaceType
interlace;
MagickBooleanType
status;
register const PixelPacket
*chroma_pixels;
register ssize_t
x;
register PixelPacket
*q;
re... | vuln | Safe | Unknown |
static ssize_t local_readlink(FsContext *fs_ctx, V9fsPath *fs_path,
char *buf, size_t bufsz)
{
ssize_t tsize = -1;
if ((fs_ctx->export_flags & V9FS_SM_MAPPED) ||
(fs_ctx->export_flags & V9FS_SM_MAPPED_FILE)) {
int fd;
fd = local_open_nofollow(fs_ctx, fs_path... | vuln | Safe | C/C++ |
private static boolean shouldLargeScaleRetreat(AUnit unit, Selection enemies) {
boolean isSituationFavorable = ACombatEvaluator.isSituationFavorable(unit);
if (!isSituationFavorable) {
unit._lastRetreat = AGame.now();
GLOBAL_RETREAT_COUNTER++;
unit.setTooltipTactical(... | vuln | Vulnerable | Java |
@Override
public void didSelectDialogs(DialogsActivity dialogsFragment, ArrayList<Long> dids, CharSequence message, boolean param) {
final int account = dialogsFragment != null ? dialogsFragment.getCurrentAccount() : currentAccount;
if (exportingChatUri != null) {
Uri uri = exportingCha... | vuln | Vulnerable | Java |
@tornado.web.asynchronous
def connect(self):
"""Gets called when a connect request is received.
* The host and port are obtained from the request uri
* A socket is created, wrapped in ssl and then added to SSLIOStream
* This stream is used to connect to speak to the remote host on g... | vuln | Vulnerable | Python |
static int pcan_usb_pro_drv_loaded(struct peak_usb_device *dev, int loaded)
{
u8 *buffer;
int err;
buffer = kmalloc(PCAN_USBPRO_FCT_DRVLD_REQ_LEN, GFP_KERNEL);
if (!buffer)
return -ENOMEM;
buffer[0] = 0;
buffer[1] = !!loaded;
err = pcan_usb_pro_send_req(dev, PCAN_USBPRO_REQ_FCT,
PCAN_USBPRO_FCT_DRVL... | vuln | Vulnerable | C/C++ |
@Override
public List<PartialPath> getPaths() {
Set<PartialPath> authPaths = new HashSet<>();
List<PartialPath> prefixPaths = fromComponent.getPrefixPaths();
List<ResultColumn> resultColumns = selectComponent.getResultColumns();
for (ResultColumn resultColumn : resultColumns) {
Expression expres... | vuln | Safe | Java |
int mongo_env_read_socket( mongo *conn, void *buf, size_t len ) {
char *cbuf = buf;
while ( len ) {
size_t sent = recv( conn->sock, cbuf, len, 0 );
if ( sent == 0 || sent == -1 ) {
__mongo_set_error( conn, MONGO_IO_ERROR, NULL, WSAGetLastError() );
return MONGO_ERROR;
... | vuln | Safe | C/C++ |
@Override
public int checkSlicePermission(Uri uri, String callingPkg, String pkg, int pid, int uid,
String[] autoGrantPermissions) {
int userId = UserHandle.getUserId(uid);
if (pkg == null) {
for (String p : mContext.getPackageManager().getPackagesForUid(uid)) {
... | vuln | Safe | Java |
void
wb_print(netdissect_options *ndo,
register const void *hdr, register u_int len)
{
register const struct pkt_hdr *ph;
ph = (const struct pkt_hdr *)hdr;
if (len < sizeof(*ph) || !ND_TTEST(*ph)) {
ND_PRINT((ndo, "%s", tstr));
return;
}
len -= sizeof(*ph);
if (ph->ph_flags)
ND_PRINT((ndo, "*"));... | vuln | Vulnerable | C/C++ |
package io.socket.client;
import io.socket.backo.Backoff;
import io.socket.emitter.Emitter;
import io.socket.parser.DecodingException;
import io.socket.parser.IOParser;
import io.socket.parser.Packet;
import io.socket.parser.Parser;
import io.socket.thread.EventThread;
import okhttp3.Call;
import okhttp3.WebSocket;
i... | vuln | Vulnerable | Java |
"80px";mxUtils.setPrefixedStyle(m.style,"transform","translate(50%,-50%)");n.appendChild(m);mxClient.IS_FF||null==navigator.clipboard||"image/png"!=x||(A=mxUtils.button(mxResources.get("copy"),function(P){P=b.base64ToBlob(L,"image/png");P=new ClipboardItem({"image/png":P,"text/html":new Blob(['<img src="data:'+x+";base... | vuln | Vulnerable | JavaScript |
void checkVerificationCodeUnexistingUser()
{
when(this.userReference.toString()).thenReturn("user:Foobar");
when(this.userManager.exists(this.userReference)).thenReturn(false);
String exceptionMessage = "User [user:Foobar] doesn't exist";
when(this.localizationManager.getTranslationP... | vuln | Vulnerable | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.