code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
BDRVQcowState *s = bs->opaque;
int len, i, shift, ret;
QCowHeader header;
ret = bdrv_pread(bs->file, 0, &header, sizeof(header));
if (ret < 0) {
goto fail;
}
be32_to_cpus(&heade... | vuln | Vulnerable | C/C++ |
fetch(id) {
return this.github.pullRequests
.get({
owner: this.owner,
repo: this.repo,
number: id
})
.then(res => {
const branch = res.data.head.ref;
execFileSync("git", ["fetch", "origin", `pull/${id}/head:${branch}`]);
execFileSync("git", ["checkou... | vuln | Safe | JavaScript |
private Mono<Void> handleServerDHParams(ServerDHParams serverDHParams) {
context.setServerDHParams(serverDHParams); // for DhGenRetry
ByteBuf serverNonceAndNewNonceSha1 = sha1Digest(context.getServerNonce(), context.getNewNonce());
ByteBuf tmpAesKey = Unpooled.wrappedBuffer(
sha... | vuln | Vulnerable | Java |
dissect_spoolss_keybuffer(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, dcerpc_info *di, guint8 *drep)
{
guint32 size;
int end_offset;
if (di->conformant_run)
return offset;
/* Dissect size and data */
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep,
hf_keybuffer... | vuln | Safe | C/C++ |
static int nf_conntrack_standalone_init_sysctl(struct net *net)
{
struct nf_conntrack_net *cnet = net_generic(net, nf_conntrack_net_id);
struct nf_udp_net *un = nf_udp_pernet(net);
struct ctl_table *table;
BUILD_BUG_ON(ARRAY_SIZE(nf_ct_sysctl_table) != NF_SYSCTL_CT_LAST_SYSCTL);
table = kmemdup(nf_ct_sysctl_tabl... | vuln | Safe | C/C++ |
void start_auth_sasl(VncState *vs)
{
const char *mechlist = NULL;
sasl_security_properties_t secprops;
int err;
char *localAddr, *remoteAddr;
int mechlistlen;
VNC_DEBUG("Initialize SASL auth %d\n", vs->csock);
if (!(localAddr = vnc_socket_local_addr("%s;%s", vs->csock)))
goto au... | vuln | Safe | C/C++ |
static njs_int_t
njs_generate_try_catch(njs_vm_t *vm, njs_generator_t *generator,
njs_parser_node_t *node)
{
njs_int_t ret;
njs_index_t exit_index;
njs_vmcode_finally_t *finally;
njs_generator_patch_t *patch;
njs_generator_block_t *block, *try_block;
njs... | vuln | Vulnerable | C/C++ |
void CtcpParser::packedReply(CoreNetwork *net, const QString &bufname, const QList<QByteArray> &replies) {
QList<QByteArray> params;
int answerSize = 0;
for(int i = 0; i < replies.count(); i++) {
answerSize += replies.at(i).size();
}
QByteArray quotedReply;
quotedReply.reserve(answerSize);
for(int i... | vuln | Safe | Unknown |
/* Copyright 2017 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 |
static UINT32 nsc_rle_encode(BYTE* in, BYTE* out, UINT32 originalSize)
{
UINT32 left;
UINT32 runlength = 1;
UINT32 planeSize = 0;
left = originalSize;
/**
* We quit the loop if the running compressed size is larger than the original.
* In such cases data will be sent uncompressed.
*/
while (left > 4 && ... | vuln | Vulnerable | C/C++ |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite (interfaces: Requester)
// Package internal is a generated GoMock package.
package internal
import (
url "net/url"
reflect "reflect"
time "time"
gomock "github.com/golang/mock/gomock"
fosite "github.com/ory/fosite"
)
// MockRequester ... | vuln | Safe | Go |
// Copyright 2019 Istio Authors
//
// 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 i... | vuln | Vulnerable | Go |
void PaymentRequest::AreRequestedMethodsSupportedCallback(
bool methods_supported) {
if (methods_supported) {
if (SatisfiesSkipUIConstraints()) {
skipped_payment_request_ui_ = true;
Pay();
}
} else {
journey_logger_.SetNotShown(
JourneyLogger::NOT_SHOWN_REASON_NO_SUPPORTED_PAYMEN... | vuln | Vulnerable | C/C++ |
buflist_match(
regmatch_T *rmp,
buf_T *buf,
int ignore_case) // when TRUE ignore case, when FALSE use 'fic'
{
char_u *match;
// First try the short file name, then the long file name.
match = fname_match(rmp, buf->b_sfname, ignore_case);
if (match == NULL && rmp->regprog != NULL)
match =... | vuln | Safe | C/C++ |
static av_always_inline void MPV_motion_internal(MpegEncContext *s,
uint8_t *dest_y,
uint8_t *dest_cb,
uint8_t *dest_cr,
int... | vuln | Vulnerable | C/C++ |
public static @NotNull Vanilla fromType(@NotNull Identifier type) {
if (modID.equals(type.modID)) return valueOf(type.id.toUpperCase());
throw new IllegalArgumentException("Tried to get a vanilla recipe enum from an identifier but the modid wasn't \"minecraft\"!");
} | vuln | Vulnerable | Java |
static int milkymist_softusb_init(SysBusDevice *dev)
{
MilkymistSoftUsbState *s = MILKYMIST_SOFTUSB(dev);
sysbus_init_irq(dev, &s->irq);
memory_region_init_io(&s->regs_region, OBJECT(s), &softusb_mmio_ops, s,
"milkymist-softusb", R_MAX * 4);
sysbus_init_mmio(dev, &s->regs_regio... | vuln | Vulnerable | C/C++ |
static int tgq_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt){
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
const uint8_t *buf_start = buf;
const uint8_t *buf_end = buf + buf_size;
TgqContext *... | vuln | Vulnerable | C/C++ |
static void
output_BLOCK_HEADER (dwg_object_ref *ref)
{
dwg_object *hdr, *obj;
dwg_obj_block_header *_hdr;
int error;
BITCODE_RL abs_ref;
char *name;
if (!ref)
{
fprintf (stderr,
"Empty BLOCK."
" Could not output an SVG symbol for this BLOCK_HEADER\n");
return;... | vuln | Safe | C/C++ |
@Method(0x800eac58L)
public static DeffPart getDeffPart(final int flags) {
final MrgFile deff = deffManager_800c693c.deffPackage_5a8;
final Function<Value, ? extends DeffPart> ctor = switch(flags >>> 24) {
case 0 -> DeffPart.LmbType::new;
case 1, 2 -> DeffPart.AnimatedTmdType::new;
case 3 -... | vuln | Vulnerable | Java |
local void compress_block(s, ltree, dtree)
deflate_state *s;
const ct_data *ltree; /* literal tree */
const ct_data *dtree; /* distance tree */
{
unsigned dist; /* distance of matched string */
int lc; /* match length or unmatched char (if dist == 0) */
unsigned sx = 0; /* ru... | vuln | Safe | C/C++ |
public void onDisable() {
if (mc.world != null) {
for(int i = 0; i < incr; i++) {
mc.world.removeEntityFromWorld((-1234 - i));
}
}
listPlayers.clear();
} | vuln | Vulnerable | Java |
void SendRendererReply(const std::vector<int>& fds, const Pickle& reply,
int reply_fd) {
struct msghdr msg;
memset(&msg, 0, sizeof(msg));
struct iovec iov = {const_cast<void*>(reply.data()), reply.size()};
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
char control_buffer[CMS... | vuln | Safe | C/C++ |
static int run(const CommandLineOptions& options)
{
IR::Module irModule;
// Load the module.
if(!loadModule(options.filename, irModule)) { return EXIT_FAILURE; }
if(options.onlyCheck) { return EXIT_SUCCESS; }
// Compile the module.
Runtime::Module* module = nullptr;
if(!options.precompiled) { module = Runtime:... | vuln | Safe | Unknown |
static int read_code_table(CLLCContext *ctx, GetBitContext *gb, VLC *vlc)
{
uint8_t symbols[256];
uint8_t bits[256];
uint16_t codes[256];
int num_lens, num_codes, num_codes_sum, prefix;
int i, j, count;
prefix = 0;
count = 0;
num_codes_sum = 0;
num_lens = get_bits(gb, ... | vuln | Safe | C/C++ |
int rose_route_frame(struct sk_buff *skb, ax25_cb *ax25)
{
struct rose_neigh *rose_neigh, *new_neigh;
struct rose_route *rose_route;
struct rose_facilities_struct facilities;
rose_address *src_addr, *dest_addr;
struct sock *sk;
unsigned short frametype;
unsigned int lci, new_lci;
unsigned char cause, diagnostic... | vuln | Vulnerable | Unknown |
@Override
protected void onResume() {
super.onResume();
updateRemotes();
IntentFilter f = new IntentFilter(LocalBroadcasts.ACTION_UPDATE_REMOTES);
f.addAction(LocalBroadcasts.ACTION_DISPLAY_MESSAGE);
f.addAction(LocalBroadcasts.ACTION_DISPLAY_TOAST);
f.addAction(Local... | vuln | Vulnerable | Java |
def _interpret_as_from(element):
insp = inspection.inspect(element, raiseerr=False)
if insp is None:
if isinstance(element, util.string_types):
_no_text_coercion(element)
try:
return insp.selectable
except AttributeError:
raise exc.ArgumentError("FROM expression expec... | vuln | Safe | Python |
function N(t,e){var n;return"string"==typeof e&&"number"!=typeof(e=t.localeData().monthsParse(e))||(n=Math.min(t.date(),I(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n)),t} | vuln | Vulnerable | JavaScript |
static int i40e_setup_macvlans(struct i40e_vsi *vsi, u16 macvlan_cnt, u16 qcnt,
struct net_device *vdev)
{
struct i40e_pf *pf = vsi->back;
struct i40e_hw *hw = &pf->hw;
struct i40e_vsi_context ctxt;
u16 sections, qmap, num_qps;
struct i40e_channel *ch;
int i, pow, ret = 0;
u8 offset = 0;
if (vsi->typ... | vuln | Vulnerable | C/C++ |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, node->inputs->size, 1);
TF_LITE_ENSURE_EQ(context, node->outputs->size, 1);
const TfLiteTensor* input_resource_id_tensor;
TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInputVariableId,
... | vuln | Safe | C/C++ |
/* CAN driver for Geschwister Schneider USB/CAN devices
* and bytewerk.org candleLight USB CAN interfaces.
*
* Copyright (C) 2013-2016 Geschwister Schneider Technologie-,
* Entwicklungs- und Vertriebs UG (Haftungsbeschränkt).
* Copyright (C) 2016 Hubert Denkmair
*
* Many thanks to all socketcan devs!
*
* This ... | vuln | Vulnerable | C/C++ |
const BlockEntry* Segment::GetBlock(const CuePoint& cp,
const CuePoint::TrackPosition& tp) {
Cluster** const ii = m_clusters;
Cluster** i = ii;
const long count = m_clusterCount + m_clusterPreloadCount;
Cluster** const jj = ii + count;
Cluster** j = jj;
while (i < j) {
Cluster** const k = i + (j - i) / 2;
... | vuln | Safe | C/C++ |
link_info_done (NautilusDirectory *directory,
NautilusFile *file,
const char *uri,
const char *name,
const char *icon,
gboolean is_launcher,
gboolean is_foreign)
{
file->details->link_info_is_up_to_date = TRUE;
nautilus_file_set_display_name (file, name, name, TRUE);
file->details->got_link_info = TR... | vuln | Vulnerable | Unknown |
exif_mnote_data_canon_load (ExifMnoteData *ne,
const unsigned char *buf, unsigned int buf_size)
{
ExifMnoteDataCanon *n = (ExifMnoteDataCanon *) ne;
ExifShort c;
size_t i, tcount, o, datao;
if (!n || !buf || !buf_size) {
exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
"ExifMnoteCanon", "Short MakerNote");
... | vuln | Vulnerable | C/C++ |
@Method(0x800d4580L)
public static long FUN_800d4580(final RunningScript a0) {
final int s2 = a0.params_20.get(0).deref().get();
if(s2 != -1) {
final int scriptIndex = allocateScriptState(0x1cL, AdditionScriptData1c::new);
loadScriptFile(scriptIndex, doNothingScript_8004f650, "", 0); //TODO
... | vuln | Vulnerable | Java |
package com.salesmanager.shop.model.catalog.product.product.definition;
import com.salesmanager.shop.model.catalog.product.ProductSpecification;
import com.salesmanager.shop.model.entity.Entity;
/**
* Applies to product version 2 management
* @author carlsamson
*
*/
public class ProductDefinition extends Entity {... | vuln | Safe | Java |
@Override
protected void onCreate(Bundle savedInstanceState) {
ApplicationLoader.postInitApplication();
requestWindowFeature(Window.FEATURE_NO_TITLE);
setTheme(R.style.Theme_TMessages);
getWindow().setBackgroundDrawableResource(R.drawable.transparent);
if (SharedConfig.passc... | vuln | Vulnerable | Java |
size_t ram_control_save_page(QEMUFile *f, ram_addr_t block_offset,
ram_addr_t offset, size_t size, int *bytes_sent)
{
if (f->ops->save_page) {
int ret = f->ops->save_page(f, f->opaque, block_offset,
offset, size, bytes_sent);
if (ret != RA... | vuln | Safe | C/C++ |
static int
live_callback(struct live_data_t *livedata, struct pcap_pkthdr *pkthdr,
const u_char * nextpkt)
{
ipv4_hdr_t *ip_hdr = NULL;
ipv6_hdr_t *ip6_hdr = NULL;
pcap_t *send = NULL;
static u_char *pktdata = NULL; /* full packet buffer */
int cache_mode, retcode;
static unsig... | vuln | Vulnerable | C/C++ |
private void fetchPronouns(String platform, String user) {
GuiNewChat nc = Minecraft.getMinecraft().ingameGUI.getChatGUI();
int id = new Random().nextInt();
nc.printChatMessageWithOptionalDeletion(new ChatComponentText("§e[NEU] Fetching Pronouns..."), id);
CompletableFuture<Optional<PronounDB.PronounChoice>> p... | vuln | Safe | Java |
def update_cluster_settings(params, request, session)
properties = params['config']
to_update = []
current = getAllSettings(session)
# We need to be able to set cluster properties also from older version GUI.
# This code handles proper processing of checkboxes.
# === backward compatibility layer start ===
... | vuln | Vulnerable | Ruby |
static int ldb_lock_backend_callback(struct ldb_request *req,
struct ldb_reply *ares)
{
struct ldb_db_lock_context *lock_context;
int ret;
if (req->context == NULL) {
/*
* The usual way to get here is to ignore the return codes
* and continuing processing after an error.
*/
abort();
}
lock_c... | vuln | Safe | C/C++ |
public void shootSpell(ServerLevel world, BlockPos pos ) {
if (! (world.getBlockEntity(pos) instanceof BasicSpellTurretTile tile)) return;
ISpellCaster caster = tile.getSpellCaster();
if(caster.getSpell().isEmpty())
return;
int manaCost = tile.getManaCost();
if(manaCo... | vuln | Safe | Java |
def upsert_mapped_projects(user_id: int, project_id: int):
""" Adds projects to mapped_projects if it doesn't exist """
sql = "select * from users where id = {0} and projects_mapped @> '{{{1}}}'".format(user_id, project_id)
result = db.engine.execute(sql)
if result.rowcount > 0:
... | vuln | Vulnerable | Python |
function updateObject($object, $table, $where=null, $identifier='id', $is_revisioned=false) {
if ($is_revisioned) {
$object->revision_id++;
//if ($table=="text") eDebug($object);
$res = $this->insertObject($object, $table);
//if ($table=="text") eDebug($object,tr... | vuln | Vulnerable | PHP |
private boolean isSymlink(File f) {
try {
String canonicalPath = f.getCanonicalPath();
return f.isDirectory() && !canonicalPath.contains(f.getAbsolutePath());
} catch (IOException e) {
}
return false;
} | vuln | Vulnerable | Java |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite (interfaces: AccessResponder)
// Package internal is a generated GoMock package.
package internal
import (
reflect "reflect"
time "time"
gomock "github.com/golang/mock/gomock"
fosite "github.com/ory/fosite"
)
// MockAccessResponder is ... | vuln | Safe | Go |
// go run mksyscall.go -l32 -tags darwin,386,!go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_386.1_11.go syscall_darwin_386.go
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build darwin,386,!go1.12
package unix
import (
"syscall"
"unsafe"
)
var _ syscall.Errno
// THIS FILE IS GE... | vuln | Safe | Go |
package artifacts
import (
"context"
"errors"
"fmt"
"io"
"mime"
"net/http"
"path"
"strings"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
apierr "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/m... | vuln | Vulnerable | Go |
/* 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 |
@Override
public void destroy(Scene origin) {
text = DefaultText;
fillPaint = DefaultFill;
font = DefaultFont;
hasMetrics = false;
super.destroyTheRest(origin);
} | vuln | Safe | Java |
static int minix_fill_super(struct super_block *s, void *data, int silent)
{
struct buffer_head *bh;
struct buffer_head **map;
struct minix_super_block *ms;
int i, block;
struct inode *root_inode;
struct minix_sb_info *sbi;
sbi = kmalloc(sizeof(struct minix_sb_info), GFP_KERNEL);
if (!sbi)
return -ENOMEM;
s... | vuln | Vulnerable | Unknown |
def delete(self, req, image_id):
self._enforce(req, 'delete_image')
image = self._get_image(req.context, image_id)
if image['protected']:
msg = _("Unable to delete as image %(image_id)s is protected"
% locals())
raise webob.exc.HTTPForbidden(explanati... | vuln | Vulnerable | Python |
struct r_bin_dyldcache_obj_t* r_bin_dyldcache_from_bytes_new(const ut8* buf, ut64 size) {
struct r_bin_dyldcache_obj_t *bin;
if (!(bin = malloc (sizeof (struct r_bin_dyldcache_obj_t)))) {
return NULL;
}
memset (bin, 0, sizeof (struct r_bin_dyldcache_obj_t));
if (!buf) {
return r_bin_dyldcache_free (bin);
}
b... | vuln | Vulnerable | C/C++ |
def __init__(self, sourceName: str):
self.sourceName = sourceName
self.type = "file"
self.content = None | vuln | Vulnerable | Python |
static void usb_uas_task(UASDevice *uas, uas_ui *ui)
{
uint16_t tag = be16_to_cpu(ui->hdr.tag);
uint64_t lun64 = be64_to_cpu(ui->task.lun);
SCSIDevice *dev = usb_uas_get_dev(uas, lun64);
int lun = usb_uas_get_lun(lun64);
UASRequest *req;
uint16_t task_tag;
if (uas_using_streams(uas) && tag >... | vuln | Safe | C/C++ |
static int vp3_decode_end(AVCodecContext *avctx)
{
Vp3DecodeContext *s = avctx->priv_data;
int i;
av_free(s->superblock_coding);
av_free(s->all_fragments);
av_free(s->coeffs);
av_free(s->coded_fragment_list);
av_free(s->superblock_fragments);
av_free(s->superblock_macroblocks);
av_fr... | vuln | Safe | C/C++ |
def fence_device_form(params, request, session)
if not allowed_for_local_cluster(session, Permissions::READ)
return 403, 'Permission denied'
end
@cur_resource = get_resource_by_id(params[:resource], get_cib_dom(session))
if @cur_resource.instance_of?(ClusterEntity::Primitive) and @cur_resource.stonith
... | vuln | Vulnerable | Ruby |
/*
* Copyright (C) 2011-2012 Christian Beier <dontmind@freeshell.org>
* Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
*
* This 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;... | vuln | Vulnerable | C/C++ |
import logging
import pathlib
from django.core import signing
from django.core.exceptions import PermissionDenied, SuspiciousFileOperation
from django.utils.crypto import constant_time_compare
from . import views
from .forms import S3FileInputMixin
from .storages import local_dev, storage
logger = logging.getLogger(... | vuln | Safe | Python |
@Override
public void stopProgramListUpdates() {
mTunerCallback.stopProgramListUpdates();
} | vuln | Vulnerable | Java |
int pos() { return ptr - start; } | vuln | Vulnerable | C/C++ |
static int init_dumping(char *database, int init_func(char*))
{
if (mysql_select_db(mysql, database))
{
DB_error(mysql, "when selecting the database");
return 1; /* If --force */
}
if (!path && !opt_xml)
{
if (opt_databases || opt_alldbs)
{
/*
length of table na... | vuln | Safe | Unknown |
/** @odoo-module **/
import { registry } from "@web/core/registry";
import {
Many2OneAvatarUserField,
KanbanMany2OneAvatarUserField,
many2OneAvatarUserField,
kanbanMany2OneAvatarUserField,
} from "@mail/web/fields/many2one_avatar_user_field/many2one_avatar_user_field";
export class Many2OneAvatarEmplo... | vuln | Safe | JavaScript |
static av_cold int movie_common_init(AVFilterContext *ctx)
{
MovieContext *movie = ctx->priv;
AVInputFormat *iformat = NULL;
int64_t timestamp;
int nb_streams = 1, ret, i;
char default_streams[16], *stream_specs, *spec, *cursor;
char name[16];
AVStream *st;
if (!movie->file_name) {
... | vuln | Vulnerable | C/C++ |
void impeg2d_flush_ext_and_user_data(dec_state_t *ps_dec)
{
UWORD32 u4_start_code;
stream_t *ps_stream;
ps_stream = &ps_dec->s_bit_stream;
u4_start_code = impeg2d_bit_stream_nxt(ps_stream,START_CODE_LEN);
while(u4_start_code == EXTENSION_START_CODE || u4_start_code == USER_DATA_START_CODE)
... | vuln | Vulnerable | C/C++ |
static void parse_type_int64(Visitor *v, const char *name, int64_t *obj,
Error **errp)
{
StringInputVisitor *siv = to_siv(v);
if (!siv->string) {
error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null",
"integer");
return;
}
if (... | vuln | Safe | C/C++ |
int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask,
int mb_bitmask_size, const AVFrame *reference)
{
int len, nb_components, i, h, v, predictor, point_transform;
int index, id, ret;
const int block_size = s->lossless ? 1 : 8;
int ilv, prev_shift;
if (!s-... | vuln | Vulnerable | C/C++ |
protected function getJobIdFromWidgetConfiguration()
{
$sql = "SELECT *
FROM plugin_hudson_widget
WHERE widget_name = '" . db_es($this->widget_id) . "'
AND owner_id = " . db_ei($this->owner_id) . "
AND owner_type = '" . db_e... | vuln | Vulnerable | PHP |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Safe | C/C++ |
static inline void ide_dma_submit_check(IDEState *s,
BlockDriverCompletionFunc *dma_cb)
{
if (s->bus->dma->aiocb)
return;
dma_cb(s, -1);
} | vuln | Vulnerable | C/C++ |
static int stbi__process_frame_header(stbi__jpeg *z, int scan)
{
stbi__context *s = z->s;
int Lf,p,i,q, h_max=1,v_max=1,c;
Lf = stbi__get16be(s); if (Lf < 11) return stbi__err("bad SOF len","Corrupt JPEG"); // JPEG
p = stbi__get8(s); if (p != 8) return stbi__err("only 8-bit","JPEG format... | vuln | Vulnerable | C/C++ |
opj_image_t *pngtoimage(const char *read_idf, opj_cparameters_t * params)
{
png_structp png = NULL;
png_infop info = NULL;
double gamma;
int bit_depth, interlace_type, compression_type, filter_type;
OPJ_UINT32 i;
png_uint_32 width, height = 0U;
int color_type;
FILE *reader = NULL;
... | vuln | Safe | C/C++ |
@Override
public int changeEncryptionPassword(int type, String password) {
mContext.enforceCallingOrSelfPermission(Manifest.permission.CRYPT_KEEPER,
"no permission to access the crypt keeper");
if (StorageManager.isFileEncryptedNativeOnly()) {
// Not supported on FBE devices... | vuln | Vulnerable | Java |
static av_cold int allocate_buffers(AVCodecContext *avctx)
{
int blk, ch;
AC3EncodeContext *s = avctx->priv_data;
int channels = s->channels + 1;
FF_ALLOC_OR_GOTO(avctx, s->planar_samples, s->channels * sizeof(*s->planar_samples),
alloc_fail);
for (ch = 0; ch < s->channels; ch+... | vuln | Safe | C/C++ |
AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec)
{
AVStream *fst;
fst = av_mallocz(sizeof(AVStream));
if (!fst)
return NULL;
fst->priv_data = av_mallocz(sizeof(FeedData));
memcpy(&fst->codec, codec, sizeof(AVCodecContext));
stream->streams[stream->nb_streams++] = fst;
... | vuln | Vulnerable | C/C++ |
u.actions&&this.executeCustomActions(u.actions))};Graph.prototype.executeCustomActions=function(u,E){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(... | vuln | Vulnerable | JavaScript |
PHP_FUNCTION(dom_document_save_html_file)
{
zval *id;
xmlDoc *docp;
int file_len, bytes, format;
dom_object *intern;
dom_doc_propsptr doc_props;
char *file;
const char *encoding;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &file, &file_len) == FAI... | vuln | Vulnerable | Unknown |
crypto_bob2(
struct exten *ep, /* extension pointer */
struct value *vp /* value pointer */
)
{
RSA *rsa; /* GQ parameters */
DSA_SIG *sdsa; /* DSA parameters */
BN_CTX *bctx; /* BIGNUM context */
EVP_MD_CTX ctx; /* signature context */
tstamp_t tstamp; /* NTP timestamp */
BIGNUM *r, *k, *g, *y;
u_char *p... | vuln | Vulnerable | Unknown |
private CloudBlobContainer getBlobContainer() {
if (storageAccount != null && blobContainer == null) {
try {
CloudBlobContainer localBlobContainer =
getBlobClient().getContainerReference(this.containerName);
// Do not modify the blob containers permissions if it already exists.
... | vuln | Safe | Java |
png_zalloc(voidpf png_ptr, uInt items, uInt size)
{
png_voidp ptr;
png_structp p=(png_structp)png_ptr;
png_uint_32 save_flags=p->flags;
png_uint_32 num_bytes;
if (png_ptr == NULL)
return (NULL);
if (items > PNG_UINT_32_MAX/size)
{
png_warning (p, "Potential overflow in png_zall... | vuln | Vulnerable | C/C++ |
bit_write_MC (Bit_Chain *dat, BITCODE_MC val)
{
int i, j;
int negative = 0;
unsigned char byte[5];
BITCODE_UMC mask = 0x0000007f;
BITCODE_UMC value = (BITCODE_UMC)val;
if (val < 0)
{
negative = 1;
value = (BITCODE_UMC)-val;
}
for (i = 4, j = 0; i >= 0; i--, j += 7)
{
byte[i]... | vuln | Safe | C/C++ |
@Override
public void handleResult(@NonNull final ChannelInfo result) {
super.handleResult(result);
headerBinding.getRoot().setVisibility(View.VISIBLE);
PicassoHelper.loadBanner(result.getBannerUrl()).tag(PICASSO_CHANNEL_TAG)
.into(headerBinding.channelBannerImage);
... | vuln | Vulnerable | Java |
Creates new DateTimeZone object.
*/
PHP_METHOD(DateTimeZone, __construct)
{
char *tz;
int tz_len;
php_timezone_obj *tzobj;
zend_error_handling error_handling;
zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &tz, &tz_len)... | vuln | Safe | Unknown |
void
bgp_capability_vty_out (struct vty *vty, struct peer *peer)
{
char *pnt;
char *end;
struct capability_mp_data mpc;
struct capability_header *hdr;
pnt = peer->notify.data;
end = pnt + peer->notify.length;
while (pnt < end)
{
if (pnt + sizeof (struct capability_mp_data) + 2 > end)
return... | vuln | Safe | C/C++ |
aperture_report(gerbv_aperture_t *apertures[], int aperture_num,
double x, double y, gerbv_image_t *img, gerbv_project_t *prj)
{
gerbv_aperture_type_t type = apertures[aperture_num]->type;
double *params = apertures[aperture_num]->parameter;
gerbv_simplified_amacro_t *sim = apertures[aperture_num]->simplified;
do... | vuln | Vulnerable | Unknown |
png_set_IHDR(png_structp png_ptr, png_infop info_ptr,
png_uint_32 width, png_uint_32 height, int bit_depth,
int color_type, int interlace_type, int compression_type,
int filter_type)
{
png_debug1(1, "in %s storage function", "IHDR");
if (png_ptr == NULL || info_ptr == NULL)
return;
info_ptr->w... | vuln | Safe | C/C++ |
inlineTokens(src, tokens = [], inLink = false, inRawBlock = false) {
let token, lastToken;
// String with links masked to avoid interference with em and strong
let maskedSrc = src;
let match;
let keepPrevChar, prevChar;
// Mask out reflinks
if (this.tokens.links) {
const links = Obje... | vuln | Safe | JavaScript |
static int ip_frag_reasm(struct ipq *qp, struct sk_buff *skb,
struct sk_buff *prev_tail, struct net_device *dev)
{
struct net *net = container_of(qp->q.net, struct net, ipv4.frags);
struct iphdr *iph;
struct sk_buff *fp, *head = skb_rb_first(&qp->q.rb_fragments);
struct sk_buff **nextp; /* To build frag_list. *... | vuln | Safe | C/C++ |
qedi_dbg_warn(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
const char *fmt, ...)
{
va_list va;
struct va_format vaf;
va_start(va, fmt);
vaf.fmt = fmt;
vaf.va = &va;
if (!(qedi_dbg_log & QEDI_LOG_WARN))
goto ret;
if (likely(qedi) && likely(qedi->pdev))
pr_warn("[%s]:[%s:%d]:%d: %pV", dev_... | vuln | Safe | C/C++ |
dissect_blip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, _U_ void *data)
{
proto_tree *blip_tree;
gint offset = 0;
/* Set the protcol column to say BLIP */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "BLIP");
/* Clear out stuff in the info column */
col_clear(pinfo->cinfo,COL_INFO);
// ------------------... | vuln | Vulnerable | Unknown |
public void saveFile(MainWindow mainWindow) {
desktop = mainWindow.getDesktop();
File configFile = new File(SimulationFiles.getSaveDir(), FILE_NAME);
// Create save directory if it doesn't exist.
if (!configFile.getParentFile().exists()) {
configFile.getParentFile().mkdirs();
logger.config(SimulationF... | vuln | Safe | Java |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 1);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
TfLiteIntArray* input_dims = input->dims;
int input_dims_size = input_dims->size;... | vuln | Vulnerable | C/C++ |
const bcrypt = require('bcrypt');
const express = require('express');
const cors = require('cors');
const path = require('path');
const uuid = require('uuid');
const asyncfs = require('fs').promises;
const sessions = require('@nvanexan/node-client-sessions');
const favicon = require('serve-favicon');
const database = ... | vuln | Vulnerable | JavaScript |
void TensorSliceReader::LoadShard(int shard) const {
CHECK_LT(shard, sss_.size());
if (sss_[shard] || !status_.ok()) {
return; // Already loaded, or invalid.
}
string value;
SavedTensorSlices sts;
const string fname = fnames_[shard];
VLOG(1) << "Reading meta data from file " << fname << "...";
Tabl... | vuln | Safe | C/C++ |
/* Copyright 2018 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 function testAuth()
{
$restoreInstance = PMA_Response::getInstance();
// Case 1
$mockResponse = $this->getMockBuilder('PMA_Response')
->disableOriginalConstructor()
->setMethods(array('isAjax', 'isSuccess', 'addJSON'))
->getMock();
$mockRe... | vuln | Vulnerable | PHP |
vmxnet3_indicate_packet(VMXNET3State *s)
{
struct Vmxnet3_RxDesc rxd;
bool is_head = true;
uint32_t rxd_idx;
uint32_t rx_ridx = 0;
struct Vmxnet3_RxCompDesc rxcd;
uint32_t new_rxcd_gen = VMXNET3_INIT_GEN;
hwaddr new_rxcd_pa = 0;
hwaddr ready_rxcd_pa = 0;
struct iovec *data = vmxnet_r... | vuln | Safe | C/C++ |
Status SparseCountSparseOutputShapeFn(InferenceContext *c) {
ShapeHandle unused;
TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 2, &unused));
auto rank = c->Dim(c->input(0), 1);
auto nvals = c->UnknownDim();
c->set_output(0, c->Matrix(nvals, rank)); // out.indices
c->set_output(1, c->Vector(nvals)); //... | vuln | Safe | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.