code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if (item.getItemId() == R.id.action_download_album) {
albumPageViewModel.getAlbumSongLiveList(requireActivity()).observe(requireActivity(), songs -> {
if(isVisible() && getActivity() != null) {
... | vuln | Safe | Java |
private void addRange(int from, int to, CharacterClassElementTree tree) {
int upperCaseFrom = Character.toUpperCase(from);
int upperCaseTo = Character.toUpperCase(to);
int lowerCaseFrom = Character.toLowerCase(upperCaseFrom);
int lowerCaseTo = Character.toLowerCase(upperCaseTo);
if (tree.a... | vuln | Vulnerable | Java |
const got = require('@/utils/got');
const parser = require('@/utils/rss-parser');
const cheerio = require('cheerio');
const { isValidHost } = require('@/utils/valid-host');
async function load(link, need_feed_description) {
const response = await got.get(link);
const $ = cheerio.load(response.data);
const ... | vuln | Safe | JavaScript |
inline void skip(int bytes) {
while (bytes > 0) {
int n = check(1, bytes);
ptr += n;
bytes -= n;
}
} | vuln | Vulnerable | C/C++ |
*/
private int
mconvert(struct magic_set *ms, struct magic *m, int flip)
{
union VALUETYPE *p = &ms->ms_value;
switch (cvt_flip(m->type, flip)) {
case FILE_BYTE:
cvt_8(p, m);
return 1;
case FILE_SHORT:
cvt_16(p, m);
return 1;
case FILE_LONG:
case FILE_DATE:
case FILE_LDATE:
cvt_32(p, m);
return 1;
... | vuln | Safe | C/C++ |
def _setup_environment_vars(self, algorithm_env: dict,
databases_to_use: list[str]) -> dict:
""""
Set environment variables required to run the algorithm
Parameters
----------
algorithm_env: dict
Dictionary with additional environment ... | vuln | Safe | Python |
static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *pict, int *got_packet)
{
const AVFrame *const p = pict;
const int near = avctx->prediction_method;
PutBitContext pb, pb2;
GetBitContext gb;
uint8_t *buf2 = NULL;
uint8_t *zero =... | vuln | Safe | C/C++ |
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
SecurityRequestContext.reset();
// Only set SecurityRequestContext for the HttpRequest but not for subsequence chunks.
// We cannot set a default/placeholder value until CDAP-18773
// is fixed since we may per... | vuln | Safe | Java |
static int vcpu_run(struct kvm_vcpu *vcpu)
{
int r;
vcpu->arch.l1tf_flush_l1d = true;
for (;;) {
if (kvm_vcpu_running(vcpu)) {
r = vcpu_enter_guest(vcpu);
} else {
r = vcpu_block(vcpu);
}
if (r <= 0)
break;
kvm_clear_request(KVM_REQ_UNBLOCK, vcpu);
if (kvm_xen_has_pending_events(vcpu))
kv... | vuln | Vulnerable | Unknown |
public static void compress(String name, List<TarFileEntry> files) throws IOException {
try (FileOutputStream fileOutputStream = new FileOutputStream(name)) {
try (TarArchiveOutputStream out = getTarArchiveOutputStream(fileOutputStream)) {
for (TarFileEntry tarFileEntry : files) {
addToArchi... | vuln | Safe | Java |
else if (S_ISLNK(mode)) {
/* acl_set_file() follows symbolic links, skip */
ret = ARCHIVE_OK;
} | vuln | Safe | C/C++ |
static int inet_listen_saddr(InetSocketAddress *saddr,
int port_offset,
bool update_addr,
Error **errp)
{
struct addrinfo ai,*res,*e;
char port[33];
char uaddr[INET6_ADDRSTRLEN+1];
char uport[33];
int rc, port_min... | vuln | Safe | C/C++ |
@RequiresNonNull({
"playerView",
"debugTextView",
"informationTextView",
"transformationStopwatch",
"progressViewGroup",
"debugFrame",
})
private Transformer createTransformer(@Nullable Bundle bundle, String filePath) {
Transformer.Builder transformerBuilder = new Transformer.Builder(/* ... | vuln | Safe | Java |
GC_allochblk_nth(size_t sz, int kind, unsigned flags, int n, int may_split)
{
struct hblk *hbp;
hdr * hhdr; /* Header corr. to hbp */
struct hblk *thishbp;
hdr * thishdr; /* Header corr. to thishbp */
signed_word size_needed; /* number of bytes in requested objects */... | vuln | Safe | Unknown |
static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
char
filename[MagickPathExtent];
const char
*option;
FILE
*file;
Image
*image,
*next;
int
status,
unique_file;
ssize_t
n;
SVGInfo
*svg_info;
unsigned char
message[MagickPathE... | vuln | Safe | C/C++ |
static int usb_xhci_post_load(void *opaque, int version_id)
{
XHCIState *xhci = opaque;
PCIDevice *pci_dev = PCI_DEVICE(xhci);
XHCISlot *slot;
XHCIEPContext *epctx;
dma_addr_t dcbaap, pctx;
uint32_t slot_ctx[4];
uint32_t ep_ctx[5];
int slotid, epid, state, intr;
dcbaap = xhci_addr64(... | vuln | Vulnerable | C/C++ |
'use strict'
const clones = require('clones')
const hasWindow = (typeof window !== 'undefined')
exports.hasWindow = hasWindow
const hasGlobal = (typeof global !== 'undefined')
exports.hasGlobal = hasGlobal
const NON_IDENTIFIER = /^\d|-|^(break|case|catch|continue|debugger|default|delete|do|else|finally|for|function... | vuln | Safe | JavaScript |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Vulnerable | C/C++ |
CString fileSystemRepresentation(const String&)
CString fileSystemRepresentation(const String& path)
{
const UChar* characters = path.characters();
int size = WideCharToMultiByte(CP_ACP, 0, characters, path.length(), 0, 0, 0, 0) - 1;
char* buffer;
CString string = CString::newUninitialized(size, buffe... | vuln | Safe | C/C++ |
var sanitize_html = function (html, allow_css) {
/**
* sanitize HTML
* if allow_css is true (default: false), CSS is sanitized as well.
* otherwise, CSS elements and attributes are simply removed.
*/
const options = {};
if (!allow_css) {
options... | vuln | Safe | JavaScript |
/*
*
* Copyright 2017 Asylo 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 applicable law or agree... | vuln | Safe | C/C++ |
static int sv_body(int s, int stype, unsigned char *context)
{
char *buf = NULL;
fd_set readfds;
int ret = 1, width;
int k, i;
unsigned long l;
SSL *con = NULL;
BIO *sbio;
struct timeval timeout;
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWAR... | vuln | Safe | Unknown |
void HTTPSession::onCertificate(uint16_t certId,
std::unique_ptr<IOBuf> authenticator) {
DestructorGuard dg(this);
VLOG(4) << "CERTIFICATE on" << *this << ", certId=" << certId;
bool isValid = false;
auto fizzBase = getTransport()->getUnderlyingTransport<AsyncFizzBase>();
if (... | vuln | Vulnerable | Unknown |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Vulnerable | C/C++ |
// Homer-App
//
// Homer-App User interface for WEB AI
//
// Schemes: http, https
// Host: localhost:9080
// BasePath: /api/v3
// Version: 1.1.2
// License: AGPL https://www.gnu.org/licenses/agpl-3.0.en.html
// Copyright: QXIP B.V. 2019-2020
//
// Consumes:
// - application/json
//
// ... | vuln | Vulnerable | Go |
PepperDeviceEnumerationHostHelper::PepperDeviceEnumerationHostHelper(
ppapi::host::ResourceHost* resource_host,
base::WeakPtr<Delegate> delegate,
PP_DeviceType_Dev device_type,
const GURL& document_url)
: resource_host_(resource_host),
delegate_(delegate),
device_type_(device_type),
... | vuln | Safe | C/C++ |
public String[] getOssNames() {
return ossNames;
} | vuln | Vulnerable | Java |
int v9fs_refresh_inode_dotl(struct p9_fid *fid, struct inode *inode)
{
loff_t i_size;
struct p9_stat_dotl *st;
struct v9fs_session_info *v9ses;
v9ses = v9fs_inode2v9ses(inode);
st = p9_client_getattr_dotl(fid, P9_STATS_ALL);
if (IS_ERR(st))
return PTR_ERR(st);
/*
* Don't update inode if the file type is dif... | vuln | Vulnerable | Unknown |
rx_cache_insert(netdissect_options *ndo,
const u_char *bp, const struct ip *ip, u_int dport)
{
struct rx_cache_entry *rxent;
const struct rx_header *rxh = (const struct rx_header *) bp;
if (!ND_TTEST_4(bp + sizeof(struct rx_header)))
return;
rxent = &rx_cache[rx_cache_next];
if (++rx_cache_nex... | vuln | Safe | Unknown |
# -*- coding: utf-8 -*-
# rdiffweb, A web interface to rdiff-backup repositories
# Copyright (C) 2012-2021 rdiffweb contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version ... | vuln | Safe | Python |
#!/usr/bin/env python
"""
Creates an HTTP server with basic auth and websocket communication.
"""
import argparse
import base64
import hashlib
import os
import time
import threading
import webbrowser
try:
import cStringIO as io
except ImportError:
import io
import tornado.web
import tornado.websocket
from tor... | vuln | Vulnerable | Python |
/*
* crun - OCI runtime written in C
*
* Copyright (C) 2017, 2018, 2019 Giuseppe Scrivano <giuseppe@scrivano.org>
* crun is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, o... | vuln | Vulnerable | C/C++ |
bool PPB_ImageData_Impl::Init(PP_ImageDataFormat format,
int width, int height,
bool init_to_zero) {
if (!IsImageDataFormatSupported(format))
return false; // Only support this one format for now.
if (width <= 0 || height <= 0)
return false;
... | vuln | Vulnerable | C/C++ |
// SPDX-License-Identifier: GPL-2.0+
/*
* EFI application loader
*
* Copyright (c) 2016 Alexander Graf
*/
#define LOG_CATEGORY LOGC_EFI
#include <common.h>
#include <bootm.h>
#include <charset.h>
#include <command.h>
#include <dm.h>
#include <efi_loader.h>
#include <efi_selftest.h>
#include <env.h>
#include <er... | vuln | Vulnerable | C/C++ |
rosbag::RecorderOptions parseOptions(int argc, char** argv) {
rosbag::RecorderOptions opts;
po::options_description desc("Allowed options");
desc.add_options()
("help,h", "produce help message")
("all,a", "record all topics")
("regex,e", "match topics using regular expressions")
("... | vuln | Safe | C/C++ |
void kvm_irqchip_add_irq_route(KVMState *s, int irq, int irqchip, int pin)
{
struct kvm_irq_routing_entry e;
assert(pin < s->gsi_count);
e.gsi = irq;
e.type = KVM_IRQ_ROUTING_IRQCHIP;
e.flags = 0;
e.u.irqchip.irqchip = irqchip;
e.u.irqchip.pin = pin;
kvm_add_routing_entry(s, &e);
} | vuln | Vulnerable | C/C++ |
LOCAL int populate_languages_metadata(MMDB_s *mmdb, MMDB_s *metadata_db,
MMDB_entry_s *metadata_start)
{
MMDB_entry_data_s entry_data;
const char *path[] = { "languages", NULL };
int status = MMDB_aget_value(metadata_start, &entry_data, path);
if (MMDB_SUCCESS != s... | vuln | Safe | C/C++ |
async def account_register_post(
request: Request,
U: str = Form(default=str()), # Username
E: str = Form(default=str()), # Email
H: str = Form(default="off"), # Hide Email
BE: str = Form(default=None), # Backup Email
R: str = Form(default=""), # Real Name
HP: str = Form(default=None), ... | vuln | Safe | Python |
/**
* 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"... | vuln | Safe | Java |
public String serializeCSV() {
return String.valueOf(playerUUID) + ';' +
serverUUID + ';' +
start + ';' +
end + ';' +
afkTime + ';' +
getExtraData(WorldTimes.class).orElseGet(WorldTimes::new).toJson() + ';' +
getExtr... | vuln | Vulnerable | Java |
import error from './error';
import objectHelper from './object';
function wrapCallback(cb, options) {
options = options || {};
options.ignoreCasing = options.ignoreCasing ? options.ignoreCasing : false;
return function(err, data) {
var errObj;
if (!err && !data) {
return cb(error.buildResponse('... | vuln | Safe | JavaScript |
xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt, int inputchk) {
xmlElementContentPtr ret = NULL, cur = NULL, n;
const xmlChar *elem = NULL;
GROW;
if (CMP7(CUR_PTR, '#', 'P', 'C', 'D', 'A', 'T', 'A')) {
SKIP(7);
SKIP_BLANKS;
SHRINK;
if (RAW == ')') {
if ((ctxt->validate) && (ctxt->input-... | vuln | Safe | C/C++ |
static gboolean nbd_accept(QIOChannel *ioc, GIOCondition condition,
gpointer opaque)
{
QIOChannelSocket *cioc;
if (!nbd_server) {
return FALSE;
}
cioc = qio_channel_socket_accept(QIO_CHANNEL_SOCKET(ioc),
NULL);
if (!cioc) {
... | vuln | Safe | C/C++ |
void HELPER(access_check_cp_reg)(CPUARMState *env, void *rip)
{
const ARMCPRegInfo *ri = rip;
switch (ri->accessfn(env, ri)) {
case CP_ACCESS_OK:
return;
case CP_ACCESS_TRAP:
case CP_ACCESS_TRAP_UNCATEGORIZED:
break;
default:
g_assert_not_reached();
}
rai... | vuln | Vulnerable | C/C++ |
static BROTLI_INLINE BrotliResult ProcessCommandsInternal(int safe,
BrotliState* s) {
int pos = s->pos;
int i = s->loop_counter;
BrotliResult result = BROTLI_RESULT_SUCCESS;
BrotliBitReader* br = &s->br;
if (!CheckInputAmount(safe, br, 28) || !WarmupBitReader(safe, br)) {
result = BROTLI_RESULT_NEEDS... | vuln | Vulnerable | C/C++ |
next_line(struct archive_read *a,
const char **b, ssize_t *avail, ssize_t *ravail, ssize_t *nl)
{
ssize_t len;
int quit;
quit = 0;
if (*avail == 0) {
*nl = 0;
len = 0;
} else
len = get_line_size(*b, *avail, nl);
/*
* Read bytes more while it does not reach the end of line.
*/
while (*nl == 0 && ... | vuln | Safe | Unknown |
Status ValidateInputsGenerateOutputs(
OpKernelContext* ctx, const Tensor** inputs, const Tensor** seq_len,
Tensor** log_prob, OpOutputList* decoded_indices,
OpOutputList* decoded_values, OpOutputList* decoded_shape) const {
Status status = ctx->input("inputs", inputs);
if (!status.ok()) return... | vuln | Safe | C/C++ |
public function write($template = '')
{
if (!empty($this->script_files)) {
$this->set_env('request_token', $this->app->get_request_token());
}
$commands = $this->get_js_commands($framed);
// if all js commands go to parent window we can ignore all
// script file... | vuln | Vulnerable | PHP |
hstore_from_array(PG_FUNCTION_ARGS)
{
ArrayType *in_array = PG_GETARG_ARRAYTYPE_P(0);
int ndims = ARR_NDIM(in_array);
int count;
int32 buflen;
HStore *out;
Pairs *pairs;
Datum *in_datums;
bool *in_nulls;
int in_count;
int i;
Assert(ARR_ELEMTYPE(in_array) == TEXTOID);
switch (ndims)
... | vuln | Safe | C/C++ |
static bool tcp_collapse_retrans(struct sock *sk, struct sk_buff *skb)
{
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *next_skb = skb_rb_next(skb);
int next_skb_size;
next_skb_size = next_skb->len;
BUG_ON(tcp_skb_pcount(skb) != 1 || tcp_skb_pcount(next_skb) != 1);
if (next_skb_size) {
if (next_skb_size <... | vuln | Vulnerable | Unknown |
static int nbd_co_send_request(BlockDriverState *bs,
NBDRequest *request,
QEMUIOVector *qiov)
{
NBDClientSession *s = nbd_get_client_session(bs);
int rc, ret, i;
qemu_co_mutex_lock(&s->send_mutex);
while (s->in_flight == MAX_NBD_REQUESTS) {
... | vuln | Safe | C/C++ |
iakerb_gss_delete_sec_context(OM_uint32 *minor_status,
gss_ctx_id_t *context_handle,
gss_buffer_t output_token)
{
OM_uint32 major_status = GSS_S_COMPLETE;
if (output_token != GSS_C_NO_BUFFER) {
output_token->length = 0;
output_token->v... | vuln | Vulnerable | C/C++ |
static OPJ_BOOL opj_pi_next_rpcl(opj_pi_iterator_t * pi)
{
opj_pi_comp_t *comp = NULL;
opj_pi_resolution_t *res = NULL;
OPJ_UINT32 index = 0;
if (!pi->first) {
goto LABEL_SKIP;
} else {
OPJ_UINT32 compno, resno;
pi->first = 0;
pi->dx = 0;
pi->dy = 0;
... | vuln | Vulnerable | Unknown |
static int64_t http_seek_internal(URLContext *h, int64_t off, int whence, int force_reconnect)
{
HTTPContext *s = h->priv_data;
URLContext *old_hd = s->hd;
uint64_t old_off = s->off;
uint8_t old_buf[BUFFER_SIZE];
int old_buf_size, ret;
AVDictionary *options = NULL;
if (whence == AVSEEK_SIZE... | vuln | Safe | Unknown |
@app.route('/savemoderation', methods=['POST'])
@login_required
def save_moderation():
"""Updates the approved state (true or false) of drawings."""
timestamp = time()
to_approve = request.form.getlist("do_approve")
approved = query_db('SELECT id from drawings WHERE is_approved = 1')
to_disapprove ... | vuln | Vulnerable | Python |
Status OplogApplicationChecks::checkAuthForCommand(OperationContext* opCtx,
const std::string& dbname,
const BSONObj& cmdObj,
OplogApplicationValidity validity) {
... | vuln | Vulnerable | Unknown |
const exec = require('async-execute');
/**
* Get remote repo name and owner
* @return {string{}}
*/
module.exports = async function remote() {
const origin = await exec('git remote get-url origin');
const nosuffix = origin.replace(/\.git$/, '');
const [ match ] = nosuffix.match(/[\w-]*\/[\w-]+$/) || [ nosuffix ]... | vuln | Vulnerable | JavaScript |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, print_function
import frappe
import time
from frappe import _, msgprint
from frappe.utils import flt, cstr, now, get_datetime_str, file_lock, date_diff
from frappe.model.base_doc... | vuln | Vulnerable | Python |
static int nut_read_header(AVFormatContext *s, AVFormatParameters *ap)
{
NUTContext *nut = s->priv_data;
ByteIOContext *bc = &s->pb;
int64_t pos;
int inited_stream_count;
nut->avf= s;
pos=0;
for(;;){
pos= find_startcode(bc, MAIN_STARTCODE, pos)+1;
if (pos<0){
... | vuln | Safe | C/C++ |
static int mov_write_hdlr_tag(AVIOContext *pb, MOVTrack *track)
{
const char *hdlr, *descr = NULL, *hdlr_type = NULL;
int64_t pos = avio_tell(pb);
if (!track) {
hdlr = "dhlr";
hdlr_type = "url ";
descr = "DataHandler";
} else {
hdlr = (track->mode == MODE_MOV) ? "mhlr" :... | vuln | Safe | C/C++ |
static int svq1_motion_inter_4v_block(DSPContext *dsp, GetBitContext *bitbuf,
uint8_t *current, uint8_t *previous,
int pitch, svq1_pmv *motion, int x, int y,
int width, int height)
{
uint8_t *src;
u... | vuln | Safe | C/C++ |
func resize(in []byte, n uint64) (head, tail []byte) {
if uint64(cap(in)) >= n {
head = in[:n]
} else {
head = make([]byte, n)
copy(head, in)
}
tail = head[len(in):]
return
} | vuln | Safe | Go |
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// This program 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... | vuln | Safe | Go |
static void gxf_read_index(AVFormatContext *s, int pkt_len) {
AVIOContext *pb = s->pb;
AVStream *st;
uint32_t fields_per_map = avio_rl32(pb);
uint32_t map_cnt = avio_rl32(pb);
int i;
pkt_len -= 8;
if ((s->flags & AVFMT_FLAG_IGNIDX) || !s->streams) {
avio_skip(pb, pkt_len);
re... | vuln | Safe | C/C++ |
static int mbochs_probe(struct mdev_device *mdev)
{
int avail_mbytes = atomic_read(&mbochs_avail_mbytes);
const struct mbochs_type *type =
&mbochs_types[mdev_get_type_group_id(mdev)];
struct device *dev = mdev_dev(mdev);
struct mdev_state *mdev_state;
int ret = -ENOMEM;
do {
if (avail_mbytes < type->mbytes)
... | vuln | Safe | Unknown |
@Override
public boolean canConnectFrom(BlockState state, Direction dir) {
return state.get(FACING) != dir;
} | vuln | Safe | Java |
def pdf_image(self, request, key, **kwargs):
pos = self.get_object()
image_vars = get_images(request.event)
if key not in image_vars:
raise NotFound('Unknown key')
image_file = image_vars[key]['evaluate'](pos, pos.order, pos.subevent or self.request.event)
if image_... | vuln | Safe | Python |
package environment
import (
"fmt"
"math"
"strconv"
"github.com/apex/log"
"github.com/pterodactyl/wings/config"
)
type Mount struct {
// In Docker environments this makes no difference, however in a non-Docker environment you
// should treat the "Default" mount as the root directory for the server. All other ... | vuln | Safe | Go |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2005-2022
* All rights reserved
*
* This file is part of GPAC / common tools sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser Gener... | vuln | Vulnerable | C/C++ |
static int gdb_set_spe_reg(CPUState *env, uint8_t *mem_buf, int n)
{
if (n < 32) {
#if defined(TARGET_PPC64)
target_ulong lo = (uint32_t)env->gpr[n];
target_ulong hi = (target_ulong)ldl_p(mem_buf) << 32;
env->gpr[n] = lo | hi;
#else
env->gprh[n] = ldl_p(mem_buf);
#endif
retur... | vuln | Vulnerable | C/C++ |
// imagew-jpeg.c
// Part of ImageWorsener, Copyright (c) 2011 by Jason Summers.
// For more information, see the readme.txt file.
#include "imagew-config.h"
#if IW_SUPPORT_JPEG == 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <setjmp.h>
#include <jpeglib.h>
#include <jerror... | vuln | Vulnerable | C/C++ |
qcrypto_tls_session_check_certificate(QCryptoTLSSession *session,
Error **errp)
{
int ret;
unsigned int status;
const gnutls_datum_t *certs;
unsigned int nCerts, i;
time_t now;
gnutls_x509_crt_t cert = NULL;
now = time(NULL);
if (now == ((time_t)-1))... | vuln | Vulnerable | C/C++ |
static _Bool have_gcrypt (void) /* {{{ */
{
static _Bool result = 0;
static _Bool need_init = 1;
if (!need_init)
return (result);
need_init = 0;
#if HAVE_LIBGCRYPT
# if GCRYPT_VERSION_NUMBER < 0x010600
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
# endif
if (!gcry_check_version (GCRY... | vuln | Vulnerable | Unknown |
void isor_reader_get_sample(ISOMChannel *ch)
{
GF_Err e;
u32 sample_desc_index;
if (ch->sample) return;
if (ch->next_track) {
ch->track = ch->next_track;
ch->next_track = 0;
}
if (ch->to_init) {
init_reader(ch);
sample_desc_index = ch->last_sample_desc_index;
} else if (ch->speed < 0) {
if (ch->last_... | vuln | Vulnerable | Unknown |
private function _notlastmodifiedby( $option ) {
$this->userQueryBuilder->addNotLastModifiedByConstraint( $option );
} | vuln | Safe | PHP |
static int formatIPTCfromBuffer(Image *ofile, char *s, ssize_t len)
{
char
temp[MagickPathExtent];
unsigned int
foundiptc,
tagsfound;
unsigned char
recnum,
dataset;
unsigned char
*readable,
*str;
ssize_t
tagindx,
taglen;
int
i,
tagcount = (int) (sizeof(tags) ... | vuln | Vulnerable | C/C++ |
SplashPath *Splash::makeDashedPath(SplashPath *path) {
SplashPath *dPath;
SplashCoord lineDashTotal;
SplashCoord lineDashStartPhase, lineDashDist, segLen;
SplashCoord x0, y0, x1, y1, xa, ya;
GBool lineDashStartOn, lineDashOn, newPath;
int lineDashStartIdx, lineDashIdx;
int i, j, k;
lineDashTotal = 0;
... | vuln | Safe | Unknown |
radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
unsigned long len, unsigned long pgoff,
unsigned long flags)
{
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
struct hstate *h = hstate_file(file);
struct vm_unmapped_area_info info;
if (unlikely(addr > mm->context.ad... | vuln | Safe | Unknown |
protected function fsock_get_contents(&$url, $timeout, $redirect_max, $ua, $outfp, $info)
{
$connect_timeout = 3;
$connect_try = 3;
$method = 'GET';
$readsize = 4096;
$ssl = '';
$getSize = null;
$headers = '';
$arr = $info;
if ($arr['scheme']... | vuln | Safe | PHP |
public synchronized void subscribe(final RemoteStream remoteStream,
final SubscribeOptions options, final ActionCallback<Subscription> callback) {
RCHECK(remoteStream);
if (!checkRoomStatus(RoomStates.CONNECTED)) {
triggerCallback(callback, new OwtError("Wrong room status."));
... | vuln | Vulnerable | Java |
i915_gem_execbuffer2(struct drm_device *dev, void *data,
struct drm_file *file)
{
struct drm_i915_gem_execbuffer2 *args = data;
struct drm_i915_gem_exec_object2 *exec2_list = NULL;
int ret;
if (args->buffer_count < 1) {
DRM_DEBUG("execbuf2 with %d buffers\n", args->buffer_count);
return -EINVAL;
}
ex... | vuln | Vulnerable | C/C++ |
CBINDInstallDlg::UpdateService(CString StartName) {
SC_HANDLE hSCManager;
SC_HANDLE hService;
if(m_toolsOnly)
return;
SetCurrent(IDS_OPEN_SCM);
hSCManager= OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
if (!hSCManager) {
MsgBox(IDS_ERR_OPEN_SCM, GetErrMessage());
return;
}
DWORD dwStart = SERVICE_D... | vuln | Safe | Unknown |
static int ql3xxx_probe(struct pci_dev *pdev,
const struct pci_device_id *pci_entry)
{
struct net_device *ndev = NULL;
struct ql3_adapter *qdev = NULL;
static int cards_found;
int uninitialized_var(pci_using_dac), err;
err = pci_enable_device(pdev);
if (err) {
pr_err("%s cannot enable PCI device\n", pci_nam... | vuln | Safe | Unknown |
static inline struct htx_blk *htx_add_header(struct htx *htx, const struct ist name,
const struct ist value)
{
struct htx_blk *blk;
/* FIXME: check name.len (< 256B) and value.len (< 1MB) */
blk = htx_add_blk(htx, HTX_BLK_HDR, name.len + value.len);
if (!blk)
return NULL;
blk->info += (value.len << 8... | vuln | Vulnerable | C/C++ |
function escape(arg, options = {}) {
const helpers = getPlatformHelpers();
const { flagProtection, interpolation, shellName } = parseOptions(
{ env: process.env, options },
helpers,
);
const argAsString = checkedToString(arg);
const escape = helpers.getEscapeFunction(shellName, { interpolation });
c... | vuln | Safe | JavaScript |
static void sfb_init_perturbation(u32 slot, struct sfb_sched_data *q)
{
q->bins[slot].perturbation = prandom_u32();
} | vuln | Vulnerable | Unknown |
/*
* Cantata
*
* Copyright (c) 2011-2018 Craig Drummond <craig.p.drummond@gmail.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 Foundation; either version 2 of the License, or
* (a... | vuln | Vulnerable | C/C++ |
package io.onedev.server.migration;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.text.MessageFormat;
... | vuln | Safe | Java |
static int iscsi_create(const char *filename, QEMUOptionParameter *options)
{
int ret = 0;
int64_t total_size = 0;
BlockDriverState bs;
IscsiLun *iscsilun = NULL;
QDict *bs_options;
memset(&bs, 0, sizeof(BlockDriverState));
while (options && options->name) {
if (!strcmp(options-... | vuln | Vulnerable | C/C++ |
inline gravity_value_t convert_value2bool (gravity_vm *vm, gravity_value_t v) {
if (VALUE_ISA_BOOL(v)) return v;
// handle conversion for basic classes
if (VALUE_ISA_INT(v)) return VALUE_FROM_BOOL(v.n != 0);
if (VALUE_ISA_FLOAT(v)) return VALUE_FROM_BOOL(v.f != 0.0);
if (VALUE_ISA_NULL(v)) return VALUE_FROM_FALS... | vuln | Safe | C/C++ |
public Request buildRequest(String baseUrl, String path, String method, List<Pair> queryParams,
List<Pair> collectionQueryParams, Object body, Map<String, String> headerParams,
Map<String, String> cookieParams, Map<String, Object> formParams, String[] authNames,
ApiCallback callback) throws ApiExcepti... | vuln | Safe | Java |
int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb)
{
MpegEncContext *s = &ctx->m;
unsigned startcode, v;
int ret;
int vol = 0;
/* search next start code */
align_get_bits(gb);
if (!s->studio_profile && s->avctx->bits_per_raw_sample != 8)
s->avctx->bits_per_... | vuln | Vulnerable | Unknown |
function at(target, path, update) {
path = pathToArray(path);
if (! path.length) {
return update(target, null);
}
const key = path[0];
if (isNumber(key)) {
if (! Array.isArray(target)) {
target = [];
}
}
else if (! isObject(target)) {
target = {};
}
validateKey(key);
if (pat... | vuln | Safe | JavaScript |
void bdrv_set_backing_hd(BlockDriverState *bs, BlockDriverState *backing_hd)
{
if (bs->backing_hd) {
assert(bs->backing_blocker);
bdrv_op_unblock_all(bs->backing_hd, bs->backing_blocker);
} else if (backing_hd) {
error_setg(&bs->backing_blocker,
"device is used as back... | vuln | Safe | C/C++ |
/**
*
*/
package com.salesmanager.shop.admin.model.content;
import javax.validation.constraints.NotEmpty;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import java.io.Serializable;
import java.util.List;
/**
* A bean class responsible for getting form data from shop Admin... | vuln | Vulnerable | Java |
private static void onClick(View v, String sourceContainer) {
// Make sure that rogue clicks don't get through while allapps is launching, or after the
// view has detached (it's possible for this to happen if the view is removed mid touch).
if (v.getWindowToken() == null) return;
Launc... | vuln | Vulnerable | Java |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | vuln | Vulnerable | Python |
int generic_permission(struct inode *inode, int mask)
{
int ret;
/*
* Do the basic permission checks.
*/
ret = acl_permission_check(inode, mask);
if (ret != -EACCES)
return ret;
if (S_ISDIR(inode->i_mode)) {
/* DACs are overridable for directories */
if (capable_wrt_inode_uidgid(inode, CAP_DAC_OVERRIDE... | vuln | Safe | C/C++ |
QPDF::dumpHPageOffset()
{
HPageOffset& t = this->m->page_offset_hints;
*this->m->out_stream
<< "min_nobjects: " << t.min_nobjects
<< std::endl
<< "first_page_offset: " << adjusted_offset(t.first_page_offset)
<< std::endl
<< "nbits_delta_nobjects: " << t.nbits_delta_nobjects
<< std::endl
<< "min_page_leng... | vuln | Vulnerable | Unknown |
static void my_skip_input_data_fn(j_decompress_ptr cinfo, long num_bytes_to_skip)
{
struct iwjpegrcontext *rctx = (struct iwjpegrcontext*)cinfo->src;
size_t bytes_still_to_skip;
int ret;
size_t bytesread;
// If the skip would leave some valid bytes in the buffer, ...
if(num_bytes_to_skip < (long)rctx->pub.bytes_... | vuln | Safe | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.