code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
@ReactProp(name = "snapToOffsets")
public void setSnapToOffsets(ReactScrollView view, @Nullable ReadableArray snapToOffsets) {
DisplayMetrics screenDisplayMetrics = DisplayMetricsHolder.getScreenDisplayMetrics();
List<Integer> offsets = new ArrayList<Integer>();
for (int i = 0; i < snapToOffsets.size(); i... | vuln | Vulnerable | Java |
@Override
public void run() {
while (observer.isReady()) {
try {
if (cancelled) { //Exit if cancelled
observer.onError(new StatusException(io.grpc.Status.CANCELLED));
is.close();
... | vuln | Safe | Java |
static void grlib_gptimer_enable(GPTimer *timer)
{
assert(timer != NULL);
ptimer_stop(timer->ptimer);
if (!(timer->config & GPTIMER_ENABLE)) {
trace_grlib_gptimer_disabled(timer->id, timer->config);
return;
}
trace_grlib_gptimer_enable(timer->id, timer->counter);
pt... | vuln | Safe | C/C++ |
ExtensionFunction* ExtensionFunctionDispatcher::CreateExtensionFunction(
const ExtensionHostMsg_Request_Params& params,
const Extension* extension,
int requesting_process_id,
const extensions::ProcessMap& process_map,
extensions::ExtensionAPI* api,
void* profile,
IPC::Sender* ipc_sender,
... | vuln | Vulnerable | C/C++ |
/*
* Unsquash a squashfs filesystem. This is a highly compressed read only
* filesystem.
*
* Copyright (c) 2009, 2010, 2011, 2012, 2019, 2021
* Phillip Lougher <phillip@squashfs.org.uk>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public Licen... | vuln | Vulnerable | C/C++ |
// This may look like C code, but it is really -*- C++ -*-
//
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
// Copyright Dirk Lemstra 2013-2017
//
// Implementation of Image
//
#define MAGICKCORE_IMPLEMENTATION 1
#define MAGICK_PLUSPLUS_IMPLEMENTATION 1
#include "Magick++/Include.h"
#include <cstdlib>
#... | vuln | Vulnerable | C/C++ |
static int em28xx_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
struct usb_device *udev;
struct em28xx *dev = NULL;
int retval;
bool has_vendor_audio = false, has_video = false, has_dvb = false;
int i, nr, try_bulk;
const int ifnum = intf->altsetting[0].desc.bInterfaceNumber;
cha... | vuln | Vulnerable | C/C++ |
static void aarch64_cpu_set_pc(CPUState *cs, vaddr value)
{
ARMCPU *cpu = ARM_CPU(cs);
cpu->env.pc = value;
} | vuln | Vulnerable | C/C++ |
static void balloon_stats_poll_cb(void *opaque)
{
VirtIOBalloon *s = opaque;
VirtIODevice *vdev = VIRTIO_DEVICE(s);
if (s->stats_vq_elem == NULL || !balloon_stats_supported(s)) {
balloon_stats_change_timer(s, s->stats_poll_interval);
return;
}
virtqueue_push(s->svq, s->stats... | vuln | Safe | C/C++ |
COMPAT_SYSCALL_DEFINE6(mbind, compat_ulong_t, start, compat_ulong_t, len,
compat_ulong_t, mode, compat_ulong_t __user *, nmask,
compat_ulong_t, maxnode, compat_ulong_t, flags)
{
unsigned long __user *nm = NULL;
unsigned long nr_bits, alloc_size;
nodemask_t bm;
nr_bits = min_t(unsigned long, maxno... | vuln | Safe | C/C++ |
int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki)
{
EVP_PKEY *pkey;
ASN1_IA5STRING *chal;
ASN1_OBJECT *spkioid;
int i, n;
char *s;
BIO_printf(out, "Netscape SPKI:\n");
X509_PUBKEY_get0_param(&spkioid, NULL, NULL, NULL, spki->spkac->pubkey);
i = OBJ_obj2nid(spkioid);
BIO_printf(o... | vuln | Safe | Unknown |
def fetch_resultSet(self, session, id):
self._openContainer(session)
sid = str(id)
if (self.idNormalizer is not None):
sid = self.idNormalizer.process_string(session, sid)
query = ("SELECT class, data FROM %s WHERE identifier = '%s';" %
(self.table, sid)
... | vuln | Vulnerable | Python |
static int read_block_types(AVCodecContext *avctx, GetBitContext *gb, Bundle *b)
{
int t, v;
int last = 0;
const uint8_t *dec_end;
CHECK_READ_VAL(gb, b, t);
dec_end = b->cur_dec + t;
if (dec_end > b->data_end) {
av_log(avctx, AV_LOG_ERROR, "Too many block type values\n");
return ... | vuln | Safe | C/C++ |
@Override
public Intent createShowAdminSupportIntent(int userId, boolean useDefaultIfNoAdmin) {
// This method is called from AM with its lock held, so don't take the DPMS lock.
// b/29242568
if (getEnforcingAdminAndUserDetailsInternal(userId, null) != null
... | vuln | Safe | Java |
static int output_frame(H264Context *h, AVFrame *dst, Picture *srcp)
{
AVFrame *src = &srcp->f;
int i;
int ret = av_frame_ref(dst, src);
if (ret < 0)
return ret;
av_dict_set(&dst->metadata, "stereo_mode", ff_h264_sei_stereo_mode(h), 0);
if (!srcp->crop)
return 0;
for (i = ... | vuln | Vulnerable | Unknown |
DelChar(NCURSES_SP_DCLx int count)
{
TR(TRACE_UPDATE, ("DelChar(%p, %d) called, position = (%ld,%ld)",
(void *) SP_PARM, count,
(long) NewScreen(SP_PARM)->_cury,
(long) NewScreen(SP_PARM)->_curx));
if (parm_dch) {
TPUTS_TRACE("parm_dch");
NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
TI... | vuln | Safe | Unknown |
DeletionConfirmationDlg(QWidget *parent, const int &size, const QString &name, bool defaultDeleteFiles): QDialog(parent) {
setupUi(this);
if (size == 1)
label->setText(tr("Are you sure you want to delete '%1' from the transfer list?", "Are you sure you want to delete 'ubuntu-linux-iso' from the transfer l... | vuln | Safe | C/C++ |
function y(ja,U,J,V,P){function R(T,Q,Z){var na=document.createElement("li");na.className=
"geCommentAction";var va=document.createElement("a");va.className="geCommentActionLnk";mxUtils.write(va,T);na.appendChild(va);mxEvent.addListener(va,"click",function(Ba){Q(Ba,ja);Ba.preventDefault();mxEvent.consume(Ba)});W.append... | vuln | Safe | JavaScript |
import javax.mail.Session;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;... | vuln | Safe | Java |
static void gen_rac(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
GEN_PRIV;
#else
TCGv t0;
CHK_SV;
t0 = tcg_temp_new();
gen_addr_reg_index(ctx, t0);
gen_helper_rac(cpu_gpr[rD(ctx->opcode)], cpu_env, t0);
tcg_temp_free(t0);
#endif
} | vuln | Safe | C/C++ |
/*
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2007-2016, 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 | Safe | Java |
@Override
public void callSessionUpdated(ImsCallProfile profile) {
if (mListener != null) {
TelephonyUtils.runWithCleanCallingIdentity(()->
mListener.callSessionUpdated(ImsCallSession.this, profile),
mListenerExecutor);
}
... | vuln | Vulnerable | Java |
static int mc_subpel(DiracContext *s, DiracBlock *block, const uint8_t *src[5],
int x, int y, int ref, int plane)
{
Plane *p = &s->plane[plane];
uint8_t **ref_hpel = s->ref_pics[ref]->hpel[plane];
int motion_x = block->u.mv[ref][0];
int motion_y = block->u.mv[ref][1];
int mx, my... | vuln | Safe | C/C++ |
void do_POWER_dozo (void)
{
if (Ts1 > Ts0) {
T2 = T0;
T0 = T1 - T0;
if (((~T2) ^ T1 ^ (-1)) & ((~T2) ^ T0) & (1 << 31)) {
xer_so = 1;
xer_ov = 1;
} else {
xer_ov = 0;
}
} else {
T0 = 0;
xer_ov = 0;
}
} | vuln | Vulnerable | C/C++ |
ExtensionDevToolsClientHost::ExtensionDevToolsClientHost(
Profile* profile,
DevToolsAgentHost* agent_host,
const std::string& extension_id,
const std::string& extension_name,
const Debuggee& debuggee)
: profile_(profile),
agent_host_(agent_host),
extension_id_(extension_id),
... | vuln | Vulnerable | C/C++ |
const fs = require('fs')
const fsProm = require('fs/promises');
const os = require('os');
const path = require('path')
const url = require('url')
const {Menu: menu, shell, dialog,
clipboard, nativeImage, ipcMain, app, BrowserWindow} = require('electron')
const crc = require('crc');
const zlib = require('zlib');
const... | vuln | Vulnerable | JavaScript |
package com.salesmanager.shop.admin.controller.customers;
import com.salesmanager.core.business.services.customer.attribute.CustomerOptionService;
import com.salesmanager.core.business.services.reference.language.LanguageService;
import com.salesmanager.core.business.utils.ajax.AjaxResponse;
import com.salesmanager.co... | vuln | Vulnerable | Java |
int main(int argc, char *argv[]) {
GooString *fileName;
UnicodeMap *uMap;
GooString *ownerPW, *userPW;
PDFDoc *doc;
char uBuf[8];
char path[1024];
char *p;
bool ok;
int exitCode;
GooList *embeddedFiles = nullptr;
int nFiles, nPages, n, i, j;
FileSpec *fileSpec;
Page *page;
Annots *annots;
... | vuln | Safe | C/C++ |
miniflow_extract(struct dp_packet *packet, struct miniflow *dst)
{
const struct pkt_metadata *md = &packet->md;
const void *data = dp_packet_data(packet);
size_t size = dp_packet_size(packet);
ovs_be32 packet_type = packet->packet_type;
uint64_t *values = miniflow_values(dst);
struct mf_ctx mf =... | vuln | Vulnerable | Unknown |
void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
uint32_t *eax, uint32_t *ebx,
uint32_t *ecx, uint32_t *edx)
{
X86CPU *cpu = x86_env_get_cpu(env);
CPUState *cs = CPU(cpu);
if (index & 0x80000000) {
if (index > env->cpuid_xlevel) {
... | vuln | Safe | C/C++ |
/*
* . .o8 oooo
* .o8 "888 `888
* .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo
* 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P'
* 888 888 888 888 8... | vuln | Vulnerable | JavaScript |
bool PermissionsRequestFunction::RunImpl() {
results_ = Request::Results::Create(false);
if (!user_gesture() && !ignore_user_gesture_for_tests) {
error_ = kUserGestureRequiredError;
return false;
}
scoped_ptr<Request::Params> params(Request::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(... | vuln | Safe | C/C++ |
# Copyright (c) 2022 PaddlePaddle 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 applic... | vuln | Safe | Python |
void CLASS lossless_jpeg_load_raw()
{
int jwide, jrow, jcol, val, jidx, i, j, row=0, col=0;
struct jhead jh;
ushort *rp;
if (!ljpeg_start (&jh, 0)) return;
if(jh.wide<1 || jh.high<1 || jh.clrs<1 || jh.bits <1)
#ifdef LIBRAW_LIBRARY_BUILD
throw LIBRAW_EXCEPTION_IO_CORRUPT;
#else
longjmp (failure, 2);... | vuln | Safe | Unknown |
public void putVertexData(Vec3 pos, Vec3 faceNormal, double u, double v, float[] colour, float alpha)
{
int next = nextVertex*FORMAT.getIntegerSize();
data[next++] = Float.floatToIntBits((float)pos.x);
data[next++] = Float.floatToIntBits((float)pos.y);
data[next++] = Float.floatToIntBits((float)pos.z);
dat... | vuln | Safe | Java |
static uint64_t pci_read(void *opaque, hwaddr addr, unsigned int size)
{
AcpiPciHpState *s = opaque;
uint32_t val = 0;
int bsel = s->hotplug_select;
if (bsel < 0 || bsel > ACPI_PCIHP_MAX_HOTPLUG_BUS) {
return 0;
}
switch (addr) {
case PCI_UP_BASE:
val = s->acpi_pcihp_pc... | vuln | Vulnerable | C/C++ |
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version... | vuln | Safe | C/C++ |
static void fdctrl_write_data(FDCtrl *fdctrl, uint32_t value)
{
FDrive *cur_drv;
int pos;
if (!(fdctrl->dor & FD_DOR_nRESET)) {
FLOPPY_DPRINTF("Floppy controller in RESET state !\n");
return;
}
if (!(fdctrl->msr & FD_MSR_RQM) || (fdctrl->msr & FD_MSR_DIO)) {
FLOPPY_DPRIN... | vuln | Vulnerable | C/C++ |
void qmp_blockdev_change_medium(const char *device, const char *filename,
bool has_format, const char *format,
bool has_read_only,
BlockdevChangeReadOnlyMode read_only,
Error **errp)
{
Blo... | vuln | Vulnerable | C/C++ |
/*!
* fullPage 4.0.4
* https://github.com/alvarotrigo/fullPage.js
*
* @license GPLv3 for open source use only
* or Fullpage Commercial License for commercial use
* http://alvarotrigo.com/fullPage/pricing/
*
* Copyright (C) 2018 http://alvarotrigo.com/fullPage - A project by Alvaro Trigo
*/
(function (global, factory) ... | vuln | Safe | JavaScript |
@NonNull
private String getDescriptionDisabledByAdmin(@NonNull Context context) {
final int defaultStrId =
R.string.security_settings_fingerprint_enroll_introduction_message_unlock_disabled;
final DevicePolicyManager devicePolicyManager = getActivity()
.getSystemServ... | vuln | Safe | Java |
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2012 - 2018 Microchip Technology Inc., and its subsidiaries.
* All rights reserved.
*/
#include "cfg80211.h"
#define GO_NEG_REQ 0x00
#define GO_NEG_RSP 0x01
#define GO_NEG_CONF 0x02
#define P2P_INV_REQ 0x03
#define P2P_INV_RSP 0x04
#define WILC_INVA... | vuln | Vulnerable | C/C++ |
def _get_least_used_nsp(self, nspss):
""""Return the nsp that has the fewest active vluns."""
# return only the nsp (node:server:port)
result = self.common._cli_run('showvlun -a -showcols Port', None)
# count the number of nsps (there is 1 for each active vlun)
nsp_counts = {}
... | vuln | Vulnerable | Python |
static int wav_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
int size;
unsigned int tag;
ByteIOContext *pb = s->pb;
AVStream *st;
WAVContext *wav = s->priv_data;
tag = get_le32(pb);
if (tag != MKTAG('R', 'I', 'F', 'F'))
return -1;
get_l... | vuln | Vulnerable | C/C++ |
void bm_poly(Bitmap *b, BmPoint points[], unsigned int n) {
unsigned int i;
if(n < 2) return;
for(i = 0; i < n - 1; i++) {
bm_line(b, points[i].x, points[i].y, points[i+1].x, points[i+1].y);
}
bm_line(b, points[0].x, points[0].y, points[i].x, points[i].y);
} | vuln | Vulnerable | C/C++ |
void requestResetPassword() throws Exception
{
when(this.authorizationManager.hasAccess(Right.PROGRAM)).thenReturn(true);
UserReference userReference = mock(UserReference.class);
ResetPasswordRequestResponse requestResponse = mock(ResetPasswordRequestResponse.class);
when(this.resetP... | vuln | Safe | Java |
static void _slurm_rpc_job_will_run(slurm_msg_t * msg)
{
/* init */
DEF_TIMERS;
int error_code = SLURM_SUCCESS;
struct job_record *job_ptr = NULL;
job_desc_msg_t *job_desc_msg = (job_desc_msg_t *) msg->data;
/* Locks: Read config, read job, read node, read partition */
slurmctld_lock_t job_read_lock = {
READ_L... | vuln | Vulnerable | Unknown |
/* Copyright (c) 2019 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "brave/browser/net/brave_ad_block_tp_networ... | vuln | Vulnerable | C/C++ |
void gfs2_clear_rgrpd(struct gfs2_sbd *sdp)
{
struct rb_node *n;
struct gfs2_rgrpd *rgd;
struct gfs2_glock *gl;
while ((n = rb_first(&sdp->sd_rindex_tree))) {
rgd = rb_entry(n, struct gfs2_rgrpd, rd_node);
gl = rgd->rd_gl;
rb_erase(n, &sdp->sd_rindex_tree);
if (gl) {
spin_lock(&gl->gl_lockref.lock);
... | vuln | Safe | C/C++ |
rdpsnd_process_training(STREAM in)
{
uint16 tick;
uint16 packsize;
STREAM out;
in_uint16_le(in, tick);
in_uint16_le(in, packsize);
logger(Sound, Debug, "rdpsnd_process_training(), tick=0x%04x", (unsigned) tick);
out = rdpsnd_init_packet(SNDC_TRAINING, 4);
out_uint16_le(out, tick);
out_uint16_le(out, p... | vuln | Vulnerable | C/C++ |
TPMI_RH_ENDORSEMENT_Unmarshal(TPMI_RH_ENDORSEMENT *target, BYTE **buffer, INT32 *size, BOOL allowNull)
{
TPM_RC rc = TPM_RC_SUCCESS;
TPMI_RH_ENDORSEMENT orig_target = *target; // libtpms added
if (rc == TPM_RC_SUCCESS) {
rc = TPM_HANDLE_Unmarshal(target, buffer, size);
}
if (rc == TPM_RC_SUCCESS... | vuln | Safe | Unknown |
public static SignValidity checkPdfShadowAttack(final byte[] actualdata, final InputStream lastReviewData, final String pagesToCheck) throws IOException {
try (final PDDocument actualDoc = PDDocument.load(actualdata);
final PDDocument lastReviewDoc = PDDocument.load(lastReviewData)) {
final PDFRenderer actua... | vuln | Vulnerable | Java |
PPC_OP(setlr)
{
regs->lr = PARAM1;
RETURN();
} | vuln | Vulnerable | C/C++ |
void cms_set_pw_data(cms_context *cms, secuPWData *pwdata)
{
ingress();
switch (cms->pwdata.source) {
case PW_SOURCE_INVALID:
case PW_PROMPT:
case PW_DEVICE:
case PW_SOURCE_MAX:
break;
case PW_FROMFD:
if (cms->pwdata.intdata >= 0 &&
!(pwdata && pwdata->source == PW_FROMFD &&
cms->pwdata.intda... | vuln | Safe | Unknown |
static int ioreq_map(struct ioreq *ioreq)
{
XenGnttab gnt = ioreq->blkdev->xendev.gnttabdev;
uint32_t domids[BLKIF_MAX_SEGMENTS_PER_REQUEST];
uint32_t refs[BLKIF_MAX_SEGMENTS_PER_REQUEST];
void *page[BLKIF_MAX_SEGMENTS_PER_REQUEST];
int i, j, new_maps = 0;
PersistentGrant *grant;
if (io... | vuln | Vulnerable | C/C++ |
stop_insert(
pos_T *end_insert_pos,
int esc, // called by ins_esc()
int nomove) // <c-\><c-o>, don't move cursor
{
int cc;
char_u *ptr;
stop_redo_ins();
replace_flush(); // abandon replace stack
/*
* Save the inserted text for later redo with ^@ and CTRL-A.
* Don't do... | vuln | Safe | Unknown |
public function update()
{
$project = $this->getProject();
$tag_id = $this->request->getIntegerParam('tag_id');
$tag = $this->tagModel->getById($tag_id);
$values = $this->request->getValues();
list($valid, $errors) = $this->tagValidator->validateModification($values);
... | vuln | Vulnerable | PHP |
public GuiChildControl remove(int col, int row) {
if (col < grid.size()) {
List<GuiChildControl> rows = grid.get(col);
if (row < rows.size())
return rows.set(row, null);
}
return null;
} | vuln | Safe | Java |
bgp_attr_parse (struct peer *peer, struct attr *attr, bgp_size_t size,
struct bgp_nlri *mp_update, struct bgp_nlri *mp_withdraw)
{
int ret;
u_char flag = 0;
u_char type = 0;
bgp_size_t length;
u_char *startp, *endp;
u_char *attr_endp;
u_char seen[BGP_ATTR_BITMAP_SIZE];
/* we need the as4_path only unt... | vuln | Vulnerable | Unknown |
@Method(0x80016a84L)
public static long scriptDivide(final RunningScript a0) {
a0.params_20.get(1).deref().div(a0.params_20.get(0).deref());
return 0;
} | vuln | Vulnerable | Java |
static int iff_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
IffDemuxContext *iff = s->priv_data;
AVIOContext *pb = s->pb;
AVStream *st = s->streams[0];
int ret;
int64_t pos = avio_tell(pb);
if (pos >= iff->body_end)
return AVERROR_EOF;
if (st->codec->co... | vuln | Vulnerable | C/C++ |
void OverlaySettings::save(QSettings* settings_ptr) {
OverlaySettings def;
SAVELOAD(bEnable, "enable");
SAVELOAD(osShow, "show");
SAVELOAD(bAlwaysSelf, "alwaysself");
SAVELOAD(uiActiveTime, "activetime");
SAVELOAD(osSort, "sort");
SAVELOAD(fX, "x");
SAVELOAD(fY, "y");
SAVELOAD(fZoom, "zoom");
SAVELOAD(uiCol... | vuln | Vulnerable | Unknown |
static void loongarch_cpu_reset(DeviceState *dev)
{
CPUState *cs = CPU(dev);
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
LoongArchCPUClass *lacc = LOONGARCH_CPU_GET_CLASS(cpu);
CPULoongArchState *env = &cpu->env;
lacc->parent_reset(dev);
env->fcsr0_mask = FCSR0_M1 | FCSR0_M2 | FCSR0_M3;
env->fc... | 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 | Safe | C/C++ |
jas_image_t *jpg_decode(jas_stream_t *in, char *optstr)
{
struct jpeg_decompress_struct cinfo;
struct jpeg_error_mgr jerr;
FILE *input_file;
jpg_dest_t dest_mgr_buf;
jpg_dest_t *dest_mgr = &dest_mgr_buf;
JDIMENSION num_scanlines;
jas_image_t *image;
int ret;
jpg_dec_importopts_t opts;
size_t num_samples;
JA... | vuln | Safe | C/C++ |
static int qdm2_decode_init(AVCodecContext *avctx)
{
QDM2Context *s = avctx->priv_data;
uint8_t *extradata;
int extradata_size;
int tmp_val, tmp, size;
int i;
float alpha;
if (!avctx->extradata || (avctx->extradata_size < 48)) {
av_log(avctx, AV_LOG_ERROR, "extradata missin... | vuln | Vulnerable | C/C++ |
private Map<RenderRegion, List<ChunkBuildResult>> setupUploadBatches(Iterator<ChunkBuildResult> renders) {
Map<RenderRegion, List<ChunkBuildResult>> map = new Reference2ObjectLinkedOpenHashMap<>();
while (renders.hasNext()) {
ChunkBuildResult result = renders.next();
RenderSecti... | vuln | Vulnerable | Java |
public void addNotification(ExpandableNotificationRow row, int childIndex) {
ensureRemovedFromTransientContainer(row);
int newIndex = childIndex < 0 ? mAttachedChildren.size() : childIndex;
mAttachedChildren.add(newIndex, row);
addView(row);
row.setUserLocked(mUserLocked);
... | vuln | Safe | Java |
async def on_federation_query_user_devices(self, user_id: str) -> JsonDict:
stream_id, devices = await self.store.get_e2e_device_keys_for_federation_query(
user_id
)
master_key = await self.store.get_e2e_cross_signing_key(user_id, "master")
self_signing_key = await self.store... | vuln | Vulnerable | Python |
void stralgoLCS(client *c) {
uint32_t i, j;
long long minmatchlen = 0;
sds a = NULL, b = NULL;
int getlen = 0, getidx = 0, withmatchlen = 0;
robj *obja = NULL, *objb = NULL;
for (j = 2; j < (uint32_t)c->argc; j++) {
char *opt = c->argv[j]->ptr;
int moreargs = (c->argc-1) - j;
... | vuln | Safe | C/C++ |
de265_error decoder_context::read_sps_NAL(bitreader& reader)
{
logdebug(LogHeaders,"----> read SPS\n");
std::shared_ptr<seq_parameter_set> new_sps = std::make_shared<seq_parameter_set>();
de265_error err;
if ((err=new_sps->read(this, &reader)) != DE265_OK) {
return err;
}
if (param_sps_headers_fd>=0)... | vuln | Vulnerable | Unknown |
@SuppressWarnings("squid:S3776") // Suppress high Cognitive Complexity warning
private void removeStarsInPath(
List<PartialPath> afterConcatPaths,
List<String> afterConcatAggregations,
List<UDFContext> afterConcatUdfList,
SelectOperator selectOperator,
int finalLimit,
int finalOffs... | vuln | Vulnerable | Java |
def change_message(self, new_message, logged_user):
update_sql = """
UPDATE Clients
SET message = ?
WHERE client_id = ?
"""
cursor = self.__conn.cursor()
cursor.execute(update_sql, (new_message, logged_user.get_client_id()))
self.__conn.commi... | vuln | Safe | Python |
static int handle_primary_tcp_pkt(NetFilterState *nf,
Connection *conn,
Packet *pkt)
{
struct tcphdr *tcp_pkt;
tcp_pkt = (struct tcphdr *)pkt->transport_header;
if (trace_event_get_state_backends(TRACE_COLO_FILTER_REWRITER_DEBUG)) {
... | vuln | Vulnerable | C/C++ |
int kvm_arch_insert_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint *bp)
{
if (cpu_memory_rw_debug(cs, bp->pc, (uint8_t *)&bp->saved_insn,
sizeof(diag_501), 0) ||
cpu_memory_rw_debug(cs, bp->pc, (uint8_t *)diag_501,
sizeof(diag_501), 1)) {
... | vuln | Vulnerable | C/C++ |
/**
* @file
* IMAP network mailbox
*
* @authors
* Copyright (C) 1996-1998,2012 Michael R. Elkins <me@mutt.org>
* Copyright (C) 1996-1999 Brandon Long <blong@fiction.net>
* Copyright (C) 1999-2009,2012,2017 Brendan Cully <brendan@kublai.com>
*
* @copyright
* This program is free software: you can redistribute ... | vuln | Safe | C/C++ |
PerformanceReport parseXml(File reportFile) throws Exception {
final SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
factory.setValidating(false);
factory.setNamespaceAware(false);
final... | vuln | Safe | Java |
def get_files(self, submit_id, password=None, astree=False):
"""
Returns files from a submitted analysis.
@param password: The password to unlock container archives with
@param astree: sflock option; determines the format in which the files are returned
@return: A tree of files
... | vuln | Vulnerable | Python |
njs_vmcode_array(njs_vm_t *vm, u_char *pc)
{
uint32_t length;
njs_array_t *array;
njs_value_t *value;
njs_vmcode_array_t *code;
code = (njs_vmcode_array_t *) pc;
array = njs_array_alloc(vm, 0, code->length, NJS_ARRAY_SPARE);
if (njs_fast_path(array != NULL)) {
... | vuln | Vulnerable | C/C++ |
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* th... | vuln | Safe | Java |
void aes_crypt_ecb( aes_context *ctx,
int mode,
const unsigned char input[16],
unsigned char output[16] )
{
int i;
unsigned long *RK, X0, X1, X2, X3, Y0, Y1, Y2, Y3;
#if defined(XYSSL_PADLOCK_C) && defined(XYSSL_HAVE_X86)
if( padlock_supports( PAD... | vuln | Vulnerable | Unknown |
/*
* oracle.c
*
* Copyright (C) 2013 Remy Mudingay <mudingay@ill.fr>
*
* This module is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any la... | vuln | Vulnerable | C/C++ |
public InternalNode<T> getGrandParentExitNode(final LongArrayBitVector v, final long[] state, final ObjectArrayList<InternalNode<T>> stack) {
if (DDEBUG) System.err.println("getParentGrandExitNode(" + v + ", " + stack + ")");
final InternalNode<T> parentExitNode = stack.pop();
// If the parent of the exit node is... | vuln | Safe | Java |
void bn_mxp_slide(bn_t c, const bn_t a, const bn_t b, const bn_t m) {
bn_t tab[RLC_TABLE_SIZE], t, u, r;
size_t l, w = 1;
uint8_t *win = RLC_ALLOCA(uint8_t, bn_bits(b));
if (win == NULL) {
RLC_THROW(ERR_NO_MEMORY);
return;
}
if (bn_cmp_dig(m, 1) == RLC_EQ) {
RLC_FREE(win);
bn_zero(c);
return;
}
if ... | vuln | Safe | C/C++ |
/* -*- coding: utf-8 -*- */
/* Copyright (C) 2000-2012 by George Williams */
/*
* 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 ... | vuln | Safe | C/C++ |
static int nbd_co_receive_offset_data_payload(NBDClientSession *s,
uint64_t orig_offset,
QEMUIOVector *qiov, Error **errp)
{
QEMUIOVector sub_qiov;
uint64_t offset;
size_t data_size;
int ret;
NBDStructuredRep... | vuln | Safe | C/C++ |
static int ep_loop_check_proc(void *priv, void *cookie, int call_nests)
{
int error = 0;
struct file *file = priv;
struct eventpoll *ep = file->private_data;
struct eventpoll *ep_tovisit;
struct rb_node *rbp;
struct epitem *epi;
mutex_lock_nested(&ep->mtx, call_nests + 1);
ep->visited = 1;
list_add(&ep->visit... | vuln | Vulnerable | C/C++ |
public static String constructFunctionKey(String fnamespace, String fname) {
String sfnamespace = fnamespace == null ?
DMLProgram.DEFAULT_NAMESPACE : fnamespace;
return sfnamespace + Program.KEY_DELIM + fname;
} | vuln | Safe | Java |
private void updateTypingIndicators() {
String typing = "";
int count = 0;
if(buffer != null) {
buffer.purgeExpiredTypingIndicators();
count = buffer.getTypingIndicators().size();
if (count > 5) {
typing = String.valueOf(count) + " people are... | vuln | Safe | Java |
package com.salesmanager.shop.admin.model.catalog;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.validation.Valid;
import com.salesmanager.core.model.catalog.category.CategoryDescription;
/**
* Wrapper to ease admin jstl
* @author carlsamson
*
*/
public class Categor... | vuln | Vulnerable | Java |
static void free_cache(BGZF *fp)
{
khint_t k;
if (fp->is_write) return;
khash_t(cache) *h = fp->cache->h;
for (k = kh_begin(h); k < kh_end(h); ++k)
if (kh_exist(h, k)) free(kh_val(h, k).block);
kh_destroy(cache, h);
free(fp->cache);
} | vuln | Safe | C/C++ |
public function confirm()
{
$task = $this->getTask();
$link = $this->getExternalTaskLink($task);
$this->response->html($this->template->render('task_external_link/remove', array(
'link' => $link,
'task' => $task,
)));
} | vuln | Safe | PHP |
decrypt_response(struct sc_card *card, unsigned char *in, size_t inlen, unsigned char *out, size_t * out_len)
{
size_t cipher_len;
size_t i;
unsigned char iv[16] = { 0 };
unsigned char plaintext[4096] = { 0 };
epass2003_exdata *exdata = NULL;
if (!card->drv_data)
return SC_ERROR_INVALID_ARGUMENTS;
exdata = ... | vuln | Vulnerable | C/C++ |
static int vorbis_floor1_decode(vorbis_context *vc,
vorbis_floor_data *vfu, float *vec)
{
vorbis_floor1 *vf = &vfu->t1;
GetBitContext *gb = &vc->gb;
uint16_t range_v[4] = { 256, 128, 86, 64 };
unsigned range = range_v[vf->multiplier - 1];
uint16_t floor1_Y[258];
u... | vuln | Vulnerable | C/C++ |
PHP_FUNCTION(touch)
{
char *filename;
int filename_len;
long filetime = 0, fileatime = 0;
int ret, argc = ZEND_NUM_ARGS();
FILE *file;
struct utimbuf newtimebuf;
struct utimbuf *newtime = &newtimebuf;
if (zend_parse_parameters(argc TSRMLS_CC, "s|ll", &filename, &filename_len, &filetime, &fileatime) == FAILURE)... | vuln | Safe | Unknown |
static u32 __peek_user_compat(struct task_struct *child, addr_t addr)
{
struct user32 *dummy32 = NULL;
per_struct32 *dummy_per32 = NULL;
addr_t offset;
__u32 tmp;
if (addr < (addr_t) &dummy32->regs.acrs) {
/*
* psw and gprs are stored on the stack
*/
if (addr == (addr_t) &dummy32->regs.psw.mask) {
/*... | vuln | Safe | Unknown |
static void copy_video_props(AVFilterBufferRefVideoProps *dst, AVFilterBufferRefVideoProps *src) {
*dst = *src;
if (src->qp_table) {
int qsize = src->qp_table_size;
dst->qp_table = av_malloc(qsize);
memcpy(dst->qp_table, src->qp_table, qsize);
}
} | vuln | Vulnerable | C/C++ |
/* 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 |
av_cold int ff_vc2enc_init_transforms(VC2TransformContext *s, int p_stride,
int p_height, int slice_w, int slice_h)
{
s->vc2_subband_dwt[VC2_TRANSFORM_9_7] = vc2_subband_dwt_97;
s->vc2_subband_dwt[VC2_TRANSFORM_5_3] = vc2_subband_dwt_53;
s->vc2_subband_dwt[VC2_TRA... | vuln | Safe | C/C++ |
TEE_Result syscall_cryp_state_copy(unsigned long dst, unsigned long src)
{
TEE_Result res;
struct tee_cryp_state *cs_dst;
struct tee_cryp_state *cs_src;
struct tee_ta_session *sess;
res = tee_ta_get_current_session(&sess);
if (res != TEE_SUCCESS)
return res;
res = tee_svc_cryp_get_state(sess, tee_svc_uref_to... | vuln | Vulnerable | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.