code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
/*-
* Copyright (c) 2016 Docker, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following d... | vuln | Safe | C/C++ |
static void *seq_buf_alloc(unsigned long size)
{
return kvmalloc(size, GFP_KERNEL_ACCOUNT);
} | vuln | Vulnerable | C/C++ |
private @ReasonCode int shouldAllowFgsWhileInUsePermissionLocked(String callingPackage,
int callingPid, int callingUid, @Nullable ServiceRecord targetService,
boolean allowBackgroundActivityStarts) {
int ret = REASON_DENIED;
final int uidState = mAm.getUidStateLocked(callingUid)... | vuln | Safe | Java |
static struct child_process *git_connect_git(int fd[2], char *hostandport,
const char *path, const char *prog,
enum protocol_version version,
int flags)
{
struct child_process *conn;
struct strbuf request = STRBUF_INIT;
/*
* Set up virtual host information based on where we will
* c... | vuln | Safe | Unknown |
public Operation.OperationResult executeFixedCostOperation(
final MessageFrame frame, final EVM evm) {
Bytes shiftAmount = frame.popStackItem();
final Bytes value = leftPad(frame.popStackItem());
final boolean negativeNumber = value.get(0) < 0;
if (shiftAmount.size() > 4 && (shiftAmount = shiftAm... | vuln | Safe | Java |
function peg$parsesection() {
var s0, s1, s2, s3, s4, s5, s6, s7;
peg$silentFails++;
s0 = peg$currPos;
s1 = peg$parsesec_tag_start();
if (s1 !== peg$FAILED) {
s2 = [];
s3 = peg$parsews();
while (s3 !== peg$FAILED) {
s2.push(s3);
s3 = peg$parsews... | vuln | Safe | JavaScript |
PHP_FUNCTION(radius_get_vendor_attr)
{
const void *data, *raw;
int len;
u_int32_t vendor;
unsigned char type;
size_t data_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &raw, &len) == FAILURE) {
return;
}
if (rad_get_vendor_attr(&vendor, &type, &data, &data_len, raw, len) == -1) {
RETURN_F... | vuln | Safe | C/C++ |
static int edit_ext(char* editor, char* name, char* date, char* data)
{
int fd;
int st;
int sz;
char* b;
char* l;
char buff[512];
pid_t pid;
strcpy(buff,"/tmp/nodau.XXXXXX");
fd = mkstemp(buff);
if (fd < 0)
return 1;
pid = fork();
if (pid < 0) {
return 1;
}else if (pid) {
close(fd);
waitpid(pid... | vuln | Safe | C/C++ |
private Configuration doDefineConfiguration(String name, Configuration... configurations) {
authorizer.checkPermission(getSubject(), AuthorizationPermission.ADMIN);
assertIsNotTerminated();
if (name == null || configurations == null)
throw new NullPointerException("Null arguments not allowed"... | vuln | Vulnerable | Java |
static ssize_t oz_cdev_write(struct file *filp, const char __user *buf,
size_t count, loff_t *fpos)
{
struct oz_pd *pd;
struct oz_elt_buf *eb;
struct oz_elt_info *ei;
struct oz_elt *elt;
struct oz_app_hdr *app_hdr;
struct oz_serial_ctx *ctx;
spin_lock_bh(&g_cdev.lock);
pd = g_cdev.active_pd;
if (pd)
... | vuln | Vulnerable | C/C++ |
void usb_ep_combine_input_packets(USBEndpoint *ep)
{
USBPacket *p, *u, *next, *prev = NULL, *first = NULL;
USBPort *port = ep->dev->port;
int ret;
assert(ep->pipeline);
assert(ep->pid == USB_TOKEN_IN);
QTAILQ_FOREACH_SAFE(p, &ep->queue, queue, next) {
if (ep->halted) {
... | vuln | Vulnerable | C/C++ |
service_info *FindServiceControlURLPath(
service_table *table, const char *controlURLPath)
{
service_info *finger = NULL;
uri_type parsed_url;
uri_type parsed_url_in;
if (!table || !controlURLPath) {
return NULL;
}
if (parse_uri(controlURLPath, strlen(controlURLPath), &parsed_url_in) ==
HTTP_SUCCESS) {
fi... | vuln | Safe | C/C++ |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "hermes/VM/Operations.h"
#include "hermes/Support/Conversions.h"
#include "hermes/Support/OSCompat.h"
#include "hermes/... | vuln | Safe | C/C++ |
PJ_DEF(pj_status_t) pjsip_tpmgr_acquire_transport2(pjsip_tpmgr *mgr,
pjsip_transport_type_e type,
const pj_sockaddr_t *remote,
int addr_len,
const pjsip_tpselector *sel,
pjsip_tx_data *tdata,
pjsip_transport **tp)
{
pjsip_tpfactory *factory;
pj_status_t stat... | vuln | Vulnerable | C/C++ |
/* $Id$ */
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; eit... | vuln | Vulnerable | C/C++ |
static bool is_zero_cluster(BlockDriverState *bs, int64_t start)
{
BDRVQcow2State *s = bs->opaque;
int nr;
BlockDriverState *file;
int64_t res = bdrv_get_block_status_above(bs, NULL, start,
s->cluster_sectors, &nr, &file);
return res >= 0 && ((res & BDRV... | vuln | Vulnerable | C/C++ |
func main() {
semver := fmt.Sprintf("%s+%s", version, commitID)
// Always set default timeout on HTTP client.
http.DefaultClient.Timeout = 1500 * time.Millisecond
tmpLogger := server.NewJSONLogger(os.Stdout, zapcore.InfoLevel, server.JSONFormat)
if len(os.Args) > 1 {
switch os.Args[1] {
case "--version":
... | vuln | Safe | Go |
package bitfield
// NOTE: Don't bother replacing the divisions/modulo with shifts/ands, go is smart.
import (
"fmt"
"math/bits"
)
// NewBitfield creates a new fixed-sized Bitfield (allocated up-front).
func NewBitfield(size int) (Bitfield, error) {
if size < 0 {
return nil, fmt.Errorf("bitfield size must be pos... | vuln | Safe | Go |
int qcow2_check_refcounts(BlockDriverState *bs, BdrvCheckResult *res)
{
BDRVQcowState *s = bs->opaque;
int64_t size;
int nb_clusters, refcount1, refcount2, i;
QCowSnapshot *sn;
uint16_t *refcount_table;
int ret;
size = bdrv_getlength(bs->file);
nb_clusters = size_to_clusters(s, size);
... | vuln | Safe | C/C++ |
int cp_sokaka_key(uint8_t *key, size_t key_len, const char *id1,
const sokaka_t k, const char *id2) {
size_t size, len1 = strlen(id1), len2 = strlen(id2);
int first = 0, result = RLC_OK;
uint8_t *buf;
g1_t p;
g2_t q;
gt_t e;
g1_null(p);
g2_null(q);
gt_null(e);
RLC_TRY {
g1_new(p);
g2_new(q);
gt_new(... | vuln | Safe | C/C++ |
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | vuln | Vulnerable | Python |
int pkey_gost_decrypt(EVP_PKEY_CTX *pctx, unsigned char *key,
size_t *key_len, const unsigned char *in, size_t in_len)
{
struct gost_pmeth_data *gctx = EVP_PKEY_CTX_get_data(pctx);
if (key == NULL) {
*key_len = 32;
return 1;
}
if (key != NULL && *key_len < 32) {
... | vuln | Safe | C/C++ |
CollationCreate(const char *collname, Oid collnamespace,
Oid collowner,
char collprovider,
bool collisdeterministic,
int32 collencoding,
const char *collcollate, const char *collctype,
const char *collversion,
bool if_not_exists,
bool quiet)
{
Relation rel;
TupleDesc tupDesc;
HeapTupl... | vuln | Vulnerable | Unknown |
public void swapActiveConfig(final UUID newConfig, final boolean startup)
throws ConfigUpdateException {
final var configToReplace = findActiveConfig();
if (configToReplace.isPresent()) {
swapActiveConfigInDb(newConfig);
if (!startup) {
try {
... | vuln | Safe | Java |
private void dispatchSessionPreappoved() {
final IntentSender target = getRemoteStatusReceiver();
final Intent intent = new Intent();
intent.putExtra(PackageInstaller.EXTRA_SESSION_ID, sessionId);
intent.putExtra(PackageInstaller.EXTRA_STATUS, PackageInstaller.STATUS_SUCCESS);
in... | vuln | Safe | Java |
/* ecc-eh-to-a.c
Copyright (C) 2014 Niels MΓΆller
This file is part of GNU Nettle.
GNU Nettle is free software: you can redistribute it and/or
modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the Lic... | vuln | Vulnerable | C/C++ |
die(SIGNAL_ARGS)
{
int save_errno = errno;
/* Don't joggle the elbow of proc_exit */
if (!proc_exit_inprogress)
{
InterruptPending = true;
ProcDiePending = true;
/*
* If it's safe to interrupt, and we're waiting for input or a lock,
* service the interrupt immediately
*/
if (ImmediateInterruptO... | vuln | Vulnerable | Unknown |
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache... | vuln | Safe | Java |
public static Optional<ConnectorSpecification> attemptToFetchSpecFromBucket(final Storage storage,
final String bucketName,
final String dockerImage) {
final St... | vuln | Vulnerable | Java |
NodeIterator::~NodeIterator()
{
if (!root()->isAttributeNode())
root()->document().detachNodeIterator(this);
} | vuln | Safe | C/C++ |
static int mp_dacl_removexattr(FsContext *ctx,
const char *path, const char *name)
{
int ret;
ret = local_removexattr_nofollow(ctx, path, MAP_ACL_DEFAULT);
if (ret == -1 && errno == ENODATA) {
errno = 0;
ret = 0;
}
return ret;
} | vuln | Safe | C/C++ |
/* 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 |
fpDiff(TIFF* tif, uint8* cp0, tmsize_t cc)
{
tmsize_t stride = PredictorState(tif)->stride;
uint32 bps = tif->tif_dir.td_bitspersample / 8;
tmsize_t wc = cc / bps;
tmsize_t count;
uint8 *cp = (uint8 *) cp0;
uint8 *tmp;
if((cc%(bps*stride))!=0)
{
TIFFErrorExt(tif->tif_clientdata, "fpDiff",
... | vuln | Safe | C/C++ |
static void msix_handle_mask_update(PCIDevice *dev, int vector, bool was_masked)
{
bool is_masked = msix_is_masked(dev, vector);
if (is_masked == was_masked) {
return;
}
if (!is_masked && msix_is_pending(dev, vector)) {
msix_clr_pending(dev, vector);
msix_notify(dev, vector);
... | vuln | Safe | C/C++ |
/*
*
* drivers/staging/android/ion/ion.c
*
* Copyright (C) 2011 Google, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distribu... | vuln | Safe | C/C++ |
static void realview_init(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)
{
CPUState *env;
ram_addr_t ram_offset;
DeviceState *dev;
qe... | vuln | Safe | C/C++ |
import ast
import enum
import inspect
import re
import builtins
import torch
import warnings
from .._jit_internal import List, Tuple, is_tuple, is_list, Dict, is_dict, Optional, \
is_optional, _qualified_name, Any, Future, is_future, is_ignored_fn, Union, is_union
from .._jit_internal import BroadcastingList1, Broa... | vuln | Vulnerable | Python |
@Override
protected final void configure(final HttpSecurity http) throws Exception {
http
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.authorizeRequests()
.antMatchers("/api/ids/da... | vuln | Safe | Java |
/* radare - LGPL - Copyright 2008-2022 - nibble, pancake, alvaro_fe */
#define R_LOG_ORIGIN "elf"
#include <r_types.h>
#include <r_util.h>
#include "elf.h"
#define MIPS_PLT_OFFSET 0x20
#define RISCV_PLT_OFFSET 0x20
#define LOONGARCH_PLT_OFFSET 0x20
#define RISCV_PLT_ENTRY_SIZE 0x10
#define LOONGARCH_PLT_ENTRY_SIZE 0... | vuln | Vulnerable | C/C++ |
@Override
public KafkaPrincipal build(AuthenticationContext context) {
if (context instanceof SaslAuthenticationContext) {
SaslServer saslServer = ((SaslAuthenticationContext) context).server();
if (saslServer instanceof OAuthBearerSaslServer) {
OAuthBearerSaslServer ... | vuln | Vulnerable | Java |
static int read_header(FFV1Context *f)
{
uint8_t state[CONTEXT_SIZE];
int i, j, context_count = -1; //-1 to avoid warning
RangeCoder *const c = &f->slice_context[0]->c;
memset(state, 128, sizeof(state));
if (f->version < 2) {
int chroma_planes, chroma_h_shift, chroma_v_shift, transparen... | vuln | Safe | C/C++ |
static ssize_t read_mem(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
phys_addr_t p = *ppos;
ssize_t read, sz;
void *ptr;
if (p != *ppos)
return 0;
if (!valid_phys_addr_range(p, count))
return -EFAULT;
read = 0;
#ifdef __ARCH_HAS_NO_PAGE_ZERO_MAPPED
/* we don't have page 0 mapped on... | vuln | Safe | Unknown |
static int cow_create(const char *filename, QemuOpts *opts, Error **errp)
{
struct cow_header_v2 cow_header;
struct stat st;
int64_t image_sectors = 0;
char *image_filename = NULL;
Error *local_err = NULL;
int ret;
BlockDriverState *cow_bs;
image_sectors = qemu_opt_get_size_del(opts... | vuln | Vulnerable | C/C++ |
# Generated by Django 2.2.9 on 2020-02-02 01:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stock', '0017_auto_20191118_2311'),
]
operations = [
migrations.AlterField(
model_name='stockitem',
name='notes',
... | vuln | Safe | Python |
static int __do_execve_file(int fd, struct filename *filename,
struct user_arg_ptr argv,
struct user_arg_ptr envp,
int flags, struct file *file)
{
char *pathbuf = NULL;
struct linux_binprm *bprm;
struct files_struct *displaced;
int retval;
if (IS_ERR(filename))
return PTR_ERR(filename);
/... | vuln | Vulnerable | Unknown |
ServiceManagerContext::ServiceManagerContext() {
service_manager::mojom::ServiceRequest packaged_services_request;
if (service_manager::ServiceManagerIsRemote()) {
auto invitation =
mojo::edk::IncomingBrokerClientInvitation::AcceptFromCommandLine(
mojo::edk::TransportProtocol::kLegacy);
... | vuln | Safe | C/C++ |
flatpak_context_merge (FlatpakContext *context,
FlatpakContext *other)
{
GHashTableIter iter;
gpointer key, value;
gboolean no_home = FALSE;
gboolean no_host = FALSE;
context->shares &= ~other->shares_valid;
context->shares |= other->shares;
context->shares_valid |= other->shares_v... | vuln | Safe | C/C++ |
int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
{
struct super_block *sb = inode->i_sb;
ext4_lblk_t punch_start, punch_stop;
handle_t *handle;
unsigned int credits;
loff_t new_size, ioffset;
int ret;
/*
* We need to test this early because xfstests assumes that a
* collapse range of ... | vuln | Vulnerable | Unknown |
void recompute_ideal_colors_2planes(
const image_block& blk,
const error_weight_block& ewb,
const block_size_descriptor& bsd,
const decimation_info& di,
int weight_quant_mode,
const uint8_t* dec_weights_quant_pvalue_plane1,
const uint8_t* dec_weights_quant_pvalue_plane2,
endpoints& ep,
vfloat4& rgbs_vector,
v... | vuln | Vulnerable | Unknown |
static int read_part_of_packet(AVFormatContext *s, int64_t *pts,
int *len, int *strid, int read_packet) {
AVIOContext *pb = s->pb;
PVAContext *pvactx = s->priv_data;
int syncword, streamid, reserved, flags, length, pts_flag;
int64_t pva_pts = AV_NOPTS_VALUE, startpos;
... | vuln | Safe | C/C++ |
static void clear_commits(BDRVVVFATState* s)
{
int i;
DLOG(fprintf(stderr, "clear_commits (%d commits)\n", s->commits.next));
for (i = 0; i < s->commits.next; i++) {
commit_t* commit = array_get(&(s->commits), i);
assert(commit->path || commit->action == ACTION_WRITEOUT);
if (commit->action != ACTION_WRITEOU... | vuln | Safe | C/C++ |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2005-2012
*
* This file is part of GPAC / MPEG2-TS sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as publishe... | vuln | Safe | C/C++ |
@Override
public void accept(Location location) {
String response = Utils.buildCoordinatesResponse(location.getLatitude(), location.getLongitude());
Utils.sendSms(smsManager, response , sender);
} | vuln | Vulnerable | Java |
/*
* L2TPv3 IP encapsulation support for IPv6
*
* Copyright (c) 2012 Katalix Systems Ltd
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your ... | vuln | Safe | C/C++ |
xfs_attr_shortform_addname(xfs_da_args_t *args)
{
int newsize, forkoff, retval;
trace_xfs_attr_sf_addname(args);
retval = xfs_attr_shortform_lookup(args);
if ((args->flags & ATTR_REPLACE) && (retval == -ENOATTR)) {
return retval;
} else if (retval == -EEXIST) {
if (args->flags & ATTR_CREATE)
return retv... | vuln | Safe | C/C++ |
bool read_ujpg( void )
{
using namespace IOUtil;
using namespace Sirikata;
// colldata.start_decoder_worker_thread(std::bind(&simple_decoder, &colldata, str_in));
unsigned char ujpg_mrk[ 64 ];
// this is where we will enable seccomp, before reading user data
write_byte_bill(Billing::HEADER, true,... | vuln | Vulnerable | C/C++ |
def parse_encoding(
ft: DictionaryObject, space_code: int
) -> Tuple[Union[str, Dict[int, str]], int]:
encoding: Union[str, List[str], Dict[int, str]] = []
if "/Encoding" not in ft:
try:
if "/BaseFont" in ft and cast(str, ft["/BaseFont"]) in charset_encoding:
encoding = d... | vuln | Safe | Python |
@Override
public void onExit(int exitCode) {
if (exitCode != 0) {
JVMCrashActivity.startCrashActivity(activity, exitCode);
Logging.LOG.log(Level.INFO, "JVM crashed, start jvm crash activity to show errors now!");
android.os.Process.killProcess(android.os.Process.myPid());... | vuln | Safe | Java |
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (C) 2016 Namjae Jeon <linkinjeon@kernel.org>
* Copyright (C) 2018 Samsung Electronics Co., Ltd.
*/
#include "glob.h"
#include "nterr.h"
#include "smb_common.h"
#include "smbstatus.h"
#include "mgmt/user_session.h"
#include "connection.h"
static int ch... | vuln | Vulnerable | C/C++ |
static int piv_validate_general_authentication(sc_card_t *card,
const u8 * data, size_t datalen,
u8 * out, size_t outlen)
{
piv_private_data_t * priv = PIV_DATA(card);
int r, tmplen, tmplen2;
u8 *p;
const unsigned char *p2;
size_t taglen;
size_t bodylen;
unsigned int cla, tag;
unsigned int real_alg_id... | vuln | Safe | C/C++ |
static void qemu_rdma_cleanup(RDMAContext *rdma)
{
struct rdma_cm_event *cm_event;
int ret, idx;
if (rdma->cm_id && rdma->connected) {
if (rdma->error_state) {
RDMAControlHeader head = { .len = 0,
.type = RDMA_CONTROL_ERROR,
... | vuln | Safe | C/C++ |
public CharSequence target() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>");
_builder.newLine();
_builder.append("<?pde version=\"3.8\"?>");
_builder.newLine();
_builder.append("<target name=\"");
St... | vuln | Vulnerable | Java |
IMPEG2D_ERROR_CODES_T impeg2d_init_video_state(dec_state_t *ps_dec, e_video_type_t e_video_type)
{
/*-----------------------------------------------------------------------*/
/* Bit Stream that conforms to MPEG-1 <ISO/IEC 11172-2> standard */
/*----------------------------------------------------------------... | vuln | Vulnerable | C/C++ |
static void gen_logicq_cc(TCGv_i64 val)
{
TCGv tmp = new_tmp();
gen_helper_logicq_cc(tmp, val);
gen_logic_CC(tmp);
dead_tmp(tmp);
} | vuln | Vulnerable | C/C++ |
static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
{
AVFilterContext *ctx = inlink->dst;
SignatureContext *sic = ctx->priv;
StreamContext *sc = &(sic->streamcontexts[FF_INLINK_IDX(inlink)]);
FineSignature* fs;
static const uint8_t pot3[5] = { 3*3*3*3, 3*3*3, 3*3, 3, 1 };
static ... | vuln | Vulnerable | C/C++ |
function displayChannelAutoreplies() {
var tbody = $('.js-autoreplies-tbody');
var rows = "";
var shouldSortTable = true;
for (var i = 0; i < channelData.autoReplies.length; i++) {
var reply = channelData.autoReplies[i];
var row = '<tr>';
row += '<td class="js-autoreplies-editcol... | vuln | Vulnerable | JavaScript |
public static boolean noCommandSuggestions() {
if (noCommandSuggestions == null || Modules.get() == null || Modules.get().get(NoRender.class) == null) return false;
return Modules.get().get(NoRender.class).isActive() && noCommandSuggestions.get();
} | vuln | Safe | Java |
Database::Database() {
QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"));
QSettings qs;
QStringList datapaths;
int i;
datapaths << g.qdBasePath.absolutePath();
datapaths << QDesktopServices::storageLocation(QDesktopServices::DataLocation);
#if defined(Q_OS_UNIX) && ! defined(Q_OS_MAC)
datapa... | vuln | Vulnerable | Unknown |
static void mips_cpu_realizefn(DeviceState *dev, Error **errp)
{
MIPSCPU *cpu = MIPS_CPU(dev);
MIPSCPUClass *mcc = MIPS_CPU_GET_CLASS(dev);
cpu_reset(CPU(cpu));
mcc->parent_realize(dev, errp);
} | vuln | Vulnerable | C/C++ |
static void virtio_net_device_realize(DeviceState *dev, Error **errp)
{
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
VirtIONet *n = VIRTIO_NET(dev);
NetClientState *nc;
int i;
virtio_init(vdev, "virtio-net", VIRTIO_ID_NET, n->config_size);
n->max_queues = MAX(n->nic_conf.peers.queues, 1);
n->vqs... | vuln | Vulnerable | C/C++ |
static void shm_destroy(struct ipc_namespace *ns, struct shmid_kernel *shp)
{
ns->shm_tot -= (shp->shm_segsz + PAGE_SIZE - 1) >> PAGE_SHIFT;
shm_rmid(ns, shp);
shm_unlock(shp);
if (!is_file_hugepages(shp->shm_file))
shmem_lock(shp->shm_file, 0, shp->mlock_user);
else if (shp->mlock_user)
user_shm_unlock(file_i... | vuln | Vulnerable | C/C++ |
static void vapic_exit(struct kvm_vcpu *vcpu)
{
struct kvm_lapic *apic = vcpu->arch.apic;
int idx;
if (!apic || !apic->vapic_addr)
return;
idx = srcu_read_lock(&vcpu->kvm->srcu);
kvm_release_page_dirty(apic->vapic_page);
mark_page_dirty(vcpu->kvm, apic->vapic_addr >> PAGE_SHIFT);
srcu_read_unlock(&vcpu->kvm->s... | vuln | Vulnerable | C/C++ |
// SPDX-License-Identifier: GPL-2.0+
/*
* (C) Copyright 2014
* DENX Software Engineering
* Heiko Schocher <hs@denx.de>
*
* (C) Copyright 2008 Semihalf
*
* (C) Copyright 2000-2004
* DENX Software Engineering
* Wolfgang Denk, wd@denx.de
*
* Updated-by: Prafulla Wadaskar <prafulla@marvell.com>
* FIT image spe... | vuln | Vulnerable | C/C++ |
/*
date-and-time.js (c) KNOWLEDGECODE | MIT
*/
(function(q){var d={},t={},r={},m="en",v={MMMM:"January February March April May June July August September October November December".split(" "),MMM:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),dddd:"Sunday Monday Tuesday Wednesday Thursday Friday Saturda... | vuln | Vulnerable | JavaScript |
// Copyright 2019 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.
// +build ignore
/*
This program reads a file containing function prototypes
(like syscall_aix.go) and generates system call bodies.
The prototypes are marked ... | vuln | Safe | Go |
null);mxEvent.consume(G)})))}if(null!=z)for(B=0;B<z.length;B++){var D=document.createElement("div");D.style.marginTop=null!=t||0<B?"6px":"0px";D.appendChild(this.graph.createLinkForHint(z[B].getAttribute("href"),mxUtils.getTextContent(z[B])));this.linkHint.appendChild(D)}}null!=this.linkHint&&Graph.sanitizeNode(this.li... | vuln | Safe | JavaScript |
@Override
public List<HttpCookie> getCookies() {
final ArrayList<HttpCookie> returnValue = new ArrayList<>();
for (List<HttpCookie> cookieList : mCookieMap.values()){
// Use an iterator instead of a foreach to avoid ConcurrentModificationException
final Iterator<HttpCookie> iterator = cookieList.iterator();... | vuln | Vulnerable | Java |
static void get_sensor_evt_status(IPMIBmcSim *ibs,
uint8_t *cmd, unsigned int cmd_len,
uint8_t *rsp, unsigned int *rsp_len,
unsigned int max_rsp_len)
{
IPMISensor *sens;
IPMI_CHECK_CMD_LEN(3);
if ((cmd[2] >... | vuln | Safe | C/C++ |
var { Cache, normalizePath, split, forEach } = require('./')
var setCache = new Cache(512),
getCache = new Cache(512)
function makeSafe(path, param) {
var result = param,
parts = split(path),
isLast
forEach(parts, function(part, isBracket, isArray, idx, parts) {
isLast = idx === parts.length - 1
... | vuln | Vulnerable | JavaScript |
public String extractText(InputStream stream, String type, String encoding) throws IOException {
try {
CharArrayWriter writer = new CharArrayWriter();
ExtractorHandler handler = new ExtractorHandler(writer);
// TODO: Use a pull parser to avoid the memory overhead
SAXParserFactory factory = SAXParserFacto... | vuln | Safe | Java |
@Redirect(method = "apply", at = @At(value = "INVOKE", target = "Ljava/util/List;add(Ljava/lang/Object;)Z"))
private boolean addFallbackLanguage(List<LanguageDefinition> list, Object e) {
LanguageDefinition en_us = this.languageDefs.get("en_us");
boolean ret = false;
List<String> fallbackLan... | vuln | Vulnerable | Java |
def search
escaped = params[:name].gsub('\\', '\\\\\\\\').gsub('%', '\%').gsub('_', '\_')
@searched = Restaurant.where("name like ? or hurigana like ?", "%#{escaped}%", "%#{escaped}%")
if @searched.empty?
@error = "ζ€η΄’γ―γΌγγγγγγγΎγγγ§γγγγγδΈεΊ¦ε
₯γγͺγγγ¦δΈγγγ"
end
end | vuln | Safe | Ruby |
PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
const char *default_model,
const char *default_devaddr)
{
Error *err = NULL;
PCIDevice *res;
if (qemu_show_nic_models(nd->model, pci_nic_models))
exit(0);
res = pci_nic_init... | vuln | Vulnerable | C/C++ |
/*
* This file is part of the KubeVirt 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 applicable la... | vuln | Safe | Go |
@SubscribeEvent(priority = EventPriority.HIGH, receiveCanceled = true)
public void onPacketReceive(PacketEvent.Receive event) {
SPacketSpawnObject packet;
if (event.getPacket() instanceof SPacketSpawnObject && (packet = event.getPacket()).getType() == 51) {
this.hasPacketBroke = false;
... | vuln | Safe | Java |
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | vuln | Vulnerable | Python |
def rename
Log.add_info(request, params.inspect)
return unless request.post?
@folder = Folder.find(params[:id])
unless Folder.check_user_auth(@folder.id, @login_user, 'w', true)
flash[:notice] = 'ERROR:' + t('folder.need_auth_to_modify')
render(:partial => 'ajax_folder_name', :layout => f... | vuln | Safe | Ruby |
static void aml_free(gpointer data, gpointer user_data)
{
Aml *var = data;
build_free_array(var->buf);
} | vuln | Vulnerable | C/C++ |
sg_fill_request_table(Sg_fd *sfp, sg_req_info_t *rinfo)
{
Sg_request *srp;
int val;
unsigned int ms;
val = 0;
list_for_each_entry(srp, &sfp->rq_list, entry) {
if (val > SG_MAX_QUEUE)
break;
rinfo[val].req_state = srp->done + 1;
rinfo[val].problem =
srp->header.masked_status &
srp->header.host_statu... | vuln | Safe | Unknown |
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++ |
int MemIo::seek( int64_t offset, Position pos )
{
int64_t newIdx = 0;
switch (pos) {
case BasicIo::cur: newIdx = p_->idx_ + offset; break;
case BasicIo::beg: newIdx = offset; break;
case BasicIo::end: newIdx = p_->size_ + offset; break;
}
if (newIdx < 0)
... | vuln | Safe | Unknown |
@Override
public void registerMap() {
map(Type.VAR_INT, Type.INT); //Entity Id
map(Type.SHORT); //Slot
map(Type.ITEM, Types1_7_6_10.COMPRESSED_NBT_ITEM); //Item
handler(packetWrapper -> {
Item item = packetWrapper.get(Types1_7_6_10.COMPRESSED_NBT_ITEM, 0);
ItemRewriter.toClient(item);
... | vuln | Vulnerable | Java |
void memory_region_transaction_commit(void)
{
AddressSpace *as;
assert(memory_region_transaction_depth);
--memory_region_transaction_depth;
if (!memory_region_transaction_depth) {
if (memory_region_update_pending) {
MEMORY_LISTENER_CALL_GLOBAL(begin, Forward);
QTAILQ_FORE... | vuln | Vulnerable | C/C++ |
void FUNCC(ff_h264_idct8_add)(uint8_t *_dst, int16_t *_block, int stride){
int i;
pixel *dst = (pixel*)_dst;
dctcoef *block = (dctcoef*)_block;
stride >>= sizeof(pixel)-1;
block[0] += 32;
for( i = 0; i < 8; i++ )
{
const int a0 = block[i+0*8] + block[i+4*8];
const int a2 = ... | vuln | Vulnerable | C/C++ |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 agreed t... | vuln | Safe | JavaScript |
package handlers
import (
"net/http"
"strconv"
"strings"
)
// CORSOption represents a functional option for configuring the CORS middleware.
type CORSOption func(*cors) error
type cors struct {
h http.Handler
allowedHeaders []string
allowedMethods []string
allowedOrigins ... | vuln | Vulnerable | Go |
static int64_t ivshmem_recv_msg(IVShmemState *s, int *pfd, Error **errp)
{
int64_t msg;
int n, ret;
n = 0;
do {
ret = qemu_chr_fe_read_all(&s->server_chr, (uint8_t *)&msg + n,
sizeof(msg) - n);
if (ret < 0) {
if (ret == -EINTR) {
... | vuln | Safe | C/C++ |
public int getHoningProgress(ItemStack itemStack) {
CompoundNBT tag = NBTHelper.getTag(itemStack);
if (tag.contains(honeProgressKey)) {
return tag.getInt(honeProgressKey);
}
return getHoningLimit(itemStack);
} | vuln | Vulnerable | Java |
private static void checkCEKLength(final SecretKey cek, final EncryptionMethod enc)
throws KeyLengthException {
if (enc.cekBitLength() != ByteUtils.bitLength(cek.getEncoded())) {
throw new KeyLengthException("The Content Encryption Key (CEK) length for " + enc + " must be " + enc.cekBitLength() + " bits");
}
... | vuln | Vulnerable | Java |
static struct htx_sl *h2_prepare_htx_reqline(uint32_t fields, struct ist *phdr, struct htx *htx, unsigned int *msgf)
{
struct ist uri, meth_sl;
unsigned int flags = HTX_SL_F_NONE;
struct htx_sl *sl;
size_t i;
if ((fields & H2_PHDR_FND_METH) && isteq(phdr[H2_PHDR_IDX_METH], ist("CONNECT"))) {
if (fields & H2_PHD... | vuln | Vulnerable | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.