code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
int expand_downwards(struct vm_area_struct *vma,
unsigned long address)
{
struct mm_struct *mm = vma->vm_mm;
struct vm_area_struct *prev;
int error = 0;
address &= PAGE_MASK;
if (address < mmap_min_addr)
return -EPERM;
/* Enforce stack_guard_gap */
prev = vma->vm_prev;
/* Check that both stack segmen... | vuln | Safe | Unknown |
public String[] getToIds() {
return toIds;
} | vuln | Vulnerable | Java |
void showCreateNewFileDialog(TreeNode<TreeFile> node) {
if (!createNewFileDialog.isShowing()) {
createNewFileDialog.show();
EditText fileName = createNewFileDialog.findViewById(android.R.id.text1);
Button createBttn = createNewFileDialog.findViewById(android.R.id.button1);
... | vuln | Safe | Java |
public void encodeHeadersAndProperties(final ByteBuf buffer) {
final TypedProperties properties = getProperties();
messageIDPosition = buffer.writerIndex();
buffer.writeLong(messageID);
SimpleString.writeNullableSimpleString(buffer, address);
if (userID == null) {
buffer.writeByte... | vuln | Vulnerable | Java |
/*
* Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
*
* Author: zccrs <zccrs@live.com>
*
* Maintainer: zccrs <zhangjide@deepin.com>
*
* 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 Foun... | vuln | Vulnerable | C/C++ |
/*
* Copyright (c) 2014 Open Grid Computing, Inc. All rights reserved.
* Copyright (c) 2005-2006 Network Appliance, Inc. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Vers... | vuln | Vulnerable | C/C++ |
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* th... | vuln | Vulnerable | Java |
TfLiteStatus EvalMean(TfLiteContext* context, TfLiteNode* node) {
OpContext op_context(context, node);
OpData* data = reinterpret_cast<OpData*>(node->user_data);
int num_axis = static_cast<int>(NumElements(op_context.axis));
TfLiteTensor* temp_index = GetTemporary(context, node, /*index=*/0);
TfLiteTensor* r... | vuln | Vulnerable | C/C++ |
asmlinkage long sys_oabi_epoll_wait(int epfd,
struct oabi_epoll_event __user *events,
int maxevents, int timeout)
{
struct epoll_event *kbuf;
mm_segment_t fs;
long ret, err, i;
if (maxevents <= 0 ||
maxevents > (INT_MAX/sizeof(*kbuf)) ||
maxevents > (INT_MAX/sizeof(*events)))
return -EINVAL... | vuln | Safe | Unknown |
void CharCodeToUnicode::addMapping(CharCode code, char *uStr, int n,
int offset) {
CharCode oldLen, i;
Unicode u;
char uHex[5];
int j;
if (code >= mapLen) {
oldLen = mapLen;
mapLen = (code + 256) & ~255;
if (unlikely(code >= mapLen)) {
error(-1, "Illegal code value in CharCodeToUnico... | vuln | Safe | C/C++ |
void PluginChannel::OnChannelConnected(int32 peer_pid) {
base::ProcessHandle handle;
if (!base::OpenProcessHandle(peer_pid, &handle)) {
NOTREACHED();
}
renderer_handle_ = handle;
NPChannelBase::OnChannelConnected(peer_pid);
} | vuln | Vulnerable | C/C++ |
static Image *ReadPNGImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
Image
*image;
MagickBooleanType
logging,
status;
MngInfo
*mng_info;
char
magic_number[MaxTextExtent];
ssize_t
count;
/*
Open image file.
*/
assert(image_info != (const ImageInfo *) NULL);
... | vuln | Safe | C/C++ |
static void machvirt_init(MachineState *machine)
{
VirtMachineState *vms = VIRT_MACHINE(machine);
VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(machine);
qemu_irq pic[NUM_IRQS];
MemoryRegion *sysmem = get_system_memory();
MemoryRegion *secure_sysmem = NULL;
int n, virt_max_cpus;
MemoryRegio... | vuln | Vulnerable | C/C++ |
static void iscsi_readcapacity_sync(IscsiLun *iscsilun, Error **errp)
{
struct scsi_task *task = NULL;
struct scsi_readcapacity10 *rc10 = NULL;
struct scsi_readcapacity16 *rc16 = NULL;
int retries = ISCSI_CMD_RETRIES;
do {
if (task != NULL) {
scsi_free_scsi_task(task);
... | vuln | Safe | C/C++ |
/* radare - LGPL - Copyright 2010-2018 - pancake */
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <r_util.h>
#include "armass16_const.h"
// TODO: only lo registers accessible in thumb arm
typedef struct {
ut64 off;
ut32 o;
char op[128];
char opstr[128];
char *a[16]; /* o... | vuln | Vulnerable | C/C++ |
Unix.files = function(paths, end) {
var self = this;
assertPaths('paths', paths);
assertFunction('end', end);
var files = {};
var queue = new Queue(1); // Concurrency yields no improvement with lsof.
queue.onData = function(paths, end) {
var escapedPaths = paths.map(
function(path) {
retur... | vuln | Vulnerable | JavaScript |
int qcow2_check_refcounts(BlockDriverState *bs)
{
BDRVQcowState *s = bs->opaque;
int64_t size;
int nb_clusters, refcount1, refcount2, i;
QCowSnapshot *sn;
uint16_t *refcount_table;
int ret, errors = 0;
size = bdrv_getlength(bs->file);
nb_clusters = size_to_clusters(s, size);
refcount... | vuln | Vulnerable | C/C++ |
static int mpegts_write_end(AVFormatContext *s)
{
MpegTSWrite *ts = s->priv_data;
MpegTSWriteStream *ts_st;
MpegTSService *service;
AVStream *st;
int i;
for(i = 0; i < s->nb_streams; i++) {
st = s->streams[i];
ts_st = st->priv_data;
if (ts_st->payload_index > 0) {
... | vuln | Safe | C/C++ |
static LUA_FUNCTION(openssl_x509_check_ip)
{
X509 * cert = CHECK_OBJECT(1, X509, "openssl.x509");
size_t sz;
const char *ip = luaL_checklstring(L, 2, &sz);
int flags = luaL_optint(L, 3, 0);
int ret = X509_check_ip(cert, (const unsigned char*)ip, sz, flags);
return openssl_push_check_result(L, ret, NULL);
} | vuln | Safe | C/C++ |
DVMuxContext* dv_init_mux(AVFormatContext* s)
{
DVMuxContext *c;
AVStream *vst = NULL;
int i;
if (s->nb_streams > 3)
return NULL;
c = av_mallocz(sizeof(DVMuxContext));
if (!c)
return NULL;
c->n_ast = 0;
c->ast[0] = c->ast[1] = NULL;
for (i=0; i<s->nb_streams... | vuln | Vulnerable | C/C++ |
@Override
public void onViewCreated(@NonNull View view, Bundle savedInstance) {
final FragmentActivity activity = getActivity();
if (activity == null) {
return;
}
mMembersAdapter = new MembersAdapter();
mFailureListener = new UiUtils.ToastFailureListener(activity... | vuln | Vulnerable | Java |
/* p_lx_elf.cpp --
This file is part of the UPX executable compressor.
Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2020 Laszlo Molnar
Copyright (C) 2000-2020 John F. Reiser
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them... | vuln | Vulnerable | C/C++ |
@Remote(called = Loc.server, targets = Loc.client)
public static void sendChatMessage(Player player, String message){
//do not receive chat messages from clients that are too young or not registered
if(net.server() && player != null && player.con != null && (Time.timeSinceMillis(player.con.connectT... | vuln | Safe | Java |
void SetClipboardText(const char *text)
{
#if defined(PLATFORM_DESKTOP)
glfwSetClipboardString(CORE.Window.handle, text);
#endif
#if defined(PLATFORM_WEB)
emscripten_run_script(TextFormat("navigator.clipboard.writeText('%s')", text));
#endif
} | vuln | Vulnerable | C/C++ |
static void vfio_disable_msix(VFIODevice *vdev)
{
msix_unset_vector_notifiers(&vdev->pdev);
if (vdev->nr_vectors) {
vfio_disable_irqindex(vdev, VFIO_PCI_MSIX_IRQ_INDEX);
vfio_disable_msi_common(vdev);
DPRINTF("%s(%04x:%02x:%02x.%x)\n", __func__, vdev->host.domain,
vdev->host.bus, vde... | vuln | Vulnerable | C/C++ |
void* ipc_rcu_alloc(int size)
{
void* out;
/*
* We prepend the allocation with the rcu struct, and
* workqueue if necessary (for vmalloc).
*/
if (rcu_use_vmalloc(size)) {
out = vmalloc(HDRLEN_VMALLOC + size);
if (out) {
out += HDRLEN_VMALLOC;
container_of(out, struct ipc_rcu_hdr, data)->is_vma... | vuln | Vulnerable | C/C++ |
private static boolean needsLookupRemoval() {
Manifest manifest;
try {
manifest = ManifestUtil.readManifest(LogManager.class);
} catch (IOException | URISyntaxException e) {
Log.warn(LogCategory.GAME_PROVIDER, "Can't read Log4J2 Manifest", e);
return true;
}
if (manifest == null) return true;
St... | vuln | Safe | Java |
static long pipe_set_size(struct pipe_inode_info *pipe, unsigned long nr_pages)
{
struct pipe_buffer *bufs;
/*
* We can shrink the pipe, if arg >= pipe->nrbufs. Since we don't
* expect a lot of shrink+grow operations, just free and allocate
* again like we would do for growing. If the pipe currently
* contai... | vuln | Vulnerable | C/C++ |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 shavitmichael, OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | vuln | Safe | Python |
/* 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 | C/C++ |
bool PM_io_parser<PMDEC>::read_hedge(Halfedge_handle e)
{ // syntax: index { opposite, prev, next, vertex, face, mark }
int n, eo, epr, ene, v, f; bool m;
if ( !(in >> n) ||
!check_sep("{") ||
!(in >> eo) || !check_sep(",") ||
!(in >> epr) || !check_sep(",") ||
!(in >> ene) || !check_sep... | vuln | Safe | Unknown |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # Django settings for OMERO.web project. # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
#
# Copyright (c) 2008-2016 University of ... | vuln | Vulnerable | Python |
@Override
public void onAuthenticated(Bundle savedInstanceState) {
setContentView(R.layout.activity_logcat);
setSupportActionBar(findViewById(R.id.toolbar));
mViewModel = new ViewModelProvider(this).get(LogViewerViewModel.class);
mProgressIndicator = findViewById(R.id.progress_linear... | 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 | C/C++ |
int CertManager::Validate()
{
CertList::reverse_iterator last = peerList_.rbegin();
size_t count = peerList_.size();
while ( count > 1 ) {
TaoCrypt::Source source((*last)->get_buffer(), (*last)->get_length());
TaoCrypt::CertDecoder cert(source, true, &signers_, verifyNone_);
if (in... | vuln | Safe | Unknown |
public void onDisable() {
if (mc.world != null) {
for(int i = 0; i < incr; i++) {
mc.world.removeEntityFromWorld((-1234 + i));
}
}
listPlayers.clear();
} | vuln | Safe | Java |
/* Copyright 2019 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 |
static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
const uint8_t *buf, int buf_size,
int first_field)
{
int i, cid, ret;
int old_bit_depth = ctx->bit_depth, bitdepth;
uint64_t header_prefix;
if (buf_size < 0x280) {
av_l... | vuln | Vulnerable | C/C++ |
package com.salesmanager.shop.store.controller.category;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.stream.Collectors;
import javax.... | vuln | Vulnerable | Java |
static bool pdb_samba_dsdb_set_trusteddom_pw(struct pdb_methods *m,
const char* domain, const char* pwd,
const struct dom_sid *sid)
{
struct pdb_samba_dsdb_state *state = talloc_get_type_abort(
m->private_data, struct pdb_samba_dsdb_state);
TALLOC_CTX *tmp_ctx = talloc_stackframe();
const char ... | vuln | Vulnerable | Unknown |
static int search_func(_UNUSED_ struct ldb_kv_private *ldb_kv,
struct ldb_val key,
struct ldb_val val,
void *state)
{
struct ldb_context *ldb;
struct ldb_kv_context *ac;
struct ldb_message *msg, *filtered_msg;
int ret;
bool matched;
ac = talloc_get_type(state, struct ldb_kv_context);
... | vuln | Vulnerable | Unknown |
void FetchManager::Loader::Start() {
if (!ContentSecurityPolicy::ShouldBypassMainWorld(execution_context_) &&
!execution_context_->GetContentSecurityPolicy()->AllowConnectToSource(
fetch_request_data_->Url())) {
PerformNetworkError(
"Refused to connect to '" + fetch_request_data_->Url... | vuln | Vulnerable | C/C++ |
public void configure(ConfigurableProvider provider)
{
provider.addAlgorithm("KeyPairGenerator.DH", PREFIX + "KeyPairGeneratorSpi");
provider.addAlgorithm("Alg.Alias.KeyPairGenerator.DIFFIEHELLMAN", "DH");
provider.addAlgorithm("KeyAgreement.DH", PREFIX + "KeyAgreementSpi");... | vuln | Safe | Java |
bmexec_trans (kwset_t kwset, char const *text, size_t size)
{
unsigned char const *d1;
char const *ep, *sp, *tp;
int d;
int len = kwset->mind;
char const *trans = kwset->trans;
if (len == 0)
return 0;
if (len > size)
return -1;
if (len == 1)
{
tp = memchr_kwset (text, size, kwset);
... | vuln | Safe | Unknown |
WORK_STATE tls_finish_handshake(SSL *s, WORK_STATE wst)
{
void (*cb) (const SSL *ssl, int type, int val) = NULL;
#ifndef OPENSSL_NO_SCTP
if (SSL_IS_DTLS(s) && BIO_dgram_is_sctp(SSL_get_wbio(s))) {
WORK_STATE ret;
ret = dtls_wait_for_dry(s);
if (ret != WORK_FINISHED_CONTINUE)
... | vuln | Vulnerable | C/C++ |
public synchronized void waitUntilReady(ThreadRole role) {
// Update thread fields with the newly known one (we're synchronized on `this`, so we can just access them
// as we want)
if (role == ThreadRole.ACQUIRE) {
acquireThread = Thread.currentThread();
}... | vuln | Safe | Java |
@Override
public void handle(RoutingContext routingContext) {
if (routingContext.user() == null) {
routingContext.fail(FORBIDDEN_CODE, FORBIDDEN_EXCEPTION);
} else {
// before starting any potential async operation here
// pause parsing the request body. The reason is that
// we don't ... | vuln | Vulnerable | Java |
STATIC ptr_t GC_alloc_large_and_clear(size_t lb, int k, unsigned flags)
{
ptr_t result;
word n_blocks = OBJ_SZ_TO_BLOCKS(lb);
GC_ASSERT(I_HOLD_LOCK());
result = GC_alloc_large(lb, k, flags);
if (result != NULL
&& (GC_debugging_started || GC_obj_kinds[k].ok_init)) {
/* Clear the wh... | vuln | Vulnerable | Unknown |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite/handler/oauth2 (interfaces: RefreshTokenStrategy)
// Package internal is a generated GoMock package.
package internal
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
fosite "github.com/ory/fosite"
)
... | vuln | Vulnerable | Go |
"""
.. module: lemur.common.utils
:platform: Unix
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
import base64
import json
import random
import re
import socket
import ssl
import string
i... | vuln | Vulnerable | Python |
static PHP_FUNCTION(xmlwriter_open_uri)
{
char *valid_file = NULL;
xmlwriter_object *intern;
xmlTextWriterPtr ptr;
char *source;
char resolved_path[MAXPATHLEN + 1];
int source_len;
#ifdef ZEND_ENGINE_2
zval *this = getThis();
ze_xmlwriter_object *ze_obj = NULL;
#endif
#ifndef ZEND_ENGINE_2
xmlOutputBufferPtr... | vuln | Safe | Unknown |
/*
* FreeRTOS Kernel V10.4.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, ... | vuln | Safe | C/C++ |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
int num_inputs = NumInputs(node);
TF_LITE_ENSURE(context, num_inputs >= 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input1 = GetInput(context, node, kInputTensor1);
TfLiteTensor* output = GetOutput(context, node, kO... | vuln | Vulnerable | C/C++ |
@Override
public void systemReady() {
enforceSystemOrRoot("Only the system can claim the system is ready");
mSystemReady = true;
final ContentResolver resolver = mContext.getContentResolver();
ContentObserver co = new ContentObserver(mHandler) {
@Override
pub... | vuln | Safe | Java |
int main(int argc, char **argv) {
swaylock_log_init(LOG_ERROR);
initialize_pw_backend(argc, argv);
srand(time(NULL));
enum line_mode line_mode = LM_LINE;
state.failed_attempts = 0;
state.args = (struct swaylock_args){
.mode = BACKGROUND_MODE_FILL,
.font = strdup("sans-serif"),
.font_size = 0,
.radius = 5... | vuln | Vulnerable | C/C++ |
public boolean tryAcquire(int numPermits) {
if (numPermits > maxPermits) {
acquire(maxPermits);
return tryAcquire(numPermits - maxPermits);
} else {
return acquire(numPermits);
}
} | vuln | Vulnerable | Java |
DataBuf PngChunk::readRawProfile(const DataBuf& text,bool iTXt)
{
DataBuf info;
unsigned char unhex[103]={0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,1, 2,3,4,5,6,7,8,9,0,0,
0,0,0,... | vuln | Safe | C/C++ |
__htab_map_lookup_and_delete_batch(struct bpf_map *map,
const union bpf_attr *attr,
union bpf_attr __user *uattr,
bool do_delete, bool is_lru_map,
bool is_percpu)
{
struct bpf_htab *htab = container_of(map, struct bpf_htab, map);
u32 bucket_cnt, total, key_size, value_size, roundup_key_siz... | vuln | Safe | C/C++ |
static void s390_init(ram_addr_t my_ram_size,
const char *boot_device,
const char *kernel_filename,
const char *kernel_cmdline,
const char *initrd_filename,
const char *cpu_model)
{
CPUState *env = NULL;
... | vuln | Safe | C/C++ |
PS_READ_FUNC(mm)
{
PS_MM_DATA;
ps_sd *sd;
int ret = FAILURE;
mm_lock(data->mm, MM_LOCK_RD);
/* If there is an ID and strict mode, verify existence */
if (PS(use_strict_mode)
&& ps_mm_key_exists(data, key TSRMLS_CC) == FAILURE) {
/* key points to PS(id), but cannot change here. */
if (key) {
efree(PS(id... | vuln | Safe | Unknown |
package dao
import (
"errors"
"github.com/bluele/gcache"
jsoniter "github.com/json-iterator/go"
"github.com/px-org/PanIndex/module"
_115 "github.com/px-org/PanIndex/pan/115"
"github.com/px-org/PanIndex/pan/123"
"github.com/px-org/PanIndex/pan/ali"
"github.com/px-org/PanIndex/pan/base"
"github.com/px-org/PanIn... | vuln | Safe | Go |
public static void performAttack(LivingEntity attacker, Entity target, AttackConfig config) {
if (attacker instanceof Player player && player.getGameMode() == GameMode.SPECTATOR && config.isSpectatingEnabled()) {
makeSpectate(player, target);
return;
}
float damage = attacker.getAttributeValue(Attribute.... | vuln | Safe | Java |
static void ogg_write_pages(AVFormatContext *s, int flush)
{
OGGContext *ogg = s->priv_data;
OGGPageList *next, *p;
if (!ogg->page_list)
return;
for (p = ogg->page_list; p; ) {
OGGStreamContext *oggstream =
s->streams[p->page.stream_index]->priv_data;
if (oggstream->p... | vuln | Vulnerable | C/C++ |
_asn1_convert_integer (const unsigned char *value, unsigned char *value_out,
int value_out_size, int *len)
{
char negative;
unsigned char val[SIZEOF_UNSIGNED_LONG_INT];
long valtmp;
int k, k2;
valtmp = _asn1_strtol (value, NULL, 10);
for (k = 0; k < SIZEOF_UNSIGNED_LONG_INT; k++)
{
val[... | vuln | Safe | Unknown |
static int klsi_105_get_line_state(struct usb_serial_port *port,
unsigned long *line_state_p)
{
int rc;
u8 *status_buf;
__u16 status;
dev_info(&port->serial->dev->dev, "sending SIO Poll request\n");
status_buf = kmalloc(KLSI_STATUSBUF_LEN, GFP_KERNEL);
if (!status_buf)
return -ENOMEM;
status_buf[0] =... | vuln | Safe | C/C++ |
function manage() {
expHistory::set('manageable', $this->params);
/* The global constants can be overriden by passing appropriate params */
//sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet
$require_login = empty($this->params['require_log... | vuln | Vulnerable | PHP |
// SPDX-License-Identifier: BSD-2-Clause
/*
* Copyright (c) 2015-2016, Linaro Limited
* Copyright (c) 2014, STMicroelectronics International N.V.
*/
#include <assert.h>
#include <bench.h>
#include <compiler.h>
#include <initcall.h>
#include <io.h>
#include <kernel/linker.h>
#include <kernel/msg_param.h>
#include <k... | vuln | Safe | C/C++ |
def post(self):
""" Update an OVPN configuration file
---
description: >-
Returns an OVPN configuration file with renewed keypair. This
allows the node to connect to the VPN server again if the keypair was
invalidated.\n
This endpoint is not accessible fo... | vuln | Vulnerable | Python |
static void
ns_input(void)
{
uint8_t flags = 0;
LOG_INFO("Received NS from ");
LOG_INFO_6ADDR(&UIP_IP_BUF->srcipaddr);
LOG_INFO_(" to ");
LOG_INFO_6ADDR(&UIP_IP_BUF->destipaddr);
LOG_INFO_(" with target address ");
LOG_INFO_6ADDR((uip_ipaddr_t *) (&UIP_ND6_NS_BUF->tgtipaddr));
LOG_INFO_("\n");
UIP_ST... | vuln | Vulnerable | C/C++ |
ccp_run_sha_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
{
struct ccp_sha_engine *sha = &cmd->u.sha;
struct ccp_dm_workarea ctx;
struct ccp_data src;
struct ccp_op op;
unsigned int ioffset, ooffset;
unsigned int digest_size;
int sb_count;
const void *init;
u64 block_size;
int ctx_size;
int ret;
sw... | vuln | Vulnerable | C/C++ |
static MagickBooleanType SkipDXTMipmaps(Image *image,DDSInfo *dds_info,
int texel_size,ExceptionInfo *exception)
{
register ssize_t
i;
MagickOffsetType
offset;
size_t
h,
w;
/*
Only skip mipmaps for textures and cube maps
*/
if (EOFBlob(image) != MagickFalse)
{
ThrowFileExc... | vuln | Vulnerable | Unknown |
static int http_RecvPostMessage(
/*! HTTP Parser object. */
http_parser_t *parser,
/*! [in] Socket Information object. */
SOCKINFO *info,
/*! File where received data is copied to. */
char *filename,
/*! Send Instruction object which gives information whether the file
* is a virtual file or not. */
struct Sen... | vuln | Safe | C/C++ |
nouveau_sgdma_create_ttm(struct ttm_buffer_object *bo, uint32_t page_flags)
{
struct nouveau_drm *drm = nouveau_bdev(bo->bdev);
struct nouveau_sgdma_be *nvbe;
nvbe = kzalloc(sizeof(*nvbe), GFP_KERNEL);
if (!nvbe)
return NULL;
if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA)
nvbe->ttm.ttm.func = ... | vuln | Vulnerable | Unknown |
void applyTaskFragmentTransactionLocked(@NonNull WindowContainerTransaction wct,
@WindowManager.TransitionType int type, boolean shouldApplyIndependently) {
if (!isValidTransaction(wct)) {
return;
}
enforceTaskFragmentOrganizerPermission("applyTaskFragmentTransaction()",
... | vuln | Vulnerable | Java |
static void fill_table(uint8_t* table[256 + 2*YUVRGB_TABLE_HEADROOM], const int elemsize,
const int64_t inc, void *y_tab)
{
int i;
uint8_t *y_table = y_tab;
y_table -= elemsize * (inc >> 9);
for (i = 0; i < 256 + 2*YUVRGB_TABLE_HEADROOM; i++) {
int64_t cb = av_clip(i-YUVRG... | vuln | Safe | C/C++ |
'''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
'''
import codecs
from abc import ABCMeta, abstractmethod
import os
import string
import typing
import yaml
try:
from yaml import CSafeLoader as SafeLoader, CSafeDumper as SafeDumper
except ImportError:
from yaml impo... | vuln | Vulnerable | Python |
default long[] getIntermediateCommunities(long nodeId) {
var dendrograms = dendrogramManager().getAllDendrograms();
int levels = ranLevels();
long[] communities = new long[levels];
for (int i = 0; i < levels; i++) {
communities[i] = dendrograms[i].get(nodeId);
}
... | vuln | Vulnerable | Java |
static int vqf_read_packet(AVFormatContext *s, AVPacket *pkt)
{
VqfContext *c = s->priv_data;
int ret;
int size = (c->frame_bit_len - c->remaining_bits + 7)>>3;
if (av_new_packet(pkt, size+2) < 0)
return AVERROR(EIO);
pkt->pos = avio_tell(s->pb);
pkt->stream_index = 0;
pkt->... | vuln | Vulnerable | C/C++ |
/*
* EJS Embedded JavaScript templates
* Copyright 2112 Matthew Eernisse (mde@fleegix.org)
*
* 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/L... | vuln | Vulnerable | JavaScript |
static int local_open(FsContext *ctx, V9fsPath *fs_path,
int flags, V9fsFidOpenState *fs)
{
char *buffer;
char *path = fs_path->data;
int fd;
buffer = rpath(ctx, path);
fd = open(buffer, flags | O_NOFOLLOW);
g_free(buffer);
if (fd == -1) {
return -1;
}
f... | vuln | Vulnerable | C/C++ |
public void run() {
LOG.info("Index Health Monitor: Starting...");
while (true) {
try {
boolean solrHealthy = isSolrHealthy();
if (this.txRecoveryObject == null && solrHealthy) {
startMonitoring();
... | vuln | Vulnerable | Java |
static inline int spx_strategy(AC3DecodeContext *s, int blk)
{
GetBitContext *bc = &s->gbc;
int fbw_channels = s->fbw_channels;
int dst_start_freq, dst_end_freq, src_start_freq,
start_subband, end_subband, ch;
if (s->channel_mode == AC3_CHMODE_MONO) {
s->channel_uses_spx[1] = 1;
... | vuln | Vulnerable | C/C++ |
int64_t ff_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts,
int64_t pos_min, int64_t pos_max, int64_t pos_limit,
int64_t ts_min, int64_t ts_max, int flags, int64_t *ts_ret,
int64_t (*read_timestamp)(struct AVFormatContext *, int , int6... | vuln | Vulnerable | C/C++ |
exif_mnote_data_fuji_load (ExifMnoteData *en,
const unsigned char *buf, unsigned int buf_size)
{
ExifMnoteDataFuji *n = (ExifMnoteDataFuji*) en;
ExifLong c;
size_t i, tcount, o, datao;
if (!n || !buf || !buf_size) {
exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
"ExifMnoteDataFuji", "Short MakerNote");
r... | vuln | Safe | Unknown |
var Promise = require('any-promise')
var assert = require('assert')
module.exports = thenify
/**
* Turn async functions into promises
*
* @param {Function} $$__fn__$$
* @return {Function}
* @api public
*/
function thenify($$__fn__$$, options) {
assert(typeof $$__fn__$$ === 'function')
return eval(createWr... | vuln | Vulnerable | JavaScript |
def _get_fc_wwpns(self):
for key in self._storage_nodes:
node = self._storage_nodes[key]
ssh_cmd = ['svcinfo', 'lsnode', '-delim', '!', node['id']]
raw = self._run_ssh(ssh_cmd)
resp = CLIResponse(raw, delim='!', with_header=False)
wwpns = set(node['WWP... | vuln | Safe | Python |
const bootbox = require('bootbox');
require('../services/Requisitions');
const RequisitionNode = require('../model/RequisitionNode');
const RequisitionMetaDataEntry = require('../model/RequisitionMetaDataEntry');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(functi... | vuln | Vulnerable | Java |
@Override
public void onBlockPlacedBy(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull BlockState state, @Nullable LivingEntity placer, @Nonnull ItemStack stack) {
for (Position position : Position.values()) {
for (int i = 0; i < 4; i++) {
BlockPos pos1 = pos.up(i);
... | vuln | Safe | 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, transparency,... | vuln | Vulnerable | Unknown |
static int rtl8139_can_receive(VLANClientState *nc)
{
RTL8139State *s = DO_UPCAST(NICState, nc, nc)->opaque;
int avail;
if (!s->clock_enabled)
return 1;
if (!rtl8139_receiver_enabled(s))
return 1;
if ((s->Cfg9346 & Chip9346_op_mask) != Cfg9346_Normal)
return 0;
if (rtl8139... | vuln | Safe | C/C++ |
package state
import (
"github.com/tendermint/tendermint/types"
)
//------------------------------------------------------
// blockchain services types
// NOTE: Interfaces used by RPC must be thread safe!
//------------------------------------------------------
//----------------------------------------------------... | vuln | Vulnerable | Go |
void qmp_guest_suspend_disk(Error **errp)
{
Error *local_err = NULL;
GuestSuspendMode *mode = g_new(GuestSuspendMode, 1);
*mode = GUEST_SUSPEND_MODE_DISK;
check_suspend_mode(*mode, &local_err);
acquire_privilege(SE_SHUTDOWN_NAME, &local_err);
execute_async(do_suspend, mode, &local_err);
if (... | vuln | Safe | C/C++ |
if(!self.define){const e=e=>{"require"!==e&&(e+=".js");let r=Promise.resolve();return i[e]||(r=new Promise((async r=>{if("document"in self){const i=document.createElement("script");i.src=e,document.head.appendChild(i),i.onload=r}else importScripts(e),r()}))),r.then((()=>{if(!i[e])throw new Error(`Module ${e} didn’t reg... | vuln | Vulnerable | JavaScript |
static int scsi_get_configuration(SCSIDiskState *s, uint8_t *outbuf)
{
int current;
if (s->qdev.type != TYPE_ROM) {
return -1;
}
if (media_is_dvd(s)) {
current = MMC_PROFILE_DVD_ROM;
} else if (media_is_cd(s)) {
current = MMC_PROFILE_CD_ROM;
} else {
current = MMC... | vuln | Safe | C/C++ |
# -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | vuln | Vulnerable | Python |
errcode_t ext2fs_flush2(ext2_filsys fs, int flags)
{
dgrp_t i;
errcode_t retval;
unsigned long fs_state;
__u32 feature_incompat;
struct ext2_super_block *super_shadow = 0;
struct ext2_group_desc *group_shadow = 0;
#ifdef WORDS_BIGENDIAN
struct ext2_group_desc *gdp;
dgrp_t j;
#endif
char *group_ptr;
blk64_t... | vuln | Safe | C/C++ |
PJ_DEF(int) pj_scan_get_char( pj_scanner *scanner )
{
int chr = *scanner->curptr;
if (!chr) {
pj_scan_syntax_err(scanner);
return 0;
}
++scanner->curptr;
if (PJ_SCAN_IS_PROBABLY_SPACE(*scanner->curptr) && scanner->skip_ws) {
pj_scan_skip_whitespace(scanner);
}
return chr;
} | vuln | Vulnerable | Unknown |
function insertServiceCategorieInDB(){
global $pearDB, $centreon;
if (testServiceCategorieExistence($_POST["sc_name"])){
$DBRESULT = $pearDB->query("INSERT INTO `service_categories` (`sc_name`, `sc_description`, `level`, `icon_id`, `sc_activate` )
VALUES ('".$pearDB->escape($_P... | vuln | Safe | PHP |
void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords)
{
BN_ULONG t;
int i;
bn_wcheck_size(a, nwords);
bn_wcheck_size(b, nwords);
assert(a != b);
assert((condition & (condition - 1)) == 0);
assert(sizeof(BN_ULONG) >= sizeof(int));
condition = ((condition - 1) >> ... | vuln | Safe | Unknown |
rsvg_end_element (void *data, const xmlChar * name)
{
RsvgHandle *ctx = (RsvgHandle *) data;
if (ctx->priv->handler_nest > 0 && ctx->priv->handler != NULL) {
if (ctx->priv->handler->end_element != NULL)
ctx->priv->handler->end_element (ctx->priv->handler, (const char *) name);
ctx->... | vuln | Safe | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.