code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static void mov_update_dts_shift(MOVStreamContext *sc, int duration)
{
if (duration < 0) {
sc->dts_shift = FFMAX(sc->dts_shift, -duration); | vuln | Vulnerable | C/C++ |
private ChannelInitializer<SocketChannel> createChannelInitializer() {
String redisUsername = configSupplier.get().getRedisUsername();
return new ChannelInitializer<SocketChannel>() {
@Override
public void initChannel(SocketChannel socketChannel) {
if (logger.isDebugEnabled()) {
l... | vuln | Safe | Java |
int nbd_client_co_flush(BlockDriverState *bs)
{
NBDClientSession *client = nbd_get_client_session(bs);
NBDRequest request = { .type = NBD_CMD_FLUSH };
NBDReply reply;
ssize_t ret;
if (!(client->nbdflags & NBD_FLAG_SEND_FLUSH)) {
return 0;
}
request.from = 0;
request.len = 0;
... | vuln | Vulnerable | C/C++ |
public static boolean shouldDrawOverlayForItem(ItemStack itemStack, TileEntity tileEntity) {
if (tileEntity instanceof MetaTileEntityHolder) {
if(!((MetaTileEntityHolder) tileEntity).getMetaTileEntity().canRenderMachineGrid())
return false;
}
if (tileEntity instanceo... | vuln | Vulnerable | Java |
protected void validateProperty(final Property property, final String areaOfPlot,
final String eastBoundary, final String westBoundary, final String southBoundary,
final String northBoundary, final String propTypeId,
final String modifyRsn, final Date propCompletionDate, final Long v... | vuln | Safe | Java |
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == Activity.RESULT_OK && data != null) {
Uri uri = data.getData();
try {
InputStream inputStream = get... | vuln | Safe | Java |
static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t flags)
{
int isv34, unsync;
unsigned tlen;
char tag[5];
int64_t next, end = avio_tell(s->pb) + len;
int taghdrlen;
const char *reason = NULL;
AVIOContext pb;
unsigned char *buffer = NULL;
int buffer_size... | vuln | Vulnerable | C/C++ |
public void setDataSource(FileDescriptor fd, long offset, long length)
throws IOException, IllegalArgumentException, IllegalStateException {
ParcelFileDescriptor modernFd = FileUtils.convertToModernFd(fd);
if (modernFd == null) {
_setDataSource(fd, offset, length);
} else... | vuln | Vulnerable | Java |
var recipesTables = $('#recipes-table').DataTable({
'order': [[1, 'asc']],
'columnDefs': [
{ 'orderable': false, 'targets': 0 },
{ 'searchable': false, "targets": 0 },
{ 'orderData': 2, 'targets': 1 }
],
select: {
style: 'single',
selector: 'tr td:not(:first-child)'
},
'initComplete': function()
{
t... | vuln | Vulnerable | JavaScript |
public static int cleanUpDirectoryContent(File directory) throws IOException {
int counter = 0;
File[] allDirFiles = directory.listFiles();
if (allDirFiles != null) {
for (int i = 0; i < allDirFiles.length; i++) {
File aFile = allDirFiles[i];
if (aFile.isDirectory()) {
counte... | vuln | Safe | Java |
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { parseDate } = require('@/utils/parse-date');
const { isValidHost } = require('@/utils/valid-host');
module.exports = async (ctx) => {
const { domain = 'news', tag } = ctx.params;
if (!isValidHost(domain)) {
throw Error('Inv... | vuln | Safe | JavaScript |
def get_list(doctype, *args, **kwargs):
'''wrapper for DatabaseQuery'''
kwargs.pop('cmd', None)
kwargs.pop('ignore_permissions', None)
kwargs.pop('data', None)
kwargs.pop('strict', None)
# If doctype is child table
if frappe.is_table(doctype):
# Example frappe.db.get_list('Purchase Receipt Item', {'parent': '... | vuln | Safe | Python |
def retrieve_videos_from_playlist(playlist_id, db):
db.execute("SELECT id, title, thumbnail, position from video WHERE playlist_id={playlist_id} ORDER BY position ASC;".format(
playlist_id=playlist_id))
rows = db.fetchall()
return rows | vuln | Vulnerable | Python |
def index
valid_http_methods :get, :post
# for permission check
if params[:package] and not ["_repository", "_jobhistory"].include?(params[:package])
pkg = DbPackage.get_by_project_and_name( params[:project], params[:package], use_source=false )
else
prj = DbProject.get_by_name params[:proj... | vuln | Safe | Ruby |
int wait_for_key_construction(struct key *key, bool intr)
{
int ret;
ret = wait_on_bit(&key->flags, KEY_FLAG_USER_CONSTRUCT,
intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE);
if (ret)
return -ERESTARTSYS;
if (test_bit(KEY_FLAG_NEGATIVE, &key->flags)) {
smp_rmb();
return key->reject_error;
}
return ke... | vuln | Vulnerable | Unknown |
/*
* 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 n... | vuln | Safe | Java |
static int h2c_decode_headers(struct h2c *h2c, struct buffer *rxbuf, uint32_t *flags)
{
const uint8_t *hdrs = (uint8_t *)b_head(&h2c->dbuf);
struct buffer *tmp = get_trash_chunk();
struct http_hdr list[MAX_HTTP_HDR * 2];
struct buffer *copy = NULL;
unsigned int msgf;
struct htx *htx = NULL;
int flen; // header f... | vuln | Safe | C/C++ |
static bool raw_handler(int proto, const struct sa *src,
const struct sa *dst, struct mbuf *mb)
{
struct allocation *al;
uint16_t numb, len;
struct perm *perm;
struct chan *chan;
const struct sa *psa;
int err;
al = allocation_find(proto, src, dst);
if (!al)
return false;
if (mbuf_get_left(mb) < 4)
ret... | vuln | Safe | C/C++ |
static void gf_media_update_bitrate_ex(GF_ISOFile *file, u32 track, Bool use_esd)
{
#ifndef GPAC_DISABLE_ISOM_WRITE
u32 i, count, timescale, db_size, cdur, csize;
u64 time_wnd, max_rate, avg_rate, bitrate;
Double br;
GF_ISOSample sample;
db_size = 0;
max_rate = avg_rate = time_wnd = bitrate = 0;
csize = 0;
cd... | vuln | Vulnerable | C/C++ |
private void addPointCarefully(Vector3d p) {
ArrayList<Vector3d> hull2 = new ArrayList<Vector3d>();
hull.add(p);
// first is left-most point in the set.
Vector3d pointOnHull = hull.get(0);
for( Vector3d n : hull ) {
if(pointOnHull.x>n.x) pointOnHull=n;
}
Vector3d firstPoint = pointOnHull;
Vector3... | vuln | Vulnerable | Java |
void TaskService::RunTask(InstanceId instance_id,
RunnerId runner_id,
base::OnceClosure task) {
{
base::AutoLock tasks_in_flight_auto_lock(tasks_in_flight_lock_);
++tasks_in_flight_;
}
if (IsInstanceIdStillBound(instance_id))
std::move(task).Run... | vuln | Safe | C/C++ |
def sqlalchemy_scheme(self) -> str:
"""SQLAlchemy scheme either from constructor, connection extras or default."""
return (
self._sqlalchemy_scheme
or self.connection_extra_lower.get("sqlalchemy_scheme")
or self.DEFAULT_SQLALCHEMY_SCHEME
) | vuln | Vulnerable | Python |
//
// 数据库管理模块
//
// TODO: 数据管理模块目前的代码存在大量冗余,后期会考虑将 数据库驱动 与 core 分成两个块来做
// import React from 'react';
// import ReactDOM from 'react-dom';
// import AceEditor from 'react-ace';
const LANG = antSword['language']['database'];
const LANG_T = antSword['language']['toastr'];
class Database {
constructor(opt) {
this... | vuln | Vulnerable | JavaScript |
: htmlspecialchars($host['User'])) . '</label></td>' . "\n"
. '<td>' . htmlspecialchars($host['Host']) . '</td>' . "\n";
$html_output .= '<td>';
$password_column = 'Password';
$check_plugin_query = "SELECT * FROM `mysql`.`user` WHERE "
. "`User` = '... | vuln | Vulnerable | PHP |
/* exif-mnote-data-fuji.c
*
* Copyright (c) 2002 Lutz Mueller <lutz@users.sourceforge.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (... | vuln | Vulnerable | C/C++ |
static bool virtio_scsi_data_plane_handle_cmd(VirtIODevice *vdev,
VirtQueue *vq)
{
VirtIOSCSI *s = (VirtIOSCSI *)vdev;
assert(s->ctx && s->dataplane_started);
return virtio_scsi_handle_cmd_vq(s, vq);
} | vuln | Vulnerable | C/C++ |
// Sandstorm - Personal Cloud Sandbox
// Copyright (c) 2014 Sandstorm Development Group, Inc. and contributors
// 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
//
/... | vuln | Vulnerable | JavaScript |
t42_parse_sfnts( T42_Face face,
T42_Loader loader )
{
T42_Parser parser = &loader->parser;
FT_Memory memory = parser->root.memory;
FT_Byte* cur;
FT_Byte* limit = parser->root.limit;
FT_Error error;
FT_Int num_tables = 0;
FT_ULong count, ttf_si... | vuln | Vulnerable | C/C++ |
protected void initializeItemHandler() {
if (level.isClientSide || itemHandler.isPresent())
return;
if (!level.isLoaded(controller))
return;
BlockEntity te = level.getBlockEntity(controller);
if (te == null || !(te instanceof BeltTileEntity))
return;
BeltInventory inventory = ((BeltTileEntity) te).ge... | vuln | Vulnerable | Java |
extract_archive_thread (GSimpleAsyncResult *result,
GObject *object,
GCancellable *cancellable)
{
ExtractData *extract_data;
LoadData *load_data;
GHashTable *checked_folders;
GHashTable *created_files;
GHashTable *folders_created_during_extr... | vuln | Vulnerable | C/C++ |
std::string ExtensionTtsController::GetMatchingExtensionId(
Utterance* utterance) {
ExtensionService* service = utterance->profile()->GetExtensionService();
DCHECK(service);
ExtensionEventRouter* event_router =
utterance->profile()->GetExtensionEventRouter();
DCHECK(event_router);
const ExtensionL... | vuln | Vulnerable | C/C++ |
static void print_notice(BIO *out, USERNOTICE *notice, int indent)
{
int i;
if (notice->noticeref) {
NOTICEREF *ref;
ref = notice->noticeref;
BIO_printf(out, "%*sOrganization: %.*s\n", indent, "",
ref->organization->length,
ref->organization->data);
... | vuln | Safe | Unknown |
/* Copyright 2018 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | vuln | Safe | Python |
func extractTarDirectory(root, prefix string, r io.Reader) error {
tr := tar.NewReader(r)
for {
header, err := tr.Next()
if err != nil {
if err == io.EOF {
return nil
}
return err
}
// Name check
name := header.Name
path, err := filepath.Rel(prefix, name)
if err != nil {
return err
}
... | vuln | Vulnerable | Go |
def __init__(self, request, model, list_display, list_display_links,
list_filter, date_hierarchy, search_fields, list_select_related,
list_per_page, list_max_show_all, list_editable, model_admin):
self.model = model
self.opts = model._meta
self.lookup_opts = self.opts
... | vuln | Safe | Python |
void ScanLineInputFile::initialize(const Header& header)
{
_data->header = header;
_data->lineOrder = _data->header.lineOrder();
const Box2i &dataWindow = _data->header.dataWindow();
_data->minX = dataWindow.min.x;
_data->maxX = dataWindow.max.x;
_data->minY = dataWind... | vuln | Vulnerable | C/C++ |
static void spapr_core_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
Error **errp)
{
MachineState *machine = MACHINE(OBJECT(hotplug_dev));
MachineClass *mc = MACHINE_GET_CLASS(hotplug_dev);
Error *local_err = NULL;
CPUCore *cc = CPU_CORE(dev);
char *base_cor... | vuln | Safe | C/C++ |
v8::Handle<v8::Value> V8ThrowException::createDOMException(v8::Isolate* isolate, int ec, const String& sanitizedMessage, const String& unsanitizedMessage, const v8::Handle<v8::Object>& creationContext)
{
if (ec <= 0 || v8::V8::IsExecutionTerminating())
return v8Undefined();
ASSERT(ec == SecurityError |... | vuln | Vulnerable | C/C++ |
void CoordinatorImpl::RequestGlobalMemoryDump(
MemoryDumpType dump_type,
MemoryDumpLevelOfDetail level_of_detail,
const std::vector<std::string>& allocator_dump_names,
const RequestGlobalMemoryDumpCallback& callback) {
auto adapter = [](const RequestGlobalMemoryDumpCallback& callback,
... | vuln | Vulnerable | C/C++ |
static pj_bool_t on_accept_complete2(pj_ssl_sock_t *ssock,
pj_ssl_sock_t *new_ssock,
const pj_sockaddr_t *src_addr,
int src_addr_len,
pj_status_t accept_status)
{
struct tls_listener *listener;
struct tls_transport *tls;
pj_ssl_sock_info ssl_info;
char addr[PJ_IN... | vuln | Safe | C/C++ |
/*
* Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com>
* 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 co... | vuln | Vulnerable | C/C++ |
public static String getText(String key) {
String value = getString(key);
if (value == null) {
log.debug("Cannot find key '" + key + "' in properties file.");
return key;
}
return value.replaceAll("\\&", "");
} | vuln | Vulnerable | Java |
static inline int wv_unpack_mono(WavpackFrameContext *s, GetBitContext *gb,
void *dst, const int type)
{
int i, j, count = 0;
int last, t;
int A, S, T;
int pos = s->pos;
uint32_t crc = s->sc.crc;
uint32_t crc_extra_bits = s->extra_sc... | vuln | Safe | C/C++ |
void decode(const char * in0, int size, FilterCharVector & out) const {
const Chr * in = reinterpret_cast<const Chr *>(in0);
if (size == -sizeof(Chr)) {
for (;*in; ++in)
out.append(*in, sizeof(Chr));
} else if (size <= -1) {
fprintf(stderr, "%s\n", unsupported_null_term_wide_... | vuln | Safe | Unknown |
/* vi:set ts=8 sts=4 sw=4 noet:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
#include "vim.h"
#if defined(HAVE_WCHAR_H)... | vuln | Vulnerable | C/C++ |
void PaymentRequest::Retry(mojom::PaymentValidationErrorsPtr errors) {
if (!IsInitialized()) {
log_.Error("Attempted retry without initialization");
OnConnectionTerminated();
return;
}
if (!IsThisPaymentRequestShowing()) {
log_.Error("Attempted retry without show");
OnConnectionTerminate... | vuln | Safe | C/C++ |
int pcistg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2)
{
CPUS390XState *env = &cpu->env;
uint64_t offset, data;
S390PCIBusDevice *pbdev;
MemoryRegion *mr;
uint8_t len;
uint32_t fh;
uint8_t pcias;
cpu_synchronize_state(CPU(cpu));
if (env->psw.mask & PSW_MASK_PSTATE) {
p... | vuln | Vulnerable | C/C++ |
DnDCreateRootStagingDirectory(void)
{
const char *root;
/*
* DnD_GetFileRoot() gives us a pointer to a static string, so there's no
* need to free anything.
*/
root = DnD_GetFileRoot();
if (!root) {
return NULL;
}
if (File_Exists(root)) {
if (!DnDRootDirUsable(root) &&
... | vuln | Vulnerable | Unknown |
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case COMPACT_PROCESS_MSG: {
long start = SystemClock.uptimeMillis();
ProcessRecord proc;
final ProcessCachedOptimizerRecord opt;
int ... | vuln | Vulnerable | Java |
static pj_status_t pjsip_auth_verify( const pjsip_authorization_hdr *hdr,
const pj_str_t *method,
const pjsip_cred_info *cred_info )
{
if (pj_stricmp(&hdr->scheme, &pjsip_DIGEST_STR) == 0) {
char digest_buf[PJSIP_MD5STRLEN];
pj_str_t digest;
pj_status_t status;
const pjsip_digest_credential ... | vuln | Safe | Unknown |
static void i8042_stop(struct serio *serio)
{
struct i8042_port *port = serio->port_data;
port->exists = false;
/*
* We synchronize with both AUX and KBD IRQs because there is
* a (very unlikely) chance that AUX IRQ is raised for KBD port
* and vice versa.
*/
synchronize_irq(I8042_AUX_IRQ);
synchronize_i... | vuln | Vulnerable | Unknown |
public static void register(PacketDirection direction, Class<?> packetClass, Supplier<?> packetSupplier, StateRegistry.PacketMapping... mappings) {
switch (direction) {
case CLIENTBOUND: {
register(LIMBO_STATE_REGISTRY.clientbound, packetClass, packetSupplier, mappings);
break;
}
c... | vuln | Safe | Java |
@Nonnull
@Override
public LogsQueryResult stepLog(@Nonnull String jobFullName, @Nonnull int runNumber, @Nonnull String flowNodeId, @Nonnull String traceId, @Nonnull String spanId, boolean complete) {
Span span = tracer.spanBuilder("ElasticsearchLogStorageRetriever.stepLog").startSpan();
final C... | vuln | Vulnerable | Java |
static void *createArrayObject(const redisReadTask *task, size_t elements) {
redisReply *r, *parent;
r = createReplyObject(task->type);
if (r == NULL)
return NULL;
if (elements > 0) {
if (SIZE_MAX / sizeof(redisReply*) < elements) return NULL; /* Don't overflow */
r->element =... | vuln | Safe | Unknown |
static void ppc_spapr_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)
{
... | vuln | Vulnerable | C/C++ |
public void testSelectByUse() {
JWKSelector selector = new JWKSelector(new JWKMatcher.Builder().keyUse(KeyUse.ENCRYPTION).build());
List<JWK> keyList = new ArrayList<>();
keyList.add(new RSAKey.Builder(new Base64URL("n"), new Base64URL("e")).keyID("1").keyUse(KeyUse.ENCRYPTION).build());
keyList.add(new ECKey... | vuln | Safe | Java |
void PixelBufferRasterWorkerPool::CheckForCompletedRasterTasks() {
TRACE_EVENT0(
"cc", "PixelBufferRasterWorkerPool::CheckForCompletedRasterTasks");
DCHECK(should_notify_client_if_no_tasks_are_pending_);
check_for_completed_raster_tasks_callback_.Cancel();
check_for_completed_raster_tasks_pending_ = fal... | vuln | Vulnerable | C/C++ |
int ZlibOutStream::overrun(int itemSize, int nItems)
{
#ifdef ZLIBOUT_DEBUG
vlog.debug("overrun");
#endif
if (itemSize > bufSize)
throw Exception("ZlibOutStream overrun: max itemSize exceeded");
checkCompressionLevel();
while (end - ptr < itemSize) {
zs->next_in = start;
zs->avail_in = ptr - star... | vuln | Vulnerable | C/C++ |
int fscrypt_get_crypt_info(struct inode *inode)
{
struct fscrypt_info *crypt_info;
struct fscrypt_context ctx;
struct crypto_skcipher *ctfm;
const char *cipher_str;
int keysize;
u8 *raw_key = NULL;
int res;
res = fscrypt_initialize(inode->i_sb->s_cop->flags);
if (res)
return res;
if (!inode->i_... | vuln | Vulnerable | C/C++ |
public function notify_edge_mode() {
w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/ui.php');
w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/admin_ui.php');
$message = sprintf(__('<p>You can now keep W3 Total Cache up-to-date without having to worry about new features breaking your website. There will b... | vuln | Safe | PHP |
private void saveMessage(GUIMessage message, Session session, long recipientId) throws ServerException {
Context context = Context.get();
SystemMessageDAO dao = (SystemMessageDAO) context.getBean(SystemMessageDAO.class);
UserDAO uDao = (UserDAO) context.getBean(UserDAO.class);
try {
User user = uDao.findByI... | vuln | Safe | Java |
static bool parse_notify(struct pool *pool, json_t *val)
{
char *job_id, *prev_hash, *coinbase1, *coinbase2, *bbversion, *nbit,
*ntime, header[228];
unsigned char *cb1 = NULL, *cb2 = NULL;
size_t cb1_len, cb2_len, alloc_len;
bool clean, ret = false;
int merkles, i;
json_t *arr;
arr = json_array_get(val, 4... | vuln | Safe | C/C++ |
/*
* tls.c - SSL/TLS/DTLS dissector
*
* Copyright (C) 2016-20 - ntop.org
*
* This file is part of nDPI, an open source deep packet inspection
* library based on the OpenDPI and PACE technology by ipoque GmbH
*
* nDPI is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser... | vuln | Safe | C/C++ |
@Override
protected void initGame() {
try {
//load the current game state
Optional<List<String>> optionalData = ReadGameData.readData();
if (optionalData.isPresent()) {
List<String> gameData = optionalData.get();
gameWorld = getGameWorld(... | vuln | Safe | Java |
// SPDX-License-Identifier: BSD-2-Clause
/*
* Copyright (c) 2014, STMicroelectronics International N.V.
*/
#include <assert.h>
#include <compiler.h>
#include <crypto/crypto.h>
#include <kernel/tee_ta_manager.h>
#include <mm/tee_mmu.h>
#include <string_ext.h>
#include <string.h>
#include <sys/queue.h>
#include <tee_a... | vuln | Safe | C/C++ |
void Compute(OpKernelContext* const context) override {
// node_ids.
const Tensor* node_ids_t;
OP_REQUIRES_OK(context, context->input("node_ids", &node_ids_t));
const auto node_ids = node_ids_t->vec<int32>();
// gradients.
const Tensor* gradients_t;
OP_REQUIRES_OK(context, context->input("g... | vuln | Vulnerable | Unknown |
const char* _InternalParse(const char* ptr, internal::ParseContext* ctx) {
// Parse a MessageSetItem
auto metadata = reflection->MutableInternalMetadata(msg);
enum class State { kNoTag, kHasType, kHasPayload, kDone };
State state = State::kNoTag;
std::string payload;
uint32_t type_id = 0;
w... | vuln | Safe | Unknown |
void __init kvmclock_init(void)
{
unsigned long mem;
int size;
size = PAGE_ALIGN(sizeof(struct pvclock_vsyscall_time_info)*NR_CPUS);
if (!kvm_para_available())
return;
if (kvmclock && kvm_para_has_feature(KVM_FEATURE_CLOCKSOURCE2)) {
msr_kvm_system_time = MSR_KVM_SYSTEM_TIME_NEW;
msr_kvm_wall_clock = MSR_... | vuln | Safe | Unknown |
TPM_CAP_Unmarshal(TPM_CAP *target, BYTE **buffer, INT32 *size)
{
TPM_RC rc = TPM_RC_SUCCESS;
TPM_CAP orig_target = *target; // libtpms added
if (rc == TPM_RC_SUCCESS) {
rc = UINT32_Unmarshal(target, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
switch (*target) {
case TPM_CAP_ALGS:
case TP... | vuln | Safe | Unknown |
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
setPreferencesFromResource(R.xml.theme_preferences, rootKey);
((Infinity) activity.getApplication()).getAppComponent().inject(this);
if (activity.typeface != null) {
setFont(activity.typeface... | vuln | Safe | Java |
static int kvm_put_msrs(X86CPU *cpu, int level)
{
CPUX86State *env = &cpu->env;
int i;
int ret;
kvm_msr_buf_reset(cpu);
kvm_msr_entry_add(cpu, MSR_IA32_SYSENTER_CS, env->sysenter_cs);
kvm_msr_entry_add(cpu, MSR_IA32_SYSENTER_ESP, env->sysenter_esp);
kvm_msr_entry_add(cpu, MSR_IA32_SYSENTER_E... | vuln | Safe | C/C++ |
int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
rpmpsm psm, char ** failedFile)
{
FD_t payload = rpmtePayload(te);
rpmfi fi = NULL;
rpmfs fs = rpmteGetFileStates(te);
rpmPlugins plugins = rpmtsPlugins(ts);
int rc = 0;
int fx = -1;
int fc = rpmfilesFC(files);
... | vuln | Vulnerable | C/C++ |
static int path_set_attribute(Item *item, const char *path) {
_cleanup_close_ int fd = -1;
struct stat st;
if (!item->attribute_set || item->attribute_mask == 0)
return 0;
fd = open(path, O_CLOEXEC|O_NOFOLLOW|O_PATH);
if (fd < 0)
return log_error... | vuln | Safe | C/C++ |
static int opt_preset(const char *opt, const char *arg)
{
FILE *f=NULL;
char tmp[1000], tmp2[1000], line[1000];
int i;
const char *base[3]= { getenv("HOME"),
"/usr/local/share",
"/usr/share",
};
for(i=!base[0]; i<3 && !f;... | vuln | Safe | C/C++ |
/**
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
*
* The Apereo Foundation licenses this file to you under the Educational
* Community License, Version 2.0 (the ... | vuln | Safe | Java |
function compactBuffers(context, node) {
var out = [node[0]],
memo, i, len, res;
for (i=1, len=node.length; i<len; i++) {
res = compiler.filterNode(context, node[i]);
if (res) {
if (res[0] === 'buffer' || res[0] === 'format') {
if (memo) {
memo[0] = (res[0] === ... | vuln | Safe | JavaScript |
function filterTemplates()
{
var searchTerms = tmplSearchInput.value;
if (searchTerms == '')
{
resetTemplates();
return;
}
if (NewDialog.tagsList[templateFile] == null)
{
var tagsList = {};
for (var cat in categories)
{
var templateList = categories[cat];
for (var i = ... | vuln | Vulnerable | JavaScript |
static void handle_arg_log_filename(const char *arg)
{
qemu_set_log_filename(arg, &error_fatal);
} | vuln | Safe | C/C++ |
void onActivityReparentedToTask(@NonNull ActivityRecord activity) {
final ITaskFragmentOrganizer organizer;
if (activity.mLastTaskFragmentOrganizerBeforePip != null) {
// If the activity is previously embedded in an organized TaskFragment.
organizer = activity.mLastTaskFragmentOr... | vuln | Vulnerable | Java |
static void init_once(void *foo)
{
struct ext4_inode_info *ei = (struct ext4_inode_info *) foo;
INIT_LIST_HEAD(&ei->i_orphan);
init_rwsem(&ei->xattr_sem);
init_rwsem(&ei->i_data_sem);
init_rwsem(&ei->i_mmap_sem);
inode_init_once(&ei->vfs_inode);
} | vuln | Safe | C/C++ |
BlockInterfaceErrorAction drive_get_onerror(BlockDriverState *bdrv)
{
int index;
for (index = 0; index < nb_drives; index++)
if (drives_table[index].bdrv == bdrv)
return drives_table[index].onerror;
return BLOCK_ERR_REPORT;
} | vuln | Vulnerable | C/C++ |
static void ttm_put_pages(struct page **pages, unsigned npages, int flags,
enum ttm_caching_state cstate)
{
struct ttm_page_pool *pool = ttm_get_pool(flags, false, cstate);
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
struct ttm_page_pool *huge = ttm_get_pool(flags, true, cstate);
#endif
unsigned long irq_flags;
unsigne... | vuln | Safe | C/C++ |
void fpm_children_bury() /* {{{ */
{
int status;
pid_t pid;
struct fpm_child_s *child;
while ( (pid = waitpid(-1, &status, WNOHANG | WUNTRACED)) > 0) {
char buf[128];
int severity = ZLOG_NOTICE;
int restart_child = 1;
child = fpm_child_find(pid);
if (WIFEXITED(status)) {
snprintf(buf, sizeof(buf), ... | vuln | Safe | Unknown |
/* 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 | Safe | Python |
/************************************************************************
* 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 | Safe | JavaScript |
var sanitize_html = function (html, allow_css) {
/**
* sanitize HTML
* if allow_css is true (default: false), CSS is sanitized as well.
* otherwise, CSS elements and attributes are simply removed.
*/
var html4 = caja.html4;
if (allow_css) {
// all... | vuln | Vulnerable | JavaScript |
@Transactional
public Optional<JwtDto> reissue(String refreshTokenString) {
if (!jwtUtil.validateRefeshJwt(refreshTokenString)) {
throw new InvalidJwtException();
}
Authentication authentication;
try {
authentication = jwtUtil.getAuthentication(refreshTokenString, false);
} catch (JwtException e) {
... | vuln | Vulnerable | Java |
mrb_f_send(mrb_state *mrb, mrb_value self)
{
mrb_sym name;
mrb_value block, *regs;
mrb_method_t m;
struct RClass *c;
mrb_callinfo *ci = mrb->c->ci;
int n = ci->n;
if (ci->cci > CINFO_NONE) {
funcall:;
const mrb_value *argv;
mrb_int argc;
mrb_get_args(mrb, "n*&", &name, &argv, &argc, &block)... | vuln | Vulnerable | Unknown |
PJ_DEF(pj_status_t) pjsip_endpt_send_response( pjsip_endpoint *endpt,
pjsip_response_addr *res_addr,
pjsip_tx_data *tdata,
void *token,
pjsip_send_callback cb)
{
/* Determine which transports and addresses to send the response,
* based on Section 18.2.2 of RFC 32... | vuln | Safe | C/C++ |
@Override
protected void onStop() {
super.onStop();
unregisterReceiver(receiver);
if (!transfer.get() && !dialogVisible && uploadMessage == null) {
binding.webview.loadUrl("about:blank");
setLastServerConnection(0);
}
} | vuln | Vulnerable | Java |
static int pop_fetch_message(struct Context *ctx, struct Message *msg, int msgno)
{
void *uidl = NULL;
char buf[LONG_STRING];
char path[PATH_MAX];
struct Progress progressbar;
struct PopData *pop_data = (struct PopData *) ctx->data;
struct PopCache *cache = NULL;
struct Header *h = ctx->hdrs[msgno];
uns... | vuln | Safe | C/C++ |
gtTileContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
{
TIFF* tif = img->tif;
tileContigRoutine put = img->put.contig;
uint32 col, row, y, rowstoread;
tmsize_t pos;
uint32 tw, th;
unsigned char* buf = NULL;
int32 fromskew, toskew;
uint32 nrow;
int ret = 1, flip;
ui... | vuln | Safe | C/C++ |
/*!
* \file LoRaMac.c
*
* \brief LoRa MAC layer implementation
*
* \copyright Revised BSD License, see section \ref LICENSE.
*
* \code
* ______ _
* / _____) _ | |
* ( (____ _____ ____ _| |_ ____... | vuln | Safe | C/C++ |
int yr_re_fast_exec(
uint8_t* code,
uint8_t* input_data,
size_t input_forwards_size,
size_t input_backwards_size,
int flags,
RE_MATCH_CALLBACK_FUNC callback,
void* callback_args)
{
RE_REPEAT_ANY_ARGS* repeat_any_args;
uint8_t* code_stack[MAX_FAST_RE_STACK];
uint8_t* input_stack[MAX_FA... | vuln | Safe | Unknown |
// Copyright 2021 dudaodong@gmail.com. All rights reserved.
// Use of this source code is governed by MIT license.
// Package fileutil implements some basic functions for file operations
package fileutil
import (
"archive/zip"
"bufio"
"errors"
"io"
"io/fs"
"io/ioutil"
"net/http"
"os"
"path"
"path/filepath"
... | vuln | Vulnerable | Go |
xmlStopParser(xmlParserCtxtPtr ctxt) {
if (ctxt == NULL)
return;
xmlHaltParser(ctxt);
ctxt->errNo = XML_ERR_USER_STOP;
} | vuln | Safe | Unknown |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityHelper.applyTheme(this);
setContentView(R.layout.activity_contributors);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ActionBar ac... | vuln | Vulnerable | Java |
horAcc16(TIFF* tif, uint8* cp0, tmsize_t cc)
{
tmsize_t stride = PredictorState(tif)->stride;
uint16* wp = (uint16*) cp0;
tmsize_t wc = cc / 2;
assert((cc%(2*stride))==0);
if (wc > stride) {
wc -= stride;
do {
REPEAT4(stride, wp[stride] = (uint16)(((unsigned int)wp[stride] + (unsigned int)wp[0]) & 0xffff)... | vuln | Vulnerable | C/C++ |
struct GuestFileSeek *qmp_guest_file_seek(int64_t handle, int64_t offset,
int64_t whence, Error **errp)
{
GuestFileHandle *gfh = guest_file_handle_find(handle, errp);
GuestFileSeek *seek_data = NULL;
FILE *fh;
int ret;
if (!gfh) {
return NULL;
fh... | vuln | Vulnerable | C/C++ |
/*
* 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 n... | vuln | Vulnerable | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.