code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
conn *conn_new(const int sfd, enum conn_states init_state,
const int event_flags,
const int read_buffer_size, enum network_transport transport,
struct event_base *base) {
conn *c = conn_from_freelist();
if (NULL == c) {
if (!(c = (conn *)calloc(1, sizeof(... | vuln | Safe | Unknown |
/************************************************************************
* 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 |
# Generated by Django 2.2.9 on 2020-02-06 12:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stock', '0019_auto_20200202_1024'),
]
operations = [
migrations.AlterField(
model_name='stockitem',
name='notes',
... | vuln | Safe | Python |
/*
* crun - OCI runtime written in C
*
* Copyright (C) 2017, 2018, 2019 Giuseppe Scrivano <giuseppe@scrivano.org>
* crun is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, o... | vuln | Safe | C/C++ |
static void sunkbd_set_leds_beeps(struct sunkbd *sunkbd)
{
serio_write(sunkbd->serio, SUNKBD_CMD_SETLED);
serio_write(sunkbd->serio,
(!!test_bit(LED_CAPSL, sunkbd->dev->led) << 3) |
(!!test_bit(LED_SCROLLL, sunkbd->dev->led) << 2) |
(!!test_bit(LED_COMPOSE, sunkbd->dev->led) << 1) |
!!test_bit(LED_NUML, ... | vuln | Safe | C/C++ |
Field_new_decimal::Field_new_decimal(uchar *ptr_arg,
uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg,
const char *field_name_arg,
... | vuln | Vulnerable | Unknown |
def add_empty_commit(folder,which_branch):
assert (os.path.isdir(folder))
os.chdir(folder)
# check to see if there are any branches in the repo with commits
result = subprocess.run(['git', 'branch', '-v'], stdout=subprocess.PIPE)
s = result.stdout.decode('utf-8')
if s != "":
# do nothi... | vuln | Vulnerable | Python |
/*
* Bittorrent Client using Qt4 and libtorrent.
* Copyright (C) 2006 Christophe Dumez
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your op... | vuln | Safe | C/C++ |
package com.salesmanager.shop.admin.model.reference;
import java.io.Serializable;
public class Size implements Serializable {
/**
*
*/
private static final long serialVersionUID = -4737272153685816396L;
private String code;
private String name;
public String getCode() {
return code;
}
public void se... | vuln | Safe | Java |
private static void onEntityImpact(Player player, LivingEntity target, LungeData data) {
ItemStack itemStack = data.itemStack;
ItemModularHandheld item = CastOptional.cast(itemStack.getItem(), ItemModularHandheld.class).orElse(null);
Vec3 bounceVector = player.position().subtract(target.positio... | vuln | Vulnerable | Java |
static void copyMultiCh16(short *dst, const int *const *src, unsigned nSamples, unsigned nChannels)
static void copyMultiCh16(short *dst, const int * src[FLACParser::kMaxChannels], unsigned nSamples, unsigned nChannels)
{
for (unsigned i = 0; i < nSamples; ++i) {
for (unsigned c = 0; c < nChannels; ++c) ... | vuln | Safe | C/C++ |
private Result handleAndReportFailure(
final Block invalidBlock, final String reason, final BlockProcessor.Result result) {
if (result.causedBy().isPresent()) {
LOG.info("{}. Block {}, caused by {}", reason, invalidBlock.toLogString(), result.causedBy());
if (!result.internalError()) {
bad... | vuln | Safe | Java |
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions ... | vuln | Vulnerable | C/C++ |
psutil_disk_io_counters(PyObject *self, PyObject *args) {
kstat_ctl_t *kc;
kstat_t *ksp;
kstat_io_t kio;
PyObject *py_retdict = PyDict_New();
PyObject *py_disk_info = NULL;
if (py_retdict == NULL)
return NULL;
kc = kstat_open();
if (kc == NULL) {
PyErr_SetFromErrno(PyExc... | vuln | Vulnerable | Unknown |
/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2009-2014 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
*
* OpenNMS(... | vuln | Safe | Java |
var T=document.createElement("tbody"),N=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(g=mxUtils.indexOf(b.pages,b.currentPage));for(q=e.length-1;0<=q;q--){var Q=function(R){var Y=new Date(R.modifiedDate),ba=null;if(0<=Y.getTime()){var ea=function(fa){x.stop();v.innerHTML="";var aa=mxUtils.parseXml(fa),... | vuln | Safe | JavaScript |
@Override
public void onPrepareOptionsMenu(@NonNull Menu menu) {
super.onPrepareOptionsMenu(menu);
if (containerActivity.getStorageManager() != null && getFile() != null) {
// Update the file
final OCFile updatedFile = containerActivity.getStorageManager().getFileById(getFil... | vuln | Safe | Java |
update_mtab (const char *dir, struct my_mntent *instead) {
mntFILE *mfp, *mftmp;
const char *fnam = _PATH_MOUNTED;
struct mntentchn mtabhead; /* dummy */
struct mntentchn *mc, *mc0 = NULL, *absent = NULL;
struct stat sbuf;
int fd;
if (mtab_does_not_exist() || !mtab_is_writable())
return;
lock_mtab();
/* h... | vuln | Safe | Unknown |
void
messageAddArgument(message *m, const char *arg)
{
int offset;
char *p;
assert(m != NULL);
if(arg == NULL)
return; /* Note: this is not an error condition */
while(isspace(*arg))
arg++;
if(*arg == '\0')
/* Empty argument? Probably a broken mail client... */
return;
cli_dbgmsg("messageAddArgument... | vuln | Vulnerable | C/C++ |
static int nbd_co_request(BlockDriverState *bs, NBDRequest *request,
QEMUIOVector *write_qiov)
{
int ret;
Error *local_err = NULL;
NBDClientSession *client = nbd_get_client_session(bs);
assert(request->type != NBD_CMD_READ);
if (write_qiov) {
assert(request->type ==... | vuln | Safe | C/C++ |
public void write(PrintWriter pw) throws IOException {
pw.println(COMMENT + " " + "dumped by " + getClass().getSimpleName());
pw.println(COMMENT + " " + BEGIN_MARKER);
for (final String url : getUrls()) {
pw.println(url);
for(final Subtype type : getSubtypesForUrl(url)) {... | vuln | Vulnerable | Java |
static void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,
unsigned long start, unsigned long end,
struct page *ref_page)
{
struct mm_struct *mm = vma->vm_mm;
unsigned long address;
pte_t *ptep;
pte_t pte;
spinlock_t *ptl;
struct page *page;
struct hstate *h = hstate_vma... | vuln | Vulnerable | Unknown |
static Image *ReadDPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
const char
*client_name;
Display
*display;
float
pixels_per_point;
Image
*image;
int
sans,
status;
Pixmap
pixmap;
register ssize_t
i;
register Quantum
*q;
register size_t
... | vuln | Vulnerable | C/C++ |
// Copyright (c) 2004-2013 Sergey Lyubka
// Copyright (c) 2013-2021 Cesanta Software Limited
// All rights reserved
//
// This software is dual-licensed: you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation. For the terms... | vuln | Safe | C/C++ |
static CURLcode tftp_connect(struct connectdata *conn, bool *done)
{
tftp_state_data_t *state;
int blksize;
blksize = TFTP_BLKSIZE_DEFAULT;
state = conn->proto.tftpc = calloc(1, sizeof(tftp_state_data_t));
if(!state)
return CURLE_OUT_OF_MEMORY;
/* alloc pkt buffers based on specified blksize */
if(... | vuln | Vulnerable | C/C++ |
int h2_make_htx_trailers(struct http_hdr *list, struct htx *htx)
{
const char *ctl;
uint32_t idx;
int i;
for (idx = 0; list[idx].n.len != 0; idx++) {
if (!list[idx].n.ptr) {
/* This is an indexed pseudo-header (RFC7540#8.1.2.1) */
goto fail;
}
/* RFC7540#8.1.2: upper case not allowed in header field n... | vuln | Safe | Unknown |
static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
{
LavfiContext *lavfi = avctx->priv_data;
double min_pts = DBL_MAX;
int stream_idx, min_pts_sink_idx = 0;
AVFilterBufferRef *ref;
AVPicture pict;
int ret, i;
int size = 0;
for (i = 0; i < avctx->nb_streams; i++) {
... | vuln | Vulnerable | C/C++ |
public List<T> getItems() {
return this.voronoiPoints.stream().map(p -> p.item()).toList();
} | vuln | Vulnerable | Java |
public boolean hasPegleg(PlayerEntity playerEntity) {
return hasPegleg(playerEntity.getUuid().toString().replace("-", ""));
} | vuln | Vulnerable | Java |
static grub_err_t read_foo (struct grub_disk *disk, grub_disk_addr_t sector, grub_size_t size, char *buf) {
if (disk != NULL) {
const int blocksize = 512; // unhardcode 512
int ret;
RIOBind *iob = disk->data;
if (bio) iob = bio;
//printf ("io %p\n", file->root->iob.io);
ret = iob->read_at (iob->io, delta+(... | vuln | Vulnerable | Unknown |
def reset_users
Log.add_info(request, params.inspect)
return unless request.post?
count = 0
unless params[:check_user].nil?
params[:check_user].each do |user_id, value|
if value == '1'
SqlHelper.validate_token([user_id])
begin
Research.destroy_all("user_... | vuln | Safe | Ruby |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | vuln | Vulnerable | Python |
private String getFileMimeType(final String filename) {
String extension = MimeTypeMap.getFileExtensionFromUrl(filename);
if (extension == null) {
return null;
}
return MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
} | vuln | Vulnerable | Java |
void usb_ep_combine_input_packets(USBEndpoint *ep)
{
USBPacket *p, *u, *next, *prev = NULL, *first = NULL;
USBPort *port = ep->dev->port;
int ret, totalsize;
assert(ep->pipeline);
assert(ep->pid == USB_TOKEN_IN);
QTAILQ_FOREACH_SAFE(p, &ep->queue, queue, next) {
if (ep->halted) ... | vuln | Safe | C/C++ |
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
{
if(ignore_settings_changes) return ;
if(key == null) return ;
switch(key)
{
// ========= Appearance settings ==========
case Constants.APPLICATION_THEME :
// Update the theme
setApplicationTheme() ... | vuln | Safe | Java |
def XMPPClientFactory(jid, password, configurationForTLS=None):
"""
Client factory for XMPP 1.0 (only).
This returns a L{xmlstream.XmlStreamFactory} with an L{XMPPAuthenticator}
object to perform the stream initialization steps (such as authentication).
@see: The notes at L{XMPPAuthenticator} desc... | vuln | Safe | Python |
protected void checkTransferablePermission(Set<PersistentResource> resourceIdentifiers) {
if (resourceIdentifiers == null) {
return;
}
final Set<PersistentResource> newResources = getRequestScope().getNewPersistentResources();
for (PersistentResource persistentResource : re... | vuln | Vulnerable | Java |
static void fix_dl_name(MEM_ROOT *root, LEX_STRING *dl)
{
const size_t so_ext_len= sizeof(SO_EXT) - 1;
if (my_strcasecmp(&my_charset_latin1, dl->str + dl->length - so_ext_len,
SO_EXT))
{
char *s= (char*)alloc_root(root, dl->length + so_ext_len + 1);
memcpy(s, dl->str, dl->length);
... | vuln | Vulnerable | Unknown |
private void sendRoleSharedPasswordAuthType()
throws NoSuchPaddingException, IllegalBlockSizeException, NoSuchAlgorithmException,
BadPaddingException, InvalidKeyException {
byte[] playerPasswordSalt = playerDatabase.getPlayerPasswordSalt(player.getName());
String[] password = new String[2];
... | vuln | Vulnerable | Java |
static bool gfar_add_rx_frag(struct gfar_rx_buff *rxb, u32 lstatus,
struct sk_buff *skb, bool first)
{
int size = lstatus & BD_LENGTH_MASK;
struct page *page = rxb->page;
if (likely(first)) {
skb_put(skb, size);
} else {
/* the last fragments' length contains the full frame length */
if (lstatus & BD... | vuln | Safe | Unknown |
@SubscribeEvent
public void keyPressOnChest(GuiOverlapEvent.ChestOverlap.KeyTyped e) {
if (!Reference.onWorld) return;
if (UtilitiesConfig.INSTANCE.preventMythicChestClose) {
if (e.getKeyCode() == 1 || e.getKeyCode() == ModCore.mc().gameSettings.keyBindInventory.getKeyCode()) {
... | vuln | Vulnerable | Java |
_handle_carbons(xmpp_stanza_t *const stanza)
{
xmpp_stanza_t *carbons = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_CARBONS);
if (!carbons) {
return FALSE;
}
const char *name = xmpp_stanza_get_name(carbons);
if (!name) {
log_error("Unable to retrieve stanza name for Carbon");
... | vuln | Vulnerable | C/C++ |
bool DebugOnStart::FindArgument(wchar_t* command_line, const char* argument_c) {
wchar_t argument[50];
for (int i = 0; argument_c[i]; ++i)
argument[i] = argument_c[i];
int argument_len = lstrlen(argument);
int command_line_len = lstrlen(command_line);
while (command_line_len > argument_len) {
wcha... | vuln | Vulnerable | Unknown |
private void onGroupIds(int[] groupIds) {
synchronized (mScanCallbackLock) {
if (mScanCallbackExecutor != null && mScanCallback != null) {
mScanCallbackExecutor.execute(() -> mScanCallback.onGroupIdsReported(groupIds));
}
}
} | vuln | Safe | Java |
static int /* O - 1 if valid, 0 if not */
valid_host(cupsd_client_t *con) /* I - Client connection */
{
cupsd_alias_t *a; /* Current alias */
cupsd_netif_t *netif; /* Current network interface */
const char *end; /* End character */
char *ptr; /* Pointer into host value */
/*
* Copy the Host: ... | vuln | Vulnerable | C/C++ |
/*
** codegen.c - mruby code generator
**
** See Copyright Notice in mruby.h
*/
#include <mruby.h>
#include <mruby/compile.h>
#include <mruby/proc.h>
#include <mruby/dump.h>
#include <mruby/numeric.h>
#include <mruby/string.h>
#include <mruby/debug.h>
#include <mruby/presym.h>
#include "node.h"
#include <mruby/opcode.... | vuln | Vulnerable | C/C++ |
QPDFObjectHandle::parseInternal(PointerHolder<InputSource> input,
std::string const& object_description,
QPDFTokenizer& tokenizer, bool& empty,
StringDecrypter* decrypter, QPDF* context,
bool ... | vuln | Safe | Unknown |
@Override
public boolean verifyDrawable(@NonNull Drawable who) {
return super.verifyDrawable(who)
// mForegroundHelper may be null during super constructor invocation.
|| (mForegroundHelper != null && mForegroundHelper.verifyDrawable(who));
} | vuln | Safe | Java |
static int cms_RecipientInfo_ktri_decrypt(CMS_ContentInfo *cms,
CMS_RecipientInfo *ri)
{
CMS_KeyTransRecipientInfo *ktri = ri->d.ktri;
EVP_PKEY *pkey = ktri->pkey;
unsigned char *ek = NULL;
size_t eklen;
int ret = 0;
size_t fixlen = 0;
CMS_EncryptedC... | vuln | Safe | Unknown |
void avfilter_unref_buffer(AVFilterBufferRef *ref)
{
if (!ref)
return;
av_assert0(ref->buf->refcount > 0);
if (!(--ref->buf->refcount)) {
if (!ref->buf->free) {
store_in_pool(ref);
return;
}
ref->buf->free(ref->buf);
}
if (ref->extended_data !=... | vuln | Safe | C/C++ |
R_API RBinJavaAttrInfo *r_bin_java_source_code_file_attr_new(RBinJavaObj *bin, ut8 *buffer, ut64 sz, ut64 buf_offset) {
if (!sz) {
return NULL;
}
ut64 offset = 0;
RBinJavaAttrInfo *attr = r_bin_java_default_attr_new (bin, buffer, sz, buf_offset);
offset += 6;
if (!attr) {
return NULL;
}
attr->type = R_BIN_J... | vuln | Vulnerable | C/C++ |
@Override
protected void onResume() {
super.onResume();
if (adapter == null) // If onCreate did not finish (nothing to share)
return;
updateRemotes();
IntentFilter f = new IntentFilter(LocalBroadcasts.ACTION_UPDATE_REMOTES);
f.addAction(LocalBroadcasts.ACTION_DISP... | vuln | Safe | Java |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
import string
import random
import hashlib
import requests
from .base import Map, WeixinError
try:
from flask import request
except Exception:
request = None
try:
from lxml import etree
except ImportError:
from xml.etree i... | vuln | Vulnerable | Python |
xsltParseStylesheetImport(xsltStylesheetPtr style, xmlNodePtr cur) {
int ret = -1;
xmlDocPtr import = NULL;
xmlChar *base = NULL;
xmlChar *uriRef = NULL;
xmlChar *URI = NULL;
xsltStylesheetPtr res;
xsltSecurityPrefsPtr sec;
if ((cur == NULL) || (style == NULL))
return (ret);
uriRe... | vuln | Vulnerable | Unknown |
static int commit_one_file(BDRVVVFATState* s,
int dir_index, uint32_t offset)
{
direntry_t* direntry = array_get(&(s->directory), dir_index);
uint32_t c = begin_of_direntry(direntry);
uint32_t first_cluster = c;
mapping_t* mapping = find_mapping_for_cluster(s, c);
uint32_t size = filesize_of_dirent... | vuln | Safe | C/C++ |
void Compute(OpKernelContext* context) override {
typedef Eigen::Map<const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>>
ConstEigenMatrixMap;
typedef Eigen::Map<Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>>
EigenMatrixMap;
constexpr int tensor_in_and_out_dims = 4;
const Tensor&... | vuln | Vulnerable | C/C++ |
def _remove_javascript_link(self, link):
# links like "j a v a s c r i p t:" might be interpreted in IE
new = _substitute_whitespace('', unquote_plus(link))
if _is_javascript_scheme(new):
# FIXME: should this be None to delete?
return ''
return link | vuln | Safe | Python |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | vuln | Safe | Java |
static DriveInfo *blockdev_init(const char *file, QDict *bs_opts,
Error **errp)
{
const char *buf;
const char *serial;
int ro = 0;
int bdrv_flags = 0;
int on_read_error, on_write_error;
DriveInfo *dinfo;
ThrottleConfig cfg;
int snapshot = 0;
bool copy_... | vuln | Vulnerable | C/C++ |
protected function emailExistsInDB($email)
{
/* Build sql query*/
$sql = 'SELECT * FROM '.$this->usersTable;
$sql .= ' WHERE email = "'.mysqli_real_escape_string($this->wiki->dblink,$email).'";';
/* Execute query */
$results = $this->wiki->loadAll($sql);
return $resu... | vuln | Safe | PHP |
#!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import azure.functions as func
# This endpoint handles the signalr negotation
# As we do not differentiate from clients at this time, we pass the Functions runtime
# provided connection straight to the client
#
# For more... | vuln | Vulnerable | Python |
static int qpeg_decode_intra(const uint8_t *src, uint8_t *dst, int size,
int stride, int width, int height)
{
int i;
int code;
int c0, c1;
int run, copy;
int filled = 0;
int rows_to_go;
rows_to_go = height;
height--;
dst = dst + height * stride;
while(... | vuln | Safe | C/C++ |
static void qmp_input_start_struct(Visitor *v, void **obj, const char *kind,
const char *name, size_t size, Error **errp)
{
QmpInputVisitor *qiv = to_qiv(v);
const QObject *qobj = qmp_input_get_object(qiv, name);
Error *err = NULL;
if (!qobj || qobject_type(qobj) != QT... | vuln | Safe | C/C++ |
function upgradeWebSocket(request, options = {}) {
const upgrade = request.headers.get("upgrade");
const upgradeHasWebSocketOption = upgrade !== null &&
ArrayPrototypeSome(
StringPrototypeSplit(upgrade, ","),
(option) =>
StringPrototypeToLowerCase(StringPrototypeTrim(option)) === "websocket"... | vuln | Safe | JavaScript |
public function write(Profile $profile)
{
$file = $this->getFilename($profile->getToken());
$profileIndexed = is_file($file);
if (!$profileIndexed) {
// Create directory
$dir = dirname($file);
if (!is_dir($dir) && false === @mkdir($dir, 0777, true) && !is... | vuln | Vulnerable | JavaScript |
#include "sass.hpp"
#include "parser.hpp"
#include "file.hpp"
#include "inspect.hpp"
#include "constants.hpp"
#include "util.hpp"
#include "prelexer.hpp"
#include "color_maps.hpp"
#include "sass/functions.h"
#include "error_handling.hpp"
// Notes about delayed: some ast nodes can have delayed evaluation so
// they can... | vuln | Safe | JavaScript |
comparetup_index_btree(const SortTuple *a, const SortTuple *b,
Tuplesortstate *state)
{
/*
* This is similar to comparetup_heap(), but expects index tuples. There
* is also special handling for enforcing uniqueness, and special treatment
* for equal keys at the end.
*/
SortSupport sortKey = state->so... | vuln | Safe | Unknown |
package configserver
import (
"crypto/sha256"
"encoding/base64"
"encoding/json"
"fmt"
"net/http"
"strings"
"time"
v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/controllers/provisioningv2/rke2"
capicontrollers "github.com/rancher/rancher/pkg/generated/contro... | vuln | Vulnerable | Go |
private static void insertPacketID(Class<?> cls, byte packetID) {
if (cls != null) {
insertPacketID(cls, packetID);
}
} | vuln | Vulnerable | Java |
private static ItemStack createHead(Player targetPlayer, Player GUIholder) {
ItemStack i = nms.getPlayerHead(targetPlayer, null);
ItemMeta im = i.getItemMeta();
assert im != null;
im.setDisplayName(getMsg(GUIholder, Messages.ARENA_SPECTATOR_TELEPORTER_GUI_HEAD_NAME)
.repl... | vuln | Safe | Java |
private static void updateFlagSecure(Window window) {
if (ConfigManager.getBooleanOrFalse(Defines.allowScreenshotOnNoForwardChat)){
return;
}
if (Build.VERSION.SDK_INT >= 23) {
if (window == null) {
return;
}
final boolean value = f... | vuln | Safe | Java |
xmlBufferCCat(xmlBufferPtr buf, const char *str) {
return xmlBufferCat(buf, (const xmlChar *) str);
} | vuln | Safe | Unknown |
def index(request, is_mobile=False):
hue_collections = DashboardController(request.user).get_search_collections()
collection_id = request.GET.get('collection')
if not hue_collections or not collection_id:
return admin_collections(request, True, is_mobile)
try:
collection_doc = Document2.objects.get(id... | vuln | Vulnerable | Python |
static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp)
{
int *fdp = (int*)CMSG_DATA(cmsg);
struct scm_fp_list *fpl = *fplp;
struct file **fpp;
int i, num;
num = (cmsg->cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr)))/sizeof(int);
if (num <= 0)
return 0;
if (num > SCM_MAX_FD)
return -EINVAL;... | vuln | Vulnerable | Unknown |
OM_uint32 KRB5_CALLCONV
gss_wrap_iov_length (minor_status,
context_handle,
conf_req_flag,
qop_req,
conf_state,
iov,
iov_count)
OM_uint32 * minor_status;
gss_ctx_id_t context_handle;
int conf... | vuln | Safe | C/C++ |
v8::Local<v8::Object> V8InjectedScriptHost::create(v8::Local<v8::Context> context, V8InspectorImpl* inspector)
{
v8::Isolate* isolate = inspector->isolate();
v8::Local<v8::Object> injectedScriptHost = v8::Object::New(isolate);
bool success = injectedScriptHost->SetPrototype(context, v8::Null(isolate)).Fr... | vuln | Safe | C/C++ |
K&&D(Editor.svgBrokenImage.src)});else{var N=new Image;this.crossOriginImages&&(N.crossOrigin="anonymous");N.onload=function(){window.clearTimeout(T);if(K)try{var Q=document.createElement("canvas"),R=Q.getContext("2d");Q.height=N.height;Q.width=N.width;R.drawImage(N,0,0);D(Q.toDataURL())}catch(Y){D(Editor.svgBrokenImag... | vuln | Safe | JavaScript |
public static function loadFrom(Db $zdb, $id, $mailing, $new = true)
{
try {
$select = $zdb->select(self::TABLE);
$select->where('mailing_id = ' . $id);
$results = $zdb->execute($select);
$result = $results->current();
return $mailing->loadFromHi... | vuln | Vulnerable | PHP |
func runUsingChrootExecMain() {
args := os.Args[1:]
var options runUsingChrootExecSubprocOptions
var err error
runtime.LockOSThread()
// Set logging.
if level := os.Getenv("LOGLEVEL"); level != "" {
if ll, err := strconv.Atoi(level); err == nil {
logrus.SetLevel(logrus.Level(ll))
}
os.Unsetenv("LOGLEVE... | vuln | Safe | Go |
@Override
public void processSuccessScenario(String response) {
IDataExtractor extractor = new OwmDataExtractor();
try {
JSONObject json = new JSONObject(response);
JSONArray list = json.getJSONArray("list");
JSONObject jsoncity = json.getJSONObject("city");
... | vuln | Safe | Java |
@Override
public LittleBox grow(EnumFacing facing) {
LittleBox box = super.grow(facing);
if (box != null)
return new LittleTransformableBox(box, data);
return null;
} | vuln | Safe | Java |
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_send_ctl.c -- Logic for sending and sent packets
*/
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <sys/queue.h>
#include <openssl/rand.h>
#include "lsquic_types.h"
#... | vuln | Safe | C/C++ |
def _port_conf_generator(self, cmd):
ssh_cmd = '%s -delim !' % cmd
out, err = self._run_ssh(ssh_cmd)
if not len(out.strip()):
return
port_lines = out.strip().split('\n')
if not len(port_lines):
return
header = port_lines.pop(0)
yield head... | vuln | Vulnerable | Python |
void
readSampleCountForLineBlock(InputStreamMutex* streamData,
DeepScanLineInputFile::Data* data,
int lineBlockId)
{
streamData->is->seekg(data->lineOffsets[lineBlockId]);
if (isMultiPart(data->version))
{
int partNumber;
OPENEXR_IMF_I... | vuln | Vulnerable | C/C++ |
def _run_algorithm(self) -> list[dict]:
"""
Run the algorithm container
Start up a helper container to complete VPN setup, pull the latest
image and then run the algorithm
Returns
-------
list[dict] or None
Description of each port on the VPN client ... | vuln | Vulnerable | Python |
static int16_t square_root(unsigned val)
{
av_assert2(!(val & 0x80000000));
return (ff_sqrt(val << 1) >> 1) & (~1);
} | vuln | Safe | C/C++ |
get_settings (NMExportedConnection *exported)
{
NMConnection *connection;
GHashTable *settings;
connection = nm_exported_connection_get_connection (exported);
utils_fill_connection_certs (connection);
settings = nm_connection_to_hash (connection);
utils_clear_filled_connection_certs (connection);
return setti... | vuln | Vulnerable | Unknown |
long Segment::ParseNext(const Cluster* pCurr, const Cluster*& pResult,
long long& pos, long& len) {
assert(pCurr);
assert(!pCurr->EOS());
assert(m_clusters);
pResult = 0;
if (pCurr->m_index >= 0) { // loaded (not merely preloaded)
assert(m_clusters[pCurr->m_index] == pCurr);
const long next_idx = pCur... | vuln | Safe | C/C++ |
MagickExport Image *AdaptiveThresholdImage(const Image *image,
const size_t width,const size_t height,const ssize_t offset,
ExceptionInfo *exception)
{
#define ThresholdImageTag "Threshold/Image"
CacheView
*image_view,
*threshold_view;
Image
*threshold_image;
MagickBooleanType
status;
M... | vuln | Safe | C/C++ |
func (f *ScmpFilter) addRuleWrapper(call ScmpSyscall, action ScmpAction, exact bool, length C.uint, cond C.scmp_cast_t) error {
if length != 0 && cond == nil {
return fmt.Errorf("null conditions list, but length is nonzero")
}
var retCode C.int
if exact {
retCode = C.seccomp_rule_add_exact_array(f.filterCtx, a... | vuln | Safe | Go |
public void onLootingEvent(LootingLevelEvent event){
if (isAlive() && getOwner() != null && event.getDamageSource().getEntity() != null && getOwner().equals(event.getDamageSource().getEntity())) {
if (level.random.nextFloat() > 0.4) {
event.setLootingLevel(event.getLootingLevel() + 1... | vuln | Vulnerable | Java |
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 | Safe | C/C++ |
static int mpc7_decode_frame(AVCodecContext * avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
MPCContext *c = avctx->priv_data;
GetBitContext gb;
uint8_t *bits;
int i, ch;
... | vuln | Safe | 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 | Vulnerable | C/C++ |
int usb_cypress_load_firmware(struct usb_device *udev, const struct firmware *fw, int type)
{
struct hexline *hx;
u8 reset;
int ret,pos=0;
hx = kmalloc(sizeof(*hx), GFP_KERNEL);
if (!hx)
return -ENOMEM;
/* stop the CPU */
reset = 1;
if ((ret = usb_cypress_writemem(udev,cypress[type].cpu_cs_register,&r... | vuln | Vulnerable | C/C++ |
package docker
import (
"bytes"
"context"
"crypto/rand"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
"path/filepath"
"strings"
"github.com/containers/image/v5/docker/reference"
"github.com/containers/image/v5/internal/iolimits"
"github.com/containers/image/v5/manifest"
"github.com/... | vuln | Safe | Go |
/*
Copyright 2018-2020 Accenture Technology
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 | Safe | Java |
@Override
public User execute(ServiceProvider context) {
User user = Strings.isNullOrEmpty(username) || Strings.isNullOrEmpty(password) ? null : context.service(IdentityProvider.class).auth(username, password);
if (user == null && !Strings.isNullOrEmpty(token)) {
user = context.service(AuthorizationHeaderVer... | vuln | Safe | Java |
int64_t bdrv_getlength(BlockDriverState *bs)
{
int64_t ret = bdrv_nb_sectors(bs);
ret = ret > INT64_MAX / BDRV_SECTOR_SIZE ? -EFBIG : ret;
return ret < 0 ? ret : ret * BDRV_SECTOR_SIZE;
} | vuln | Safe | C/C++ |
'use strict';
const spawn = require('child_process').spawn;
const packageData = require('../../package.json');
const LeWindows = require('./le-windows');
const LeUnix = require('./le-unix');
const shared = require('../shared');
/**
* Generates a Transport object for Sendmail
*
* Possible options can be the followi... | vuln | Vulnerable | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.