code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static int fsmVerify(const char *path, rpmfi fi)
{
int rc;
int saveerrno = errno;
struct stat dsb;
mode_t mode = rpmfiFMode(fi);
rc = fsmStat(path, 1, &dsb);
if (rc)
return rc;
if (S_ISREG(mode)) {
/* HP-UX (and other os'es) don't permit unlink on busy files. */
char *rmpath = rstrsc... | vuln | Vulnerable | C/C++ |
void ff_er_add_slice(ERContext *s, int startx, int starty,
int endx, int endy, int status)
{
const int start_i = av_clip(startx + starty * s->mb_width, 0, s->mb_num - 1);
const int end_i = av_clip(endx + endy * s->mb_width, 0, s->mb_num);
const int start_xy = s->mb_index2xy[star... | vuln | Vulnerable | C/C++ |
import hashlib
import logging
import traceback
from typing import TYPE_CHECKING, Any, Dict, Iterable, Union
from uuid import UUID
import graphene
from django.conf import settings
from django.db.models import Q, Value
from django.db.models.functions import Concat
from graphql import GraphQLDocument
from graphql.error i... | vuln | Vulnerable | Python |
static void attach(sPAPRDRConnector *drc, DeviceState *d, void *fdt,
int fdt_start_offset, bool coldplug, Error **errp)
{
DPRINTFN("drc: %x, attach", get_index(drc));
if (drc->isolation_state != SPAPR_DR_ISOLATION_STATE_ISOLATED) {
error_setg(errp, "an attached device is still awaitin... | vuln | Safe | C/C++ |
static inline int64_t get_image_offset(BlockDriverState *bs, uint64_t offset,
bool write)
{
BDRVVPCState *s = bs->opaque;
uint64_t bitmap_offset, block_offset;
uint32_t pagetable_index, offset_in_block;
pagetable_index = offset / s->block_size;
offset_in_block ... | vuln | Vulnerable | C/C++ |
@Override
public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = new ActionRequestValidationException();
if (waitForState.isAnyOf(VALID_WAIT_STATES) == false) {
validationException.addValidationError(
... | vuln | Vulnerable | Java |
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
RepoLoader.getInstance().addListener(this);
super.onCreate(savedInstanceState);
String modulePackageName = getArguments() == null ? null : getArguments().getString("modulePackageName");
module = RepoLoader.getInst... | vuln | Safe | Java |
package client
import (
"encoding/json"
"fmt"
api "k8s.io/api/storage/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/kubeedge/beehive/pkg/core/model"
"github.com/kubeedge/kubeedge/edge/pkg/common/message"
"github.com/kubeedge/kubeedge/edge/pkg/common/modules"
"github.com/kubeedge/kubeedge/edge... | vuln | Vulnerable | Go |
// anti-copyright Lucy Phipps 2022
// vi: sw=2 tw=80
#define VERSION "v1.0.4"
#include <errno.h>
#include <inttypes.h>
#include <limits.h>
#include <setjmp.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if CHAR_BIT != 8
#error "char isn't 8-bit"
#endif
#if __STDC_VERSION__ < 201112L... | vuln | Vulnerable | C/C++ |
private ChannelFuture finishEncode(final ChannelHandlerContext ctx, ChannelPromise promise) {
if (finished) {
promise.setSuccess();
return promise;
}
finished = true;
final ByteBuf footer = ctx.alloc().heapBuffer(
compressor.maxCompressedLength(bu... | vuln | Vulnerable | Java |
- (WOResponse *) changePasswordAction
{
NSString *username, *domain, *password, *newPassword, *value;
NSDictionary *message;
WOCookie *authCookie;
NSArray *creds;
SOGoUserManager *um;
SOGoPasswordPolicyError error;
SOGoSystemDefaults *sd;
SOGoWebAuthenticator *auth;
WOResponse *response;
WORequest *... | vuln | Vulnerable | Objective-C |
static int shorten_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
AVFrame *frame = data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
ShortenContext *s = avctx->priv_data;
int i, input_buf_size = 0;
... | vuln | Safe | Unknown |
async function downloadNpmStarter({ name, version }, parentDir, { useYarn } = {}) {
// Download from npm, using yarn if possible
if (useYarn) {
await execa('yarn', ['add', `${name}@${version}`, '--no-lockfile', '--silent'], {
cwd: parentDir,
});
} else {
await execa('npm', ['install', `${name}@$... | vuln | Safe | JavaScript |
bt_status_t btif_storage_add_bonded_device(bt_bdaddr_t *remote_bd_addr,
LINK_KEY link_key,
uint8_t key_type,
uint8_t pin_length)
{
bdstr_t bdstr;
bdaddr_to_string(remote_bd_addr, bdstr, sizeof(bdstr));
int ret = btif_config_set_int(bdstr, "LinkKeyType", (int)key_t... | vuln | Vulnerable | C/C++ |
@Override
public void configure(ResourceInfo resourceInfo, FeatureContext context) {
Set<PrioritizedContainerRequestFilter> filters = Sets.newLinkedHashSet();
// Check the resource
RequiresPermissions permAnnotation = resourceInfo.getResourceClass().getAnnotation(RequiresPermissions.class);... | vuln | Safe | Java |
package cluster
import (
"context"
"encoding/base64"
"fmt"
"io/ioutil"
"os"
"path"
"strings"
"github.com/pkg/errors"
"github.com/rancher/rancher/pkg/namespace"
"github.com/rancher/rancher/pkg/serviceaccounttoken"
"github.com/rancher/wrangler/pkg/kubeconfig"
coreV1 "k8s.io/api/core/v1"
metav1 "k8s.io/apim... | vuln | Safe | Go |
# -*- 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 |
@Inject(method = "onSyncedBlockEvent", at = @At("HEAD"))
public void enhanced_bes$listenForRing(int type, int data, CallbackInfoReturnable<Boolean> cir) {
// the !ringing prevents people from unnecessarily destroying your fps by spamming a bell in a complex, hard-to-rebuild chunk
if (type == 1 && !r... | vuln | Safe | Java |
static inline int vmsvga_fifo_empty(struct vmsvga_state_s *s)
{
if (!s->config || !s->enable)
return 1;
return (s->cmd->next_cmd == s->cmd->stop);
} | vuln | Vulnerable | C/C++ |
static int coroutine_fn bdrv_aligned_pwritev(BdrvChild *child,
BdrvTrackedRequest *req, int64_t offset, unsigned int bytes,
int64_t align, QEMUIOVector *qiov, int flags)
{
BlockDriverState *bs = child->bs;
BlockDriver *drv = bs->drv;
bool waited;
int ret;
int64_t end_sector = DIV_ROUND_UP(of... | vuln | Vulnerable | C/C++ |
scoped_refptr<PermissionSet> UnpackPermissionSet(
const Permissions& permissions, std::string* error) {
APIPermissionSet apis;
std::vector<std::string>* permissions_list = permissions.permissions.get();
if (permissions_list) {
PermissionsInfo* info = PermissionsInfo::GetInstance();
for (std::vector... | vuln | Vulnerable | C/C++ |
@Override
public int setErrorParameter(BeforeEnterEvent event,
ErrorParameter<NotFoundException> parameter) {
LoggerFactory.getLogger(RouteNotFoundError.class)
.info(parameter.hasCustomMessage()
? parameter.getCustomMessage() : "Route is not found",
... | vuln | Safe | Java |
_gcry_ecc_ecdsa_sign (gcry_mpi_t input, ECC_secret_key *skey,
gcry_mpi_t r, gcry_mpi_t s,
int flags, int hashalgo)
{
gpg_err_code_t rc = 0;
int extraloops = 0;
gcry_mpi_t k, dr, sum, k_1, x;
mpi_point_struct I;
gcry_mpi_t hash;
const void *abuf;
unsigned int abi... | vuln | Safe | Unknown |
static void vnc_desktop_resize(VncState *vs)
{
if (vs->csock == -1 || !vnc_has_feature(vs, VNC_FEATURE_RESIZE)) {
return;
}
if (vs->client_width == pixman_image_get_width(vs->vd->server) &&
vs->client_height == pixman_image_get_height(vs->vd->server)) {
return;
}
vs->client_w... | vuln | Safe | Unknown |
/* Copyright 2016 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 |
public String[] getCdDtlNm2() {
return cdDtlNm2;
} | vuln | Vulnerable | Java |
gboolean vnc_color_map_lookup(VncColorMap *map,
guint16 idx,
guint16 *red,
guint16 *green,
guint16 *blue)
{
if (idx >= (map->size + map->offset))
return FALSE;
*red = map->colors[idx ... | vuln | Vulnerable | Unknown |
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
/*
* RequestItemManager.java
*
* Created on 27 de Marco de 2006, 17:12 by Arnaldo Dantas
*
*/
pac... | vuln | Safe | Java |
public void refundConsumed(){
for(ItemStack i : consumedStacks){
ItemEntity entity = new ItemEntity(level, getX(), getY(), getZ(), i);
level.addFreshEntity(entity);
consumedStacks = new ArrayList<>();
}
if(recipe != null) {
int exp = recipe.exp;
... | vuln | Safe | Java |
#include "extensions/filters/network/http_connection_manager/config.h"
#include <chrono>
#include <memory>
#include <string>
#include <vector>
#include "envoy/config/core/v3/base.pb.h"
#include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.h"
#include "envoy/extensions/filter... | vuln | Vulnerable | C/C++ |
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* ZGFX (RDP8) Bulk Data Compression
*
* Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com>
* Copyright 2017 Armin Novak <armin.novak@thincast.com>
* Copyright 2017 Thincast Technologies GmbH
*
* Licensed under the Apache License, Version 2.0 (th... | vuln | Vulnerable | C/C++ |
public static String getCreatorRealmType(final Authentication authentication) {
if (authentication.isApiKey()) {
return (String) authentication.getMetadata().get(AuthenticationField.API_KEY_CREATOR_REALM_TYPE);
} else {
return authentication.getSourceRealm().getType();
}
... | vuln | Safe | Java |
private PendingIntent createContentPendingIntent() {
return PendingIntent.getBroadcast(this, ACTION_REQUEST_CODE_OPEN_MENU,
new Intent(ACTION_OPEN_MENU), PendingIntent.FLAG_CANCEL_CURRENT);
} | vuln | Vulnerable | Java |
protected Beacon fromScanData(byte[] bytesToProcess, int rssi, BluetoothDevice device, long timestampMs, Beacon beacon) {
BleAdvertisement advert = new BleAdvertisement(bytesToProcess);
boolean parseSucceeded = false;
ArrayList<Pdu> pdusToParse = new ArrayList<Pdu>();
int startByte = 0;
... | vuln | Safe | Java |
String.prototype.escapeHTML = function(){
/*
HTML Escape Before Inserting Untrusted Data into HTML Element Content
https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention
_Cheat_Sheet#RULE_.231_-_HTML_Escape_Before_Inserting_Untrusted_Data_into
_HTML_Element_Content
*/
var ... | vuln | Safe | JavaScript |
// SPDX-License-Identifier: MIT
#include <linux/pagemap.h>
#include <linux/slab.h>
#include "nouveau_drv.h"
#include "nouveau_mem.h"
#include "nouveau_ttm.h"
struct nouveau_sgdma_be {
/* this has to be the first field so populate/unpopulated in
* nouve_bo.c works properly, otherwise have to move them here
*/
st... | vuln | Vulnerable | C/C++ |
public function enableCurrency(TransactionCurrency $currency)
{
app('preferences')->mark();
$this->repository->enable($currency);
session()->flash('success', (string)trans('firefly.currency_is_now_enabled', ['name' => $currency->name]));
Log::channel('audit')->info(sprintf('Enabled ... | vuln | Vulnerable | PHP |
zzip_mem_disk_findmatch(ZZIP_MEM_DISK* dir,
char* filespec, ZZIP_DISK_ENTRY* after,
zzip_fnmatch_fn_t compare, int flags) {
return zzip_disk_findmatch(dir->disk, filespec, after, compare, flags); } | vuln | Vulnerable | Unknown |
def parse(socket=nil)
@socket = socket
begin
@peeraddr = socket.respond_to?(:peeraddr) ? socket.peeraddr : []
@addr = socket.respond_to?(:addr) ? socket.addr : []
rescue Errno::ENOTCONN
raise HTTPStatus::EOFError
end
read_request_line(socket)
if @http_version... | vuln | Vulnerable | Ruby |
document.createElement("span");x.style["float"]="right";x.style.cursor="pointer";x.style.userSelect="none";x.style.marginTop="-4px";x.appendChild(n);mxUtils.write(x,mxResources.get("showStartScreen"));mxEvent.addListener(x,"click",function(F){mxEvent.getSource(F)!=n&&(n.checked=!n.checked)});header=x}var K=localStorage... | vuln | Safe | JavaScript |
void csync_daemon_session()
{
static char line[4 * 4096];
struct stat sb;
address_t peername = { .sa.sa_family = AF_UNSPEC, };
socklen_t peerlen = sizeof(peername);
char *peer=0, *tag[32];
int i;
if (fstat(0, &sb))
csync_fatal("Can't run fstat on fd 0: %s", strerror(errno));
switch (sb.st_mode & S_IFMT) {
... | vuln | Safe | C/C++ |
static void naludmx_set_dolby_vision(GF_NALUDmxCtx *ctx)
{
u8 dv_cfg[24];
if (!ctx->opid)
return;
switch (ctx->dv_mode) {
case DVMODE_NONE:
case DVMODE_CLEAN:
return;
//auto mode, wait until we have RPU or EL to signal profile
case DVMODE_AUTO:
if (!ctx->nb_dv_rpu && !ctx->nb_dv_el) return;
break;
}
... | vuln | Safe | Unknown |
@WorkerThread
private void rollbackAll() {
assertInWorkerThread();
RollbackManager rollbackManager = mContext.getSystemService(RollbackManager.class);
List<RollbackInfo> rollbacks = rollbackManager.getAvailableRollbacks();
if (useTwoPhaseRollback(rollbacks)) {
return;
... | vuln | Safe | Java |
'use strict';
/**
* Representation a of zip file in js
* @constructor
*/
function JSZip() {
// if this constructor is used without `new`, it adds `new` before itself:
if(!(this instanceof JSZip)) {
return new JSZip();
}
if(arguments.length) {
throw new Error("The constructor with pa... | vuln | Safe | JavaScript |
/**
* Copyright (c) 2006-2020, JGraph Ltd
* Copyright (c) 2006-2020, draw.io AG
*/
/**
* Constructs a new point for the optional x and y coordinates. If no
* coordinates are given, then the default values for <x> and <y> are used.
* @constructor
* @class Implements a basic 2D point. Known subclassers = {@link m... | vuln | Vulnerable | JavaScript |
static int decode_mb_info(IVI5DecContext *ctx, IVIBandDesc *band,
IVITile *tile, AVCodecContext *avctx)
{
int x, y, mv_x, mv_y, mv_delta, offs, mb_offset,
mv_scale, blks_per_mb;
IVIMbInfo *mb, *ref_mb;
int row_offset = band->mb_size * band->pitch;
... | vuln | Vulnerable | C/C++ |
def add_language(self, language):
""""Add new language for item translations."""
if self.connection:
t = (language[0], )
self.cursor.execute('insert into itemlanguage (language) values (?)', t)
self.connection.commit() | vuln | Safe | Python |
/* -*- C++ -*-
* File: libraw_cxx.cpp
* Copyright 2008-2017 LibRaw LLC (info@libraw.org)
* Created: Sat Mar 8 , 2008
*
* LibRaw C++ interface (implementation)
LibRaw is free software; you can redistribute it and/or modify
it under the terms of the one of two licenses as you choose:
1. GNU LESSER GENERAL PUBLIC ... | vuln | Vulnerable | C/C++ |
static void sp_setup(struct net_device *dev)
{
/* Finish setting up the DEVICE info. */
dev->netdev_ops = &sp_netdev_ops;
dev->mtu = SIXP_MTU;
dev->hard_header_len = AX25_MAX_HEADER_LEN;
dev->header_ops = &ax25_header_ops;
dev->addr_len = AX25_ADDR_LEN;
dev->type = ARPHRD_AX25;
dev->tx_queue_len = 10;
/... | vuln | Safe | Unknown |
package com.salesmanager.shop.model.catalog.product.product.definition;
import java.util.ArrayList;
import java.util.List;
import com.salesmanager.shop.model.catalog.category.ReadableCategory;
import com.salesmanager.shop.model.catalog.manufacturer.ReadableManufacturer;
import com.salesmanager.shop.model.catalog.prod... | vuln | Safe | Java |
protected BlockState tryConvert(IWorld world, BlockPos pos, BlockState state, BlockState underState) {
Block underBlock = underState.getBlock();
if (!(Blocks.SOUL_FIRE.is(underBlock) || Blocks.SOUL_CAMPFIRE.is(underBlock)))
return state;
if (world.isClientSide()) {
spawnConversionParticles(world, pos);
}... | vuln | Vulnerable | Java |
/*
* 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 ... | vuln | Safe | Java |
BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace, BOOL alpha)
BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
BOOL alpha)
{
png_struct *png_ptr = NULL;
png_info *info_ptr = NULL;
png_byte *png_pixels = NULL;
png_byte **row... | vuln | Safe | C/C++ |
constructor(cfg) {
super();
/**
* Configuration options.
*
* @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
* @property {Hasher} hasher The hasher to use. Default: SHA1
* @property {number} iterations The number of iterations to perform. Default: 1
... | vuln | Vulnerable | JavaScript |
package io.hawt.web;
import java.io.IOException;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import javax.security.auth.Subject;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
i... | vuln | Vulnerable | Java |
static int
get_function_args(
char_u **argp,
char_u endchar,
garray_T *newargs,
garray_T *argtypes, // NULL unless using :def
int types_optional, // types optional if "argtypes" is not NULL
evalarg_T *evalarg, // context or NULL
int *varargs,
garray_T *default_args,
int skip,
... | vuln | Vulnerable | C/C++ |
public void run() {
Looper.prepare();
int bogon = (int)SystemClock.elapsedRealtime();
NotificationManager mNotificationManager = (NotificationManager)_appContext.getSystemService(Context.NOTIFICATION_SERVICE);
NotificationCompat.Builder builder = new NotificationCompat.Builder(_appContext);
builder... | vuln | Safe | Java |
static int do_change_type(struct nameidata *nd, int flag)
{
struct vfsmount *m, *mnt = nd->mnt;
int recurse = flag & MS_REC;
int type = flag & ~MS_REC;
if (nd->dentry != nd->mnt->mnt_root)
return -EINVAL;
down_write(&namespace_sem);
spin_lock(&vfsmount_lock);
for (m = mnt; m; m = (recurse ? next_mnt(m, mnt) ... | vuln | Vulnerable | Unknown |
getvcol(
win_T *wp,
pos_T *pos,
colnr_T *start,
colnr_T *cursor,
colnr_T *end)
{
colnr_T vcol;
char_u *ptr; // points to current char
char_u *posptr; // points to char at pos->col
char_u *line; // start of the line
int incr;
int head;
#ifdef FEAT_VARTABS
int *vts = w... | vuln | Vulnerable | C/C++ |
ext2_xattr_delete_inode(struct inode *inode)
{
struct buffer_head *bh = NULL;
struct mb_cache_entry *ce;
down_write(&EXT2_I(inode)->xattr_sem);
if (!EXT2_I(inode)->i_file_acl)
goto cleanup;
bh = sb_bread(inode->i_sb, EXT2_I(inode)->i_file_acl);
if (!bh) {
ext2_error(inode->i_sb, "ext2_xattr_delete_inode",
... | vuln | Vulnerable | Unknown |
/*
* base64.c
* base64 encode/decode implementation
*
* Copyright (c) 2011 Nikias Bassen, All Rights Reserved.
*
* This library 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 ... | vuln | Safe | C/C++ |
public PendingAnimation createTaskLaunchAnimation(
TaskView tv, long duration, Interpolator interpolator) {
if (FeatureFlags.IS_STUDIO_BUILD && mPendingAnimation != null) {
throw new IllegalStateException("Another pending animation is still running");
}
int count = getTa... | vuln | Vulnerable | Java |
static inline int check_pmd_range(struct vm_area_struct *vma, pud_t *pud,
unsigned long addr, unsigned long end,
const nodemask_t *nodes, unsigned long flags,
void *private)
{
pmd_t *pmd;
unsigned long next;
pmd = pmd_offset(pud, addr);
do {
next = pmd_addr_end(addr, end);
split_huge_page_pmd(vma->vm_mm,... | vuln | Safe | Unknown |
@Override
public Object getParam(@NonNull String key, Object defVal) {
synchronized (SoterExParametersTrebleImpl.class) {
if (FINGERPRINT_TYPE.equals(key)) {
return fingerprintType != FINGERPRINT_TYPE_UNDEFINE ? fingerprintType : defVal;
} else if (FINGERPRINT_HARDWAR... | vuln | Safe | Java |
static AVStream *add_av_stream1(FFServerStream *stream,
AVCodecContext *codec, int copy)
{
AVStream *fst;
if(stream->nb_streams >= FF_ARRAY_ELEMS(stream->streams))
return NULL;
fst = av_mallocz(sizeof(AVStream));
if (!fst)
return NULL;
if (copy) {
... | vuln | Vulnerable | C/C++ |
static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
AVPacket *pkt)
{
unsigned char chunk_preamble[CHUNK_PREAMBLE_SIZE];
int chunk_type;
int chunk_size;
unsigned char opcode_preamble[OPCODE_PREAMBLE_SIZE];
unsigned char opcode_type;
unsigned char opcode_version;
int opcode_... | vuln | Safe | C/C++ |
static void dnxhd_decode_dct_block_10(const DNXHDContext *ctx,
RowContext *row, int n)
{
dnxhd_decode_dct_block(ctx, row, n, 6, 8, 4);
} | vuln | Vulnerable | C/C++ |
package nosurf
import (
"crypto/rand"
"crypto/subtle"
"encoding/base64"
"fmt"
"io"
)
const (
tokenLength = 32
)
/*
There are two types of tokens.
* The unmasked "real" token consists of 32 random bytes.
It is stored in a cookie (base64-encoded) and it's the
"reference" value that sent tokens get compared ... | vuln | Vulnerable | Go |
PHP_FUNCTION(rename)
{
char *old_name, *new_name;
int old_name_len, new_name_len;
zval *zcontext = NULL;
php_stream_wrapper *wrapper;
php_stream_context *context;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|r", &old_name, &old_name_len, &new_name, &new_name_len, &zcontext) == FAILURE) {
RETURN_FAL... | vuln | Vulnerable | Unknown |
static void vmd_decode(VmdVideoContext *s)
{
int i;
unsigned int *palette32;
unsigned char r, g, b;
const unsigned char *p = s->buf + 16;
const unsigned char *p_end = s->buf + s->size;
const unsigned char *pb;
unsigned char meth;
unsigned char *dp;
unsigned char *pp;
u... | vuln | Safe | C/C++ |
int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
{
int ret = 0;
int codec_init_ok = 0;
AVDictionary *tmp = NULL;
const AVPixFmtDescriptor *pixdesc;
if (avcodec_is_open(avctx))
return 0;
if ((!codec && !avctx->codec)) {
a... | vuln | Vulnerable | Unknown |
static gboolean netscreen_read(wtap *wth, int *err, gchar **err_info,
gint64 *data_offset)
{
gint64 offset;
int pkt_len;
char line[NETSCREEN_LINE_LENGTH];
char cap_int[NETSCREEN_MAX_INT_NAME_LENGTH];
gboolean cap_dir;
char cap_dst[13];
/* Find the next packet */
offset = netscreen_seek_next_packet(wth... | vuln | Vulnerable | C/C++ |
static void cpu_handle_guest_debug(CPUState *env)
{
gdb_set_stop_cpu(env);
qemu_system_debug_request();
#ifdef CONFIG_IOTHREAD
env->stopped = 1;
#endif
} | vuln | Vulnerable | C/C++ |
repodata_schema2id(Repodata *data, Id *schema, int create)
{
int h, len, i;
Id *sp, cid;
Id *schematahash;
if (!*schema)
return 0; /* XXX: allow empty schema? */
if ((schematahash = data->schematahash) == 0)
{
data->schematahash = schematahash = solv_calloc(256, sizeof(Id));
for (i = 1; i... | vuln | Vulnerable | C/C++ |
check_compat_entry_size_and_hooks(struct compat_ipt_entry *e,
struct xt_table_info *newinfo,
unsigned int *size,
const unsigned char *base,
const unsigned char *limit,
const unsigned int *hook_entries,
const unsigned int *underflows,
const char *name)
{
struct xt_entry_match *... | vuln | Safe | C/C++ |
FLAC__bool read_residual_partitioned_rice_(FLAC__StreamDecoder *decoder, unsigned predictor_order, unsigned partition_order, FLAC__EntropyCodingMethod_PartitionedRiceContents *partitioned_rice_contents, FLAC__int32 *residual, FLAC__bool is_extended)
{
FLAC__uint32 rice_parameter;
int i;
unsigned partition, sample, u... | vuln | Safe | Unknown |
mcs_recv_connect_response(STREAM mcs_data)
{
UNUSED(mcs_data);
uint8 result;
int length;
STREAM s;
RD_BOOL is_fastpath;
uint8 fastpath_hdr;
logger(Protocol, Debug, "%s()", __func__);
s = iso_recv(&is_fastpath, &fastpath_hdr);
if (s == NULL)
return False;
ber_parse_header(s, MCS_CONNECT_RESPONSE, &length)... | vuln | Vulnerable | C/C++ |
$this->admin->json_response = ['status' => 'error', 'message' => htmlspecialchars($e->getMessage(), ENT_QUOTES | ENT_HTML5, 'UTF-8')]; | vuln | Safe | PHP |
function empty(key) {
var char = key.charCodeAt(0);
return (char > 47 && char < 58) ? [] : {};
}
export function nestie(input, glue) {
glue = glue || '.';
var arr, tmp, output;
var i=0, k, key;
for (k in input) {
tmp = output; // reset
arr = k.split(glue);
for (i=0; i < arr.length;) {
key = arr[i++];
... | vuln | Vulnerable | JavaScript |
static int decorrelate(TAKDecContext *s, int c1, int c2, int length)
{
GetBitContext *gb = &s->gb;
int32_t *p1 = s->decoded[c1] + 1;
int32_t *p2 = s->decoded[c2] + 1;
int i;
int dshift, dfactor;
switch (s->dmode) {
case 1:
for (i = 0; i < length; i++) {
int32... | vuln | Safe | C/C++ |
static av_cold int ulti_decode_init(AVCodecContext *avctx)
{
UltimotionDecodeContext *s = avctx->priv_data;
s->avctx = avctx;
s->width = avctx->width;
s->height = avctx->height;
s->blocks = (s->width / 8) * (s->height / 8);
avctx->pix_fmt = AV_PIX_FMT_YUV410P;
s->ulti_codebook = ulti_codeboo... | vuln | Vulnerable | C/C++ |
@Override
public Optional<AuthState> currentAuthState(final HttpServletRequest request) {
LOGGER.debug("currentAuthState");
AuthStateImpl authState = getAuthState(request);
// Now we can check if we're logged in somehow (session or certs) and build the response accordingly
if (authS... | vuln | Safe | Java |
static void reply_sesssetup_and_X_spnego(struct smb_request *req)
{
const uint8 *p;
DATA_BLOB blob1;
size_t bufrem;
char *tmp;
const char *native_os;
const char *native_lanman;
const char *primary_domain;
const char *p2;
uint16 data_blob_len = SVAL(req->vwv+7, 0);
enum remote_arch_types ra_type = get_remote_a... | vuln | Vulnerable | C/C++ |
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | vuln | Safe | Python |
static js_Ast *equality(js_State *J, int notin)
{
js_Ast *a = relational(J, notin);
loop:
if (jsP_accept(J, TK_EQ)) { a = EXP2(EQ, a, relational(J, notin)); goto loop; }
if (jsP_accept(J, TK_NE)) { a = EXP2(NE, a, relational(J, notin)); goto loop; }
if (jsP_accept(J, TK_STRICTEQ)) { a = EXP2(STRICTEQ, a, relational... | vuln | Vulnerable | Unknown |
qcrypto_tls_creds_x509_unload(QCryptoTLSCredsX509 *creds)
{
if (creds->data) {
gnutls_certificate_free_credentials(creds->data);
creds->data = NULL; | vuln | Vulnerable | C/C++ |
package com.salesmanager.shop.admin.controller.customers;
import com.salesmanager.core.business.services.customer.attribute.CustomerOptionValueService;
import com.salesmanager.core.business.services.reference.language.LanguageService;
import com.salesmanager.core.business.utils.ajax.AjaxResponse;
import com.salesmanag... | vuln | Safe | Java |
package com.salesmanager.shop.admin.controller.configurations;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
impor... | vuln | Vulnerable | Java |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <inttypes.h>
#include <string.h>
#include <sys/queue.h>
#ifdef WIN32
#include <Ws2tcpip.h>
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <a... | vuln | Vulnerable | C/C++ |
static void vhost_vsock_common_send_transport_reset(VHostVSockCommon *vvc)
{
VirtQueueElement *elem;
VirtQueue *vq = vvc->event_vq;
struct virtio_vsock_event event = {
.id = cpu_to_le32(VIRTIO_VSOCK_EVENT_TRANSPORT_RESET),
};
elem = virtqueue_pop(vq, sizeof(VirtQueueElement));
if (!elem... | vuln | Safe | C/C++ |
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
{
AVFilterContext *ctx = inlink->dst;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
uint32_t plane_checksum[4] = {0}, checksum = 0;
int i, plane, vsub = desc->log2_chroma_h;
for (plane = 0; plane < 4 && frame->... | vuln | Safe | C/C++ |
import Controller from "@ember/controller";
import { action } from "@ember/object";
import { getAbsoluteURL } from "discourse-common/lib/get-url";
import discourseComputed, {
afterRender,
} from "discourse-common/utils/decorators";
import { longDateNoYear } from "discourse/lib/formatter";
import Sharing from "discour... | vuln | Vulnerable | JavaScript |
static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
AVCodecContext *avctx, const char *args,
uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size,
int keyfr... | vuln | Safe | C/C++ |
/* @flow */
/* eslint max-len: 0 */
const messages = {
upToDate: 'Already up-to-date.',
folderInSync: 'Folder in sync.',
nothingToInstall: 'Nothing to install.',
resolvingPackages: 'Resolving packages',
checkingManifest: 'Validating package.json',
fetchingPackages: 'Fetching packages',
linkingDependencie... | vuln | Vulnerable | JavaScript |
SessionStartupPref StartupBrowserCreator::GetSessionStartupPref(
const base::CommandLine& command_line,
Profile* profile) {
DCHECK(profile);
PrefService* prefs = profile->GetPrefs();
SessionStartupPref pref = SessionStartupPref::GetStartupPref(prefs);
#if defined(OS_CHROMEOS)
const bool is_first_run =
... | vuln | Safe | Unknown |
static struct sk_buff *xfrm_state_netlink(struct sk_buff *in_skb,
struct xfrm_state *x, u32 seq)
{
struct xfrm_dump_info info;
struct sk_buff *skb;
skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
if (!skb)
return ERR_PTR(-ENOMEM);
info.in_skb = in_skb;
info.out_skb = skb;
info.nlmsg_seq = seq;... | vuln | Vulnerable | C/C++ |
public static void readSyncEntity(DataInputStream input, Reads read) throws IOException{
int id = input.readInt();
byte typeID = input.readByte();
Syncc entity = Groups.sync.getByID(id);
boolean add = false, created = false;
if(entity == null && id == player.id()){
... | vuln | Vulnerable | Java |
private static String getMinecraftAccessToken(String uhs, String xstsToken)
throws LoginException
{
JsonObject postData = new JsonObject();
postData.addProperty("identityToken",
"XBL3.0 x=" + uhs + ";" + xstsToken);
String request = postData.toString();
try
{
URLConnection connection = MC_TOKEN... | vuln | Safe | Java |
daemon_AuthUserPwd(char *username, char *password, char *errbuf)
{
#ifdef _WIN32
/*
* Warning: the user which launches the process must have the
* SE_TCB_NAME right.
* This corresponds to have the "Act as part of the Operating System"
* turned on (administrative tools, local security settings, local
* polici... | vuln | Vulnerable | Unknown |
bool RenderFrameHostManager::CanSubframeSwapProcess(
const GURL& dest_url,
SiteInstance* source_instance,
SiteInstance* dest_instance) {
DCHECK(!source_instance || !dest_instance);
GURL resolved_url = dest_url;
if (url::Origin::Create(resolved_url).unique()) {
if (source_instance) {
resol... | vuln | Safe | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.