code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
package com.zrlog.web.controller.blog;
import com.zrlog.common.Constants;
import com.zrlog.common.request.CreateCommentRequest;
import com.zrlog.common.response.CreateCommentResponse;
import com.zrlog.model.Comment;
import com.zrlog.model.Log;
import com.zrlog.model.Type;
import com.zrlog.service.ArticleService;
impor... | vuln | Safe | Java |
/*
* MOV, 3GP, MP4 muxer
* Copyright (c) 2003 Thomas Raivio
* Copyright (c) 2004 Gildas Bazin <gbazin at videolan dot org>
* Copyright (c) 2009 Baptiste Coudurier <baptiste dot coudurier at gmail dot com>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it u... | vuln | Safe | C/C++ |
protected void populateMainMenuOptions() {
String none = StringHelper.getString("none");
// action selection option
String str = getString("dialogOption_action");
str = StringHelper.substituteToken(str, "$action", action != null ?
Misc.ucFirst(action.getDef().name.toLowerCase()) : none);
options.addOp... | vuln | Vulnerable | Java |
const std::string& AppControllerImpl::MaybeGetAndroidPackageName(
const std::string& app_id) {
const auto& package_name_it = android_package_map_.find(app_id);
if (package_name_it != android_package_map_.end()) {
return package_name_it->second;
}
ArcAppListPrefs* arc_prefs_ = ArcAppListPrefs::Get(pro... | vuln | Vulnerable | C/C++ |
static int dshow_read_packet(AVFormatContext *s, AVPacket *pkt)
{
struct dshow_ctx *ctx = s->priv_data;
AVPacketList *pktl = NULL;
while (!ctx->eof && !pktl) {
WaitForSingleObject(ctx->mutex, INFINITE);
pktl = ctx->pktl;
if (pktl) {
*pkt = pktl->pkt;
ctx->pktl... | vuln | Safe | C/C++ |
xmlSnprintfElementContent(char *buf, int size, xmlElementContentPtr content, int englob) {
int len;
if (content == NULL) return;
len = strlen(buf);
if (size - len < 50) {
if ((size - len > 4) && (buf[len - 1] != '.'))
strcat(buf, " ...");
return;
}
if (englob) strcat(buf, "(");
switc... | vuln | Safe | Unknown |
int main (int argc, char **argv) {
(void)argc;
char rule[COMMANDSIZE_4096];
char log_msg[OS_MAXSTR];
char lock_path[COMMANDSIZE_4096];
char lock_pid_path[COMMANDSIZE_4096];
int action = OS_INVALID;
cJSON *input_json = NULL;
struct utsname uname_buffer;
action = setup_and_check_messa... | vuln | Safe | C/C++ |
def list_profile_dirs(self):
profiles = list_bundled_profiles()
if profiles:
print()
print("Available profiles in IPython:")
self._print_profiles(profiles)
print()
print(" The first request for a bundled profile will copy it")
pr... | vuln | Safe | Python |
private @Nullable FieldAnnos getFieldAnnos(VariableElement fieldElt) {
String className = ElementUtils.getEnclosingClassName(fieldElt);
// Read in classes for the element.
getFileForElement(fieldElt);
ClassOrInterfaceAnnos classAnnos = classToAnnos.get(className);
FieldAnnos fieldAnnos = classAnnos.... | vuln | Vulnerable | Java |
static inline void tss_invalidate_io_bitmap(struct tss_struct *tss)
{
/*
* Invalidate the I/O bitmap by moving io_bitmap_base outside the
* TSS limit so any subsequent I/O access from user space will
* trigger a #GP.
*
* This is correct even when VMEXIT rewrites the TSS limit
* to 0x67 as the only requirem... | vuln | Vulnerable | C/C++ |
evbuffer_add_vprintf(struct evbuffer *buf, const char *fmt, va_list ap)
{
char *buffer;
size_t space;
size_t oldoff = buf->off;
int sz;
va_list aq;
/* make sure that at least some space is available */
if (evbuffer_expand(buf, 64) < 0)
return (-1);
for (;;) {
size_t used = buf->misalign + buf->off;
buffe... | vuln | Safe | Unknown |
async def release(self):
validate_savepoint_name(self.name)
await self.transaction.connection.execute(
f"RELEASE SAVEPOINT {self.name}"
) | vuln | Safe | Python |
/**
* $Id: ProxyServlet.java,v 1.4 2013/12/13 13:18:11 david Exp $
* Copyright (c) 2011-2012, JGraph Ltd
*/
package com.mxgraph.online;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.... | vuln | Vulnerable | Java |
@Override
public List<ProcessMemoryState> getMemoryStateForProcesses() {
List<ProcessMemoryState> processMemoryStates = new ArrayList<>();
synchronized (mProcLock) {
synchronized (mPidsSelfLocked) {
for (int i = 0, size = mPidsSelfLocked.size(); i < si... | vuln | Vulnerable | Java |
public CsrfTokenHandler(final Form< ? > form)
{
form.add(csrfTokenField = new HiddenField<String>("csrfToken", Model.of(getCsrfSessionToken())));
} | vuln | Vulnerable | Java |
void rose_start_hbtimer(struct sock *sk)
{
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->timer);
rose->timer.function = rose_timer_expiry;
rose->timer.expires = jiffies + rose->hb;
sk_reset_timer(sk, &rose->timer, rose->timer.expires);
} | vuln | Safe | Unknown |
date_s_rfc3339(int argc, VALUE *argv, VALUE klass)
{
VALUE str, sg;
rb_scan_args(argc, argv, "02", &str, &sg);
switch (argc) {
case 0:
str = rb_str_new2("-4712-01-01T00:00:00+00:00");
case 1:
sg = INT2FIX(DEFAULT_SG);
}
{
VALUE hash = date_s__rfc3339(klass, str);
return d_new_by_f... | vuln | Vulnerable | Unknown |
int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, char **error TSRMLS_DC) /* {{{ */
{
phar_zip_dir_end locator;
char buf[sizeof(locator) + 65536];
long size;
php_uint16 i;
phar_archive_data *mydata = NULL;
phar_entry_info entry = {0};
char *... | vuln | Vulnerable | C/C++ |
sctp_disposition_t sctp_sf_ootb(struct net *net,
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
{
struct sctp_chunk *chunk = arg;
struct sk_buff *skb = chunk->skb;
sctp_chunkhdr_t *ch;
sctp_errhdr_t *err;
__u8... | vuln | Vulnerable | C/C++ |
async def on_federation_query_client_keys(
self, query_body: Dict[str, Dict[str, Optional[List[str]]]]
) -> JsonDict:
"""Handle a device key query from a federated server:
Handles the path: GET /_matrix/federation/v1/users/keys/query
Args:
query_body: The body of the qu... | vuln | Vulnerable | Python |
@Override
public void callSessionUpdateReceived(ImsCallProfile profile) {
if (mListener != null) {
TelephonyUtils.runWithCleanCallingIdentity(()->
mListener.callSessionUpdateReceived(ImsCallSession.this, profile),
mListenerExecutor);
... | vuln | Vulnerable | Java |
public function redirect($route, $code = null)
{
/** @var Uri $uri */
$uri = $this['uri'];
// Clean route for redirect
$route = preg_replace("#^\/[\\\/]+\/#", '/', $route);
// Check for code in route
$regex = '/.*(\[(30[1-7])\])$/';
preg_match($regex, $rout... | vuln | Safe | PHP |
static int decode_frame(AVCodecContext *avctx,
void *data,
int *got_frame,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
unsigned int buf_size = avpkt->size;
const uint8_t *buf_end = buf + buf_size;
const uint8_t *src... | vuln | Safe | C/C++ |
FileTransfer::DoUpload(filesize_t *total_bytes, ReliSock *s)
{
int rc;
MyString fullname;
filesize_t bytes;
bool is_the_executable;
bool upload_success = false;
bool do_download_ack = false;
bool do_upload_ack = false;
bool try_again = false;
int hold_code = 0;
int hold_subcode = 0;
MyString error_desc;
boo... | vuln | Vulnerable | C/C++ |
/**
* Modules
*/
var path = require('path')
/**
* Vars
*/
var relative = path.relative
var lastCwd = process.cwd()
var cache = Object.create(null)
/**
* Expose cachedPathRelative
*/
module.exports = cachedPathRelative
/**
* cachedPathRelative
*/
function cachedPathRelative (from, to) {
// If the curren... | vuln | Safe | JavaScript |
SYSCALL_DEFINE5(perf_event_open,
struct perf_event_attr __user *, attr_uptr,
pid_t, pid, int, cpu, int, group_fd, unsigned long, flags)
{
struct perf_event *group_leader = NULL, *output_event = NULL;
struct perf_event *event, *sibling;
struct perf_event_attr attr;
struct perf_event_context *ctx, *uninitialized_... | vuln | Safe | Unknown |
// disable no-return-await for model functions
/* eslint-disable no-return-await */
module.exports = function(crowi) {
const debug = require('debug')('growi:models:comment');
const mongoose = require('mongoose');
const ObjectId = mongoose.Schema.Types.ObjectId;
const commentSchema = new mongoose.Schema({
... | vuln | Safe | JavaScript |
const cheerio = require('cheerio');
const { puppeteerGet, renderDesc } = require('./utils');
const config = require('@/config').value;
const { isValidHost } = require('@/utils/valid-host');
module.exports = async (ctx) => {
const pub = ctx.params.pub;
const jrn = ctx.params.jrn;
const host = `https://${pub... | vuln | Safe | JavaScript |
void V8Window::namedPropertyGetterCustom(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
if (!name->IsString())
return;
auto nameString = name.As<v8::String>();
LocalDOMWindow* window = toLocalDOMWindow(V8Window::toImpl(info.Holder()));
if (!window)
return;
... | vuln | Vulnerable | C/C++ |
public void displayCustomNameOf(ItemStack stack, int nixiePositionInRow) {
CompoundNBT compoundnbt = stack.getChildTag("display");
if (compoundnbt != null && compoundnbt.contains("Name", NBT.TAG_STRING)) {
hasCustomText = true;
rawCustomText = getJsonFromString(compoundnbt.getString("Name"));
customTextInd... | vuln | Safe | Java |
@Inject(method = "set(ILnet/minecraft/util/registry/RegistryKey;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;Z)Lnet/minecraft/util/registry/RegistryEntry;", at = @At("HEAD"))
public void setPre(int id, RegistryKey<T> registryId, T object, Lifecycle lifecycle, boolean checkDuplicateKeys, CallbackInfoReturnable... | vuln | Safe | Java |
void
parseSWF_MORPHGRADIENT (FILE * f, struct SWF_MORPHGRADIENT *gradient)
{
int i;
gradient->NumGradients = readUInt8 (f);
if( gradient->NumGradients > 8 ) {
fprintf(stderr, "%d gradients in SWF_MORPHGRADiENT, expected a max of 8", gradient->NumGradients);
gradient->NumGradients = 8;
}
for (i = 0; i < ... | vuln | Safe | C/C++ |
/** @odoo-module **/
import { registry } from "@web/core/registry";
import {
Many2ManyTagsAvatarUserField,
KanbanMany2ManyTagsAvatarUserField,
many2ManyTagsAvatarUserField,
kanbanMany2ManyTagsAvatarUserField,
listMany2ManyTagsAvatarUserField,
} from "@mail/web/fields/many2many_avatar_user_field/man... | vuln | Vulnerable | JavaScript |
static int mxg_read_packet(AVFormatContext *s, AVPacket *pkt)
{
int ret;
unsigned int size;
uint8_t *startmarker_ptr, *end, *search_end, marker;
MXGContext *mxg = s->priv_data;
while (!avio_feof(s->pb) && !s->pb->error){
if (mxg->cache_size <= OVERREAD_SIZE) {
ret = ... | vuln | Safe | C/C++ |
private void unregisterAppInstallReceiver() {
if (appInstallReceiver != null) {
try {
context.unregisterReceiver(appInstallReceiver);
} catch (Exception e) {
// Receiver not registered
e.printStackTrace();
}
appInsta... | vuln | Safe | Java |
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache... | vuln | Safe | Java |
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11,
# andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh,
# falgh1, grunjol, csitk... | vuln | Safe | JavaScript |
private boolean displaySizeChanged() {
int realWidth = mc.getWindow().getWidth();
int realHeight = mc.getWindow().getHeight();
if (realWidth == 0 || realHeight == 0) {
// These can be zero on Windows if minimized.
// Creating zero-sized framebuffers however will throw an ... | vuln | Safe | Java |
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* Auto-Detect PDUs
*
* Copyright 2014 Dell Software <Mike.McDonald@software.dell.com>
*
* 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 Lice... | vuln | Safe | C/C++ |
PHP_FUNCTION(realpath)
{
char *filename;
int filename_len;
char resolved_path_buff[MAXPATHLEN];
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
return;
}
if (VCWD_REALPATH(filename, resolved_path_buff)) {
if (PG(safe_mode) && (!php_checkuid(resolved_path_buf... | vuln | Vulnerable | Unknown |
static int writeState(const char *stateFilename)
{
struct logState *p;
FILE *f;
char *chptr;
unsigned int i = 0;
int error = 0;
int bytes = 0;
int fdcurr;
int fdsave;
struct stat sb;
char *tmpFilename = NULL;
struct tm now;
time_t now_time, last_time;
char *prevCtx;
... | vuln | Safe | Unknown |
static void encode_rgb48_10bit(AVCodecContext *avctx, const AVPicture *pic, uint8_t *dst)
{
DPXContext *s = avctx->priv_data;
const uint8_t *src = pic->data[0];
int x, y;
for (y = 0; y < avctx->height; y++) {
for (x = 0; x < avctx->width; x++) {
int value;
if (s->big_endi... | vuln | Safe | C/C++ |
def build_param_dict( self, incoming, input_datasets, output_datasets, output_paths, job_working_directory, input_paths=[] ):
"""
Build the dictionary of parameters for substituting into the command
line. Each value is wrapped in a `InputValueWrapper`, which allows
all the attributes of ... | vuln | Vulnerable | Python |
static int host_pci_config_read(int pos, int len, uint32_t val)
{
char path[PATH_MAX];
int config_fd;
ssize_t size = sizeof(path);
int rc = snprintf(path, size, "/sys/bus/pci/devices/%04x:%02x:%02x.%d/%s",
0, 0, 0, 0, "config");
if (rc >= size || rc < 0) {
return -... | vuln | Vulnerable | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Safe | C/C++ |
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
{
GradFunContext *s = inlink->dst->priv;
AVFilterLink *outlink = inlink->dst->outputs[0];
AVFrame *out;
int p, direct;
if (av_frame_is_writable(in)) {
direct = 1;
out = in;
} else {
direct = 0;
out = ff_g... | vuln | Vulnerable | C/C++ |
@SuppressWarnings("deprecation")
@Override
@SuppressLint({"SetJavaScriptEnabled", "JavascriptInterface", "RestrictedApi"})
protected void onCreate(@Nullable Bundle savedInstanceState) {
this.moduleFile = new File(this.getCacheDir(), "module.zip");
super.onCreate(savedInstanceState);
... | vuln | Safe | Java |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | vuln | Vulnerable | Python |
/*
* Copyright 2013 the original author or authors.
*
* 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 applicabl... | vuln | Safe | Java |
ext4_xattr_block_get(struct inode *inode, int name_index, const char *name,
void *buffer, size_t buffer_size)
{
struct buffer_head *bh = NULL;
struct ext4_xattr_entry *entry;
size_t size;
void *end;
int error;
struct mb_cache *ea_block_cache = EA_BLOCK_CACHE(inode);
ea_idebug(inode, "name=%d.%s, buffer=%... | vuln | Vulnerable | 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 |
_bdf_parse_glyphs( char* line,
unsigned long linelen,
unsigned long lineno,
void* call_data,
void* client_data )
{
int c, mask_index;
char* s;
unsigned char* bp;... | vuln | Safe | Unknown |
paint_mouse_pointer(XImage *image, struct x11grab *s)
{
int x_off = s->x_off;
int y_off = s->y_off;
int width = s->width;
int height = s->height;
Display *dpy = s->dpy;
XFixesCursorImage *xcim;
int x, y;
int line, column;
int to_line, to_column;
int pixstride = image->bits_per_pi... | vuln | Vulnerable | C/C++ |
txBoolean fxProxyHasProperty(txMachine* the, txSlot* instance, txID id, txIndex index)
{
txBoolean result;
txSlot* proxy = instance->next;
txSlot* function = fxCheckProxyFunction(the, proxy, _has);
if (function) {
txSlot* target;
mxPushReference(proxy->value.proxy.target);
target = the->stack;
/* THIS */
... | vuln | Vulnerable | C/C++ |
static av_cold int dnxhd_decode_init(AVCodecContext *avctx)
{
DNXHDContext *ctx = avctx->priv_data;
ctx->avctx = avctx;
ctx->cid = -1;
avctx->colorspace = AVCOL_SPC_BT709;
avctx->coded_width = FFALIGN(avctx->width, 16);
avctx->coded_height = FFALIGN(avctx->height, 16);
ctx->rows = av_mallo... | vuln | Vulnerable | C/C++ |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2022
* All rights reserved
*
* This file is part of GPAC / ISO Media File Format sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU L... | vuln | Safe | C/C++ |
/*
* This file is part of ubridge, a program to bridge network interfaces
* to UDP tunnels.
*
* Copyright (C) 2015 GNS3 Technologies Inc.
*
* ubridge 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 Fou... | vuln | Vulnerable | C/C++ |
public static File lastFileModified(String dir) {
File fl = new File(dir);
File[] files = fl.listFiles(File::isFile);
long lastMod = Long.MIN_VALUE;
File choice = null;
try {
for (File file : files) {
if (file.lastModified() > lastMod) {
... | vuln | Vulnerable | Java |
# Generated by Django 2.2.9 on 2020-02-01 12:31
from django.db import migrations
import markdownx.models
class Migration(migrations.Migration):
dependencies = [
('company', '0009_auto_20191118_2323'),
]
operations = [
migrations.AlterField(
model_name='company',
... | vuln | Vulnerable | Python |
function I(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t} | vuln | Vulnerable | JavaScript |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | vuln | Safe | Python |
int ZEXPORT inflate(strm, flush)
z_streamp strm;
int flush;
{
struct inflate_state FAR *state;
z_const unsigned char FAR *next; /* next input */
unsigned char FAR *put; /* next output */
unsigned have, left; /* available input and output */
unsigned long hold; /* bit buffer */
... | vuln | Vulnerable | C/C++ |
static int rtp_parse_mp4_au(RTPDemuxContext *s, const uint8_t *buf)
{
int au_headers_length, au_header_size, i;
GetBitContext getbitcontext;
RTPPayloadData *infos;
infos = s->rtp_payload_data;
if (infos == NULL)
return -1;
au_headers_length = AV_RB16(buf);
if (au_headers_length ... | vuln | Safe | C/C++ |
def __call__(self, value: Dict[str, Any]) -> Any:
if (
value.get("lc", None) == 1
and value.get("type", None) == "secret"
and value.get("id", None) is not None
):
[key] = value["id"]
if key in self.secrets_map:
return self.secre... | vuln | Vulnerable | Python |
void GetPreviewDataForIndex(int index,
scoped_refptr<base::RefCountedBytes>* data) {
if (index != printing::COMPLETE_PREVIEW_DOCUMENT_INDEX &&
index < printing::FIRST_PAGE_INDEX) {
return;
}
PreviewPageDataMap::iterator it = page_data_map_.find(index);
i... | vuln | Vulnerable | C/C++ |
cdf_unpack_summary_info(const cdf_stream_t *sst, const cdf_header_t *h,
cdf_summary_info_header_t *ssi, cdf_property_info_t **info, size_t *count)
{
size_t maxcount;
const cdf_summary_info_header_t *si =
CAST(const cdf_summary_info_header_t *, sst->sst_tab);
const cdf_section_declaration_t *sd =
CAST(c... | vuln | Safe | C/C++ |
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator p... | vuln | Vulnerable | Java |
void ide_dma_cb(void *opaque, int ret)
{
IDEState *s = opaque;
int n;
int64_t sector_num;
bool stay_active = false;
if (ret < 0) {
int op = BM_STATUS_DMA_RETRY;
if (s->dma_cmd == IDE_DMA_READ)
op |= BM_STATUS_RETRY_READ;
else if (s->dma_cmd == IDE_DMA_TRIM)
... | vuln | Safe | C/C++ |
static byte[] generatePackageMataDataBytes(String label, String path, TransactionRequest.Type type) {
if (path == null) {
path = "";
}
return format("{\"path\":%s,\"type\":\"%s\",\"label\":%s}", new Gson().toJson(path), type.toPackageName(), new Gson().toJson(label)).getBytes(UTF_8);... | vuln | Vulnerable | Java |
@VisibleForTesting
protected static String detectXMLFileType(final InputStream in) throws XMLStreamException {
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
inputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false);
XMLEventReader eventReader = inputFactory.createXMLEventR... | vuln | Safe | Java |
/*
Copyright (c) 2009 Dave Gamble
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, including without limitation the rights
to use, copy, modify, merge, publish, distr... | vuln | Vulnerable | C/C++ |
async def get_rooms_in_group(
self, group_id: str, requester_user_id: str
) -> JsonDict:
"""Get the rooms in group as seen by requester_user_id
This returns rooms in order of decreasing number of joined users
"""
await self.check_group_is_ours(group_id, requester_user_id, a... | vuln | Vulnerable | Python |
file_extension(const char *s) /* I - Filename or URL */
{
const char *extension; /* Pointer to directory separator */
static char buf[1024]; /* Buffer for files with targets */
if (s == NULL)
return (NULL);
else if (!strncmp(s, "data:image/bmp;", 15))
return ("bmp");
else if (!strncmp(s, "data:image... | vuln | Vulnerable | C/C++ |
read_viminfo_barline(vir_T *virp, int got_encoding, int force, int writing)
{
char_u *p = virp->vir_line + 1;
int bartype;
garray_T values;
bval_T *vp;
int i;
int read_next = TRUE;
// The format is: |{bartype},{value},...
// For a very long string:
// |{bartype},>{length of "... | vuln | Vulnerable | Unknown |
void kvm_lapic_sync_to_vapic(struct kvm_vcpu *vcpu)
{
u32 data, tpr;
int max_irr, max_isr;
struct kvm_lapic *apic = vcpu->arch.apic;
void *vapic;
apic_sync_pv_eoi_to_guest(vcpu, apic);
if (!test_bit(KVM_APIC_CHECK_VAPIC, &vcpu->arch.apic_attention))
return;
tpr = kvm_apic_get_reg(apic, APIC_TASKPRI) & 0xff;... | vuln | Vulnerable | Unknown |
OMX_ERRORTYPE SoftAVCEncoder::internalGetParameter(
OMX_INDEXTYPE index, OMX_PTR params) {
switch (index) {
case OMX_IndexParamVideoBitrate:
{
OMX_VIDEO_PARAM_BITRATETYPE *bitRate =
(OMX_VIDEO_PARAM_BITRATETYPE *) params;
if (bitRate->nPortIndex != 1) {
... | vuln | Vulnerable | C/C++ |
static av_cold int init(AVFilterContext *ctx)
{
SendCmdContext *sendcmd = ctx->priv;
int ret, i, j;
if (sendcmd->commands_filename && sendcmd->commands_str) {
av_log(ctx, AV_LOG_ERROR,
"Only one of the filename or commands options must be specified\n");
return AVERROR(EINVAL);... | vuln | Vulnerable | C/C++ |
function get( root, path ){
var i, c,
space,
nextSpace,
curSpace = root;
if ( !root ){
return root;
}
space = parse(path);
if ( space.length ){
for( i = 0, c = space.length; i < c; i++ ){
nextSpace = space[i];
if (nextSpace === '__proto__'){
return null;
}
if ( isUndefined(curSpa... | vuln | Safe | JavaScript |
static int aiff_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
int size, filesize;
offset_t offset = 0;
uint32_t tag;
unsigned version = AIFF_C_VERSION1;
ByteIOContext *pb = s->pb;
AVStream * st = s->streams[0];
filesize = get_tag(pb, &tag);
if... | vuln | Safe | C/C++ |
function errorToJson(error) {
let jsonError = {
message: error.message,
stack: error.stack,
name: error.name
};
// Add all custom codeFrame properties
Object.keys(error).forEach(key => {
jsonError[key] = error[key];
});
return jsonError;
} | vuln | Vulnerable | JavaScript |
_gnutls_x509_dn_to_string(const char *oid, void *value,
int value_size, gnutls_datum_t * str)
{
const struct oid_to_string *oentry;
int ret;
gnutls_datum_t tmp;
size_t size;
if (value == NULL || value_size <= 0) {
gnutls_assert();
return GNUTLS_E_INVALID_REQUEST;
}
oentry = get_oid_entry(oid);
if (oe... | vuln | Vulnerable | Unknown |
snmp_ber_encode_null(unsigned char *out, uint32_t *out_len, uint8_t type)
{
(*out_len)++;
*out-- = 0x00;
out = snmp_ber_encode_type(out, out_len, type);
return out;
} | vuln | Vulnerable | C/C++ |
ieee802_15_4_if_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, const u_char *p)
{
u_int caplen = h->caplen;
int hdrlen;
uint16_t fc;
uint8_t seq;
if (caplen < 3) {
ND_PRINT((ndo, "[|802.15.4] %x", caplen));
return caplen;
}
fc = EXTRACT_LE_16BITS(p);
hdrlen = ... | vuln | Vulnerable | C/C++ |
/*
* The MIT License
*
* Copyright 2018 CloudBees, Inc.
*
* 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, including without limitation the rights
* to use, copy, ... | vuln | Safe | Java |
static void fw_cfg_data_mem_write(void *opaque, hwaddr addr,
uint64_t value, unsigned size)
{
FWCfgState *s = opaque;
unsigned i = size;
do {
fw_cfg_write(s, value >> (8 * --i));
} while (i);
} | vuln | Safe | C/C++ |
target_count_create(struct iter_qstate* iq)
{
if(!iq->target_count) {
iq->target_count = (int*)calloc(2, sizeof(int));
/* if calloc fails we simply do not track this number */
if(iq->target_count)
iq->target_count[0] = 1;
}
} | vuln | Vulnerable | Unknown |
lldp_decode(struct lldpd *cfg OVS_UNUSED, char *frame, int s,
struct lldpd_hardware *hardware, struct lldpd_chassis **newchassis,
struct lldpd_port **newport)
{
struct lldpd_chassis *chassis;
struct lldpd_port *port;
const struct eth_addr lldpaddr = LLDP_MULTICAST_ADDR;
const cha... | vuln | Safe | C/C++ |
/*
* Copyright 2016 LINE Corporation
*
* LINE Corporation licenses this file to you 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:
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless r... | vuln | Vulnerable | Java |
IDNSpoofChecker::IDNSpoofChecker() {
UErrorCode status = U_ZERO_ERROR;
checker_ = uspoof_open(&status);
if (U_FAILURE(status)) {
checker_ = nullptr;
return;
}
uspoof_setRestrictionLevel(checker_, USPOOF_HIGHLY_RESTRICTIVE);
SetAllowedUnicodeSet(&status);
int32_t checks = uspoof_getChecks(check... | vuln | Vulnerable | C/C++ |
static Status Compute(OpKernelContext* context,
const typename TTypes<T, 1>::ConstTensor& values,
const typename TTypes<T, 1>::ConstTensor& value_range,
int32_t nbins, typename TTypes<Tout, 1>::Tensor& out) {
const CPUDevice& d = context->eigen... | vuln | Safe | Unknown |
private void makeDefaultConfiguration() {
if (defaultConfig == null) {
XToolkit.awtLock();
try {
// what if this was called after the screen number has changed
// and initNativeData() was called to re-set x11Screens, but before invalidate()
... | vuln | Safe | Java |
package com.salesmanager.core.business.services.catalog.product.attribute;
import java.util.List;
import com.salesmanager.core.business.exception.ServiceException;
import com.salesmanager.core.business.services.common.generic.SalesManagerEntityService;
import com.salesmanager.core.model.catalog.product.Product;
impor... | vuln | Safe | Java |
/*
* Dragonfly - Runtime dependency management library
* Copyright (c) 2021 Joshua Sing <joshua@hypera.dev>
*
* 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, in... | vuln | Vulnerable | Java |
static inline int fpregs_state_valid(struct fpu *fpu, unsigned int cpu)
{
return fpu == this_cpu_read_stable(fpu_fpregs_owner_ctx) && cpu == fpu->last_cpu;
} | vuln | Vulnerable | Unknown |
add_mibfile(const char* tmpstr, const char* d_name, FILE *ip )
{
FILE *fp;
char token[MAXTOKEN], token2[MAXTOKEN];
/*
* which module is this
*/
if ((fp = fopen(tmpstr, "r")) == NULL) {
snmp_log_perror(tmpstr);
return 1;
}
DEBUGMSGTL(("parse-mibs",... | vuln | Vulnerable | C/C++ |
def _has_access(*, is_authorized: bool, func: Callable, args, kwargs):
"""
Define the behavior whether the user is authorized to access the resource.
:param is_authorized: whether the user is authorized to access the resource
:param func: the function to call if the user is authorized
:param args: ... | vuln | Safe | Python |
package io.swagger.generator.online;
import com.fasterxml.jackson.databind.JsonNode;
import io.swagger.codegen.*;
import io.swagger.generator.exception.ApiException;
import io.swagger.generator.exception.BadRequestException;
import io.swagger.generator.model.GeneratorInput;
import io.swagger.generator.model.InputOptio... | vuln | Vulnerable | Java |
@TdlibThread
void onUpdateMessageSendSucceeded (TdApi.UpdateMessageSendSucceeded update) {
TdApi.Message sentMessage = update.message;
ViewController<?> c = null;
try {
c = UI.getCurrentStackItem();
} catch (ArrayIndexOutOfBoundsException ignored) { }
if (((c instanceof MessagesController &&... | vuln | Safe | Java |
function PMA_cleanupPathInfo()
{
global $PMA_PHP_SELF, $_PATH_INFO;
$PMA_PHP_SELF = PMA_getenv('PHP_SELF');
$_PATH_INFO = PMA_getenv('PATH_INFO');
if (! empty($_PATH_INFO) && ! empty($PMA_PHP_SELF)) {
$path_info_pos = mb_strrpos($PMA_PHP_SELF, $_PATH_INFO);
$pathLength = $path_info_pos ... | vuln | Vulnerable | PHP |
private void setOptions() {
if (view == null || getContext() == null)
return;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
swMetered.setChecked(prefs.getBoolean("metered", true));
int download = prefs.getInt("download", MessageHelp... | vuln | Safe | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.