code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
def is_in_or_equal(path_1: str | Path, path_2: str | Path):
"""
True if path_1 is a descendant (i.e. located within) path_2 or if the paths are the
same, returns False otherwise.
Parameters:
path_1: str or Path (should be a file)
path_2: str or Path (can be a file or directory)
"""
... | vuln | Safe | Python |
__acquires(kernel_lock)
{
struct buffer_head *bh;
struct ext4_super_block *es = NULL;
struct ext4_sb_info *sbi;
ext4_fsblk_t block;
ext4_fsblk_t sb_block = get_sb_block(&data);
ext4_fsblk_t logical_sb_block;
unsigned long offset = 0;
unsigned long journal_devnum = 0;
unsigned long def_mount_opts;
struct inod... | vuln | Vulnerable | Unknown |
protected void validateXml(String xml) throws IllegalArgumentException {
if (xml==null || xml.toUpperCase().contains("<!DOCTYPE")) {
throw new IllegalArgumentException("Invalid metadata XML contents:"+xml);
}
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.n... | vuln | Safe | Java |
ripng_print(netdissect_options *ndo, const u_char *dat, unsigned int length)
{
register const struct rip6 *rp = (const struct rip6 *)dat;
register const struct netinfo6 *ni;
unsigned int length_left;
u_int j;
ND_TCHECK(rp->rip6_cmd);
switch (rp->rip6_cmd) {
case RIP6_REQUEST:
length_left = length;
if (leng... | vuln | Safe | C/C++ |
int32_t cli_bcapi_extract_new(struct cli_bc_ctx *ctx, int32_t id)
{
cli_ctx *cctx;
int res = -1;
cli_event_count(EV, BCEV_EXTRACTED);
cli_dbgmsg("previous tempfile had %u bytes\n", ctx->written);
if (!ctx->written)
return 0;
if (ctx->ctx && cli_updatelimits(ctx->ctx, ctx->written))
return -1;... | vuln | Safe | C/C++ |
static int qh_core(int sd, char *buf, unsigned int len)
{
char *space;
if (*buf == 0 || !strcmp(buf, "help")) {
nsock_printf_nul(sd,
"Query handler for manipulating nagios core.\n"
"Available commands:\n"
" loadctl Print information about current load control settings\n"
" loadctl <option... | vuln | Vulnerable | Unknown |
static int smka_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
SmackerAudioContext *s = avctx->priv_data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
GetBitContext gb;
HuffContext h[4] = { { 0 } };
VLC vlc[4] ... | vuln | Vulnerable | C/C++ |
def GameNewPlayed(Played, ID):
db.execute("UPDATE games set GamesPlayed = ? WHERE ID = ?", Played, ID)
database.commit() | vuln | Safe | Python |
static void decode_format80(const unsigned char *src, int src_size,
unsigned char *dest, int dest_size, int check_size) {
int src_index = 0;
int dest_index = 0;
int count;
int src_pos;
unsigned char color;
int i;
while (src_index < src_size) {
av_dlog(NULL, " opcode %02X: ",... | vuln | Safe | C/C++ |
protected void updateSearch() {
String searchString = searchField.getText();
if (refreshItemList || !searchLast.equals(searchString)) {
getScreenHandler().itemListClientSorted.clear();
boolean searchMod = false;
if (searchString.startsWith("@")) {
searchMod = true;
searchString = searchString.subst... | vuln | Safe | Java |
static CURL *get_curl_handle(void)
{
CURL *result = curl_easy_init();
if (!result)
die("curl_easy_init failed");
if (!curl_ssl_verify) {
curl_easy_setopt(result, CURLOPT_SSL_VERIFYPEER, 0);
curl_easy_setopt(result, CURLOPT_SSL_VERIFYHOST, 0);
} else {
/* Verify authenticity of the peer's certificate */
... | vuln | Safe | C/C++ |
status_t BnSoundTriggerHwService::onTransact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
switch(code) {
case LIST_MODULES: {
CHECK_INTERFACE(ISoundTriggerHwService, data, reply);
unsigned int numModulesReq = data.readInt32();
unsigned int numMo... | vuln | Vulnerable | C/C++ |
flatpak_dir_pull (FlatpakDir *self,
FlatpakRemoteState *state,
const char *ref,
const char *opt_rev,
const char **subpaths,
... | vuln | Vulnerable | C/C++ |
func ServerDefault(ops ...func(*tls.Config)) *tls.Config {
tlsconfig := &tls.Config{
// Avoid fallback by default to SSL protocols < TLS1.2
MinVersion: tls.VersionTLS12,
PreferServerCipherSuites: true,
CipherSuites: DefaultServerAcceptedCiphers,
}
for _, op := range ops {
op(tlsc... | vuln | Safe | Go |
static int pin_rcv_pages(struct hfi1_filedata *fd, struct tid_user_buf *tidbuf)
{
int pinned;
unsigned int npages;
unsigned long vaddr = tidbuf->vaddr;
struct page **pages = NULL;
struct hfi1_devdata *dd = fd->uctxt->dd;
/* Get the number of pages the user buffer spans */
npages = num_user_pages(vaddr, tidbuf->... | vuln | Vulnerable | Unknown |
static int snd_timer_user_tselect(struct file *file,
struct snd_timer_select __user *_tselect)
{
struct snd_timer_user *tu;
struct snd_timer_select tselect;
char str[32];
int err = 0;
tu = file->private_data;
if (tu->timeri) {
snd_timer_close(tu->timeri);
tu->timeri = NULL;
}
if (copy_from_user(&tsel... | vuln | Safe | C/C++ |
public Poly1305()
{
super(new org.bouncycastle.crypto.macs.Poly1305(new AESFastEngine()));
} | vuln | Vulnerable | Java |
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\... | vuln | Safe | C/C++ |
find_help_tags(
char_u *arg,
int *num_matches,
char_u ***matches,
int keep_lang)
{
char_u *s, *d;
int i;
// Specific tags that either have a specific replacement or won't go
// through the generic rules.
static char *(except_tbl[][2]) = {
{"*", "star"},
{"g*", "gstar"},
{"[*"... | vuln | Vulnerable | C/C++ |
int av_reallocp(void *ptr, size_t size)
{
void **ptrptr = ptr;
void *ret;
ret = av_realloc(*ptrptr, size);
if (!ret) {
return AVERROR(ENOMEM);
*ptrptr = ret; | vuln | Vulnerable | C/C++ |
package lfshttp
import (
"bytes"
"encoding/json"
"fmt"
"path/filepath"
"regexp"
"strings"
"time"
"github.com/git-lfs/git-lfs/config"
"github.com/git-lfs/git-lfs/subprocess"
"github.com/git-lfs/git-lfs/tools"
"github.com/rubyist/tracerx"
)
type SSHResolver interface {
Resolve(Endpoint, string) (sshAuthRes... | vuln | Safe | Go |
def empty
Log.add_info(request, params.inspect)
return unless request.post?
@folder_id = params[:id]
mail_account_id = params[:mail_account_id]
SqlHelper.validate_token([@folder_id, mail_account_id])
trash_folder = MailFolder.get_for(@login_user, mail_account_id, MailFolder::XTYPE_TRASH)
... | vuln | Safe | Ruby |
int Read(void* pDestBuffer, unsigned int nSize)
{
if (m_nPos >= m_nLen)
nSize = 0;
else if (nSize > (m_nLen - m_nPos))
nSize = m_nLen - m_nPos;
memcpy( pDestBuffer, (m_sFile + m_nPos), nSize );
m_nPos += nSize;
... | vuln | Safe | C/C++ |
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: https://www.espocrm.com
*
* EspoCRM is free software: you can redistribute i... | vuln | Safe | JavaScript |
/* jshint unused: false */
/* global Noty, Blob, window, atob, Joi, sigma, $, tippy, document, _, arangoHelper, frontendConfig, sessionStorage, localStorage, XMLHttpRequest */
(function () {
'use strict';
var isCoordinator = null;
window.isCoordinator = function (callback) {
if (isCoordinator === null) {
... | vuln | Safe | C/C++ |
static Image *ReadTIFFImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
#define MaxPixelChannels 32
#define ThrowTIFFException(severity,message) \
{ \
if (pixel_info != (MemoryInfo *) NULL) \
pixel_info=RelinquishVirtualMemory(pixel_info); \
if (quantum_info != (QuantumInfo *) NULL) \
quantu... | vuln | Vulnerable | C/C++ |
static struct dirent *local_readdir(FsContext *ctx, V9fsFidOpenState *fs)
{
struct dirent *entry;
again:
entry = readdir(fs->dir.stream);
if (!entry) {
return NULL;
}
if (ctx->export_flags & V9FS_SM_MAPPED) {
entry->d_type = DT_UNKNOWN;
} else if (ctx->export_flags & V9FS_SM_MA... | vuln | Vulnerable | Unknown |
static int hmac_create(struct crypto_template *tmpl, struct rtattr **tb)
{
struct shash_instance *inst;
struct crypto_alg *alg;
struct shash_alg *salg;
int err;
int ds;
int ss;
err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_SHASH);
if (err)
return err;
salg = shash_attr_alg(tb[1], 0, 0);
if (IS_ERR(sa... | vuln | Safe | C/C++ |
import logging
import yaml
import requests
import io
from redash import settings
from redash.query_runner import *
from redash.utils import json_dumps
logger = logging.getLogger(__name__)
try:
import pandas as pd
import numpy as np
enabled = True
except ImportError:
enabled = False
class CSV(BaseQu... | vuln | Vulnerable | Python |
ac_circ_buf_t *ac_circ_buf_new(u32 size, u32 elem_sz)
{
ac_circ_buf_t *cbuf;
if (!is_pow2(size))
return NULL;
cbuf = malloc(sizeof(ac_circ_buf_t));
cbuf->head = cbuf->tail = 0;
cbuf->size = size;
if (elem_sz == 0) {
cbuf->elem_sz = 1;
cbuf->type = PTR_BUF;
cbuf->buf.ptr_buf = malloc(size * sizeof(void ... | vuln | Vulnerable | C/C++ |
void iov_iter_advance(struct iov_iter *i, size_t bytes)
{
BUG_ON(i->count < bytes);
if (likely(i->nr_segs == 1)) {
i->iov_offset += bytes;
i->count -= bytes;
} else {
const struct iovec *iov = i->iov;
size_t base = i->iov_offset;
/*
* The !iov->iov_len check ensures we skip over unlikely
* zero-len... | vuln | Vulnerable | Unknown |
static int dsa_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8)
{
const unsigned char *p, *q, *pm;
int pklen, pmlen;
int ptype;
void *pval;
ASN1_STRING *pstr;
X509_ALGOR *palg;
ASN1_INTEGER *privkey = NULL;
BN_CTX *ctx = NULL;
DSA *dsa = NULL;
int ret = 0;
if (!PKCS8_p... | vuln | Safe | Unknown |
void fb_write_str(char *str, size_t len, const fb_t a, unsigned int radix) {
fb_t t;
int d, l, i, j;
char c;
fb_null(t);
l = fb_size_str(a, radix);
if (len < l) {
RLC_THROW(ERR_NO_BUFFER);
return;
}
len = l;
l = log_radix(radix);
if (!valid_radix(radix)) {
RLC_THROW(ERR_NO_VALID);
return;
}
if (... | vuln | Safe | C/C++ |
int ide_init_drive(IDEState *s, BlockDriverState *bs,
const char *version, const char *serial)
{
int cylinders, heads, secs;
uint64_t nb_sectors;
s->bs = bs;
bdrv_get_geometry(bs, &nb_sectors);
bdrv_guess_geometry(bs, &cylinders, &heads, &secs);
if (cylinders < 1 || cylinders ... | vuln | Vulnerable | C/C++ |
static void send_framebuffer_update_hextile(VncState *vs, int x, int y, int w, int h)
{
int i, j;
int has_fg, has_bg;
uint8_t *last_fg, *last_bg;
vnc_framebuffer_update(vs, x, y, w, h, 5);
last_fg = (uint8_t *) malloc(vs->depth);
last_bg = (uint8_t *) malloc(vs->depth);
has_fg = has_bg = 0;
... | vuln | Vulnerable | C/C++ |
static uint dump_routines_for_db(char *db)
{
char query_buff[QUERY_LENGTH];
const char *routine_type[]= {"FUNCTION", "PROCEDURE"};
char db_name_buff[NAME_LEN*2+3], name_buff[NAME_LEN*2+3];
char *routine_name;
int i;
FILE *sql_file= md_result_file;
MYSQL_RES *routine_res, *r... | vuln | Safe | Unknown |
public byte[] allocateJobCaches(String cacheAllocationRequestString) {
CacheAllocationRequest cacheAllocationRequest = CacheAllocationRequest.fromString(cacheAllocationRequestString);
return SerializationUtils.serialize((Serializable) jobManager.allocateJobCaches(
getJobToken(), cacheAllocationRequest.getCurren... | vuln | Safe | Java |
function set_up(container) {
// Find prev/next links
var prev = container.find('.pagination .prev');
var next = container.find('.pagination .next');
var prev_url = null, next_url = null;
if (prev.length)
prev_url = prev.attr('href');
... | vuln | Vulnerable | JavaScript |
Track::GetContentEncodingByIndex(unsigned long idx) const {
const ContentEncoding* Track::GetContentEncodingByIndex(
unsigned long idx) const {
const ptrdiff_t count =
content_encoding_entries_end_ - content_encoding_entries_;
assert(count >= 0);
if (idx >= static_cast<unsigned long>(count))
return ... | vuln | Safe | C/C++ |
static int vp3_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
Vp3DecodeContext *s = avctx->priv_data;
GetBitContext gb;
static int counter = 0;
*data_size = 0;
init_get_bits(&gb, buf, buf_size * 8... | vuln | Safe | C/C++ |
/* mqtt_client.c
*
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfMQTT.
*
* wolfMQTT 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
* (at your... | vuln | Vulnerable | C/C++ |
int hfs_cat_find_brec(struct super_block *sb, u32 cnid,
struct hfs_find_data *fd)
{
hfs_cat_rec rec;
int res, len, type;
hfs_cat_build_key(sb, fd->search_key, cnid, NULL);
res = hfs_brec_read(fd, &rec, sizeof(rec));
if (res)
return res;
type = rec.type;
if (type != HFS_CDR_THD && type != HFS_CDR_FTH)... | vuln | Safe | Unknown |
def __call__(self, func):
@functools.wraps(func)
def check_user_or_serial_in_request_wrapper(*args, **kwds):
user = self.request.all_data.get("user", "").strip()
serial = self.request.all_data.get("serial", "").strip()
if not serial and not user:
raise... | vuln | Safe | Python |
/*
* Copyright (C) 1996-2022 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
* Please see the COPYING and CONTRIBUTORS files for details.
*/
/* DEBUG: section 10 Gopher */
#include ... | vuln | Safe | C/C++ |
static GdkPixbuf *get_contiguous_pixbuf (guint width,
guint height,
gboolean has_alpha)
{
guchar *pixels;
guint channels, rowstride, bytes;
if (has_alpha)
channels = 4;
else
channels = 3;
rowstride = width * channels;
if (rowstride / channels != width)
return NULL; ... | vuln | Vulnerable | Unknown |
static int
decompress_r2007 (BITCODE_RC *restrict dst, int dst_size,
BITCODE_RC *restrict src, int src_size)
{
uint32_t length = 0;
uint32_t offset = 0;
BITCODE_RC *dst_start = dst;
BITCODE_RC *dst_end = dst + dst_size;
BITCODE_RC *src_end = src + src_size;
unsigned char opcode;
if (!s... | vuln | Safe | C/C++ |
Jsi_RC jsi_StaticArgTypeCheck(Jsi_Interp *interp, int atyp, const char *p1, const char *p2, int index, Jsi_Func *func, jsi_Pline *line) {
Assert(index>0);
Jsi_RC rc;
if (interp->typeCheck.parse==0 && interp->typeCheck.all==0)
return JSI_OK;
int ai = index-1+func->callflags.bits.addargs;
if (... | vuln | Safe | C/C++ |
export function setByKeyPath(obj, keyPath, value) {
if (!obj || keyPath === undefined) return;
if ('isFrozen' in Object && Object.isFrozen(obj)) return;
if (typeof keyPath !== 'string' && 'length' in keyPath) {
assert(typeof value !== 'string' && 'length' in value);
for (var i = 0, l = keyPa... | vuln | Vulnerable | JavaScript |
bool ParseMessageSetItemImpl(io::CodedInputStream* input, MS ms) {
// This method parses a group which should contain two fields:
// required int32 type_id = 2;
// required data message = 3;
uint32_t last_type_id = 0;
// If we see message data before the type_id, we'll append it to this so
// we can p... | vuln | Vulnerable | Unknown |
static inline void RENAME(bgr24ToUV_mmx)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, long width, enum PixelFormat srcFormat)
{
__asm__ volatile(
"movq 24+%4, %%mm6 \n\t"
"mov %3, %%"REG_a" \n\t"
"pxor %%mm7, %%mm7 ... | vuln | Safe | C/C++ |
@Override
public void tick() {
getWorldServer().profiler.startSection("playerCubeMapTick");
long currentTime = this.getWorldServer().getTotalWorldTime();
getWorldServer().profiler.startSection("addPendingPlayers");
if (!pendingPlayerAdd.isEmpty()) {
// copy in case playe... | vuln | Vulnerable | Java |
file_add_mapi_attrs (File* file, MAPI_Attr** attrs)
{
int i;
for (i = 0; attrs[i]; i++)
{
MAPI_Attr* a = attrs[i];
if (a->num_values)
{
switch (a->name)
{
case MAPI_ATTACH_LONG_FILENAME:
assert(a->type == szMAPI_STRING);
if (file->name) XFREE(file->name);
file->name = strdup( ... | vuln | Safe | C/C++ |
// Code generated by go-swagger; DO NOT EDIT.
// 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 ... | vuln | Safe | Go |
ip_cancel_eval_core(interp, msg, flag)
Tcl_Interp *interp;
VALUE msg;
int flag;
{
#if TCL_MAJOR_VERSION < 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 6)
rb_raise(rb_eNotImpError,
"cancel_eval is supported Tcl/Tk8.6 or later.");
UNREACHABLE;
#else
Tcl_Obj *msg_obj;
if (NIL_P(m... | vuln | Safe | Unknown |
static gboolean cosine_read(wtap *wth, int *err, gchar **err_info,
gint64 *data_offset)
{
gint64 offset;
int pkt_len;
char line[COSINE_LINE_LENGTH];
/* Find the next packet */
offset = cosine_seek_next_packet(wth, err, err_info, line);
if (offset < 0)
return FALSE;
*data_offset = offset;
/* Parse the he... | vuln | Vulnerable | C/C++ |
import { FlowRouter } from 'meteor/ostrio:flow-router-extra'
import './projectAccessRights.html'
import { t, i18nReady } from '../../utils/i18n.js'
import {
validateEmail, getGlobalSetting, showToast,
} from '../../utils/frontend_helpers'
import Projects from '../../api/projects/projects.js'
Template.projectAccessRi... | vuln | Vulnerable | JavaScript |
private void cleanUpSurface() {
tx.close();
maybeOnDragEnd();
// Synchronize removing the drag surface with the next draw after calling
// maybeOnDragEnd()
SurfaceControl.Transaction transaction = new SurfaceControl.Transaction();
... | vuln | Safe | Java |
int net_init_tap(const NetClientOptions *opts, const char *name,
NetClientState *peer, Error **errp)
{
const NetdevTapOptions *tap;
int fd, vnet_hdr = 0, i = 0, queues;
const char *script = NULL;
const char *downscript = NULL;
Error *err = NULL;
const char *vhostfdname;
... | vuln | Safe | C/C++ |
i_alloc_struct_array(gs_memory_t * mem, uint num_elements,
gs_memory_type_ptr_t pstype, client_name_t cname)
{
gs_ref_memory_t * const imem = (gs_ref_memory_t *)mem;
obj_header_t *obj;
ulong lsize;
#ifdef MEMENTO
if (Memento_failThisEvent())
return NULL;
#endif
ALLOC_CH... | vuln | Safe | Unknown |
const CuePoint* Cues::GetLast() const {
if (m_cue_points == NULL)
return NULL;
if (m_count <= 0)
return NULL;
#if 0
LoadCuePoint(); //init cues
const size_t count = m_count + m_preload_count;
if (count == 0) //weird
return NULL;
const size_t index = count - 1;
CuePoint* cons... | vuln | Vulnerable | C/C++ |
function advancedFilterSearch($queue, $filter)
{
global $database_ged;
$datas = array();
if($filter == "description"){
echo json_encode($datas);
return false;
}
$gedsql_result1=sqlrequest($database_ged,"SELECT pkt_type_id,pkt_type_name FROM pkt_type WHERE pkt_type_id!='0' AND pkt_type_id<'100';");
while... | vuln | Vulnerable | PHP |
static int _dns_encode_domain(struct dns_context *context, const char *domain)
{
int num = 0;
int total_len = 0;
unsigned char *ptr_num = context->ptr++;
int dict_offset = 0;
dict_offset = _dns_get_domain_offset(context, domain);
total_len++;
/*[len]string[len]string...[0]0 */
while (_dns_left_len(context) > ... | vuln | Safe | C/C++ |
private void postLogin(User user) {
identity.login();
log.debug("Configuring application after user '{}' login", user.getUid());
GluuCustomPerson person = findPersonByDn(user.getDn());
identity.setUser(person);
// Set user roles
UserRole[] userRoles = securityService.get... | vuln | Vulnerable | Java |
def requires_access_decorator(func: T):
@wraps(func)
def decorated(*args, **kwargs):
__tracebackhide__ = True # Hide from pytest traceback.
appbuilder = current_app.appbuilder
dag_id = (
kwargs.get("dag_id")
or request.args.get("dag_... | vuln | Safe | Python |
def delete(self, path=None):
"""
Delete file or folder
"""
if not self.validate_request('delete'):
return unauthorized(self.ERROR_NOT_ALLOWED['Error'])
if self.shared_dir:
the_dir = self.shared_dir
else:
the_dir = self.dir if self.dir i... | vuln | Safe | Python |
QPDF::makeIndirectObject(QPDFObjectHandle oh)
{
int max_objid = toI(getObjectCount());
QPDFObjGen next(max_objid + 1, 0);
this->m->obj_cache[next] =
ObjCache(QPDFObjectHandle::ObjAccessor::getObject(oh), -1, -1);
return QPDFObjectHandle::Factory::newIndirect(
this, next.getObj(), next.getGen())... | vuln | Safe | Unknown |
public synchronized Connection<T> registerConnection(ConnectionProtocol<T> connection) {
if(Log.isDebugEnabled()) {
Log.debug("Connection {} is now authenticated", connection.getSessionIdentifier());
}
Connection<T> con = activeConnections.get(connection.getSessionIdentifier());
if... | vuln | Safe | Java |
static function lookup($var) {
if (is_array($var))
return parent::lookup($var);
elseif (is_numeric($var))
return parent::lookup(array('staff_id' => (int) $var));
elseif (Validator::is_email($var))
return parent::lookup(array('email' => $var));
elseif (... | vuln | Safe | PHP |
def cookies(self):
# type: () -> Dict[str, str]
return self.request.COOKIES | vuln | Vulnerable | Python |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2006-2019
* 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 Le... | vuln | Vulnerable | C/C++ |
protocol_handshake_oldstyle (struct connection *conn)
{
struct old_handshake handshake;
int64_t r;
uint64_t exportsize;
uint16_t gflags, eflags;
/* In --tls=require / FORCEDTLS mode, old style handshakes are
* rejected because they cannot support TLS.
*/
if (tls == 2) {
nbdkit_error ("non-TLS cli... | vuln | Vulnerable | Unknown |
public List<Realm> getPossibleWorlds() {
List<Realm> joinableRealms = new ArrayList<>();
HttpUriRequest request = RequestBuilder.get()
.setUri(REALMS_ENDPOINT + "/worlds")
.setHeader(HttpHeaders.CONTENT_TYPE, "application/json")
.build();
try {
... | vuln | Vulnerable | Java |
static int php_handler(request_rec *r)
{
php_struct * volatile ctx;
void *conf;
apr_bucket_brigade * volatile brigade;
apr_bucket *bucket;
apr_status_t rv;
request_rec * volatile parent_req = NULL;
TSRMLS_FETCH();
#define PHPAP_INI_OFF php_apache_ini_dtor(r, parent_req TSRMLS_CC);
conf = ap_get_module_config(... | vuln | Safe | C/C++ |
static TCGv gen_ea(CPUM68KState *env, DisasContext *s, uint16_t insn,
int opsize, TCGv val, TCGv *addrp, ea_what what)
{
TCGv reg;
TCGv result;
uint32_t offset;
switch ((insn >> 3) & 7) {
case 0:
reg = DREG(insn, 0);
if (what == EA_STORE) {
gen_partset... | vuln | Vulnerable | C/C++ |
int main(int argc, char *argv[])
{
int free_query_string = 0;
int exit_status = SUCCESS;
int cgi = 0, c, i, len;
zend_file_handle file_handle;
char *s;
/* temporary locals */
int behavior = PHP_MODE_STANDARD;
int no_headers = 0;
int orig_optind = php_optind;
char *orig_optarg = php_optarg;
char *script_file... | vuln | Safe | Unknown |
static int read_public_key(RSA *rsa)
{
int r;
sc_path_t path;
sc_file_t *file;
u8 buf[2048], *p = buf;
size_t bufsize, keysize;
r = select_app_df();
if (r)
return 1;
sc_format_path("I1012", &path);
r = sc_select_file(card, &path, &file);
if (r) {
fprintf(stderr, "Unable to select public key file: %s\n", ... | vuln | Vulnerable | Unknown |
int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src)
{
int ret, i;
av_assert0(!dst->f->buf[0]);
av_assert0(src->f->buf[0]);
av_assert0(src->tf.f == src->f);
dst->tf.f = dst->f;
ret = ff_thread_ref_frame(&dst->tf, &src->tf);
if (ret < 0)
goto fail;
dst->qsca... | vuln | Vulnerable | C/C++ |
@Override
public void follow() {
Building core = player.closestCore();
Item item = items.min(i -> indexer.hasOre(i) && player.unit().canMine(i), i -> core.items.get(i));
if (item == null) return;
if (player.unit().maxAccepted(item) == 0) { // drop off
if (player.within(c... | vuln | Vulnerable | Java |
private void extractConfigSettings(Artifact artifact) throws MojoExecutionException {// NOSONAR
try (JarFile configSettings = new JarFile(artifact.getFile())) {
Enumeration<JarEntry> entries = configSettings.entries();
while (entries.hasMoreElements()) {
JarEntry jarFileE... | vuln | Vulnerable | Java |
int32_t FASTCALL get_word (WavpackStream *wps, int chan, int32_t *correction)
{
register struct entropy_data *c = wps->w.c + chan;
uint32_t ones_count, low, mid, high;
int32_t value;
int sign;
if (!wps->wvbits.ptr)
return WORD_EOF;
if (correction)
*correction = 0;
if (!(wp... | vuln | Vulnerable | C/C++ |
@Override
public void transform(Deobfuscator deobfuscator) throws Exception {
deobfuscator.classes().stream()
.filter(classNode -> classNode.superName.equals("java/lang/ClassLoader"))
.filter(classNode -> classNode.fields != null)
.filter(classNode -> !classNo... | vuln | Vulnerable | Java |
@GetMapping(value=OSS.LIST_AJAX)
public @ResponseBody ResponseEntity<Object> listAjax(
OssMaster ossMaster
, HttpServletRequest req
, HttpServletResponse res
, Model model){
int page = Integer.parseInt(req.getParameter("page"));
int rows = Integer.parseInt(req.getParameter("rows"));
String sidx = req... | vuln | Safe | Java |
Expr *sqlite3CreateColumnExpr(sqlite3 *db, SrcList *pSrc, int iSrc, int iCol){
Expr *p = sqlite3ExprAlloc(db, TK_COLUMN, 0, 0);
if( p ){
struct SrcList_item *pItem = &pSrc->a[iSrc];
Table *pTab = p->y.pTab = pItem->pTab;
p->iTable = pItem->iCursor;
if( p->y.pTab->iPKey==iCol ){
p->iColumn = -1... | vuln | Safe | C/C++ |
static void intel_hda_update_int_sts(IntelHDAState *d)
{
uint32_t sts = 0;
uint32_t i;
if (d->rirb_sts & ICH6_RBSTS_IRQ) {
sts |= (1 << 30);
}
if (d->rirb_sts & ICH6_RBSTS_OVERRUN) {
sts |= (1 << 30);
}
if (d->state_sts & d->wake_en) {
sts |= (1 << 30);
}
... | vuln | Safe | C/C++ |
package com.salesmanager.shop.model.catalog.product.attribute;
import java.util.ArrayList;
import java.util.List;
import com.salesmanager.shop.model.catalog.product.attribute.api.ReadableProductOptionValueEntity;
public class ReadableProductOption extends ProductOption {
/**
*
*/
private static final long se... | vuln | Vulnerable | Java |
ath6kl_usb_alloc_urb_from_pipe(struct ath6kl_usb_pipe *pipe)
{
struct ath6kl_urb_context *urb_context = NULL;
unsigned long flags;
/* bail if this pipe is not initialized */
if (!pipe->ar_usb)
return NULL;
spin_lock_irqsave(&pipe->ar_usb->cs_lock, flags);
if (!list_empty(&pipe->urb_list_head)) {
urb_context... | vuln | Safe | Unknown |
Prism.languages.nix = {
'comment': /\/\*[\s\S]*?\*\/|#.*/,
'string': {
pattern: /"(?:[^"\\]|\\[\s\S])*"|''(?:(?!'')[\s\S]|''(?:'|\\|\$\{))*''/,
greedy: true,
inside: {
'interpolation': {
// The lookbehind ensures the ${} is not preceded by \ or ''
pattern: /(^|(?:^|(?!'').)[^\\])\$\{(?:[^}]|\{[^}]*\}... | vuln | Vulnerable | JavaScript |
static int virtio_net_handle_mac(VirtIONet *n, uint8_t cmd,
struct iovec *iov, unsigned int iov_cnt)
{
struct virtio_net_ctrl_mac mac_data;
size_t s;
NetClientState *nc = qemu_get_queue(n->nic);
if (cmd == VIRTIO_NET_CTRL_MAC_ADDR_SET) {
if (iov_size(iov, iov_cnt... | vuln | Vulnerable | C/C++ |
final void requestUnmaximized() {
if (nativePtr != 0) {
nativeRequestUnmaximized(nativePtr);
}
} | vuln | Vulnerable | Java |
/*
* 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 | Safe | Java |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import re
# see https://gist.github.com/dperini/729294
URL_REGEX = re.compile(
# protocol identifier
"(?:(?:https?|ftp)://)"
# user:pass authentication
"(?:\S+(?::\S*)?@)?"
"(?:"
# IP address exclus... | vuln | Vulnerable | Python |
public void setDirectory(String path) {
//Log.d("Files", "Path: " + path);
try {
current = new File(path);
appendHistory(path);
if (!current.canRead())
Log.e("Files", "Cannot read contents of directory");
if (!current.exists())
... | vuln | Safe | Java |
@Override
public EntityDimensions getDimensions(Pose pPose, EntityDimensions original) {
return this.fellTreesGoal.shouldUseLumberjackDimensions() ? this.lumberJackDimensions : original;
} | vuln | Vulnerable | Java |
public void postWorldRenderEvent(float delta) {
renderer.allowMatrixUpdate = false;
if (scriptError || luaRuntime == null || worldRenderLimit == 0)
return;
tryCall(luaRuntime.events.POST_WORLD_RENDER, Math.max(worldRenderLimit - worldRenderInstructions, 1), LuaDouble.valueOf(delta)... | vuln | Vulnerable | Java |
@Override
public boolean matches(HttpServletRequest request) {
boolean matches = !RestRequestMatcher.INSTANCE.matches(request)
&& !IgnoredRequestMatcher.INSTANCE.matches(request)
&& !samlMetaEndpoint.matcher(request.getRequestURI()).matches()
&& !samlEndpoint.matcher(request.getRequestURI()).matches()
... | vuln | Vulnerable | Java |
static bool scsi_target_emulate_report_luns(SCSITargetReq *r)
{
BusChild *kid;
int i, len, n;
int channel, id;
bool found_lun0;
if (r->req.cmd.xfer < 16) {
return false;
}
if (r->req.cmd.buf[2] > 2) {
return false;
}
channel = r->req.dev->channel;
id = r->req.dev-... | vuln | Safe | C/C++ |
@Implementation(minSdk = LOLLIPOP_MR1)
protected List<SubscriptionInfo> getActiveSubscriptionInfoList() {
checkReadPhoneStatePermission();
return subscriptionList;
} | vuln | Safe | Java |
/*
* Univention Directory Notifier
*
* Copyright 2004-2019 Univention GmbH
*
* http://www.univention.de/
*
* All rights reserved.
*
* The source code of this program is made available
* under the terms of the GNU Affero General Public License version 3
* (GNU AGPL V3) as published by the Free Software Founda... | vuln | Vulnerable | C/C++ |
@Override
public void onDestroyView() {
super.onDestroyView();
binding = null;
} | vuln | Vulnerable | Java |
static Image *ReadRLAImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
typedef struct _WindowFrame
{
short
left,
right,
bottom,
top;
} WindowFrame;
typedef struct _RLAInfo
{
WindowFrame
window,
active_window;
short
frame,
storage_type,
... | vuln | Vulnerable | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.