code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
void WebGL2RenderingContextBase::deleteVertexArray(
WebGLVertexArrayObject* vertex_array) {
if (isContextLost() || !vertex_array ||
!ValidateWebGLObject("deleteVertexArray", vertex_array))
return;
if (!vertex_array->IsDefaultObject() &&
vertex_array == bound_vertex_array_object_)
SetBou... | vuln | Safe | C/C++ |
import { isTestSuiteActive } from "../../support/page_objects/projectConstants";
import { mainPage } from "../../support/page_objects/mainPage";
let formViewURL;
export const genTest = (apiType, dbType) => {
if (!isTestSuiteActive(apiType, dbType)) return;
describe(`${apiType.toUpperCase()} api - FORM view`,... | vuln | Vulnerable | JavaScript |
static inline void Process_ipfix_template_add(exporter_ipfix_domain_t *exporter, void *DataPtr, uint32_t size_left, FlowSource_t *fs) {
input_translation_t *translation_table;
ipfix_template_record_t *ipfix_template_record;
ipfix_template_elements_std_t *NextElement;
int i;
uint16_t Offset = 0;
// a template flowset ... | vuln | Safe | Unknown |
private static void addPrincipalsForPrivateCredentials(Set<Principal> principals,
Set<Object> privateCredentials)
{
for (Object credential : privateCredentials) {
if (credential instanceof PasswordCredential) {
String username = ((PasswordCredentia... | vuln | Vulnerable | Java |
func createDeviceNode(rootfs string, node *devices.Device, bind bool) error {
if node.Path == "" {
// The node only exists for cgroup reasons, ignore it here.
return nil
}
dest := filepath.Join(rootfs, node.Path)
if err := os.MkdirAll(filepath.Dir(dest), 0755); err != nil {
return err
}
if bind {
return b... | vuln | Vulnerable | Go |
public static VoxelShape getCollisionShapeOrThrow(boolean canCollide, BlockState state, IBlockReader reader, BlockPos blockPos, ISelectionContext context) {
if (!canCollide)
return VoxelShapes.empty();
if (!NoCubesConfig.Server.collisionsEnabled || !NoCubes.smoothableHandler.isSmoothable(state))
return state.... | vuln | Vulnerable | Java |
static int mongo_cursor_get_more( mongo_cursor *cursor ) {
int res;
if( cursor->limit > 0 && cursor->seen >= cursor->limit ) {
cursor->err = MONGO_CURSOR_EXHAUSTED;
return MONGO_ERROR;
}
else if( ! cursor->reply ) {
cursor->err = MONGO_CURSOR_INVALID;
return MONGO_ERROR;... | vuln | Vulnerable | Unknown |
process_form_int(struct parsed_tag *tag, int fid)
{
char *p, *q, *r, *s, *tg, *n;
p = "get";
parsedtag_get_value(tag, ATTR_METHOD, &p);
q = "!CURRENT_URL!";
parsedtag_get_value(tag, ATTR_ACTION, &q);
q = url_encode(remove_space(q), cur_baseURL, cur_document_charset);
r = NULL;
#ifdef USE_M1... | vuln | Vulnerable | Unknown |
static int ssl23_get_server_hello(SSL *s)
{
char buf[8];
unsigned char *p;
int i;
int n;
n=ssl23_read_bytes(s,7);
if (n != 7) return(n);
p=s->packet;
memcpy(buf,p,n);
if ((p[0] & 0x80) && (p[2] == SSL2_MT_SERVER_HELLO) &&
(p[5] == 0x00) && (p[6] == 0x02))
{
#ifdef OPENSSL_NO_SSL2
SSLerr(SSL_F_SSL23_... | vuln | Vulnerable | Unknown |
static inline void vmsvga_copy_rect(struct vmsvga_state_s *s,
int x0, int y0, int x1, int y1, int w, int h)
{
DisplaySurface *surface = qemu_console_surface(s->vga.con);
uint8_t *vram = s->vga.vram_ptr;
int bypl = surface_stride(surface);
int bypp = surface_bytes_per_pixel(surface);
... | vuln | Vulnerable | C/C++ |
static int virtio_blk_load(QEMUFile *f, void *opaque, int version_id)
{
VirtIOBlock *s = opaque;
if (version_id != 2)
return -EINVAL;
virtio_load(&s->vdev, f);
while (qemu_get_sbyte(f)) {
VirtIOBlockReq *req = virtio_blk_alloc_request(s);
qemu_get_buffer(f, (unsigned char*)&req->... | vuln | Vulnerable | C/C++ |
@Override
public void onRender3D(Render3DEvent event) {
AxisAlignedBB bb;
Vec3d interp;
int i;
if (this.items.getValue()) {
i = 0;
for (Entity entity : mc.world.loadedEntityList) {
if (!(entity instanceof EntityItem) || !(mc.player.getDistanceS... | vuln | Vulnerable | Java |
static int vp8_lossless_decode_frame(AVCodecContext *avctx, AVFrame *p,
int *got_frame, uint8_t *data_start,
unsigned int data_size, int is_alpha_chunk)
{
WebPContext *s = avctx->priv_data;
int w, h, ret, i, used;
if (!is_alpha_chunk)... | vuln | Safe | C/C++ |
public static void generateZipFile(String path, String outputDir, boolean useGm) throws Exception {
File file2Zip = new File(CleanPathUtil.cleanString(path));
// 压缩文件的路径不存在
if (!file2Zip.exists()) {
log.error("file not exist:{}", path);
throw new Exception("file not exis... | vuln | Safe | Java |
@Override
public void setConfiguration(RadioManager.BandConfig config) {
if (!RadioServiceUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot set configuration for AIDL HAL client from non-current user");
return;
}
synchronized (mLock) {
checkNo... | vuln | Safe | Java |
package io.onedev.server.web.component.markdown;
import static org.apache.wicket.ajax.attributes.CallbackParameter.explicit;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Hash... | vuln | Vulnerable | Java |
static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
vorbis_residue *vr,
unsigned ch,
uint8_t *do_not_decode,
... | vuln | Vulnerable | C/C++ |
# -*- coding: utf-8 -*-
# Copyright 2015, 2016 OpenMarket Ltd
# Copyright 2018 New Vector Ltd
# Copyright 2019 Matrix.org Federation C.I.C
#
# 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
#
# ... | vuln | Vulnerable | Python |
// SPDX-License-Identifier: GPL-2.0
/*
* Kernel internal timers
*
* Copyright (C) 1991, 1992 Linus Torvalds
*
* 1997-01-28 Modified by Finn Arne Gangstad to make timers scale better.
*
* 1997-09-10 Updated NTP code according to technical memorandum Jan '96
* "A Kernel Model for Precision Tim... | vuln | Vulnerable | C/C++ |
int main (int argc, char **argv)
{
int ret = 0, got_frame;
if (argc != 4) {
fprintf(stderr, "usage: %s input_file video_output_file audio_output_file\n"
"API example program to show how to read frames from an input file.\n"
"This program reads frames from a file, decodes ... | vuln | Vulnerable | C/C++ |
@Override
public boolean selectNpc(@Nullable TaterzenNPC npc) {
if (
npc != null && !npc.canEdit(this.player) &&
Taterzens.getInstance().getPlatform().checkPermission(
this.player.createCommandSourceStack(), "taterzens.npc.select.bypass", config.perms.selectBypass... | vuln | Vulnerable | Java |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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 applic... | vuln | Vulnerable | Go |
static int test_rand_drbg_reseed(void)
{
RAND_DRBG *master, *public, *private;
unsigned char rand_add_buf[256];
int rv=0;
time_t before_reseed;
/* Check whether RAND_OpenSSL() is the default method */
if (!TEST_ptr_eq(RAND_get_rand_method(), RAND_OpenSSL()))
return 0;
/* All three ... | vuln | Vulnerable | Unknown |
static BlockJob *do_drive_backup(DriveBackup *backup, BlockJobTxn *txn,
Error **errp)
{
BlockDriverState *bs;
BlockDriverState *target_bs;
BlockDriverState *source = NULL;
BlockJob *job = NULL;
BdrvDirtyBitmap *bmap = NULL;
AioContext *aio_context;
QDict *opt... | vuln | Safe | C/C++ |
handle_get_connection (GVfsDBusDaemon *object,
GDBusMethodInvocation *invocation,
gpointer user_data)
{
GVfsDaemon *daemon = G_VFS_DAEMON (user_data);
GDBusServer *server;
GError *error;
gchar *address1;
NewConnectionData *data;
char *socket_dir;
gchar *guid;
... | vuln | Safe | Unknown |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2021
* All rights reserved
*
* This file is part of GPAC / ISO Media File Format sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU L... | vuln | Vulnerable | C/C++ |
private void launchDeepLinkIntentToRight() {
if (!mIsEmbeddingActivityEnabled) {
return;
}
final Intent intent = getIntent();
if (intent == null || !TextUtils.equals(intent.getAction(),
ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY)) {
return;
... | vuln | Vulnerable | Java |
private void handleRtspMessage(List<String> message) {
RtspResponse response = RtspMessageUtil.parseResponse(message);
int cSeq = Integer.parseInt(checkNotNull(response.headers.get(RtspHeaders.CSEQ)));
@Nullable RtspRequest matchingRequest = pendingRequests.get(cSeq);
if (matchingRequest == nu... | vuln | Safe | Java |
int queue_signal(CPUArchState *env, int sig, target_siginfo_t *info)
{
CPUState *cpu = ENV_GET_CPU(env);
TaskState *ts = cpu->opaque;
struct emulated_sigtable *k;
struct sigqueue *q, **pq;
abi_ulong handler;
int queue;
trace_user_queue_signal(env, sig);
k = &ts->sigtab[sig - 1];
queu... | vuln | Vulnerable | C/C++ |
DecodeTime(char *str, int *tmask, struct tm * tm, fsec_t *fsec)
{
char *cp;
*tmask = DTK_TIME_M;
tm->tm_hour = strtol(str, &cp, 10);
if (*cp != ':')
return -1;
str = cp + 1;
tm->tm_min = strtol(str, &cp, 10);
if (*cp == '\0')
{
tm->tm_sec = 0;
*fsec = 0;
}
else if (*cp != ':')
return -1;
else
{... | vuln | Safe | C/C++ |
/*
* Kernel-based Virtual Machine driver for Linux
*
* This module enables machines with Intel VT-x extensions to run virtual
* machines without emulation or binary translation.
*
* Copyright (C) 2006 Qumranet, Inc.
* Copyright 2010 Red Hat, Inc. and/or its affiliates.
*
* Authors:
* Avi Kivity <avi@qumra... | vuln | Safe | C/C++ |
void arm_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr,
vaddr addr, unsigned size,
MMUAccessType access_type,
int mmu_idx, MemTxAttrs attrs,
MemTxResult response, uintptr... | vuln | Vulnerable | C/C++ |
eval_lambda(
char_u **arg,
typval_T *rettv,
evalarg_T *evalarg,
int verbose) // give error messages
{
int evaluate = evalarg != NULL
&& (evalarg->eval_flags & EVAL_EVALUATE);
typval_T base = *rettv;
int ret;
rettv->v_type = VAR_UNKNOWN;
if (**arg == '{')
{
// ->{l... | vuln | Safe | C/C++ |
public static boolean shouldShow(@NonNull OsmandSettings settings, @NonNull MapActivity activity) {
OsmandApplication app = activity.getMyApplication();
if (app.getAppCustomization().isFeatureEnabled(FRAGMENT_RENDER_INIT_ERROR_ID)) {
File file = app.getAppPath(EXCEPTION_PATH);
return settings.OPENGL_RENDER_FA... | vuln | Vulnerable | Java |
package com.dextra.injectit.servlets;
import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
i... | vuln | Vulnerable | Java |
int sock_setsockopt(struct socket *sock, int level, int optname,
char __user *optval, unsigned int optlen)
{
struct sock *sk = sock->sk;
int val;
int valbool;
struct linger ling;
int ret = 0;
/*
* Options without arguments
*/
if (optname == SO_BINDTODEVICE)
return sock_bindtodevice(sk, optval, optl... | vuln | Vulnerable | C/C++ |
/*
* auth.c - deal with authentication.
*
* This file implements authentication when setting up an RFB connection.
*/
/*
* Copyright (C) 2010, 2012-2019 D. R. Commander. All Rights Reserved.
* Copyright (C) 2010 University Corporation for Atmospheric Research.
* All Rights Reserved.
* C... | vuln | Safe | C/C++ |
static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
uint64_t off, uint32_t max_count)
{
ssize_t err;
size_t offset = 7;
uint64_t read_count;
V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
VirtQueueElement *elem = v->elems[pdu->idx];
... | vuln | Safe | C/C++ |
Database.prototype.write_event = function(event) {
let obj = this;
let write_keyval = function(key, val) {
obj.db.run(
"INSERT INTO tb_events (uid, key, value) VALUES ( ? , ? , ? );",
[event.uid, key, val]
);
};
[["name", event.name],
["description", even... | vuln | Safe | JavaScript |
void CertManager::setPeerX509(X509* x)
{
if (x == 0) return;
X509_NAME* issuer = x->GetIssuer();
X509_NAME* subject = x->GetSubject();
ASN1_STRING* before = x->GetBefore();
ASN1_STRING* after = x->GetAfter();
peerX509_ = NEW_YS X509(issuer->GetName(), issuer->GetLength(),
subject->... | vuln | Safe | Unknown |
/* 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 | Safe | Python |
static int tcp_write_packet(AVFormatContext *s, RTSPStream *rtsp_st)
{
RTSPState *rt = s->priv_data;
AVFormatContext *rtpctx = rtsp_st->transport_priv;
uint8_t *buf, *ptr;
int size;
uint8_t *interleave_header, *interleaved_packet;
size = avio_close_dyn_buf(rtpctx->pb, &buf);
rtpctx->pb = NUL... | vuln | Safe | C/C++ |
def sendEmail(sydent, templateFile, mailTo, substitutions):
"""
Sends an email with the given parameters.
:param sydent: The Sydent instance to use when building the configuration to send the
email with.
:type sydent: sydent.sydent.Sydent
:param templateFile: The filename of the template to... | vuln | Safe | Python |
async def impl(request: Request, handler: _Handler) -> StreamResponse:
if isinstance(request.match_info.route, SystemRoute):
paths_to_check = []
if "?" in request.raw_path:
path, query = request.raw_path.split("?", 1)
query = "?" + query
else:
... | vuln | Safe | Python |
void Compute(OpKernelContext* context) override {
const Tensor& input = context->input(0);
const Tensor& diag = context->input(1);
// MatrixSetDiag and MatrixSetDiagV2 both use this OpKernel. MatrixSetDiag
// only has two inputs, so we have to check the number of inputs before
// reading additional... | vuln | Safe | C/C++ |
_krb5_extract_ticket(krb5_context context,
krb5_kdc_rep *rep,
krb5_creds *creds,
krb5_keyblock *key,
krb5_const_pointer keyseed,
krb5_key_usage key_usage,
krb5_addresses *addrs,
unsigned nonce,
unsigned flags,
krb5_data *request,
krb5_decrypt_proc de... | vuln | Safe | C/C++ |
/*
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2002-2012, Open Source Geospatial Foundation (OSGeo)
*
* 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 ... | vuln | Vulnerable | Java |
void* H264SwDecMalloc(u32 size) {
return malloc(size);
} | vuln | Vulnerable | C/C++ |
static int decode_fctl_chunk(AVCodecContext *avctx, PNGDecContext *s,
uint32_t length)
{
uint32_t sequence_number;
int cur_w, cur_h, x_offset, y_offset, dispose_op, blend_op;
if (length != 26)
return AVERROR_INVALIDDATA;
if (!(s->hdr_state & PNG_IHDR)) {
av_l... | vuln | Safe | C/C++ |
void NavigationRequest::OnRequestRedirected(
const net::RedirectInfo& redirect_info,
const scoped_refptr<network::ResourceResponse>& response) {
response_ = response;
ssl_info_ = response->head.ssl_info;
#if defined(OS_ANDROID)
base::WeakPtr<NavigationRequest> this_ptr(weak_factory_.GetWeakPtr());
bool... | vuln | Vulnerable | C/C++ |
@Override
public IAgriGrowCondition stateBelow(IntPredicate strength, Collection<BlockState> states) {
return this.stateBelow((str, state) -> strength.test(str) || states.contains(state), Stream.concat(Stream.of(
Descriptions.BLOCK_BELOW),
states.stream()
... | vuln | Safe | Java |
def _update_metadata(self, metadata_role, upperbound_filelength, version=None):
"""
<Purpose>
Non-public method that downloads, verifies, and 'installs' the metadata
belonging to 'metadata_role'. Calling this method implies that the
'metadata_role' on the repository is newer than the client's... | vuln | Safe | Python |
static int open_self_cmdline(void *cpu_env, int fd)
{
int fd_orig = -1;
bool word_skipped = false;
fd_orig = open("/proc/self/cmdline", O_RDONLY);
if (fd_orig < 0) {
return fd_orig;
}
while (true) {
ssize_t nb_read;
char buf[128];
char *cp_buf = buf;
nb_re... | vuln | Vulnerable | C/C++ |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
// There are two ways in which the 'output' can be made dynamic: it could be
// a string tensor, or its shape cannot b... | vuln | Vulnerable | C/C++ |
QPDFAcroFormDocumentHelper::traverseField(
QPDFObjectHandle field, QPDFObjectHandle parent, int depth,
std::set<QPDFObjGen>& visited)
{
if (depth > 100)
{
// Arbitrarily cut off recursion at a fixed depth to avoid
// specially crafted files that could cause stack overflow.
return... | vuln | Vulnerable | Unknown |
void Compute(OpKernelContext* context) override {
const Tensor& input_sizes = context->input(0);
const Tensor& filter = context->input(1);
const Tensor& out_backprop = context->input(2);
TensorShape input_shape;
OP_REQUIRES_OK(context,
Conv2DBackpropComputeInputShape(input_sizes,... | vuln | Safe | Unknown |
void AcpiCpuHotplug_add(ACPIGPE *gpe, AcpiCpuHotplug *g, CPUState *cpu)
{
CPUClass *k = CPU_GET_CLASS(cpu);
int64_t cpu_id;
*gpe->sts = *gpe->sts | ACPI_CPU_HOTPLUG_STATUS;
cpu_id = k->get_arch_id(CPU(cpu));
g->sts[cpu_id / 8] |= (1 << (cpu_id % 8));
} | vuln | Vulnerable | C/C++ |
NOEXPORT int init_section(int eof, SERVICE_OPTIONS **section_ptr) {
char *errstr;
#ifndef USE_WIN32
(*section_ptr)->option.log_stderr=new_global_options.option.log_stderr;
#endif /* USE_WIN32 */
if(*section_ptr==&new_service_options) {
/* end of global options or inetd mode -> initialize globals *... | vuln | Vulnerable | Unknown |
const got = require('@/utils/got');
const utils = require('./utils');
module.exports = async (ctx) => {
const site = ctx.params.site;
const only_media = ctx.params.only_media ? 'true' : 'false';
const url = `http://${site}/api/v1/timelines/public?local=true&only_media=${only_media}`;
const response =... | vuln | Vulnerable | JavaScript |
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code distributions
* retain the ab... | vuln | Vulnerable | C/C++ |
paged_results_copy_down_controls(TALLOC_CTX *mem_ctx,
struct ldb_control **controls)
{
struct ldb_control **new_controls;
unsigned int i, j, num_ctrls;
if (controls == NULL) {
return NULL;
}
for (num_ctrls = 0; controls[num_ctrls]; num_ctrls++);
new_controls = talloc_array(mem_ctx, struct ldb_control *,... | vuln | Safe | Unknown |
function ue(t,e,i){for(var n,s=(ce.tweeners[e]||[]).concat(ce.tweeners["*"]),r=0,o=s.length;r<o;r++)if(n=s[r].call(i,e,t))return n} | vuln | Safe | JavaScript |
public void setPlayerHeadPose(PlayerEntity player, Pose pose) {
PlayerEntityAcc acc = (PlayerEntityAcc) player;
if (acc.getHeadPose() == null) {
acc.markVR();
}
acc.getHeadPose().set(pose);
if (player.world.isClient && player instanceof ClientPlayerEntity) {
... | vuln | Safe | Java |
private boolean tryUnpackZipFile(final File importSandboxDirectory, final MultipartFile multipartFile) {
/* Extract ZIP contents */
ZipEntry zipEntry = null;
InputStream inputStream = null;
ZipInputStream zipInputStream = null;
boolean foundEntry = false;
try {
... | vuln | Safe | Java |
Jsi_Value *jsi_ValueObjKeyAssign(Jsi_Interp *interp, Jsi_Value *target, Jsi_Value *keyval, Jsi_Value *value, int flag)
{
int arrayindex = -1;
if (keyval->vt == JSI_VT_NUMBER && Jsi_NumberIsInteger(keyval->d.num) && keyval->d.num >= 0) {
arrayindex = (int)keyval->d.num;
}
/* TODO: array["1"] als... | vuln | Vulnerable | C/C++ |
int n_ssl3_mac(SSL *ssl, unsigned char *md, int send)
{
SSL3_RECORD *rec;
unsigned char *mac_sec,*seq;
EVP_MD_CTX md_ctx;
const EVP_MD_CTX *hash;
unsigned char *p,rec_char;
size_t md_size;
int npad;
int t;
if (send)
{
rec= &(ssl->s3->wrec);
mac_sec= &(ssl->s3->write_mac_secret[0]);
seq= &(ssl->s3->wr... | vuln | Safe | Unknown |
psutil_users(PyObject *self, PyObject *args) {
PyObject *py_retlist = PyList_New(0);
PyObject *py_username = NULL;
PyObject *py_tty = NULL;
PyObject *py_hostname = NULL;
PyObject *py_tuple = NULL;
if (py_retlist == NULL)
return NULL;
#if (defined(__FreeBSD_version) && (__FreeBSD_versio... | vuln | Vulnerable | Unknown |
// mkerrors.sh -Wall -Werror -static -I/tmp/include -m32
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build 386,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 _const.go
package unix
import "syscall"
const (
B1000000 ... | vuln | Safe | Go |
#ifndef JSI_LITE_ONLY
#ifndef JSI_AMALGAMATION
#include "jsiInt.h"
#endif
/* Return value from call to function will is not used. */
bool Jsi_FunctionReturnIgnored(Jsi_Interp *interp, Jsi_Func *funcPtr) {
return funcPtr->callflags.bits.isdiscard;
}
bool Jsi_FunctionIsConstructor(Jsi_Func *funcPtr)
{
return (f... | vuln | Safe | C/C++ |
static function encrypt($string, $key) {
$result = '';
for ($i=0; $i<strlen($string); $i++) {
$char = substr($string, $i, 1);
$keychar = substr($key, ($i % strlen($key))-1, 1);
$char = chr(ord($char)+ord($keychar));
$result .= $char;
}
return base64_enc... | vuln | Vulnerable | PHP |
package com.salesmanager.shop.admin.model.catalog;
import com.salesmanager.core.model.catalog.product.availability.ProductAvailability;
import com.salesmanager.core.model.catalog.product.description.ProductDescription;
import com.salesmanager.core.model.catalog.product.image.ProductImage;
import com.salesmanager.core.... | vuln | Vulnerable | Java |
public boolean useOpenGlRenderer() {
return NativeCoreContext.isInit() && osmandSettings.USE_OPENGL_RENDER.get();
} | vuln | Safe | Java |
GIT_INLINE(bool) only_spaces_and_dots(const char *path)
{
const char *c = path;
for (;; c++) {
if (*c == '\0')
return true;
if (*c != ' ' && *c != '.')
return false;
}
return true;
} | vuln | Vulnerable | C/C++ |
static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
{
zval *id;
xmlDoc *docp;
dom_object *intern;
char *source = NULL, *valid_file = NULL;
int source_len = 0;
xmlSchemaParserCtxtPtr parser;
xmlSchemaPtr sptr;
xmlSchemaValidCtxtPtr vptr;
int ... | vuln | Vulnerable | Unknown |
static av_cold int decode_close(AVCodecContext *avctx)
{
IVI5DecContext *ctx = avctx->priv_data;
ff_ivi_free_buffers(&ctx->planes[0]);
if (ctx->frame.data[0])
avctx->release_buffer(avctx, &ctx->frame);
return 0;
} | vuln | Vulnerable | C/C++ |
function getRecentDocs(getAll)
{
if (recentDocsCallback)
{
tempDlgContent.scrollTop = 0;
diagramsTiles.innerHTML = '';
spinner.spin(diagramsTiles);
cancelPendingCall = false;
callInitiated = true;
diagramsListTitle.innerHTML = mxUtils.htmlEntities(mxResources.get('recentDiag'));
lastSearchStr ... | vuln | Vulnerable | JavaScript |
void btsock_rfc_signaled(UNUSED_ATTR int fd, int flags, uint32_t user_id) {
pthread_mutex_lock(&slot_lock);
rfc_slot_t *slot = find_rfc_slot_by_id(user_id);
if (!slot)
goto out;
bool need_close = false;
if (flags & SOCK_THREAD_FD_RD && !slot->f.server) {
if (slot->f.connected) {
int size = 0;
... | vuln | Safe | C/C++ |
@Override
protected void init() {
super.init();
hoverAreas.clear();
clearWidgets();
minecraft.keyboardHandler.setSendRepeatsToGui(true);
playerList = new CreateGroupList(this, 9, 49, 160, 88, () -> VoicechatClient.CLIENT.getPlayerStateManager().getPlayerStates());
g... | vuln | Safe | Java |
public void writeJsonOutput(ScanRequest request, Object report, Logger log) throws MachinaException {
try {
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
mapper.writeValue(new File(request.getFilename()).getCanonical... | vuln | Safe | Java |
@Override
protected void onInitialize()
{
super.onInitialize();
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
boolean authenticated = authentication != null
&& !(authentication instanceof AnonymousAuthenticationToken);
L... | vuln | Safe | Java |
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
{
AVFilterContext *ctx = inlink->dst;
FPSContext *s = ctx->priv;
AVFilterLink *outlink = ctx->outputs[0];
int64_t delta;
int i, ret;
s->frames_in++;
/* discard frames until we get the first timestamp */
if (s->pt... | vuln | Vulnerable | C/C++ |
static void x86_cpu_unrealizefn(DeviceState *dev, Error **errp)
{
X86CPU *cpu = X86_CPU(dev);
X86CPUClass *xcc = X86_CPU_GET_CLASS(dev);
Error *local_err = NULL;
#ifndef CONFIG_USER_ONLY
cpu_remove_sync(CPU(dev));
qemu_unregister_reset(x86_cpu_machine_reset_cb, dev);
#endif
if (cpu->apic_state) ... | vuln | Safe | C/C++ |
get_options(int *argc,char ***argv)
{
int ho_error;
char *tmp_string;
MY_STAT sbuf; /* Stat information for the data file */
DBUG_ENTER("get_options");
if ((ho_error= handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
if (debug_info_flag)
my_end_arg= MY_CHECK_ERROR | MY_... | vuln | Safe | Unknown |
@Override
protected void serviceStop() throws Exception {
if (registryClient != null) {
registryClient.stop();
}
fs.getFileSystem().close();
super.serviceStop();
} | vuln | Safe | Java |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Safe | C/C++ |
static int mpegvideo_probe(AVProbeData *p)
{
uint32_t code= -1;
int pic=0, seq=0, slice=0, pspack=0, vpes=0, apes=0, res=0, sicle=0;
int i;
uint32_t last = 0;
for(i=0; i<p->buf_size; i++){
code = (code<<8) + p->buf[i];
if ((code & 0xffffff00) == 0x100) {
switch(code){
... | vuln | Vulnerable | C/C++ |
int ff_split_xiph_headers(uint8_t *extradata, int extradata_size,
int first_header_size, uint8_t *header_start[3],
int header_len[3])
{
int i, j;
if (AV_RB16(extradata) == first_header_size) {
for (i=0; i<3; i++) {
header_len[i] = AV_RB16(e... | vuln | Vulnerable | C/C++ |
static int get_registers(rtl8150_t * dev, u16 indx, u16 size, void *data)
{
return usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0),
RTL8150_REQ_GET_REGS, RTL8150_REQT_READ,
indx, 0, data, size, 500);
} | vuln | Vulnerable | C/C++ |
@SubscribeEvent
public void death(LivingDeathEvent ev) {
if (PlayerLinkController.getSettings(null, ev.getEntity().getUniqueID()).hideFromDiscord) return;
if (ev.getEntity() instanceof PlayerEntity || (ev.getEntity() instanceof TameableEntity && ((TameableEntity) ev.getEntity()).getOwner() instanceo... | vuln | Vulnerable | Java |
@Override
public boolean onUpdate(int currentTick) {
if (this.server.getDifficulty() < 1) {
this.close();
return false;
}
if (!this.isAlive()) {
if (++this.deadTicks >= 23) {
this.close();
return false;
}
... | vuln | Safe | Java |
public boolean blobExists(String uri) {
return getBlobURL(uri).exists();
} | vuln | Safe | Java |
static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
{
KLVPacket klv;
while (!s->pb->eof_reached) {
if (klv_read_packet(&klv, s->pb) < 0)
return -1;
PRINT_KEY(s, "read packet", klv.key);
av_dlog(s, "size %"PRIu64" offset %#"PRIx64"\n", klv.length, klv.offset);
... | vuln | Vulnerable | C/C++ |
QmpInputVisitor *qmp_input_visitor_new(QObject *obj, bool strict)
{
QmpInputVisitor *v;
v = g_malloc0(sizeof(*v));
v->visitor.type = VISITOR_INPUT;
v->visitor.start_struct = qmp_input_start_struct;
v->visitor.end_struct = qmp_input_end_struct;
v->visitor.start_list = qmp_input_start_list;
v-... | vuln | Vulnerable | C/C++ |
protected void build_further_dialog(){
boolean needRecreate=bLastFromWebView!=hasText();
if(!bFromWebView && mWebView!=null) {
statHasBookmark();
}
ListView dialogList;
//CMN.Log("重建对话???", hasText());
if(GlobalOptions.isDark!=lastInDark || d==null)
{
CMN.Log("重建对话框…");
needRecreate=fal... | vuln | Vulnerable | Java |
static int dns_validate_dns_response(unsigned char *resp, unsigned char *bufend,
struct dns_resolution *resolution, int max_answer_records)
{
unsigned char *reader;
char *previous_dname, tmpname[DNS_MAX_NAME_SIZE];
int len, flags, offset;
int dns_query_record_id;
int nb_saved_records;
struct dns_query_it... | vuln | Vulnerable | Unknown |
int build_ntlmssp_auth_blob(unsigned char **pbuffer,
u16 *buflen,
struct cifs_ses *ses,
const struct nls_table *nls_cp)
{
int rc;
AUTHENTICATE_MESSAGE *sec_blob;
__u32 flags;
unsigned char *tmp;
rc = setup_ntlmv2_rsp(ses, nls_cp);
if (rc) {
cifs_dbg(VFS, "Error %d during NTLMSSP authenticati... | vuln | Safe | Unknown |
@EventHandler
public void invulnerabilityKnockback(EliteMobDamagedEvent event) {
if (!event.getEliteMobEntity().hasPower(this)) return;
if (!event.getEliteMobEntity().isValid()) return;
event.getEntity().setVelocity(new Vector(0, 0, 0));
new BukkitRunnable() {
@Override
... | vuln | Safe | Java |
static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image,
ExceptionInfo *exception)
{
#define WriteRunlengthPacket(image,pixel,length,p) \
{ \
if ((image->alpha_trait != UndefinedPixelTrait) && (length != 0) && \
(GetPixelAlpha(image,p) == (Quantum) TransparentAlpha)) \
{ \
q=P... | vuln | Vulnerable | C/C++ |
static int iothread_stop(Object *object, void *opaque)
{
IOThread *iothread;
iothread = (IOThread *)object_dynamic_cast(object, TYPE_IOTHREAD);
if (!iothread || !iothread->ctx) {
return 0;
}
iothread->stopping = true;
aio_notify(iothread->ctx);
if (atomic_read(&iothread->main_loop)) ... | vuln | Vulnerable | C/C++ |
/* The MIT License (MIT)
*
* Copyright (c) 2015 Main Street Softworks, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rig... | vuln | Vulnerable | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.