code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
/*
* NET An implementation of the SOCKET network access protocol.
*
* Version: @(#)socket.c 1.1.93 18/02/95
*
* Authors: Orest Zborowski, <obz@Kodak.COM>
* Ross Biro
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
*
* Fixes:
* Anonymous : NOTSOCK/BADF cleanup. Error fix in
* shutdown()
* Alan Co... | vuln | Safe | C/C++ |
static void vfio_msix_enable(VFIOPCIDevice *vdev)
{
vfio_disable_interrupts(vdev);
vdev->msi_vectors = g_malloc0(vdev->msix->entries * sizeof(VFIOMSIVector));
vdev->interrupt = VFIO_INT_MSIX;
vfio_msix_vector_do_use(&vdev->pdev, 0, NULL, NULL);
vfio_msix_vector_release(&vdev->pdev, 0);
if (... | vuln | Vulnerable | C/C++ |
async def get_earliest_token_for_stats(
self, stats_type: str, id: str
) -> Optional[int]:
"""
Fetch the "earliest token". This is used by the room stats delta
processor to ignore deltas that have been processed between the
start of the background task and any particular room... | vuln | Safe | Python |
open_pcsc_reader_wrapped (const char *portstr)
{
int slot;
reader_table_t slotp;
int fd, rp[2], wp[2];
int n, i;
pid_t pid;
size_t len;
unsigned char msgbuf[9];
int err;
unsigned int dummy_status;
/* Note that we use the constant and not the fucntion because this
code won't be be used under Wi... | vuln | Vulnerable | Unknown |
/*
BSD 2-Clause License
Copyright (c) 2018, lynnl
Cleaned up and refactored for r2 in 2021: condret
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 ab... | vuln | Safe | C/C++ |
BGD_DECLARE(void *) gdImagePngPtr (gdImagePtr im, int *size)
{
void *rv;
gdIOCtx *out = gdNewDynamicCtx (2048, NULL);
if (out == NULL) return NULL;
if (!_gdImagePngCtxEx (im, out, -1)) {
rv = gdDPExtractData (out, size);
} else {
rv = NULL;
}
out->gd_free (out);
return rv;
} | vuln | Safe | Unknown |
#include "encoding.h"
#include <Windows.h>
namespace {
// Wrapper for Windows API MultiByteToWideChar.
std::wstring MB2WC(const std::string& input, unsigned int code_page) {
if (input.empty()) {
return L"";
}
int length = ::MultiByteToWideChar(code_page, 0, &input[0],
... | vuln | Vulnerable | C/C++ |
// SPDX-License-Identifier: GPL-2.0-only
#include <linux/types.h>
#include <linux/skbuff.h>
#include <linux/socket.h>
#include <linux/sysctl.h>
#include <linux/net.h>
#include <linux/module.h>
#include <linux/if_arp.h>
#include <linux/ipv6.h>
#include <linux/mpls.h>
#include <linux/netconf.h>
#include <linux/nospec.h>
... | vuln | Vulnerable | C/C++ |
int ff_slice_thread_init(AVCodecContext *avctx)
{
SliceThreadContext *c;
int thread_count = avctx->thread_count;
#if HAVE_W32THREADS
w32thread_init();
#endif
if (av_codec_is_encoder(avctx->codec) &&
avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO &&
avctx->height > 2800)
thread_co... | vuln | Safe | C/C++ |
void unix_gc(void)
{
struct unix_sock *u;
struct unix_sock *next;
struct sk_buff_head hitlist;
struct list_head cursor;
LIST_HEAD(not_cycle_list);
spin_lock(&unix_gc_lock);
/* Avoid a recursive GC. */
if (gc_in_progress)
goto out;
gc_in_progress = true;
/*
* First, select candidates for garbage collect... | vuln | Safe | Unknown |
static int nc_dns(ASN1_IA5STRING *dns, ASN1_IA5STRING *base)
{
char *baseptr = (char *)base->data;
char *dnsptr = (char *)dns->data;
/* Empty matches everything */
if (base->length == 0)
return X509_V_OK;
if (dns->length < base->length)
return X509_V_ERR_PERMITTED_VIOLATION;
/... | vuln | Safe | Unknown |
public String getHeader() {
try {
return URLDecoder.decode(header, "UTF-8"); // header is url encoded
} catch (UnsupportedEncodingException e) {
return null;
}
} | vuln | Vulnerable | Java |
PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
: PrintManager(web_contents),
printing_rfh_(nullptr),
printing_succeeded_(false),
inside_inner_message_loop_(false),
#if !defined(OS_MACOSX)
expecting_first_page_(true),
#endif
queue_(g_browser_process->p... | vuln | Vulnerable | C/C++ |
@Override
public void detectAndSendChanges() {
lastTickIndexToFlow.clear();
BatchedCrystalUpdate update = new BatchedCrystalUpdate(tile.getIDHash(), tile.getEnergyStored());
for (byte i = 0; i < tile.getFlowRates().size(); i++) {
byte flow = tile.getFlowRates().get(i);
... | vuln | Vulnerable | Java |
int vhdx_parse_log(BlockDriverState *bs, BDRVVHDXState *s, bool *flushed,
Error **errp)
{
int ret = 0;
VHDXHeader *hdr;
VHDXLogSequence logs = { 0 };
hdr = s->headers[s->curr_header];
*flushed = false;
if (s->log.hdr == NULL) {
s->log.hdr = qemu_blockalign(bs, siz... | vuln | Safe | C/C++ |
void *zrealloc(void *ptr, size_t size) {
#ifndef HAVE_MALLOC_SIZE
void *realptr;
#endif
size_t oldsize;
void *newptr;
if (size == 0 && ptr != NULL) {
zfree(ptr);
return NULL;
}
if (ptr == NULL) return zmalloc(size);
#ifdef HAVE_MALLOC_SIZE
oldsize = zmalloc_size(ptr);
ne... | vuln | Vulnerable | Unknown |
static int mp_dacl_removexattr(FsContext *ctx,
const char *path, const char *name)
{
int ret;
char *buffer;
buffer = rpath(ctx, path);
ret = lremovexattr(buffer, MAP_ACL_DEFAULT);
if (ret == -1 && errno == ENODATA) {
errno = 0;
ret = 0;
}
... | vuln | Vulnerable | C/C++ |
Pl_LZWDecoder::sendNextCode()
{
int high = this->byte_pos;
int med = (this->byte_pos + 1) % 3;
int low = (this->byte_pos + 2) % 3;
int bits_from_high = 8 - this->bit_pos;
int bits_from_med = this->code_size - bits_from_high;
int bits_from_low = 0;
if (bits_from_med > 8)
{
bits_from_low... | vuln | Vulnerable | Unknown |
public V1AccessPermission build() {
return new V1AccessPermission(new V1AccessResourceMatcher(pattern, patternType, type), operations);
} | vuln | Vulnerable | Java |
public LowMemoryException createLowMemoryIfNeeded(Function function,
Set<? extends DistributedMember> memberSet) {
if (function.optimizeForWrite()
&& !MemoryThresholds.isLowMemoryExceptionDisabled()) {
Set<DistributedMember> criticalMembersFrom = getHeapCriticalMembersFrom(memberSet);
if (... | vuln | Vulnerable | Java |
static int ass_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr,
AVPacket *avpkt)
{
const char *ptr = avpkt->data;
int len, size = avpkt->size;
while (size > 0) {
int duration;
ASSDialog *dialog = ff_ass_split_dialog(avctx->priv_data, ptr, 0, NULL)... | vuln | Safe | C/C++ |
static int raw_cmd_copyin(int cmd, void __user *param,
struct floppy_raw_cmd **rcmd)
{
struct floppy_raw_cmd *ptr;
int ret;
int i;
*rcmd = NULL;
loop:
ptr = kmalloc(sizeof(struct floppy_raw_cmd), GFP_USER);
if (!ptr)
return -ENOMEM;
*rcmd = ptr;
ret = copy_from_user(ptr, param, sizeof(*ptr));
ptr->nex... | vuln | Safe | C/C++ |
bool asn1_write_DATA_BLOB_LDAPString(struct asn1_data *data, const DATA_BLOB *s)
{
asn1_write(data, s->data, s->length);
return !data->has_error;
} | vuln | Vulnerable | Unknown |
static void gen_mtsr(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);
#else
TCGv t0;
if (unlikely(ctx->pr)) {
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);
return;
}
t0 = tcg_const_tl(SR(ctx->opcode));
gen_helper_store_sr(cpu_... | vuln | Vulnerable | C/C++ |
protected void continueValidation(Fluid fluid) {
try {
search(fluid, infinityCheckFrontier, infinityCheckVisited,
(p, d) -> infinityCheckFrontier.add(new BlockPosEntry(p, d)), true);
} catch (ChunkNotLoadedException e) {
infinityCheckFrontier.clear();
infinityCheckVisited.clear();
setLongValidationT... | vuln | Safe | Java |
function m(t,e){var r;if(!t||!t.state){return z}r=t.state;if((r.wrap&2)===0){return z}r.head=e;e.done=false;return H} | vuln | Safe | JavaScript |
@Override
public void scan(boolean directionDown, boolean skipSubChannel) {
synchronized (mLock) {
checkNotClosedLocked();
if (!checkConfiguredLocked()) return;
nativeScan(mNativeContext, directionDown, skipSubChannel);
}
} | vuln | Vulnerable | Java |
xmlParserEntityCheck(xmlParserCtxtPtr ctxt, size_t size,
xmlEntityPtr ent, size_t replacement)
{
size_t consumed = 0;
if ((ctxt == NULL) || (ctxt->options & XML_PARSE_HUGE))
return (0);
if (ctxt->lastError.code == XML_ERR_ENTITY_LOOP)
return (1);
/*
* This may... | vuln | Vulnerable | Unknown |
public function sendData($data)
{
// don't throw exceptions for 4xx errors
$this->httpClient->getEventDispatcher()->addListener(
'request.error',
function ($event) {
if ($event['response']->isClientError()) {
$event->stopPropagation();
... | vuln | Vulnerable | JavaScript |
...(ctx.input.cookiecutterCompat
? {}
: {
tags: {
// TODO(mtlewis/orkohunter): Document Why we are changing the literals? Not here, but on scaffolder docs. ADR?
variableStart: '${{',
variableEnd: '}}',
},
}),
... | vuln | Safe | JavaScript |
int wolfSSH_SFTP_RecvRMDIR(WOLFSSH* ssh, int reqId, byte* data, word32 maxSz)
{
word32 sz;
int ret = 0;
char* dir;
word32 idx = 0;
byte* out;
word32 outSz = 0;
byte type;
char err[] = "Remove Directory Error";
char suc[] = "Removed Directory";
char* res = NULL;
if (... | vuln | Safe | C/C++ |
fbPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
{
srcRepeat = FALSE;
if (maskTransform)
maskRepeat = FALSE;
fbWalkCompositeRegion (op, pSrc, pMask, pDst, xSrc, ySrc,
xMask, yMask, xDst, yDst, width, height,
srcRepeat, maskRepeat, func);
} | vuln | Safe | C/C++ |
/*
* Copyright © 2015-2018 Aeneas Rekkas <aeneas+oss@aeneas.io>
*
* 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... | vuln | Vulnerable | Go |
/* nbdkit
* Copyright (C) 2013-2019 Red Hat Inc.
*
* 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 conditions and the f... | vuln | Safe | C/C++ |
if(null!=P&&null!=P.originalSrc)if(!G)P={src:P.originalSrc};else if(G&&null!=this.themes&&"darkTheme"==this.defaultThemeName){var K=this.stylesheet,F=this.shapeForegroundColor,H=this.shapeBackgroundColor;this.stylesheet=this.getDefaultStylesheet();this.shapeBackgroundColor="#ffffff";this.shapeForegroundColor="#000000";... | vuln | Vulnerable | JavaScript |
static void php_wddx_pop_element(void *user_data, const XML_Char *name)
{
st_entry *ent1, *ent2;
wddx_stack *stack = (wddx_stack *)user_data;
HashTable *target_hash;
zend_class_entry **pce;
zval *obj;
zval *tmp;
TSRMLS_FETCH();
/* OBJECTS_FIXME */
if (stack->top == 0) {
return;
}
if (!strc... | vuln | Safe | C/C++ |
package command
import (
"context"
"fmt"
"strings"
"time"
"github.com/zitadel/logging"
"github.com/zitadel/zitadel/internal/api/authz"
"github.com/zitadel/zitadel/internal/command/preparation"
"github.com/zitadel/zitadel/internal/crypto"
"github.com/zitadel/zitadel/internal/domain"
"github.com/zitadel/zita... | vuln | Vulnerable | Go |
private boolean startActivityForAttachedApplicationIfNeeded(ActivityRecord r,
WindowProcessController app, ActivityRecord top) {
if (r.finishing || !r.okToShowLocked() || !r.visibleIgnoringKeyguard || r.app != null
|| app.mUid != r.info.applicationInfo.uid || !app.mName.equals(r.proc... | vuln | Vulnerable | Java |
@SuppressWarnings({"RedundantCast", "RedundantSuppression"})
public boolean start(View parent)
{
// Initializations
Context context = parent.getContext() ;
LayoutInflater inflater = LayoutInflater.from(context) ;
// Prepare the popup view
View popupView = inflater.inflate(R.layout.view_popup, (ViewGroup)nu... | vuln | Vulnerable | Java |
/*
* 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 |
@Override
@Nullable
public ChunkAccess getChunk(int x, int z, ChunkStatus status, boolean create) {
if (Thread.currentThread() != ((ServerChunkCacheAccessor) this).getMainThread())
return CompletableFuture.supplyAsync(() -> this.getChunk(x, z, status, create), this.mainThreadProcessor).join(... | vuln | Vulnerable | Java |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_min_heap.c
*/
#include <assert.h>
#include <stddef.h>
#include <stdint.h>
#include "lsquic_min_heap.h"
static void
heapify_min_heap (struct min_heap *heap, unsigned i)
{
struct min_heap_elem el;
unsigned smallest;
a... | vuln | Vulnerable | C/C++ |
/* nbdkit
* Copyright (C) 2013-2019 Red Hat Inc.
*
* 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 conditions and the f... | vuln | Safe | C/C++ |
/**
* <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 |
@Override
public void perform(SyntaxNodeAnalysisContext ctx) {
List<Diagnostic> diagnostics = ctx.semanticModel().diagnostics();
for (Diagnostic diagnostic : diagnostics) {
if (diagnostic.diagnosticInfo().severity() == DiagnosticSeverity.ERROR) {
return;
}
... | vuln | Safe | Java |
static __u8 *pl_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{
if (*rsize >= 62 && rdesc[39] == 0x2a && rdesc[40] == 0xf5 &&
rdesc[41] == 0x00 && rdesc[59] == 0x26 &&
rdesc[60] == 0xf9 && rdesc[61] == 0x00) {
hid_info(hdev, "fixing up Petalynx Maxter Remote report descriptor\n");
... | vuln | Safe | C/C++ |
@NotNull
private <T> Optional<GQLResponse<T>> postGqlRequest(@NotNull IGQLOperation<T> operation){
try{
var integrity = integrityProvider.getIntegrity();
var response = unirest.post(ENDPOINT)
.header(AUTHORIZATION, "OAuth " + twitchLogin.getAccessToken())
.header(CLIENT_INTEGRITY_HEADER, integrit... | vuln | Vulnerable | Java |
// Copyright 2009,2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Darwin system calls.
// This file is compiled as ordinary Go code,
// but it is also input to mksyscall,
// which parses the //sys lines and generates s... | vuln | Safe | Go |
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
switch (yytype)
{
case 6: /* _CLASS_ */
#line 104 "re_grammar.y" /* yacc.c:1257 */
{ yr_free(((*yyvaluep).class_vector)); }
#line 1053 "re_grammar.c" /* yacc.c:1257 */
break;
case 26: /* alternative */
#line 105 "re_grammar.y" /* yacc.c:1257 */... | vuln | Safe | C/C++ |
int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
{
int id, sr, ch, ba, tag, bps;
id = avctx->codec_id;
sr = avctx->sample_rate;
ch = avctx->channels;
ba = avctx->block_align;
tag = avctx->codec_tag;
bps = av_get_exact_bits_per_sample(avctx->codec_id);
if (... | vuln | Safe | C/C++ |
DECLAREreadFunc(readContigTilesIntoBuffer)
{
int status = 1;
tsize_t tilesize = TIFFTileSize(in);
tdata_t tilebuf;
uint32 imagew = TIFFScanlineSize(in);
uint32 tilew = TIFFTileRowSize(in);
int iskew = imagew - tilew;
uint8* bufp = (uint8*) buf;
uint32 tw, tl;
uint32 row;
(void) spp;
tilebuf = _TIFFmalloc(t... | vuln | Vulnerable | Unknown |
static void vrend_renderer_init_blit_ctx(struct vrend_blitter_ctx *blit_ctx)
{
struct virgl_gl_ctx_param ctx_params;
int i;
if (blit_ctx->initialised) {
vrend_clicbs->make_current(0, blit_ctx->gl_context);
return;
}
ctx_params.shared = true;
ctx_params.major_ver = VREND_GL_VER_MAJOR;... | vuln | Vulnerable | C/C++ |
crypt_pw_cmp(const char *userpwd, const char *dbpwd)
{
int rc = -1;
char *cp = NULL;
size_t dbpwd_len = strlen(dbpwd);
struct crypt_data data;
data.initialized = 0;
/*
* there MUST be at least 2 chars of salt and some pw bytes, else this is INVALID and will
* allow any password to bin... | vuln | Safe | C/C++ |
public static void GoPoc(String product) throws InvocationTargetException, IllegalAccessException, NullMethodArgsException, MalformedURLException {
BasicController controller = Cache.routes.get(product);
String target = Cache.uiController.targetAddress.getText();
target = getUrl(target);
String ... | vuln | Vulnerable | Java |
@NotNull
public T addRole(T newRoleTable) {
return addRole(newRoleTable, false);
} | vuln | Safe | Java |
(function (Prism) {
// CAREFUL!
// The following patterns are concatenated, so the group referenced by a back reference is non-obvious!
var strings = [
// normal string
// 1 capturing group
/(["'])(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|(?!\1)[^\\`$])*\1/.source,
// here doc
// 2 capturing groups
/<<... | vuln | Safe | JavaScript |
void Hints::readTables(BaseStream *str, Linearization *linearization, XRef *xref, SecurityHandler *secHdlr)
{
hintsOffset = linearization->getHintsOffset();
hintsLength = linearization->getHintsLength();
hintsOffset2 = linearization->getHintsOffset2();
hintsLength2 = linearization->getHintsLength2();
... | vuln | Vulnerable | Unknown |
const bootbox = require('bootbox');
require('../services/Requisitions');
const RequisitionNode = require('../model/RequisitionNode');
const RequisitionMetaDataEntry = require('../model/RequisitionMetaDataEntry');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(functi... | vuln | Vulnerable | Java |
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | vuln | Vulnerable | Python |
ssize_t clif_get_attr(const char *input, size_t input_len, clif_attr_t *attr)
{
assert(input);
assert(attr);
const char *pos = input;
const char *end = input + input_len;
bool quoted = false;
bool scan_value = false;
/* initialize attr */
attr->value = NULL;
attr->key = NULL;
/... | vuln | Vulnerable | C/C++ |
static void vdbeVComment(Vdbe *p, const char *zFormat, va_list ap){
assert( p->nOp>0 || p->aOp==0 );
assert( p->aOp==0 || p->aOp[p->nOp-1].zComment==0 || p->db->mallocFailed
|| p->pParse->nErr>0 );
if( p->nOp ){
assert( p->aOp );
sqlite3DbFree(p->db, p->aOp[p->nOp-1].zComment);
p->aOp[p->nOp... | vuln | Safe | C/C++ |
// Copyright 2020 Google LLC
//
// 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 agreed to in ... | vuln | Safe | Go |
static bool vgacon_scroll(struct vc_data *c, unsigned int t, unsigned int b,
enum con_scroll dir, unsigned int lines)
{
unsigned long oldo;
unsigned int delta;
if (t || b != c->vc_rows || vga_is_gfx || c->vc_mode != KD_TEXT)
return false;
if (!vga_hardscroll_enabled || lines >= c->vc_rows / 2)
return false;... | vuln | Vulnerable | C/C++ |
def _process_measurement_list(agentAttestState, lines, hash_alg, lists=None, m2w=None, pcrval=None, ima_keyrings=None,
boot_aggregates=None):
failure = Failure(Component.IMA)
running_hash = agentAttestState.get_pcr_state(config.IMA_PCR, hash_alg)
found_pcr = (pcrval is None)
... | vuln | Vulnerable | Python |
static void avrc_msg_cback(uint8_t handle, uint8_t label, uint8_t cr,
BT_HDR* p_pkt) {
uint8_t opcode;
tAVRC_MSG msg;
uint8_t* p_data;
uint8_t* p_begin;
bool drop = false;
bool do_free = true;
BT_HDR* p_rsp = NULL;
uint8_t* p_rsp_data;
int xx;
bool reject = false;
const char* p_d... | vuln | Safe | C/C++ |
BOOL nego_read_request(rdpNego* nego, wStream* s)
{
BYTE li;
BYTE type;
UINT16 length;
if (!tpkt_read_header(s, &length))
return FALSE;
if (!tpdu_read_connection_request(s, &li, length))
return FALSE;
if (li != Stream_GetRemainingLength(s) + 6)
{
WLog_ERR(TAG, "Incorrect TPDU length indicator.");
retu... | vuln | Safe | Unknown |
function wp_http_validate_url( $url ) {
$original_url = $url;
$url = wp_kses_bad_protocol( $url, array( 'http', 'https' ) );
if ( ! $url || strtolower( $url ) !== strtolower( $original_url ) ) {
return false;
}
$parsed_url = @parse_url( $url );
if ( ! $parsed_url || empty( $parsed_url['host'] ) ) {
... | vuln | Vulnerable | PHP |
@Override
public PendingIntent getAuthentificationNotificationContentIntent(Context context, DownloadRequest request) {
final Intent activityIntent = new Intent(context.getApplicationContext(), DownloadAuthenticationActivity.class);
activityIntent.setAction("request" + request.getFeedfileId());
... | vuln | Vulnerable | Java |
function createTextElement(element) {
var textElement = document.createElement('span');
$(textElement).addClass('doublestate-button-text');
const buttonText = presenter.getSanitizedButtonTextValue();
$(textElement).html(buttonText);
$(element).append(textElement);
} | vuln | Safe | JavaScript |
# -*- coding: utf-8 -*-
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, get_object_or_404
from spirit.core.utils.http import safe_redirect
from spirit.core.utils.views import is_post, post_data
from ..models import Comment
from .forms import FlagForm
@login_required
de... | vuln | Safe | Python |
static void
do_local_notify(xmlNode * notify_src, const char *client_id,
gboolean sync_reply, gboolean from_peer)
{
/* send callback to originating child */
cib_client_t *client_obj = NULL;
int local_rc = pcmk_ok;
if (client_id != NULL) {
client_obj = g_hash_table_lookup(client_... | vuln | Vulnerable | C/C++ |
cisco_autorp_print(netdissect_options *ndo,
register const u_char *bp, register u_int len)
{
int type;
int numrps;
int hold;
if (len < 8)
goto trunc;
ND_TCHECK(bp[0]);
ND_PRINT((ndo, " auto-rp "));
type = bp[0];
switch (type) {
case 0x11:
ND_PRINT((ndo, "candidate-advert"));
break;
c... | vuln | Safe | C/C++ |
private BTreeElement snapshotAnElement(final String name, final RTObject instanceArg, final int indent) {
BTreeElement retval = null, element = null;
String rowString = "";
RTObject instance = instanceArg;
if (name.startsWith("temp$") || name.startsWith("parseTemp$")) {
return null;
}
for (... | vuln | Safe | Java |
@Override
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
if (!Xplat.isModLoadedSuccess()) {
LogManager.getLogger().log(Level.WARN, "not loading '" + mixinClassName + "' because mod failed to load completely");
return false;
}
if (mixi... | vuln | Safe | Java |
private static void startLottieAnimationWith(LottieAnimationView illustrationView,
@RawRes int rawRes) {
try {
illustrationView.setAnimation(rawRes);
illustrationView.setRepeatCount(LottieDrawable.INFINITE);
illustrationView.playAnimation();
} catch (Illeg... | vuln | Vulnerable | Java |
static void render_fragments(Vp3DecodeContext *s,
int first_fragment,
int fragment_width,
int fragment_height,
int plane )
{
int x, y;
int m, n;
int i = first_fragment;
int j;
int16_t... | vuln | Vulnerable | C/C++ |
GF_Err adts_dmx_process(GF_Filter *filter)
{
GF_ADTSDmxCtx *ctx = gf_filter_get_udta(filter);
GF_FilterPacket *pck, *dst_pck;
u8 *data, *output;
u8 *start;
u32 pck_size, remain, prev_pck_size;
u64 cts = GF_FILTER_NO_TS;
//always reparse duration
if (!ctx->duration.num)
adts_dmx_check_dur(filter, ctx);
if (... | vuln | Safe | C/C++ |
@Override
public void syncAsUser(SyncRequest request, int userId, String callingPackage) {
enforceCrossUserPermission(userId, "no permission to request sync as user: " + userId);
final int callingUid = Binder.getCallingUid();
final int callingPid = Binder.getCallingPid();
if (!hasAc... | vuln | Safe | Java |
default void startFromAction(SmartspaceAction action, View v, boolean showOnLockscreen) {
try {
if (action.getIntent() != null) {
startIntent(v, action.getIntent(), showOnLockscreen);
} else if (action.getPendingIntent() != null) {
star... | vuln | Safe | Java |
static av_cold int xvid_encode_init(AVCodecContext *avctx)
{
int xerr, i, ret = -1;
int xvid_flags = avctx->flags;
struct xvid_context *x = avctx->priv_data;
uint16_t *intra, *inter;
int fd;
xvid_plugin_single_t single = { 0 };
struct xvid_ff_pass1 rc2pass1 = { 0 };... | vuln | Vulnerable | C/C++ |
const cheerio = require('cheerio');
const got = require('@/utils/got');
module.exports = async (ctx) => {
const url = `http://${ctx.params.url}`;
const res = await got.get(`${url}/archives/`);
const $ = cheerio.load(res.data);
const list = $('.post-header');
const count = [];
for (let i = 0; ... | vuln | Vulnerable | JavaScript |
static VALUE
ossl_cipher_update(int argc, VALUE *argv, VALUE self)
{
EVP_CIPHER_CTX *ctx;
unsigned char *in;
long in_len, out_len;
VALUE data, str;
rb_scan_args(argc, argv, "11", &data, &str);
if (!RTEST(rb_attr_get(self, id_key_set)))
ossl_raise(eCipherError, "key not set");
StringValue... | vuln | Safe | C/C++ |
void PngImage::readMetadata()
{
#ifdef DEBUG
std::cerr << "Exiv2::PngImage::readMetadata: Reading PNG file " << io_->path() << std::endl;
#endif
if (io_->open() != 0) {
throw Error(kerDataSourceOpenFailed, io_->path(), strError());
}
IoCloser closer(*io_);
if (!is... | vuln | Vulnerable | C/C++ |
static int virtio_blk_handle_rw_error(VirtIOBlockReq *req, int error,
bool is_read)
{
BlockErrorAction action = blk_get_error_action(req->dev->blk,
is_read, error);
VirtIOBlock *s = req->dev;
if (action == BLOCK_ERROR_ACTION_STOP) {
req->next = ... | vuln | Vulnerable | C/C++ |
private void react(Comment comment, boolean like) {
JSONObject options = new JSONObject();
try {
options.put("comment_ids", comment.getId());
options.put("type", like ? "like" : "dislike");
options.put("clear_types", like ? "dislike" : "like");
if ((like ... | vuln | Vulnerable | Java |
# -*- coding: utf-8 -*-
# Copyright 2018 New Vector Ltd
#
# 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 la... | vuln | Vulnerable | Python |
def write_record_async(
self,
record_envelope: RecordEnvelope[
Union[
MetadataChangeEvent,
MetadataChangeProposal,
MetadataChangeProposalWrapper,
]
],
write_callback: WriteCallback,
) -> None:
callback = ... | vuln | Safe | Python |
AVFilterContext *avfilter_open(AVFilter *filter, char *inst_name)
{
AVFilterContext *ret = av_malloc(sizeof(AVFilterContext));
ret->av_class = av_mallocz(sizeof(AVClass));
ret->av_class->item_name = filter_name;
ret->filter = filter;
ret->name = inst_name ? av_strdup(inst_name) : NULL;
ret... | vuln | Vulnerable | C/C++ |
static void qemu_laio_process_completion(struct qemu_laio_state *s,
struct qemu_laiocb *laiocb)
{
int ret;
s->count--;
ret = laiocb->ret;
if (ret != -ECANCELED) {
if (ret == laiocb->nbytes) {
ret = 0;
} else if (ret >= 0) {
if (laiocb->is_read) {
... | vuln | Safe | C/C++ |
public Authenticated authenticate(UsernamePasswordToken token) {
String fullName = null;
String email = null;
Collection<String> groupNames = null;
Collection<String> sshKeys = null;
Name userSearchBase;
try {
userSearchBase = new CompositeName().add(getUserSearchBase());
} catch (InvalidN... | vuln | Vulnerable | Java |
public static InstanceManager<BlockEntity> getTiles(LevelAccessor world) {
if (Backend.isOn()) {
return instanceWorlds.get(world)
.getTileEntityInstanceManager();
} else {
throw new NullPointerException("Backend is off, cannot retrieve instance world.");
}
} | vuln | Safe | Java |
/*
* linux/fs/ceph/acl.c
*
* Copyright (C) 2013 Guangliang Zhao, <lucienchao@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope ... | vuln | Vulnerable | C/C++ |
@SuppressWarnings("deprecation")
@Parameters(count=4, requires= {RMGOption.SIGNATURE})
public void dispatchCodebase()
{
String className = p.getPositionalString(3);
RMGUtils.setCodebase(p.getPositionalString(4));
String signature = RMGOption.SIGNATURE.getString();
int argume... | vuln | Vulnerable | Java |
static int get_file_caps(struct linux_binprm *bprm)
{
struct dentry *dentry;
int rc = 0;
struct vfs_cap_data vcaps;
struct inode *inode;
if (bprm->file->f_vfsmnt->mnt_flags & MNT_NOSUID) {
bprm_clear_caps(bprm);
return 0;
}
dentry = dget(bprm->file->f_dentry);
inode = dentry->d_inode;
if (!inode->i_op ||... | vuln | Vulnerable | Unknown |
@Override
public void worldLoad() {
spawnLocation.setWorld(Bukkit.getWorld(worldName));
spawn(true);
} | vuln | Vulnerable | Java |
static int vapic_prepare(VAPICROMState *s)
{
if (vapic_map_rom_writable(s) < 0) {
return -1;
}
if (patch_hypercalls(s) < 0) {
return -1;
}
vapic_enable_tpr_reporting(true);
return 0;
} | vuln | Safe | C/C++ |
static int jas_icclut16_input(jas_iccattrval_t *attrval, jas_stream_t *in,
int cnt)
{
int i;
int j;
int clutsize;
jas_icclut16_t *lut16 = &attrval->data.lut16;
lut16->clut = 0;
lut16->intabs = 0;
lut16->intabsbuf = 0;
lut16->outtabs = 0;
lut16->outtabsbuf = 0;
if (jas_iccgetuint8(in, &lut16->numinchans) ||
... | vuln | Safe | Unknown |
protected boolean findJpaDependencies(Set<ResolvedDependency> deps) {
for (ResolvedDependency dep : deps) {
if (!visited.contains(dep)) {
if ("org.eclipse.persistence".equals(dep.getModuleGroup()) && "org.eclipse.persistence.core".equals(dep.getModuleName()))
retu... | vuln | Safe | Java |
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* 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 | Vulnerable | Java |
static int create_vorbis_context(vorbis_enc_context *venc,
AVCodecContext *avccontext)
{
vorbis_enc_floor *fc;
vorbis_enc_residue *rc;
vorbis_enc_mapping *mc;
int i, book, ret;
venc->channels = avccontext->channels;
venc->sample_rate = avccontext->sample_rat... | vuln | Vulnerable | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.