code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static void sunkbd_enable(struct sunkbd *sunkbd, bool enable)
{
serio_pause_rx(sunkbd->serio);
sunkbd->enabled = enable;
serio_continue_rx(sunkbd->serio);
} | vuln | Vulnerable | C/C++ |
static MemTxResult access_with_adjusted_size(hwaddr addr,
uint64_t *value,
unsigned size,
unsigned access_size_min,
unsigned access_size_max,
... | vuln | Safe | C/C++ |
void bn_write_str(char *str, int len, const bn_t a, int radix) {
bn_t t;
dig_t d;
int digits, l, i, j;
char c;
bn_null(t);
l = bn_size_str(a, radix);
if (len < l) {
RLC_THROW(ERR_NO_BUFFER);
return;
}
if (radix < 2 || radix > 64) {
RLC_THROW(ERR_NO_VALID);
return;
}
if (bn_is_zero(a) == 1) {
*s... | vuln | Vulnerable | C/C++ |
'select': function(e) {
if((e.hasAttribute('multiple') === false) && $(e).hasClass('nosearch') === false) {
$(e).select2({
dropdownAutoWidth : true,
// break a select option item into multi lines
templateResult: function(item) {
var selectionText = item.text.split('\n');
var returnString = $... | vuln | Vulnerable | JavaScript |
!function(e){function n(e){return RegExp("(\\()"+e+"(?=[\\s\\)])")}function a(e){return RegExp("([\\s([])"+e+"(?=[\\s)])")}var t="[-+*/_~!@$%^=<>{}\\w]+",r="(\\()",s="(?=\\))",i="(?=\\s)",o={heading:{pattern:/;;;.*/,alias:["comment","title"]},comment:/;.*/,string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0,inside:{argument:... | vuln | Safe | JavaScript |
static int decode_slice_header(H264Context *h, H264Context *h0)
{
unsigned int first_mb_in_slice;
unsigned int pps_id;
int ret;
unsigned int slice_type, tmp, i, j;
int last_pic_structure, last_pic_droppable;
int must_reinit;
int needs_reinit = 0;
int field_pic_flag, bottom_field_flag;
... | vuln | Safe | Unknown |
static av_cold int shorten_decode_close(AVCodecContext *avctx)
{
ShortenContext *s = avctx->priv_data;
int i;
for (i = 0; i < s->channels; i++) {
s->decoded[i] = NULL;
av_freep(&s->decoded_base[i]);
av_freep(&s->offset[i]);
}
av_freep(&s->bitstream);
av_freep(&s->coeffs);... | vuln | Safe | C/C++ |
int kvm_arch_remove_hw_breakpoint(target_ulong addr, target_ulong len, int type)
{
return -EINVAL;
} | vuln | Vulnerable | C/C++ |
static void
copy_move_file (CopyMoveJob *copy_job,
GFile *src,
GFile *dest_dir,
gboolean same_fs,
gboolean unique_names,
char **dest_fs_type,
SourceInfo *source_info,
... | vuln | Vulnerable | C/C++ |
handle_keywordonly_args(struct compiling *c, const node *n, int start,
asdl_seq *kwonlyargs, asdl_seq *kwdefaults)
{
PyObject *argname;
node *ch;
expr_ty expression, annotation;
arg_ty arg = NULL;
int i = start;
int j = 0; /* index for kwdefaults and kwonlyargs */
if... | vuln | Safe | C/C++ |
int ff_h264_execute_decode_slices(H264Context *h, unsigned context_count)
{
AVCodecContext *const avctx = h->avctx;
H264SliceContext *sl;
int i;
av_assert0(context_count && h->slice_ctx[context_count - 1].mb_y < h->mb_height);
if (h->avctx->hwaccel ||
h->avctx->codec->capabilities & CODEC_CA... | vuln | Vulnerable | C/C++ |
RenderFrameHostImpl* RenderFrameHostManager::GetFrameHostForNavigation(
const NavigationRequest& request) {
DCHECK(!request.common_params().url.SchemeIs(url::kJavaScriptScheme))
<< "Don't call this method for JavaScript URLs as those create a "
"temporary NavigationRequest and we don't want to res... | vuln | Vulnerable | C/C++ |
public void setAspect(Aspect aspect){
if(holder != null)
holder.stored = aspect;
} | vuln | Vulnerable | Java |
protected SSLEngineResult unwrap(SSLEngine sslEngine, ByteBuffer input, ByteBuffer output) throws SSLException
{
// CVE-2021-28165 - Jetty #6072
// https://github.com/eclipse/jetty.project/security/advisories/GHSA-26vr-8j45-3r4w
SSLEngineResult results = sslEngine.unwrap(input, output);
... | vuln | Safe | Java |
static int vnc_refresh_server_surface(VncDisplay *vd)
{
int y;
uint8_t *guest_row;
uint8_t *server_row;
int cmp_bytes;
VncState *vs;
int has_dirty = 0;
struct timeval tv = { 0, 0 };
if (!vd->non_adaptive) {
gettimeofday(&tv, NULL);
has_dirty = vnc_update_stats(vd, &tv);... | vuln | Vulnerable | Unknown |
def handle(self, request, data):
# For now we'll allow fallback to OPENSTACK_KEYSTONE_URL if the
# form post doesn't include a region.
endpoint = data.get('region', None) or settings.OPENSTACK_KEYSTONE_URL
region_name = dict(self.fields['region'].choices)[endpoint]
request.sessio... | vuln | Vulnerable | Python |
/*
* Copyright (c) 2004-2021, University of Oslo
* 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 copyright notice, this
* list of cond... | vuln | Vulnerable | Java |
static void* swoole_unserialize_object(void *buffer, zval *return_value, zend_uchar bucket_len, zval *args, long flag)
{
zval property;
uint32_t arr_num = 0;
size_t name_len = *((unsigned short*) buffer);
if (!name_len)
{
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "illegal unserialize data")... | vuln | Vulnerable | Unknown |
public void removeItem(String url) {
items.remove(url);
updatedAt = new Date();
} | vuln | Vulnerable | Java |
static int __init ipip_init(void)
{
int err;
printk(banner);
if (xfrm4_tunnel_register(&ipip_handler, AF_INET)) {
printk(KERN_INFO "ipip init: can't register tunnel\n");
return -EAGAIN;
}
err = register_pernet_device(&ipip_net_ops);
if (err)
xfrm4_tunnel_deregister(&ipip_handler, AF_INET);
return err;
... | vuln | Vulnerable | C/C++ |
static cJSON *get_object_item(const cJSON * const object, const char * const name, const cJSON_bool case_sensitive)
{
cJSON *current_element = NULL;
if ((object == NULL) || (name == NULL))
{
return NULL;
}
current_element = object->child;
if (case_sensitive)
{
while ((curre... | vuln | Vulnerable | C/C++ |
PHP_METHOD(Phar, buildFromDirectory)
{
char *dir, *error, *regex = NULL;
size_t dir_len, regex_len = 0;
zend_bool apply_reg = 0;
zval arg, arg2, iter, iteriter, regexiter;
struct _phar_t pass;
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
zend_throw_exception_ex(spl_ce_Unexpec... | vuln | Vulnerable | C/C++ |
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | vuln | Vulnerable | Java |
static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags,
const char *dev_name, void *raw_data)
{
struct super_block *s;
struct ecryptfs_sb_info *sbi;
struct ecryptfs_dentry_info *root_info;
const char *err = "Getting sb failed";
struct inode *inode;
struct path path;
uid_t check_ru... | vuln | Safe | C/C++ |
public function html() {
global $wp_locale;
$wp_version = get_bloginfo( 'version' );
// Get data, new (POST) and old (GET).
$data = $this->merge_or_fetch_data();
$post_title = $this->get_suggested_title( $data );
$post_content = $this->get_suggested_content( $data );
// Get site settings array/data.
... | vuln | Vulnerable | PHP |
private void setupRenderer() {
StructureTemplate schematic = SchematicItem.loadSchematic(activeSchematicItem);
Vec3i size = schematic.getSize();
if (size.equals(Vec3i.ZERO))
return;
Level clientWorld = Minecraft.getInstance().level;
SchematicWorld w = new SchematicWorld(clientWorld);
SchematicWorld wMir... | vuln | Vulnerable | Java |
package com.ruoyi.common.exception.file;
import java.util.Arrays;
import org.apache.commons.fileupload.FileUploadException;
/**
* 文件上传 误异常类
*
* @author ruoyi
*/
public class InvalidExtensionException extends FileUploadException
{
private static final long serialVersionUID = 1L;
private String[] allowedE... | vuln | Vulnerable | Java |
/*!
Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
// eslint-disable-next-line no-undef
RbForm.postAfter = function (data) {
... | vuln | Safe | Java |
static struct dentry *proc_mount(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
{
int err;
struct super_block *sb;
struct pid_namespace *ns;
char *options;
if (flags & MS_KERNMOUNT) {
ns = (struct pid_namespace *)data;
options = NULL;
} else {
ns = task_active_pid_ns(curren... | vuln | Vulnerable | Unknown |
int64_t LineBasedFrameDecoder::findEndOfLine(IOBufQueue& buf) {
Cursor c(buf.front());
for (uint32_t i = 0; i < maxLength_ && i < buf.chainLength(); i++) {
auto b = c.read<char>();
if (b == '\n' && terminatorType_ != TerminatorType::CARRIAGENEWLINE) {
return i;
} else if (terminatorType_ != Termin... | vuln | Vulnerable | C/C++ |
int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *tty)
{
struct vc_data *vc = vc_cons[fg_console].d;
int sel_mode, new_sel_start, new_sel_end, spc;
char *bp, *obp;
int i, ps, pe, multiplier;
u16 c;
struct kbd_struct *kbd = kbd_table + fg_console;
poke_blanked_console();
{ unsigned... | vuln | Safe | Unknown |
/*
* random.c -- A strong random number generator
*
* Copyright (C) 2017 Jason A. Donenfeld <Jason@zx2c4.com>. All
* Rights Reserved.
*
* Copyright Matt Mackall <mpm@selenic.com>, 2003, 2004, 2005
*
* Copyright Theodore Ts'o, 1994, 1995, 1996, 1997, 1998, 1999. All
* rights reserved.
*
* Redistribution and ... | vuln | Safe | C/C++ |
static BROTLI_INLINE size_t BrotliGetRemainingBytes(BrotliBitReader* br) {
static const size_t kCap = (size_t)1 << BROTLI_LARGE_MAX_WBITS;
if (br->avail_in > kCap) return kCap;
return br->avail_in + (BrotliGetAvailableBits(br) >> 3);
} | vuln | Safe | Unknown |
mem_log_init(const char* prog_name, const char *banner)
{
size_t log_name_len;
char *log_name;
if (__test_bit(LOG_CONSOLE_BIT, &debug)) {
log_op = stderr;
return;
}
if (log_op)
fclose(log_op);
log_name_len = 5 + strlen(prog_name) + 5 + 7 + 4 + 1; /* "/tmp/" + prog_name + "_mem." + PID + ".log" + '\0" */
... | vuln | Vulnerable | C/C++ |
public KeyPair generateKeyPair()
{
if (!initialised)
{
DSAParametersGenerator pGen = new DSAParametersGenerator();
pGen.init(strength, certainty, random);
param = new DSAKeyGenerationParameters(random, pGen.generateParameters());
engine.init(param);
... | vuln | Vulnerable | Java |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | vuln | Vulnerable | Python |
static void FUNCC(pred4x4_vertical)(uint8_t *_src, const uint8_t *topright, int _stride){
pixel *src = (pixel*)_src;
int stride = _stride/sizeof(pixel);
const pixel4 a= ((pixel4*)(src-stride))[0];
((pixel4*)(src+0*stride))[0]= a;
((pixel4*)(src+1*stride))[0]= a;
((pixel4*)(src+2*stride))[0]= a;
... | vuln | Vulnerable | C/C++ |
public void flushOutStream() {
if (!session.isActive() || disconnected || outStream == null || outStream.currentOffset == 0) {
return;
}
byte[] temp = new byte[outStream.currentOffset];
System.arraycopy(outStream.buffer, 0, temp, 0, temp.length);
// Packet packet = new Packet(-1, Type.FIXED, Unpooled.wrap... | vuln | Vulnerable | Java |
import logging
import requests
from flask import redirect, url_for, Blueprint, flash, request, session
from redash import models, settings
from redash.authentication import (
create_and_login_user,
logout_and_redirect_to_index,
get_next_path,
)
from redash.authentication.org_resolving import current_org
... | vuln | Safe | Python |
renderPreviewLink() {
const gist = this.state.latestGist;
const user = gist.user || 'anonymous';
const preview = !!gist.files['index.html'];
if(preview) {
return <span><a target="_blank" rel="noopener noreferrer" href={"https://bl.ocks.org/"+user+"/"+gist.id}>Preview</a>,{' '}</span>
}
ret... | vuln | Safe | JavaScript |
public void writeRecordFile() {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yy-MM-dd-HH-mm-ss");
File recordFile = new File(SpeedRunIGT.getRecordsPath().toFile(), simpleDateFormat.format(new Date()) + ".json");
String resultRecord = recordString;
if (resultRecord.isEmpty())... | vuln | Safe | Java |
def _authorizedResource(self, request):
"""
Get the L{IResource} which the given request is authorized to receive.
If the proper authorization headers are present, the resource will be
requested from the portal. If not, an anonymous login attempt will be
made.
"""
... | vuln | Safe | Python |
static void
virtio_blk_deinit(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
{
struct blockif_ctxt *bctxt;
struct virtio_blk *blk;
if (dev->arg) {
DPRINTF(("virtio_blk: deinit\n"));
blk = (struct virtio_blk *) dev->arg;
/* De-init virtio-blk device only on valid bctxt*/
if (!blk->dummy_bctxt) {
bct... | vuln | Vulnerable | C/C++ |
static int get_buffer_internal(AVCodecContext *avctx, AVFrame *frame, int flags)
{
const AVHWAccel *hwaccel = avctx->hwaccel;
int override_dimensions = 1;
int ret;
if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
if ((ret = av_image_check_size2(avctx->width, avctx->height, avctx->max_pixels, AV_PI... | vuln | Vulnerable | C/C++ |
void mips_malta_init (ram_addr_t ram_size, int vga_ram_size,
const char *boot_device,
const char *kernel_filename, const char *kernel_cmdline,
const char *initrd_filename, const char *cpu_model)
{
char buf[1024];
unsigned long bios_offset;
ta... | vuln | Safe | C/C++ |
/**
* Jooby https://jooby.io
* Apache License Version 2.0 https://jooby.io/LICENSE.txt
* Copyright 2014 Edgar Espina
*/
package io.jooby.internal.netty;
import com.typesafe.config.Config;
import io.jooby.Body;
import io.jooby.ByteRange;
import io.jooby.Context;
import io.jooby.Cookie;
import io.jooby.DefaultContex... | vuln | Safe | Java |
import dictionary from './utils/dictionary';
import tracking from './utils/tracking';
import helpers from './utils/helpers';
import path from './utils/path';
import sorting from './utils/sorting';
import lazyLoading from './utils/lazyloading';
import ajax from './plugins/ajax';
import animation from './plugins/animati... | vuln | Safe | JavaScript |
showEmptyFolder: function (albumPath, errorMessage) {
var message = '<div class="icon-gallery"></div>';
var uploadAllowed = true;
this.element.children().detach();
this.removeLoading();
if (!_.isUndefined(errorMessage) && errorMessage !== null) {
message += '<h2>' + t('gallery',
'Album cannot... | vuln | Vulnerable | PHP |
static void vp6_build_huff_tree(VP56Context *s, uint8_t coeff_model[],
const uint8_t *map, unsigned size, VLC *vlc)
{
Node nodes[2*size], *tmp = &nodes[size];
int a, b, i;
tmp[0].count = 256;
for (i=0; i<size-1; i++) {
a = tmp[i].count * coeff_model[i]... | vuln | Safe | C/C++ |
package proxyutil
import (
"context"
"errors"
"log"
"net/http"
"net/http/httputil"
"strings"
"time"
glog "github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/contexthandler"
)
// StatusClientClosedRequest A non-standard status code introduced by nginx
// for the case when a cl... | vuln | Safe | Go |
static int init_die(RzBinDwarfDie *die, ut64 abbr_code, ut64 attr_count) {
if (!die) {
return -1;
}
if (attr_count) {
die->attr_values = calloc(sizeof(RzBinDwarfAttrValue), attr_count);
if (!die->attr_values) {
return -1;
}
} else {
die->attr_values = NULL;
}
die->abbrev_code = abbr_code;
die->capac... | vuln | Safe | Unknown |
@Override
protected void update() {
if(topNet && getFilter().isEmpty())return;
if(cooldown > 0) {
cooldown--;
return;
}
if(!this.getBlockState().get(BlockInventoryHopperBasic.ENABLED))return;
boolean hasFilter = !getFilter().isEmpty();
IItemHandler top = this.top.orElse(EmptyHandler.INSTANCE);
IIte... | vuln | Safe | Java |
// various tools by Adrien Joly
// tests: tests/tess-snips.js
var fs = require('fs');
var urlModule = require('url');
var http = require('http');
var https = require('https');
var querystring = require('querystring');
var firstWeek = new Date('Monday January 3, 2011 08:00'); // week #1 = 1st of january 2010
// priva... | vuln | Safe | JavaScript |
doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num,
size_t size, off_t fsize, int *flags, int mach, int strtab)
{
Elf32_Shdr sh32;
Elf64_Shdr sh64;
int stripped = 1;
void *nbuf;
off_t noff, coff, name_off;
uint64_t cap_hw1 = 0; /* SunOS 5.x hardware capabilites */
uint64_t cap_sf1 = ... | vuln | Vulnerable | Unknown |
int hci_req_sync(struct hci_dev *hdev, int (*req)(struct hci_request *req,
unsigned long opt),
unsigned long opt, u32 timeout, u8 *hci_status)
{
int ret;
/* Serialize all requests */
hci_req_sync_lock(hdev);
/* check the state after obtaing the lock to protect the HCI_UP
* against any races from hci_d... | vuln | Safe | Unknown |
protected final void handlePlayerJoin(@NotNull OnlineUser onlineUser) {
// Handle the first player joining the server
CompletableFuture.runAsync(() -> {
if (firstUser) {
firstUser = false;
plugin.fetchServer(onlineUser).join();
}
}).thenRun... | vuln | Vulnerable | Java |
@Override
public boolean canUse() {
this.attackTarget = this.entityHost.getLastHurtByMob();
if (this.attackTarget == null || this.entityHost.distanceTo(attackTarget) > this.breathRange || !this.entityHost.getSensing().hasLineOfSight(attackTarget) || !EntitySelector.NO_CREATIVE_OR_SPECTATOR.and(EntitySelector.LIVI... | vuln | Safe | Java |
static int read_seek(AVFormatContext *s, int stream_index,
int64_t timestamp, int flags)
{
AVStream *st = s->streams[0];
CaffContext *caf = s->priv_data;
int64_t pos;
timestamp = FFMAX(timestamp, 0);
if (caf->frames_per_packet > 0 && caf->bytes_per_packet > 0) {
... | vuln | Vulnerable | C/C++ |
int64_t qmp_guest_file_open(const char *path, bool has_mode, const char *mode, Error **err)
{
FILE *fh;
Error *local_err = NULL;
int fd;
int64_t ret = -1, handle;
if (!has_mode) {
mode = "r";
}
slog("guest-file-open called, filepath: %s, mode: %s", path, mode);
fh = safe_open_or... | vuln | Safe | Unknown |
public ResponseEntity<Void> testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass body) throws RestClientException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missin... | vuln | Vulnerable | Java |
static RList* entries(RBinFile* bf) {
RList* ret = NULL;
RBinAddr* addr = NULL;
psxexe_header psxheader;
if (!(ret = r_list_new ())) {
return NULL;
}
if (!(addr = R_NEW0 (RBinAddr))) {
r_list_free (ret);
return NULL;
}
if (r_buf_fread_at (bf->buf, 0, (ut8*)&psxheader, "8c17i", 1) != sizeof (psxexe_head... | vuln | Safe | C/C++ |
/* 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 | Vulnerable | Python |
static void scalar_min_max_or(struct bpf_reg_state *dst_reg,
struct bpf_reg_state *src_reg)
{
bool src_known = tnum_is_const(src_reg->var_off);
bool dst_known = tnum_is_const(dst_reg->var_off);
s64 smin_val = src_reg->smin_value;
u64 umin_val = src_reg->umin_value;
if (src_known && dst_known) {
__mark_... | vuln | Safe | C/C++ |
void nw_cache_free(nw_cache *cache, void *obj)
{
if (cache->free < cache->free_total) {
cache->free_arr[cache->free++] = obj;
} else if (cache->free_total < NW_CACHE_MAX_SIZE) {
uint32_t new_free_total = cache->free_total * 2;
void *new_arr = realloc(cache->free_arr, new_free_total * siz... | vuln | Safe | C/C++ |
GF_Err gp_rtp_builder_do_hevc(GP_RTPPacketizer *builder, u8 *nalu, u32 nalu_size, u8 IsAUEnd, u32 FullAUSize)
{
u32 do_flush, bytesLeft, size;
do_flush = 0;
if (!nalu) do_flush = 1;
else if (builder->sl_header.accessUnitStartFlag) do_flush = 1;
/*we must NOT fragment a NALU*/
else if (builder->bytesInPacket + na... | vuln | Vulnerable | Unknown |
private int
mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
size_t nbytes, size_t o, unsigned int cont_level, int mode, int text,
int flip, int recursion_level, int *printed_something,
int *need_separator, int *returnval)
{
uint32_t soffset, offset = ms->offset;
uint32_t count = m->str... | vuln | Vulnerable | C/C++ |
int av_opt_set_dict(void *obj, AVDictionary **options)
{
AVDictionaryEntry *t = NULL;
AVDictionary *tmp = NULL;
int ret = 0;
if (!options)
return 0;
while ((t = av_dict_get(*options, "", t, AV_DICT_IGNORE_SUFFIX))) {
ret = av_opt_set(obj, t->key, t->value, 0);
if (ret == A... | vuln | Safe | C/C++ |
static void clipper_init(MachineState *machine)
{
ram_addr_t ram_size = machine->ram_size;
const char *cpu_model = machine->cpu_model;
const char *kernel_filename = machine->kernel_filename;
const char *kernel_cmdline = machine->kernel_cmdline;
const char *initrd_filename = machine->initrd_filename;... | vuln | Safe | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Safe | C/C++ |
// Warning: The author still knows nothing about javascript!
// params:
// type: subject type
const got = require('@/utils/got'); // get web content
const cheerio = require('cheerio'); // html parser
const get_article = require('./_article');
module.exports = async (ctx) => {
const type = ctx.params.type ?? 'www... | vuln | Vulnerable | JavaScript |
static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,
const struct nlattr * const nla[])
{
const struct nfgenmsg *nfmsg = nlmsg_data(info->nlh);
u32 ktype, dtype, flags, policy, gc_int, objtype;
struct netlink_ext_ack *extack = info->extack;
u8 genmask = nft_genmask_next(info->net);
... | vuln | Vulnerable | C/C++ |
void opj_get_all_encoding_parameters( const opj_image_t *p_image,
const opj_cp_t *p_cp,
OPJ_UINT32 tileno,
OPJ_INT32 * p_tx0,
OPJ_INT32 * p_tx1,
... | vuln | Vulnerable | C/C++ |
/* -*- C++ -*-
* File: libraw_datastream.cpp
* Copyright 2008-2021 LibRaw LLC (info@libraw.org)
*
* LibRaw C++ interface (implementation)
LibRaw is free software; you can redistribute it and/or modify
it under the terms of the one of two licenses as you choose:
1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
... | vuln | Safe | C/C++ |
private int getNextPosition(boolean force) {
// return current play position
if (!force && mRepeatMode == REPEAT_CURRENT) {
return Math.max(mPlayPos, 0);
}
// suffle all songs
else if (mShuffleMode == SHUFFLE_NORMAL) {
if (mPlayPos >= 0) {
... | vuln | Safe | Java |
void join(pid_t pid, int argc, char **argv, int index) {
EUID_ASSERT();
pid_t parent = pid;
// in case the pid is that of a firejail process, use the pid of the first child process
pid = switch_to_child(pid);
// exit if no permission to join the sandbox
check_join_permission(pid);
extract_x11_display(parent);... | vuln | Vulnerable | Unknown |
static uint32_t ehci_mem_readl(void *ptr, target_phys_addr_t addr)
{
EHCIState *s = ptr;
uint32_t val;
val = s->mmio[addr] | (s->mmio[addr+1] << 8) |
(s->mmio[addr+2] << 16) | (s->mmio[addr+3] << 24);
trace_usb_ehci_mmio_readl(addr, addr2str(addr), val);
return val;
} | vuln | Vulnerable | C/C++ |
valuePop(xmlXPathParserContextPtr ctxt)
{
xmlXPathObjectPtr ret;
if ((ctxt == NULL) || (ctxt->valueNr <= 0))
return (NULL);
if (ctxt->valueNr <= ctxt->valueFrame) {
xmlXPatherror(ctxt, __FILE__, __LINE__, XPATH_STACK_ERROR);
return (NULL);
}
ctxt->valueNr--;
if (ctxt->... | vuln | Safe | Unknown |
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 | Vulnerable | PHP |
ZrtpPacketPingAck* ZRtp::preparePingAck(ZrtpPacketPing* ppkt) {
// Because we do not support ZRTP proxy mode use the truncated ZID.
// If this code shall be used in ZRTP proxy implementation the computation
// of the endpoint hash must be enhanced (see chaps 5.15ff and 5.16)
zrtpPingAck.setLocalEpHash(... | vuln | Vulnerable | Unknown |
public InteractionResult blockRightClick(Player player, InteractionHand hand, BlockPos pos, Direction face) {
if (player instanceof ServerPlayer && FTBChunksAPI.getManager().protect(player, hand, pos, Protection.INTERACT_BLOCK).get()) {
return InteractionResult.FAIL;
}
return InteractionResult.PASS;
} | vuln | Safe | Java |
public static String[] readStringArray(DataInput in)
throws IOException
{
String[] as;
if (in instanceof PofInputStream)
{
Object[] ao = (Object[]) ((PofInputStream) in).readObject();
if (ao == null)
{
as = null;
... | vuln | Vulnerable | Java |
ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
handle_t *handle, unsigned int reserv_clstrs)
{
struct buffer_head *bitmap_bh = NULL;
struct ext4_group_desc *gdp;
struct buffer_head *gdp_bh;
struct ext4_sb_info *sbi;
struct super_block *sb;
ext4_fsblk_t block;
int err, len;
BUG_ON(ac->ac_st... | vuln | Safe | Unknown |
static int target_xcopy_locate_se_dev_e4_iter(struct se_device *se_dev,
const unsigned char *dev_wwn)
{
unsigned char tmp_dev_wwn[XCOPY_NAA_IEEE_REGEX_LEN];
int rc;
if (!se_dev->dev_attrib.emulate_3pc) {
pr_debug("XCOPY: emulate_3pc disabled on se_dev %p\n", se_dev);
return 0;
}
memset(&tmp_dev_ww... | vuln | Safe | Unknown |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.utils
from frappe import throw, _
from frappe.website.website_generator import WebsiteGenerator
from frappe.utils.verified_... | vuln | Safe | Python |
const makeRegex = (string) => {
// default: case_senstivie = true
if (ctx.query.filter_case_sensitive === 'false') {
return new RE2(string, 'i');
} else {
return new RE2(string);
}
}; | vuln | Safe | JavaScript |
CURLcode Curl_close(struct Curl_easy *data)
{
struct Curl_multi *m;
if(!data)
return CURLE_OK;
Curl_expire_clear(data); /* shut off timers */
m = data->multi;
if(m)
/* This handle is still part of a multi handle, take care of this first
and detach this handle from there. */
curl_multi_... | vuln | Safe | C/C++ |
@endpoints.route("/h2h")
def h2h():
if db == None:
init()
player1 = request.args.get('tag1', default="christmasmike")
player2 = request.args.get('tag2', default="christmasmike")
sql = "SELECT * FROM matches WHERE (player1 = '"+str(player1)+"' OR "\
+"player2 = '"+str(player1)+"') AN... | vuln | Vulnerable | Python |
@Override
public void setConfigFlag(int flag, boolean value) {
if (!RadioServiceUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot set config flag for HAL 1.x client from non-current user");
return;
}
if (flag == RadioManager.CONFIG_FORCE_ANALOG) {
... | vuln | Safe | Java |
protected List<TimerJobEntity> getTimerDeclarations(ProcessDefinitionEntity processDefinition, Process process) {
JobManager jobManager = Context.getCommandContext().getJobManager();
List<TimerJobEntity> timers = new ArrayList<TimerJobEntity>();
if (CollectionUtil.isNotEmpty(process.getFlowElements())) {
... | vuln | Vulnerable | Java |
void PropagateRemoteDelete::start()
{
qCInfo(lcPropagateRemoteDelete) << "Start propagate remote delete job for" << _item->_file;
if (propagator()->_abortRequested)
return;
if (!_item->_encryptedFileName.isEmpty() || _item->isEncrypted()) {
if (!_item->_encryptedFileName.isEmpty()) {
... | vuln | Safe | C/C++ |
/* 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 | Safe | Python |
static int load_block_from_cache(BGZF *fp, int64_t block_address)
{
khint_t k;
cache_t *p;
khash_t(cache) *h = (khash_t(cache)*)fp->cache;
k = kh_get(cache, h, block_address);
if (k == kh_end(h)) return 0;
p = &kh_val(h, k);
if (fp->block_length != 0) fp->block_offset = 0;
fp->block_add... | vuln | Vulnerable | C/C++ |
@Override
public boolean preprocess( String entryName, InputStream reader, Writer writer, FieldsMetadata fieldsMetadata,
IDocumentFormatter formatter, Map<String, Object> sharedContext )
throws XDocReportException, IOException
{
try
{
XMLReader ... | vuln | Safe | Java |
bool f_libxml_disable_entity_loader(bool disable /* = true */) {
xmlParserInputBufferCreateFilenameFunc old;
if (disable) {
old = xmlParserInputBufferCreateFilenameDefault(hphp_libxml_input_buffer_noload);
} else {
old = xmlParserInputBufferCreateFilenameDefault(nullptr);
}
return (old == hphp_libxml... | vuln | Vulnerable | Unknown |
bool IDNSpoofChecker::SafeToDisplayAsUnicode(base::StringPiece16 label,
bool is_tld_ascii) {
UErrorCode status = U_ZERO_ERROR;
int32_t result =
uspoof_check(checker_, label.data(),
base::checked_cast<int32_t>(label.size()), nullptr, &status);
... | vuln | Vulnerable | C/C++ |
transformCreateStmt(CreateStmt *stmt, const char *queryString)
{
ParseState *pstate;
CreateStmtContext cxt;
List *result;
List *save_alist;
ListCell *elements;
Oid namespaceid;
Oid existing_relid;
ParseCallbackState pcbstate;
bool like_found = false;
bool is_foreign_table = IsA(stmt, CreateForei... | vuln | Safe | Unknown |
int arm_set_cpu_on(uint64_t cpuid, uint64_t entry, uint64_t context_id,
uint32_t target_el, bool target_aa64)
{
CPUState *target_cpu_state;
ARMCPU *target_cpu;
struct CpuOnInfo *info;
assert(qemu_mutex_iothread_locked());
DPRINTF("cpu %" PRId64 " (EL %d, %s) @ 0x%" PRIx64 " with R... | vuln | Safe | C/C++ |
static void vc1_decode_skip_blocks(VC1Context *v)
{
MpegEncContext *s = &v->s;
if (!v->s.last_picture.f.data[0])
return;
ff_er_add_slice(&s->er, 0, s->start_mb_y, s->mb_width - 1, s->end_mb_y - 1, ER_MB_END);
s->first_slice_line = 1;
for (s->mb_y = s->start_mb_y; s->mb_y < s->end_mb_y; s->mb... | vuln | Vulnerable | C/C++ |
static int udf_read_inode(struct inode *inode, bool hidden_inode)
{
struct buffer_head *bh = NULL;
struct fileEntry *fe;
struct extendedFileEntry *efe;
uint16_t ident;
struct udf_inode_info *iinfo = UDF_I(inode);
struct udf_sb_info *sbi = UDF_SB(inode->i_sb);
struct kernel_lb_addr *iloc = &iinfo->i_location;
un... | vuln | Safe | C/C++ |
@WorkerThread
private void loadPackageInfo() {
if (mainModel == null) return; // Should never happen but checked anyway
mInstalledPackageInfo = mainModel.getInstalledPackageInfo();
mApplicationInfo = mPackageInfo.applicationInfo;
// Set App Icon
if (iconLoaderThread != null)... | vuln | Safe | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.