code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
}
static int
iscsi_set_host_param(struct iscsi_transport *transport,
struct iscsi_uevent *ev)
{
char *data = (char*)ev + sizeof(*ev);
struct Scsi_Host *shost;
int err;
if (!transport->set_host_param)
return -ENOSYS;
shost = scsi_host_lookup(ev->u.set_host_param.host_no);
if (!shost) {
printk(KERN_ER... | vuln | Vulnerable | Unknown |
package com.bezman.background;
import com.bezman.servlet.IndexServlet;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.ArrayList;
/**
* Created by Terence on 1... | vuln | Safe | Java |
static int virtio_scsi_vring_init(VirtIOSCSI *s, VirtQueue *vq, int n,
void (*fn)(VirtIODevice *vdev, VirtQueue *vq))
{
BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(s)));
int rc;
rc = virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), n, true);
if (rc != 0) {
... | vuln | Safe | C/C++ |
MOBI_RET mobi_parse_huffdic(const MOBIData *m, MOBIHuffCdic *huffcdic) {
MOBI_RET ret;
const size_t offset = mobi_get_kf8offset(m);
if (m->mh == NULL || m->mh->huff_rec_index == NULL || m->mh->huff_rec_count == NULL) {
debug_print("%s", "HUFF/CDIC records metadata not found in MOBI header\n");
... | vuln | Safe | C/C++ |
private void showNotification(boolean isGpsStarted) {
if (isRecording()) {
Intent intent = IntentUtils.newIntent(this, TrackRecordingActivity.class)
.putExtra(TrackRecordingActivity.EXTRA_TRACK_ID, recordingStatus.getTrackId());
PendingIntent pendingIntent = TaskStack... | vuln | Vulnerable | Java |
public InteractionResult blockRightClick(Player player, InteractionHand hand, BlockPos pos, Direction face) {
if (FTBChunksAPI.getManager().protect(player, hand, pos, Protection.INTERACT_BLOCK).get()) {
return InteractionResult.FAIL;
}
return InteractionResult.PASS;
} | vuln | Vulnerable | Java |
dophn_core(struct magic_set *ms, int clazz, int swap, int fd, off_t off,
int num, size_t size, off_t fsize, int *flags)
{
Elf32_Phdr ph32;
Elf64_Phdr ph64;
size_t offset, len;
unsigned char nbuf[BUFSIZ];
ssize_t bufsize;
if (size != xph_sizeof) {
if (file_printf(ms, ", corrupted program header size") == -1... | vuln | Vulnerable | C/C++ |
def decode(json, proc = nil, options = {})
data = ::JSON.load(json, proc, options)
if ActiveSupport.parse_json_times
convert_dates_from(data)
else
data
end
end | vuln | Vulnerable | Ruby |
int
SWFInput_readSBits(SWFInput input, int number)
{
int num = SWFInput_readBits(input, number);
if(number && num & (1<<(number-1)))
return num - (1<<number);
else
return num;
} | vuln | Safe | C/C++ |
int X509_cmp_time(ASN1_TIME *ctm, time_t *cmp_time)
{
char *str;
ASN1_TIME atm;
long offset;
char buff1[24], buff2[24], *p;
int i, j, remaining;
p = buff1;
remaining = ctm->length;
str = (char *)ctm->data;
/*
* Note that the following (historical) code allows much more slack in... | vuln | Safe | Unknown |
struct xt_table_info *xt_alloc_table_info(unsigned int size)
{
struct xt_table_info *info = NULL;
size_t sz = sizeof(*info) + size;
if (sz < sizeof(*info))
return NULL;
/* Pedantry: prevent them from hitting BUG() in vmalloc.c --RR */
if ((SMP_ALIGN(size) >> PAGE_SHIFT) + 2 > totalram_pages)
return NUL... | vuln | Safe | C/C++ |
void WebContentsImpl::DidProceedOnInterstitial() {
DCHECK(!(ShowingInterstitialPage() && interstitial_page_->pause_throbber()));
if (ShowingInterstitialPage() && frame_tree_.IsLoading())
LoadingStateChanged(true, true, nullptr);
} | vuln | Safe | C/C++ |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* http_server.c -- A simple HTTP/QUIC server
*
* It serves up files from the filesystem.
*/
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/queue.h>
#include <sys/types.h>
#i... | vuln | Vulnerable | C/C++ |
static uint16_t nvme_identify_ns(NvmeCtrl *n, NvmeIdentify *c)
{
NvmeNamespace *ns;
uint32_t nsid = le32_to_cpu(c->nsid);
uint64_t prp1 = le64_to_cpu(c->prp1);
uint64_t prp2 = le64_to_cpu(c->prp2);
if (nsid == 0 || nsid > n->num_namespaces) {
return NVME_INVALID_NSID | NVME_DNR;
}
ns... | vuln | Vulnerable | C/C++ |
pdf14_pop_transparency_group(gs_gstate *pgs, pdf14_ctx *ctx,
const pdf14_nonseparable_blending_procs_t * pblend_procs,
int tos_num_color_comp, cmm_profile_t *curr_icc_profile, gx_device *dev)
{
pdf14_buf *tos = ctx->stack;
pdf14_buf *nos = tos->saved;
pdf14_mask_t *mask_stack = tos->mask_stack;
... | vuln | Safe | C/C++ |
def fetch(cls) -> "InstanceConfig":
entry = cls.get(get_instance_name())
if entry is None:
entry = cls()
entry.save()
return entry | vuln | Vulnerable | Python |
int cp_sokaka_key(uint8_t *key, size_t key_len, const char *id1,
const sokaka_t k, const char *id2) {
int len1 = strlen(id1), len2 = strlen(id2);
int size, first = 0, result = RLC_OK;
uint8_t *buf;
g1_t p;
g2_t q;
gt_t e;
g1_null(p);
g2_null(q);
gt_null(e);
RLC_TRY {
g1_new(p);
g2_new(q);
gt_new(e);... | vuln | Vulnerable | C/C++ |
static void vga_putcharxy(DisplayState *ds, int x, int y, int ch,
TextAttributes *t_attrib)
{
uint8_t *d;
const uint8_t *font_ptr;
unsigned int font_data, linesize, xorcol, bpp;
int i;
unsigned int fgcol, bgcol;
#ifdef DEBUG_CONSOLE
printf("x: %2i y: %2i", x, y);
co... | vuln | Vulnerable | C/C++ |
static int qcow_write(BlockDriverState *bs, int64_t sector_num,
const uint8_t *buf, int nb_sectors)
{
BDRVQcowState *s = bs->opaque;
int ret, index_in_cluster, n;
uint64_t cluster_offset;
int n_end;
while (nb_sectors > 0) {
index_in_cluster = sector_num & (s->cluster_sec... | vuln | Vulnerable | C/C++ |
static const ut8 *r_bin_dwarf_parse_comp_unit(Sdb *s, const ut8 *obuf,
RBinDwarfCompUnit *cu, const RBinDwarfDebugAbbrev *da,
size_t offset, const ut8 *debug_str, size_t debug_str_len) {
const ut8 *buf = obuf, *buf_end = obuf + (cu->hdr.length - 7);
ut64 abbr_code;
size_t i;
if (cu->hdr.length > debug_str_len... | vuln | Safe | C/C++ |
finish_newstyle_options (struct connection *conn, uint64_t *exportsize)
{
if (protocol_common_open (conn, exportsize, &conn->eflags) == -1)
return -1;
debug ("newstyle negotiation: flags: export 0x%x", conn->eflags);
return 0;
} | vuln | Safe | Unknown |
SoftMPEG4Encoder::~SoftMPEG4Encoder() {
ALOGV("Destruct SoftMPEG4Encoder");
releaseEncoder();
List<BufferInfo *> &outQueue = getPortQueue(1);
List<BufferInfo *> &inQueue = getPortQueue(0);
CHECK(outQueue.empty());
CHECK(inQueue.empty());
} | vuln | Vulnerable | C/C++ |
/* 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 | C/C++ |
int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
{
struct udp_sock *up = udp_sk(sk);
int rc;
int is_udplite = IS_UDPLITE(sk);
if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb))
goto drop;
if (static_key_false(&udpv6_encap_needed) && up->encap_type) {
int (*encap_rcv)(struct sock *sk, struct sk_bu... | vuln | Vulnerable | Unknown |
public static void render() {
ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
int width = scaledResolution.getScaledWidth();
int height = scaledResolution.getScaledHeight();
int mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth;
... | vuln | Vulnerable | Java |
public java.net.http.HttpRequest.Builder addAuth(java.net.http.HttpRequest.Builder requestBuilder, String uri) {
if ( authModifiers.isEmpty() )
return requestBuilder;
// Convert to the key for authentication handlers.
String endpointURL = HttpLib.endpoint(uri);
AuthRequestMod... | vuln | Vulnerable | Java |
static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
enum hrtimer_mode mode)
{
struct hrtimer_cpu_base *cpu_base;
int base;
memset(timer, 0, sizeof(struct hrtimer));
cpu_base = raw_cpu_ptr(&hrtimer_bases);
if (clock_id == CLOCK_REALTIME && mode != HRTIMER_MODE_ABS)
clock_id = CLOCK_MONO... | vuln | Vulnerable | Unknown |
# -*- coding: utf-8 -*-
'''
feedgen.feed
~~~~~~~~~~~~
:copyright: 2013-2020, Lars Kiesow <lkiesow@uos.de>
:license: FreeBSD and LGPL, see license.* for more details.
'''
import sys
from datetime import datetime
import dateutil.parser
import dateutil.tz
from lxml import etree # nosec - not using th... | vuln | Safe | Python |
@Override
public void deleteText() {
Cursor cursor = getCursor();
if (!cursor.isSelected()) {
io.github.rosemoe.sora.text.Content text = getText();
int startIndex = cursor.getLeft();
if (startIndex - 1 >= 0) {
char deleteChar = text.charAt(startInd... | vuln | Safe | Java |
static TCGv_i64 gen_mulu_i64_i32(TCGv a, TCGv b)
{
TCGv_i64 tmp1 = tcg_temp_new_i64();
TCGv_i64 tmp2 = tcg_temp_new_i64();
tcg_gen_extu_i32_i64(tmp1, a);
dead_tmp(a);
tcg_gen_extu_i32_i64(tmp2, b);
dead_tmp(b);
tcg_gen_mul_i64(tmp1, tmp1, tmp2);
tcg_temp_free_i64(tmp2);
return tmp1;
... | vuln | Vulnerable | C/C++ |
function renderDeletedPipeline(node) {
var gui = '';
gui += '<h3 title="' + node.name + '" class="deleted">' + node.name + '</h3>';
if (node.message) {
gui += '<div class="message deleted"><span>' + _.escape(node.message) + '</span></div>';
}
gui += '<div class="actio... | vuln | Safe | JavaScript |
@Override
public void execute() throws Exception {
TraceManager.TraceObject traceObject = TraceManager.serviceTrace(session.getShardingService(), "execute-for-ddl-prepare");
try {
lock.lock();
try {
this.reset();
} finally {
lock.un... | vuln | Safe | Java |
static int
lzma_filter_converter(_lzma_state *state, PyObject *spec, void *ptr)
{
lzma_filter *f = (lzma_filter *)ptr;
PyObject *id_obj;
if (!PyMapping_Check(spec)) {
PyErr_SetString(PyExc_TypeError,
"Filter specifier must be a dict or dict-like object");
return 0;
... | vuln | Vulnerable | C/C++ |
jbig2_sd_new(Jbig2Ctx *ctx, int n_symbols)
{
Jbig2SymbolDict *new = NULL;
if (n_symbols < 0) {
jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1, "Negative number of symbols in symbol dict: %d", n_symbols);
return NULL;
}
new = jbig2_new(ctx, Jbig2SymbolDict, 1);
if (new != NULL) {
... | vuln | Vulnerable | C/C++ |
int get_rock_ridge_filename(struct iso_directory_record *de,
char *retname, struct inode *inode)
{
struct rock_state rs;
struct rock_ridge *rr;
int sig;
int retnamlen = 0;
int truncate = 0;
int ret = 0;
if (!ISOFS_SB(inode->i_sb)->s_rock)
return 0;
*retname = 0;
init_rock_state(&rs, inode);
s... | vuln | Vulnerable | C/C++ |
autodiscover_response_cb (SoupSession *session,
SoupMessage *msg,
gpointer data)
{
GSimpleAsyncResult *simple = data;
struct _autodiscover_data *ad;
EwsUrls exch_urls, expr_urls;
guint status = msg->status_code;
xmlDoc *doc;
xmlNode *node;
gint idx;
GError *e... | vuln | Safe | Unknown |
delete (position p, position_set *s)
{
size_t i;
for (i = 0; i < s->nelem; ++i)
if (p.index == s->elems[i].index)
break;
if (i < s->nelem)
for (--s->nelem; i < s->nelem; ++i)
s->elems[i] = s->elems[i + 1];
} | vuln | Safe | Unknown |
private TSExecuteStatementResp submitQueryTask(
PhysicalPlan physicalPlan, long startTime, TSExecuteStatementReq req) throws Exception {
QueryTask queryTask =
new QueryTask(
physicalPlan,
startTime,
req.sessionId,
req.statement,
req.statement... | vuln | Vulnerable | Java |
// SPDX-License-Identifier: GPL-2.0
/*
* Mediated virtual PCI display host device driver
*
* Emulate enough of qemu stdvga to make bochs-drm.ko happy. That is
* basically the vram memory bar and the bochs dispi interface vbe
* registers in the mmio register bar. Specifically it does *not*
* include any legacy vg... | vuln | Vulnerable | Python |
static irqreturn_t snd_msnd_interrupt(int irq, void *dev_id)
{
struct snd_msnd *chip = dev_id;
void *pwDSPQData = chip->mappedbase + DSPQ_DATA_BUFF;
u16 head, tail, size;
/* Send ack to DSP */
/* inb(chip->io + HP_RXL); */
/* Evaluate queued DSP messages */
head = readw(chip->DSPQ + JQS_wHead);
tail = readw(c... | vuln | Safe | C/C++ |
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_cubic.c -- LSQUIC CUBIC implementation.
*/
#include <inttypes.h>
#include <math.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <sys/queue.h>
#ifdef WIN32
#include <vc_compat.h>
#endif
#include "lsquic_int_... | vuln | Safe | C/C++ |
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either ... | vuln | Vulnerable | Go |
public function edit(Request $request, $id) {
return $this->view('product::admin.product.edit', [
'content_id'=>$id
]);
} | vuln | Vulnerable | PHP |
gcry_mpi_powm (gcry_mpi_t res,
gcry_mpi_t base, gcry_mpi_t expo, gcry_mpi_t mod)
{
/* Pointer to the limbs of the arguments, their size and signs. */
mpi_ptr_t rp, ep, mp, bp;
mpi_size_t esize, msize, bsize, rsize;
int msign, bsign, rsign;
/* Flags telling the secure allocation s... | vuln | Safe | Unknown |
@Override
public boolean onBackPressed() {
if (isSearching()) {
endSearch();
return true;
}
if (selectionTracker != null && selectionTracker.hasSelection()) {
selectionTracker.clearSelection();
return true;
... | vuln | Vulnerable | Java |
private void setupParserListener(MultiSourceReader multiSourceReader, GraphqlParser parser, GraphqlAntlrToLanguage toLanguage) {
int maxTokens = toLanguage.getParserOptions().getMaxTokens();
// prevent a billion laugh attacks by restricting how many tokens we allow
ParseTreeListener listener = n... | vuln | Vulnerable | Java |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Vulnerable | C/C++ |
static inline void qtrle_decode_2n4bpp(QtrleContext *s, int stream_ptr,
int row_ptr, int lines_to_change, int bpp)
{
int rle_code, i;
int pixel_ptr;
int row_inc = s->frame.linesize[0];
unsigned char pi[16];
unsigned char *rgb = s->frame.data[0];
int pixel_limit = s... | vuln | Safe | C/C++ |
void CoordinatorImpl::RegisterClientProcess(
mojom::ClientProcessPtr client_process_ptr,
mojom::ProcessType process_type) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
mojom::ClientProcess* client_process = client_process_ptr.get();
client_process_ptr.set_connection_error_handler(
base::BindO... | vuln | Vulnerable | C/C++ |
QPDFTokenizer::findEI(PointerHolder<InputSource> input)
{
if (! input.getPointer())
{
return;
}
qpdf_offset_t last_offset = input->getLastOffset();
qpdf_offset_t pos = input->tell();
// Use QPDFWordTokenFinder to find EI surrounded by delimiters.
// Then read the next several token... | vuln | Vulnerable | Unknown |
static void ep_mul_sim_endom(ep_t r, const ep_t p, const bn_t k, const ep_t q,
const bn_t m, const ep_t *t) {
int i, sk0, sk1, sl0, sl1, w, g = 0;
int8_t naf0[RLC_FP_BITS + 1], naf1[RLC_FP_BITS + 1], *t0, *t1, u;
int8_t naf2[RLC_FP_BITS + 1], naf3[RLC_FP_BITS + 1], *t2, *t3;
bn_t n, k0, k1, m0, m1;
bn_t v1[3], v... | vuln | Safe | C/C++ |
static void ivi_process_empty_tile(AVCodecContext *avctx, IVIBandDesc *band,
IVITile *tile, int32_t mv_scale)
{
int x, y, need_mc, mbn, blk, num_blocks, mv_x, mv_y, mc_type;
int offs, mb_offset, row_offset;
IVIMbInfo *mb, *ref_mb;
const in... | vuln | Vulnerable | C/C++ |
CommandInfoList *qmp_query_commands(Error **errp)
{
CommandInfoList *list = NULL;
qmp_for_each_command(cur_mon->qmp.commands, query_commands_cb, &list);
return list;
} | vuln | Safe | C/C++ |
def update_theory_base(tag, link):
theory = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + "\\theory.db")
conn = theory.cursor()
conn.execute("insert into " + str(tag) + " values (?)", (str(link), ))
theory.commit()
theory.close() | vuln | Vulnerable | Python |
MagickExport MagickBooleanType InterpolatePixelChannel(
const Image *magick_restrict image,const CacheView_ *image_view,
const PixelChannel channel,const PixelInterpolateMethod method,
const double x,const double y,double *pixel,ExceptionInfo *exception)
{
double
alpha[16],
gamma,
pixels[16];
Mag... | vuln | Vulnerable | C/C++ |
void MessageService::OpenChannelToTab(
int source_process_id, int source_routing_id, int receiver_port_id,
int tab_id, const std::string& extension_id,
const std::string& channel_name) {
content::RenderProcessHost* source =
content::RenderProcessHost::FromID(source_process_id);
if (!source)
re... | vuln | Vulnerable | C/C++ |
static void
ip_optprint(netdissect_options *ndo,
register const u_char *cp, u_int length)
{
register u_int option_len;
const char *sep = "";
for (; length > 0; cp += option_len, length -= option_len) {
u_int option_code;
ND_PRINT((ndo, "%s", sep));
sep = ",";
ND_TCHECK(*cp);
option_code = *c... | vuln | Safe | C/C++ |
int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
{
int ret = 0;
if (av_strstart(p, "pgmpu:data:application/vnd.ms.wms-hdr.asfv1;base64,", &p)) {
AVIOContext pb;
RTSPState *rt = s->priv_data;
AVDictionary *opts = NULL;
int len = strlen(p) * 6 / 8;
char *buf =... | vuln | Vulnerable | C/C++ |
def get(self, email):
""" Fetch data for admin with the corresponding email """
return database_utilities.execute_query(f"""select * from admins where email = %s""", (email, )) | vuln | Safe | Python |
static const struct usb_cdc_union_desc *
ims_pcu_get_cdc_union_desc(struct usb_interface *intf)
{
const void *buf = intf->altsetting->extra;
size_t buflen = intf->altsetting->extralen;
struct usb_cdc_union_desc *union_desc;
if (!buf) {
dev_err(&intf->dev, "Missing descriptor data\n");
return NULL;
}
if (!bu... | vuln | Safe | Unknown |
static inline void CopyPixels(PixelPacket *destination, | vuln | Safe | C/C++ |
var mxClient={VERSION:"19.0.2",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==docum... | vuln | Safe | JavaScript |
def validate_environment(cls, values: Dict) -> Dict:
"""Validate that api key and python package exists in environment."""
anyscale_service_url = get_from_dict_or_env(
values, "anyscale_service_url", "ANYSCALE_SERVICE_URL"
)
anyscale_service_route = get_from_dict_or_env(
... | vuln | Safe | Python |
void
addMultirowsForm(Buffer *buf, AnchorList *al)
{
int i, j, k, col, ecol, pos;
Anchor a_form, *a;
FormItemList *fi;
Line *l, *ls;
if (al == NULL || al->nanchor == 0)
return;
for (i = 0; i < al->nanchor; i++) {
a_form = al->anchors[i];
al->anchors[i].rows = 1;
if (a_form.hseq < 0 || a_for... | vuln | Safe | C/C++ |
static av_always_inline void iadst4_1d(const dctcoef *in, ptrdiff_t stride,
dctcoef *out, int pass)
{
int t0, t1, t2, t3;
t0 = 5283 * IN(0) + 15212 * IN(2) + 9929 * IN(3);
t1 = 9929 * IN(0) - 5283 * IN(2) - 15212 * IN(3);
t2 = 13377 * (IN(0) - IN(2) + IN(3));
... | vuln | Vulnerable | C/C++ |
void ff_eac3_apply_spectral_extension(AC3DecodeContext *s)
{
int bin, bnd, ch, i;
uint8_t wrapflag[SPX_MAX_BANDS]={1,0,}, num_copy_sections, copy_sizes[SPX_MAX_BANDS];
float rms_energy[SPX_MAX_BANDS];
bin = s->spx_dst_start_freq;
num_copy_sections = 0;
for (bnd = 0; bnd < s->num_spx_bands; ... | vuln | Vulnerable | C/C++ |
def execute(self, context: Context):
hive = HiveCliHook(hive_cli_conn_id=self.hive_cli_conn_id, auth=self.hive_auth)
mysql = MySqlHook(mysql_conn_id=self.mysql_conn_id)
self.log.info("Dumping MySQL query results to local file")
conn = mysql.get_conn()
cursor = conn.cursor()
... | vuln | Safe | Python |
function read (cache, integrity, opts = {}) {
const { size } = opts
return withContentSri(cache, integrity, (cpath, sri) => {
// get size
return lstat(cpath).then(stat => ({ stat, cpath, sri }))
}).then(({ stat, cpath, sri }) => {
if (typeof size === 'number' && stat.size !== size) {
throw sizeE... | vuln | Vulnerable | JavaScript |
const char* Track::GetNameAsUTF8() const
{
return m_info.nameAsUTF8;
} | vuln | Vulnerable | C/C++ |
public boolean requestBugreport() {
if (mRemoteBugreportServiceIsActive.get()
|| (mService.getDeviceOwnerRemoteBugreportUriAndHash() != null)) {
Slogf.d(LOG_TAG, "Remote bugreport wasn't started because there's already one running");
return false;
}
final... | vuln | Safe | Java |
static void kvmclock_realize(DeviceState *dev, Error **errp)
{
KVMClockState *s = KVM_CLOCK(dev);
if (!kvm_enabled()) {
error_setg(errp, "kvmclock device requires KVM");
return;
}
kvm_update_clock(s);
qemu_add_vm_change_state_handler(kvmclock_vm_state_change, s);
} | vuln | Safe | C/C++ |
int quicklistPushHead(quicklist *quicklist, void *value, size_t sz) {
quicklistNode *orig_head = quicklist->head;
if (likely(
_quicklistNodeAllowInsert(quicklist->head, quicklist->fill, sz))) {
quicklist->head->zl =
ziplistPush(quicklist->head->zl, value, sz, ZIPLIST_HEAD);
... | vuln | Vulnerable | Unknown |
function draw_vdef_preview($vdef_id) {
?>
<tr class='even'>
<td style='padding:4px'>
<pre>vdef=<?php print get_vdef($vdef_id, true);?></pre>
</td>
</tr>
<?php
} | vuln | Vulnerable | PHP |
static void gen_load_exclusive(DisasContext *s, int rt, int rt2,
TCGv addr, int size)
{
TCGv tmp;
switch (size) {
case 0:
tmp = gen_ld8u(addr, IS_USER(s));
break;
case 1:
tmp = gen_ld16u(addr, IS_USER(s));
break;
case 2:
case 3:
... | vuln | Safe | C/C++ |
rx_cache_insert(netdissect_options *ndo,
const u_char *bp, const struct ip *ip, int dport)
{
struct rx_cache_entry *rxent;
const struct rx_header *rxh = (const struct rx_header *) bp;
if (ndo->ndo_snapend - bp + 1 <= (int)(sizeof(struct rx_header) + sizeof(int32_t)))
return;
rxent = &rx_cache[rx... | vuln | Safe | C/C++ |
@Override
public void onSharedPreferenceChanged(SharedPreferences pref, String key) {
if (mEditor == null) {
return;
}
switch (key) {
case SharedPreferenceKeys.FONT_SIZE:
mEditor.setTextSize(Integer.parseInt(pref.getString(key, "14")));
... | vuln | Safe | Java |
private void cleanupChannels (NotificationManager m) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && m != null) {
List<android.app.NotificationChannel> channels = m.getNotificationChannels();
for (android.app.NotificationChannel channel : channels) {
String id = channel.getId();
... | vuln | Vulnerable | Java |
BYTE *DecompressRTF(variableLength *p, int *size) {
BYTE *dst; // destination for uncompressed bytes
BYTE *src;
unsigned int in;
unsigned int out;
variableLength comp_Prebuf;
ULONG compressedSize, uncompressedSize, magic;
comp_Prebuf.size = strlen(RTF_PREBUF);
comp_Prebuf.data = calloc(comp_Prebuf.size... | vuln | Vulnerable | C/C++ |
static ssize_t hfi1_file_write(struct file *fp, const char __user *data,
size_t count, loff_t *offset)
{
const struct hfi1_cmd __user *ucmd;
struct hfi1_filedata *fd = fp->private_data;
struct hfi1_ctxtdata *uctxt = fd->uctxt;
struct hfi1_cmd cmd;
struct hfi1_user_info uinfo;
struct hfi1_tid_info tinfo;... | vuln | Safe | C/C++ |
static int mb86a20s_read_status(struct dvb_frontend *fe, enum fe_status *status)
{
struct mb86a20s_state *state = fe->demodulator_priv;
int val;
*status = 0;
val = mb86a20s_readreg(state, 0x0a) & 0xf;
if (val < 0)
return val;
if (val >= 2)
*status |= FE_HAS_SIGNAL;
if (val >= 4)
*status |= FE_HAS_CARRI... | vuln | Vulnerable | Unknown |
void Compute(OpKernelContext* ctx) override {
// This call processes inputs 1 and 2 to write output 0.
ReshapeOp::Compute(ctx);
if (!ctx->status().ok()) {
return;
}
const auto& input_min_float_tensor = ctx->input(2);
const auto& input_min_float_shape = input_min_float_tensor.shape();
... | vuln | Safe | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Safe | C/C++ |
public long getInsertThrottleIntervalInMs() {
Object val =
this.parameterMap.getOrDefault(
INSERT_THROTTLE_INTERVAL_IN_MILLIS, INSERT_THROTTLE_INTERVAL_IN_MILLIS_DEFAULT);
if (val instanceof String) {
return Long.parseLong(val.toString());
}
return (long) val;
} | vuln | Safe | Java |
GF_EXPORT
GF_Err gf_svg_parse_attribute(GF_Node *n, GF_FieldInfo *info, char *attribute_content, u8 anim_value_type)
{
GF_Err e = GF_OK;
/* for all attributes, except strings, apply some sort of white space normalization*/
if (info->fieldType != DOM_String_datatype && strlen(attribute_content)) {
u32 i, len;
/*r... | vuln | Safe | C/C++ |
int streamAppendItem(stream *s, robj **argv, int64_t numfields, streamID *added_id, streamID *use_id) {
/* Generate the new entry ID. */
streamID id;
if (use_id)
id = *use_id;
else
streamNextID(&s->last_id,&id);
/* Check that the new ID is greater than the last entry ID
* ... | vuln | Vulnerable | Unknown |
int main(int argc G_GNUC_UNUSED, char **argv G_GNUC_UNUSED)
{
SpiceMarshaller *marshaller;
SpiceMsgMainShortDataSubMarshall *msg;
size_t len, msg_len;
int free_res;
uint8_t *data;
message_destructor_t free_message;
msg = g_new0(SpiceMsgMainShortDataSubMarshall, 1);
msg->data = g_new(uin... | vuln | Safe | C/C++ |
GF_Err xtra_box_read(GF_Box *s, GF_BitStream *bs)
{
GF_XtraBox *ptr = (GF_XtraBox *)s;
while (ptr->size) {
GF_XtraTag *tag;
u32 prop_type = 0;
char *data=NULL, *data2=NULL;
ISOM_DECREASE_SIZE_NO_ERR(ptr, 8)
s32 tag_size = gf_bs_read_u32(bs);
u32 name_size = gf_bs_read_u32(bs);
if (tag_size < 8) return ... | vuln | Safe | Unknown |
static void
parser_reparse_as_common_identifier (parser_context_t *context_p, /**< context */
parser_line_counter_t start_line, /**< start line */
parser_line_counter_t start_column) /**< start column */
{
if (context_p->token.lit_location.type... | vuln | Safe | C/C++ |
...(ctx.input.cookiecutterCompat
? {}
: {
tags: {
// TODO(mtlewis/orkohunter): Document Why we are changing the literals? Not here, but on scaffolder docs. ADR?
variableStart: '${{',
variableEnd: '}}',
},
}),
... | vuln | Vulnerable | JavaScript |
void ecdsa_verify_prepare_legacy(ecdsa_verify_context_t *ctx, const ecc_int256_t *hash, const ecdsa_signature_t *signature) {
ecc_int256_t w, u1, tmp;
ctx->r = signature->r;
ecc_25519_gf_recip(&w, &signature->s);
ecc_25519_gf_reduce(&tmp, hash);
ecc_25519_gf_mult(&u1, &tmp, &w);
ecc_25519_gf_mult(&ctx->u2... | vuln | Vulnerable | C/C++ |
gdev_pdf_put_params_impl(gx_device * dev, const gx_device_pdf * save_dev, gs_param_list * plist)
{
int ecode, code;
gx_device_pdf *pdev = (gx_device_pdf *) dev;
float cl = (float)pdev->CompatibilityLevel;
bool locked = pdev->params.LockDistillerParams, ForOPDFRead;
gs_param_name param_name;
pde... | vuln | Vulnerable | Unknown |
rdp_in_unistr(STREAM s, int in_len, char **string, uint32 * str_size)
{
static iconv_t icv_utf16_to_local;
size_t ibl, obl;
char *pin, *pout;
struct stream packet = *s;
if ((in_len < 0) || ((uint32)in_len >= (RD_UINT32_MAX / 2)))
{
logger(Protocol, Error, "rdp_in_unistr(), length of unicode data is out of bou... | vuln | Safe | Unknown |
void ff_init_block_index(MpegEncContext *s){
const int linesize = s->current_picture.f.linesize[0];
const int uvlinesize = s->current_picture.f.linesize[1];
const int mb_size= 4;
s->block_index[0]= s->b8_stride*(s->mb_y*2 ) - 2 + s->mb_x*2;
s->block_index[1]= s->b8_stride*(s->mb_y*2 ) - 1 ... | vuln | Vulnerable | C/C++ |
static void lag_pred_line(LagarithContext *l, uint8_t *buf,
int width, int stride, int line)
{
int L, TL;
L = buf[width - stride - 1];
if (!line) {
L = l->dsp.add_hfyu_left_prediction(buf + 1, buf + 1,
width - 1, buf... | vuln | Vulnerable | C/C++ |
static int nl80211_start_sched_scan(struct sk_buff *skb,
struct genl_info *info)
{
struct cfg80211_sched_scan_request *request;
struct cfg80211_registered_device *rdev = info->user_ptr[0];
struct net_device *dev = info->user_ptr[1];
struct nlattr *attr;
struct wiphy *wiphy;
int err, tmp, n_ssids = 0, n_ch... | vuln | Safe | C/C++ |
static void calipso_doi_putdef(struct calipso_doi *doi_def)
{
if (!doi_def)
return;
if (!refcount_dec_and_test(&doi_def->refcount))
return;
calipso_cache_invalidate();
call_rcu(&doi_def->rcu, calipso_doi_free_rcu);
} | vuln | Safe | Unknown |
static MagickBooleanType WritePICTImage(const ImageInfo *image_info,
Image *image,ExceptionInfo *exception)
{
#define MaxCount 128
#define PictCropRegionOp 0x01
#define PictEndOfPictureOp 0xff
#define PictJPEGOp 0x8200
#define PictInfoOp 0x0C00
#define PictInfoSize 512
#define PictPixmapOp 0x9A
#define PictPIC... | vuln | Vulnerable | C/C++ |
#include "cache.h"
#include "config.h"
#include "commit.h"
#include "utf8.h"
#include "diff.h"
#include "revision.h"
#include "string-list.h"
#include "mailmap.h"
#include "log-tree.h"
#include "notes.h"
#include "color.h"
#include "reflog-walk.h"
#include "gpg-interface.h"
#include "trailer.h"
#include "run-command.h"... | vuln | Safe | C/C++ |
static int wav_parse_fmt_tag(AVFormatContext *s, int64_t size, AVStream **st)
{
AVIOContext *pb = s->pb;
int ret;
*st = av_new_stream(s, 0);
if (!*st)
return AVERROR(ENOMEM);
ret = ff_get_wav_header(pb, (*st)->codec, size);
if (ret < 0)
return ret;
(*st)->need_parsing = ... | vuln | Safe | C/C++ |
def handleInputParameterError(f):
def new_f(*args, **kwargs):
try:
return f(*args, **kwargs)
except InputParameterError as e:
msgStr = str(e)
log.warning('%s', msgStr)
return HttpResponseBadRequest(htmlEscape(msgStr))
return new_f | vuln | Safe | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.