code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unl... | vuln | Vulnerable | Java |
static void send_ext_key_event_ack(VncState *vs)
{
vnc_lock_output(vs);
vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE);
vnc_write_u8(vs, 0);
vnc_write_u16(vs, 1);
vnc_framebuffer_update(vs, 0, 0,
pixman_image_get_width(vs->vd->server),
pixma... | vuln | Safe | Unknown |
mutateAndGetPayload: async (_args, context, mutationInfo) => {
try {
const { config, auth, info } = context;
const viewer = await getUserFromSessionToken(
context,
mutationInfo,
'viewer.user.',
auth.user.id
);
await usersRouter.handleLogOut... | vuln | Safe | JavaScript |
def upload_ssh_key(name: str, user_group: str, key: str) -> bool:
if '..' in name:
print('error: nice try')
return False
try:
key = paramiko.pkey.load_private_key(key)
except Exception as e:
print(f'error: Cannot save SSH key file: {e}')
return False
lib_path = get_config.get_config_var('main', 'lib_pat... | vuln | Safe | Python |
struct resource_pool *dce120_create_resource_pool(
uint8_t num_virtual_links,
struct dc *dc)
{
struct dce110_resource_pool *pool =
kzalloc(sizeof(struct dce110_resource_pool), GFP_KERNEL);
if (!pool)
return NULL;
if (construct(num_virtual_links, dc, pool))
return &pool->base;
kfree(pool);
BREAK_TO_DEBUG... | vuln | Safe | C/C++ |
static void curl_readv_bh_cb(void *p)
{
CURLState *state;
int running;
CURLAIOCB *acb = p;
BDRVCURLState *s = acb->common.bs->opaque;
qemu_bh_delete(acb->bh);
acb->bh = NULL;
size_t start = acb->sector_num * SECTOR_SIZE;
size_t end;
switch (curl_find_buf(s, start, acb->nb_s... | vuln | Safe | C/C++ |
int qemu_strtoll(const char *nptr, const char **endptr, int base,
int64_t *result)
{
char *p;
int err = 0;
if (!nptr) {
if (endptr) {
*endptr = nptr;
}
err = -EINVAL;
} else {
errno = 0;
*result = strtoll(nptr, &p, base);
err =... | vuln | Vulnerable | C/C++ |
int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
{
if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
(unsigned int)sk->sk_rcvbuf)
return -ENOMEM;
skb_orphan(skb);
skb->sk = sk;
skb->destructor = sock_rmem_free;
atomic_add(skb->truesize, &sk->sk_rmem_alloc);
skb_set_err_queue(skb);
... | vuln | Safe | Unknown |
xfs_attr3_leaf_add_work(
struct xfs_buf *bp,
struct xfs_attr3_icleaf_hdr *ichdr,
struct xfs_da_args *args,
int mapindex)
{
struct xfs_attr_leafblock *leaf;
struct xfs_attr_leaf_entry *entry;
struct xfs_attr_leaf_name_local *name_loc;
struct xfs_attr_leaf_name_remote *name_rmt;
struct xfs_mount *mp;
int t... | vuln | Vulnerable | C/C++ |
int kvm_iommu_unmap_guest(struct kvm *kvm)
{
struct iommu_domain *domain = kvm->arch.iommu_domain;
/* check if iommu exists and in use */
if (!domain)
return 0;
kvm_iommu_unmap_memslots(kvm);
iommu_domain_free(domain);
return 0;
} | vuln | Vulnerable | Unknown |
/**
* Copyright (c) 2006-2016, JGraph Ltd
*/
/**
* No CSS and resources available in embed mode. Parameters and docs:
* https://www.diagrams.net/doc/faq/embed-html-options
*/
GraphViewer = function(container, xmlNode, graphConfig)
{
this.init(container, xmlNode, graphConfig);
};
// Editor inherits from mxEventSo... | vuln | Safe | JavaScript |
int ssh_buffer_add_data(struct ssh_buffer_struct *buffer, const void *data, uint32_t len)
{
buffer_verify(buffer);
if (data == NULL) {
return -1;
}
if (buffer->used + len < len) {
return -1;
}
if (buffer->allocated < (buffer->used + len)) {
if(buffer->pos > 0)
buffer_shift(buffer);
... | vuln | Vulnerable | C/C++ |
static void object_set_link_property(Object *obj, Visitor *v, void *opaque,
const char *name, Error **errp)
{
Object **child = opaque;
bool ambiguous = false;
const char *type;
char *path;
type = object_property_get_type(obj, name, NULL);
visit_type_str(v, &p... | vuln | Safe | C/C++ |
def main():
parser = get_argparser()
argv = sys.argv[1:]
args = parser.parse_args(argv)
if args.json_args is not None:
args = _unpack_json_args(args)
earlyinit.early_init(args)
# We do this imports late as earlyinit needs to be run first (because of
# version checking and other early... | vuln | Vulnerable | Python |
long dd_get_item_size(struct dump_dir *dd, const char *name)
{
if (!str_is_correct_filename(name))
error_msg_and_die("Cannot get item size. '%s' is not a valid file name", name);
long size = -1;
char *iname = concat_path_file(dd->dd_dirname, name);
struct stat statbuf;
if (lstat(iname, &st... | vuln | Vulnerable | Unknown |
TiledInputFile::TiledInputFile (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int numThreads):
_data (new Data (numThreads))
{
_data->_deleteStream=false;
//
// This constructor is called when a user
// explicitly wants to read a tiled file.
//
bool streamDataCreated = false;
try
{
... | vuln | Vulnerable | Unknown |
static void sunkbd_reinit(struct work_struct *work)
{
struct sunkbd *sunkbd = container_of(work, struct sunkbd, tq);
wait_event_interruptible_timeout(sunkbd->wait, sunkbd->reset >= 0, HZ);
serio_write(sunkbd->serio, SUNKBD_CMD_SETLED);
serio_write(sunkbd->serio,
(!!test_bit(LED_CAPSL, sunkbd->dev->led) << 3) ... | vuln | Vulnerable | C/C++ |
int dd_delete_item(struct dump_dir *dd, const char *name)
{
if (!dd->locked)
error_msg_and_die("dump_dir is not opened"); /* bug */
if (!str_is_correct_filename(name))
error_msg_and_die("Cannot delete item. '%s' is not a valid file name", name);
char *path = concat_path_file(dd->dd_dirname... | vuln | Vulnerable | Unknown |
from enum import Enum
class PaymentError(Exception):
def __init__(self, message, code=None):
super(PaymentError, self).__init__(message, code)
self.message = message
self.code = code
def __str__(self):
return self.message
class GatewayError(IOError):
pass
class CustomP... | vuln | Vulnerable | Python |
static void bt_for_each(struct blk_mq_hw_ctx *hctx,
struct blk_mq_bitmap_tags *bt, unsigned int off,
busy_iter_fn *fn, void *data, bool reserved)
{
struct request *rq;
int bit, i;
for (i = 0; i < bt->map_nr; i++) {
struct blk_align_bitmap *bm = &bt->map[i];
for (bit = find_first_bit(&bm->word, bm->depth);
... | vuln | Vulnerable | Unknown |
static ssize_t cgroup_release_agent_write(struct kernfs_open_file *of,
char *buf, size_t nbytes, loff_t off)
{
struct cgroup *cgrp;
BUILD_BUG_ON(sizeof(cgrp->root->release_agent_path) < PATH_MAX);
/*
* Release agent gets called with all capabilities,
* require capabilities to set release agent.
*/
if... | vuln | Safe | C/C++ |
static CK_RV fill_ec_key_from_privkey(EC_KEY *ec_key, const CK_BYTE *data,
CK_ULONG data_len)
{
EC_POINT *point = NULL;
CK_RV rc = CKR_OK;
if (!EC_KEY_oct2priv(ec_key, data, data_len)) {
TRACE_ERROR("EC_KEY_oct2priv failed\n");
rc = CKR_FUNCTION_FAILED;... | vuln | Safe | C/C++ |
_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... | vuln | Safe | C/C++ |
static int decode_zbuf(AVBPrint *bp, const uint8_t *data,
const uint8_t *data_end)
{
z_stream zstream;
unsigned char *buf;
unsigned buf_size;
int ret;
zstream.zalloc = ff_png_zalloc;
zstream.zfree = ff_png_zfree;
zstream.opaque = NULL;
if (inflateInit(&zstream) !... | vuln | Vulnerable | C/C++ |
@Override
protected void init() {
super.init();
hoverAreas.clear();
buttons.clear();
children.clear();
minecraft.keyboardHandler.setSendRepeatsToGui(true);
playerList = new CreateGroupList(this, 9, 49, 160, 88, () -> Main.CLIENT_VOICE_EVENTS.getPlayerStateManager().g... | vuln | Safe | Java |
"""Tornado handlers for cluster web service."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import json
from tornado import web
from ...base.handlers import APIHandler
#-----------------------------------------------------------------------------
# Cluster h... | vuln | Safe | Python |
<div class='graphWrapper' style='width:100%;' id='wrapper_<?php print $graph['local_graph_id']?>' graph_width='<?php print $graph['width'];?>' graph_height='<?php print $graph['height'];?>' title_font_size='<?php print ((read_user_setting('custom_fonts') == 'on') ? read_user_setting('title_size') : read_config_option('... | vuln | Safe | PHP |
static int ohci_service_ed_list(OHCIState *ohci, uint32_t head, int completion)
{
struct ohci_ed ed;
uint32_t next_ed;
uint32_t cur;
int active;
active = 0;
if (head == 0)
return 0;
for (cur = head; cur; cur = next_ed) {
if (ohci_read_ed(ohci, cur, &ed)) {
trac... | vuln | Vulnerable | Unknown |
static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap)
{
ByteIOContext *pb = &s->pb;
SmackerContext *smk = (SmackerContext *)s->priv_data;
AVStream *st, *ast[7];
int i, ret;
int tbase;
smk->magic = get_le32(pb);
if (smk->magic != MKTAG('S', 'M', 'K', '2') && smk->mag... | vuln | Safe | C/C++ |
private BodyConsumer deployAppFromArtifact(final ApplicationId appId) throws IOException {
// Perform auth checks outside BodyConsumer as only the first http request containing auth header
// to populate SecurityRequestContext while http chunk doesn't. BodyConsumer runs in the thread
// that processes the l... | vuln | Safe | Java |
static int set_register(pegasus_t *pegasus, __u16 indx, __u8 data)
{
u8 *buf;
int ret;
buf = kmemdup(&data, 1, GFP_NOIO);
if (!buf)
return -ENOMEM;
ret = usb_control_msg(pegasus->usb, usb_sndctrlpipe(pegasus->usb, 0),
PEGASUS_REQ_SET_REG, PEGASUS_REQT_WRITE, data,
indx, buf, 1, 1000);
if (re... | vuln | Safe | Unknown |
static av_cold int mpeg4video_parse_init(AVCodecParserContext *s)
{
ParseContext1 *pc = s->priv_data;
pc->enc = av_mallocz(sizeof(MpegEncContext));
if (!pc->enc)
return -1;
pc->first_picture = 1;
return 0;
} | vuln | Vulnerable | C/C++ |
int
dlt_raw_init(tcpeditdlt_t *ctx)
{
tcpeditdlt_plugin_t *plugin;
assert(ctx);
if ((plugin = tcpedit_dlt_getplugin(ctx, dlt_value)) == NULL) {
tcpedit_seterr(ctx->tcpedit, "Unable to initialize unregistered plugin %s", dlt_name);
return TCPEDIT_ERROR;
}
/* allocate memory for our... | vuln | Safe | C/C++ |
selaComputeCompositeParameters(const char *fileout)
{
char *str, *nameh1, *nameh2, *namev1, *namev2;
char buf[L_BUF_SIZE];
l_int32 size, size1, size2, len;
SARRAY *sa;
SELA *selabasic, *selacomb;
selabasic = selaAddBasic(NULL);
selacomb = selaAddDwaCombs(NULL);
sa = sarrayCreate(64);
for (... | vuln | Vulnerable | C/C++ |
async def dirsearch(ctx , *, argument):
if not CommandInjection.commandInjection(argument=argument , RCE=RCE):
await ctx.send("**Your Command Contains Unallowed Chars. Don't Try To Use It Again.**")
return
Path = TOOLS['dirsearch']; MainPath = getcwd(); chdir(Path)
await ctx.send(f"**Ru... | vuln | Safe | Python |
static X509_STORE *init_revocation_store(fr_tls_server_conf_t *conf)
{
X509_STORE *store = NULL;
store = X509_STORE_new();
/* Load the CAs we trust */
if (conf->ca_file || conf->ca_path)
if(!X509_STORE_load_locations(store, conf->ca_file, conf->ca_path)) {
ERROR(LOG_PREFIX ": X509_STORE error %s", ERR_error_... | vuln | Vulnerable | Unknown |
int create_flush_cmd_control(struct f2fs_sb_info *sbi)
{
dev_t dev = sbi->sb->s_bdev->bd_dev;
struct flush_cmd_control *fcc;
int err = 0;
if (SM_I(sbi)->fcc_info) {
fcc = SM_I(sbi)->fcc_info;
goto init_thread;
}
fcc = kzalloc(sizeof(struct flush_cmd_control), GFP_KERNEL);
if (!fcc)
return -ENOMEM;
atomi... | vuln | Vulnerable | Unknown |
static void sun4uv_init(ram_addr_t RAM_size,
const char *boot_devices,
const char *kernel_filename, const char *kernel_cmdline,
const char *initrd_filename, const char *cpu_model,
const struct hwdef *hwdef)
{
CPUState *e... | vuln | Safe | C/C++ |
static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
{
long elements;
if( *p >= max - 2) {
zend_error(E_WARNING, "Bad unserialize data");
return -1;
}
elements = parse_iv2((*p) + 2, p);
(*p) += 2;
if (ce->serialize == NULL) {
object_init_ex(*rval, ce);
} else {
/* If ... | vuln | Safe | Unknown |
/*************************************************************************
This project implements a complete(!) JPEG (Recommendation ITU-T
T.81 | ISO/IEC 10918-1) codec, plus a library that can be used to
encode and decode JPEG streams.
It also implements ISO/IEC 18477 aka JPEG XT which is an extensi... | vuln | Vulnerable | C/C++ |
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_hpi.c - implementation of (Extensible) HTTP Priority Iterator.
*/
#include <assert.h>
#include <inttypes.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/queue.h>
#include <sys/types.h>
#ifdef WIN32
#inc... | vuln | Safe | C/C++ |
func (a *AuthenticatorOAuth2Introspection) Authenticate(r *http.Request, session *AuthenticationSession, config json.RawMessage, _ pipeline.Rule) error {
cf, client, err := a.Config(config)
if err != nil {
return err
}
token := helper.BearerTokenFromRequest(r, cf.BearerTokenLocation)
if token == "" {
return e... | vuln | Safe | Go |
void __l2cap_connect_rsp_defer(struct l2cap_chan *chan)
{
struct l2cap_conn_rsp rsp;
struct l2cap_conn *conn = chan->conn;
u8 buf[128];
u8 rsp_code;
rsp.scid = cpu_to_le16(chan->dcid);
rsp.dcid = cpu_to_le16(chan->scid);
rsp.result = cpu_to_le16(L2CAP_CR_SUCCESS);
rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO)... | vuln | Vulnerable | Unknown |
function PMA_getCentralColumnsCount($db)
{
$cfgCentralColumns = PMA_centralColumnsGetParams();
if (empty($cfgCentralColumns)) {
return 0;
}
$pmadb = $cfgCentralColumns['db'];
$GLOBALS['dbi']->selectDb($pmadb, $GLOBALS['controllink']);
$central_list_table = $cfgCentralColumns['table'];
... | vuln | Vulnerable | PHP |
void Compute(OpKernelContext* context) override {
// Get the input Tensors.
OpInputList params_nested_splits_in;
OP_REQUIRES_OK(context, context->input_list("params_nested_splits",
¶ms_nested_splits_in));
OP_REQUIRES(
context, params_nested_sp... | vuln | Safe | C/C++ |
private void setPosition() {
Group group = mChannel.getGroup();
int position = mGroupAdapter.indexOf(group);
boolean change = mBinding.group.getSelectedPosition() != position;
if (change) mBinding.group.setSelectedPosition(position);
if (change) mChannelAdapter.setItems(group.get... | vuln | Vulnerable | Java |
public String[] getWebpages() {
return webpages;
} | vuln | Vulnerable | Java |
void host_net_remove_completion(ReadLineState *rs, int nb_args, const char *str)
{
NetClientState *ncs[MAX_QUEUE_NUM];
int count, i, len;
len = strlen(str);
readline_set_completion_index(rs, len);
if (nb_args == 2) {
count = qemu_find_net_clients_except(NULL, ncs,
... | vuln | Safe | C/C++ |
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11,
# andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh,
# falgh1, grunjol, csitk... | vuln | Vulnerable | Python |
static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eof)
{
int ret = 0, i;
int got_output = 0;
AVPacket avpkt;
if (!ist->saw_first_ts) {
ist->dts = ist->st->avg_frame_rate.num ? - ist->dec_ctx->has_b_frames * AV_TIME_BASE / av_q2d(ist->st->avg_frame_rate) : 0;
i... | vuln | Vulnerable | C/C++ |
BGD_DECLARE(void *) gdImageWBMPPtr(gdImagePtr im, int *size, int fg)
{
void *rv;
gdIOCtx *out = gdNewDynamicCtx(2048, NULL);
if (out == NULL) return NULL;
if (!_gdImageWBMPCtx(im, fg, out)) {
rv = gdDPExtractData(out, size);
} else {
rv = NULL;
}
out->gd_free(out);
return rv;
} | vuln | Safe | Unknown |
private PerformanceReport readFromXML(File reportFile) throws Exception {
final PerformanceReport report = createPerformanceReport();
report.setExcludeResponseTime(excludeResponseTime);
report.setShowTrendGraphs(showTrendGraphs);
report.setReportFileName(reportFile.getName());
D... | vuln | Vulnerable | Java |
static void *virtio_scsi_load_request(QEMUFile *f, SCSIRequest *sreq)
{
SCSIBus *bus = sreq->bus;
VirtIOSCSI *s = container_of(bus, VirtIOSCSI, bus);
VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(s);
VirtIOSCSIReq *req;
uint32_t n;
req = g_malloc(sizeof(*req));
qemu_get_be32s(f, &n);
assert... | vuln | Vulnerable | Unknown |
@OnlyIn(Dist.CLIENT)
public void setLast(Player player, ItemStack stack, PlacementPosition position, BlockHitResult result) {
this.stack = stack;
if (positions.isEmpty())
pos = position.getPos();
last = new ShapeSelectPos(player, position, result);
ensureSameContext(last)... | vuln | Vulnerable | Java |
@Override
public void handle(PlayerEntity sender) {
InteractionManager.instance().getClientNetworkHandler().handleSpawnProjectile(this);
} | vuln | Safe | Java |
int aio_bh_poll(AioContext *ctx)
{
QEMUBH *bh, **bhp, *next;
int ret;
ctx->walking_bh++;
ret = 0;
for (bh = ctx->first_bh; bh; bh = next) {
smp_read_barrier_depends();
next = bh->next;
if (!bh->deleted && atomic_xchg(&bh->scheduled, 0)) {
if (!bh... | vuln | Vulnerable | C/C++ |
func_contains (struct _ESExp *f,
gint argc,
struct _ESExpResult **argv,
gpointer data)
{
EBookBackendLDAPSExpData *ldap_data = data;
ESExpResult *r;
if (argc == 2
&& argv[0]->type == ESEXP_RES_STRING
&& argv[1]->type == ESEXP_RES_STRING) {
gchar *propname = a... | vuln | Vulnerable | Unknown |
private void sendNotification() {
if (notificationSender == null || sending) {
return;
}
fragmentSettingsBinding.sendingProgressIndicator.setVisibility(View.VISIBLE);
sending = true;
CompletableFuture.supplyAsync(() -> notificationSender.sendParsedNotification(new ... | vuln | Vulnerable | Java |
static void decode_phase(struct Flex * flex, char PhaseNo) {
if (flex==NULL) return;
uint32_t *phaseptr=NULL;
int i, j;
switch (PhaseNo) {
case 'A': phaseptr=flex->Data.PhaseA.buf; break;
case 'B': phaseptr=flex->Data.PhaseB.buf; break;
case 'C': phaseptr=flex->Data.PhaseC.buf; break;
case 'D'... | vuln | Vulnerable | C/C++ |
static int qcrypto_ivgen_essiv_init(QCryptoIVGen *ivgen,
const uint8_t *key, size_t nkey,
Error **errp)
{
uint8_t *salt;
size_t nhash;
size_t nsalt;
QCryptoIVGenESSIV *essiv = g_new0(QCryptoIVGenESSIV, 1);
nsalt = qcrypto_c... | vuln | Vulnerable | C/C++ |
@SneakyThrows
public static String dLocalize(String s1, String s2, String s3) {
if (!wordKey.containsKey(s1 + s2 + s3)) { // Not in cache or Not in file
JsonObject jsonObj;
File langFile = new File(instance.getDataFolder() + "/languages", AdaptConfig.get().getLanguage() + ".json");
... | vuln | Safe | Java |
static int digi_startup(struct usb_serial *serial)
{
struct device *dev = &serial->interface->dev;
struct digi_serial *serial_priv;
int ret;
int i;
/* check whether the device has the expected number of endpoints */
if (serial->num_port_pointers < serial->type->num_ports + 1) {
dev_err(dev, "OOB endpoints m... | vuln | Safe | C/C++ |
static int insert_key(
sc_pkcs15_card_t *p15card,
const char *path,
unsigned char id,
unsigned char key_reference,
int key_length,
unsigned char auth_id,
const char *label
)
{
sc_card_t *card = p15card->card;
sc_context_t *ctx = p15card->card->ctx;
sc_file_t *f;
struct s... | vuln | Safe | C/C++ |
Map1to1(SDL_Palette * src, SDL_Palette * dst, int *identical)
{
Uint8 *map;
int i;
if (identical) {
if (src->ncolors <= dst->ncolors) {
/* If an identical palette, no need to map */
if (src == dst
||
(SDL_memcmp
(src->colors, ... | vuln | Vulnerable | Unknown |
var EE = require('events').EventEmitter
var parse = require('url').parse
var http = require('http')
var path = require('path')
var fs = require('fs')
var fileExists = require('utils-fs-exists')
var htmlls = require('html-ls')
var filed = require('filed')
var xtend = require('xtend')
var replace = require('stream-repla... | vuln | Vulnerable | JavaScript |
static char *print_value( cJSON *item, int depth, int fmt )
static char *print_value(cJSON *item,int depth,int fmt,printbuffer *p)
{
char *out=0;
if (!item) return 0;
if (p)
{
switch ((item->type)&255)
{
case cJSON_NULL: {out=ensure(p,5); if (out) strcpy(out,"null"); break;}
case cJSON_False: {out=ensure(... | vuln | Safe | C/C++ |
mp_err mp_mul_2d(const mp_int *a, int b, mp_int *c)
{
mp_digit d;
mp_err err;
/* copy */
if (a != c) {
if ((err = mp_copy(a, c)) != MP_OKAY) {
return err;
}
}
if (c->alloc < (c->used + (b / MP_DIGIT_BIT) + 1)) {
if ((err = mp_grow(c, c->used + (b / MP_DIGIT_BIT) + 1)) !=... | vuln | Vulnerable | C/C++ |
@Override
public void readNetData(FriendlyByteBuf buffer) {
super.readNetData(buffer);
structure = ResourceKey.create(Registry.CONFIGURED_STRUCTURE_FEATURE_REGISTRY, buffer.readResourceLocation());
} | vuln | Vulnerable | Java |
@VisibleForTesting
void setSubtitle() {
if (mEraseEsims) {
((TextView) mContentView.findViewById(R.id.sud_layout_description))
.setText(R.string.main_clear_final_desc_esim);
}
} | vuln | Vulnerable | Java |
"""Django settings for InvenTree project.
In practice the settings in this file should not be adjusted,
instead settings can be configured in the config.yaml file
located in the top level project directory.
This allows implementation configuration to be hidden from source control,
as well as separate configuration pa... | vuln | Safe | Python |
LZWReadByte (FILE *fd,
gint just_reset_LZW,
gint input_code_size)
{
static gint fresh = FALSE;
gint code, incode;
static gint code_size, set_code_size;
static gint max_code, max_code_size;
static gint firstcode, oldcode;
static gint clear_code, end_code;
static gint tabl... | vuln | Vulnerable | C/C++ |
_updateContents(element) {
let content;
let changed;
let templateFunction;
let itemVisibleFrameContent;
let visibleFrameTemplateFunction;
const itemData = this._getItemData(); // get a clone of the data from the dataset
const frameElement = this.dom.box || this.dom.point;
const itemVis... | vuln | Vulnerable | JavaScript |
int asn1_ber_decoder(const struct asn1_decoder *decoder,
void *context,
const unsigned char *data,
size_t datalen)
{
const unsigned char *machine = decoder->machine;
const asn1_action_t *actions = decoder->actions;
size_t machlen = decoder->machlen;
enum asn1_opcode op;
unsigned char tag = 0, ... | vuln | Safe | C/C++ |
@Override
public TokensList getCompletionsFromTokenInLocalScope(IModule module, ICompletionState state,
boolean searchSameLevelMods, boolean lookForArgumentCompletion, ILocalScope localScope)
throws CompletionRecursionException {
TokensList tokens;
//now, if we have to look f... | vuln | Vulnerable | Java |
package com.salesmanager.core.business.services.catalog.product;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import javax.inject.Inject;
import o... | vuln | Vulnerable | Java |
bool bdrv_all_can_snapshot(BlockDriverState **first_bad_bs)
{
bool ok = true;
BlockDriverState *bs;
BdrvNextIterator it;
for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) {
AioContext *ctx = bdrv_get_aio_context(bs);
aio_context_acquire(ctx);
if (bdrv_is_inserted(bs) && !bdrv_i... | vuln | Safe | C/C++ |
TfLiteStatus StoreAllDecodedSequences(
TfLiteContext* context,
const std::vector<std::vector<std::vector<int>>>& sequences,
TfLiteNode* node, int top_paths) {
const int32_t batch_size = sequences.size();
std::vector<int32_t> num_entries(top_paths, 0);
// Calculate num_entries per path
for (const au... | vuln | Safe | C/C++ |
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2017-2019 Intel Corporation <www.intel.com>
*/
#include <image.h>
#include <log.h>
#include <asm/global_data.h>
#include <asm/io.h>
#include <asm/arch/fpga_manager.h>
#include <asm/arch/reset_manager.h>
#include <asm/arch/system_manager.h>
#include <asm/arch/sdra... | vuln | Safe | C/C++ |
static gboolean
comics_check_decompress_command (gchar *mime_type,
ComicsDocument *comics_document,
GError **error)
{
gboolean success;
gchar *std_out, *std_err;
gint retval;
GError *err = NULL;
/* FIXME, use proper cbr/cbz mime types once they're
* included in shared-mime-info */
... | vuln | Safe | C/C++ |
/*
* IPv6 fragment reassembly for connection tracking
*
* Copyright (C)2004 USAGI/WIDE Project
*
* Author:
* Yasuyuki Kozakai @USAGI <yasuyuki.kozakai@toshiba.co.jp>
*
* Based on: net/ipv6/reassembly.c
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Ge... | vuln | Safe | C/C++ |
public void testSerializeAndParsePublicJWKSet()
throws Exception {
ECParameterSpec ecParameterSpec = ECKey.Curve.P_256.toECParameterSpec();
KeyPairGenerator generator = KeyPairGenerator.getInstance("EC");
generator.initialize(ecParameterSpec);
KeyPair keyPair = generator.generateKeyPair();
ECKey ec... | vuln | Safe | Java |
static void RENAME(yuv2bgr24_1)(SwsContext *c, const int16_t *buf0,
const int16_t *ubuf[2], const int16_t *bguf[2],
const int16_t *abuf0, uint8_t *dest,
int dstW, int uvalpha, int y)
{
const int16_t *ubuf0 = ubuf[0], *ub... | vuln | Vulnerable | C/C++ |
private void tick() {
if (stock != null) {
if (Mouse.getDrag() == null) {
component.stopClientDragging();
new DragPacket(stock, component, false, 0, true).sendToServer();
stock = null;
component = null;
lastDelta = null;... | vuln | Vulnerable | Java |
static inline void dv_guess_qnos(EncBlockInfo* blks, int* qnos)
{
int size[5];
int i, j, k, a, prev, a2;
EncBlockInfo* b;
size[4]= 1<<24;
do {
b = blks;
for (i=0; i<5; i++) {
if (!qnos[i])
continue;
qnos[i]--;
size[i] = 0;
for (j=0;... | vuln | Vulnerable | C/C++ |
void ElectronRenderFrameObserver::DidMeaningfulLayout(
blink::WebMeaningfulLayout layout_type) {
if (layout_type == blink::WebMeaningfulLayout::kVisuallyNonEmpty) {
mojo::AssociatedRemote<mojom::ElectronBrowser> browser_remote;
render_frame_->GetRemoteAssociatedInterfaces()->GetInterface(
&browser... | vuln | Vulnerable | Unknown |
static void dtls1_clear_queues(SSL *s)
{
pitem *item = NULL;
hm_fragment *frag = NULL;
DTLS1_RECORD_DATA *rdata;
while ((item = pqueue_pop(s->d1->unprocessed_rcds.q)) != NULL) {
rdata = (DTLS1_RECORD_DATA *)item->data;
if (rdata->rbuf.buf) {
OPENSSL_free(rdata->rbuf.buf);
... | vuln | Vulnerable | Unknown |
sc_oberthur_read_file(struct sc_pkcs15_card *p15card, const char *in_path,
unsigned char **out, size_t *out_len,
int verify_pin)
{
struct sc_context *ctx = p15card->card->ctx;
struct sc_card *card = p15card->card;
struct sc_file *file = NULL;
struct sc_path path;
size_t sz;
int rv;
LOG_FUNC_CALLED(ctx);
if... | vuln | Safe | C/C++ |
static inline int onenand_prog_main(OneNANDState *s, int sec, int secn,
void *src)
{
int result = 0;
if (secn > 0) {
uint32_t size = secn << BDRV_SECTOR_BITS;
uint32_t offset = sec << BDRV_SECTOR_BITS;
assert(UINT32_MAX >> BDRV_SECTOR_BITS > sec);
assert(UINT32_MA... | vuln | Safe | C/C++ |
int ff_j2k_init_component(J2kComponent *comp, J2kCodingStyle *codsty, J2kQuantStyle *qntsty, int cbps, int dx, int dy)
{
int reslevelno, bandno, gbandno = 0, ret, i, j, csize = 1;
if (ret=ff_j2k_dwt_init(&comp->dwt, comp->coord, codsty->nreslevels-1, codsty->transform))
return ret;
for (i = 0; i < 2... | vuln | Vulnerable | C/C++ |
private void setHorizontalActions() {
mHorizontalLayout.removeAllViews();
if (mainModel != null && !mainModel.getIsExternalApk()) {
// Set open
final Intent launchIntentForPackage = mPackageManager.getLaunchIntentForPackage(mPackageName);
if (launchIntentForPackage !=... | vuln | Safe | Java |
static int diffie_hellman_sha256(LIBSSH2_SESSION *session,
_libssh2_bn *g,
_libssh2_bn *p,
int group_order,
unsigned char packet_type_init,
unsigned char p... | vuln | Vulnerable | Unknown |
/*
* EJS Embedded JavaScript templates
* Copyright 2112 Matthew Eernisse (mde@fleegix.org)
*
* 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/L... | vuln | Safe | JavaScript |
static int caca_write_header(AVFormatContext *s)
{
CACAContext *c = s->priv_data;
AVStream *st = s->streams[0];
AVCodecContext *encctx = st->codec;
int ret, bpp;
c->ctx = s;
if (c->list_drivers) {
list_drivers(c);
return AVERROR_EXIT;
}
if (c->list_dither) {
if (!... | vuln | Safe | C/C++ |
void RGWCORSRule::format_exp_headers(string& s) {
s = "";
for(list<string>::iterator it = exposable_hdrs.begin();
it != exposable_hdrs.end(); ++it) {
if (s.length() > 0)
s.append(",");
s.append((*it));
}
} | vuln | Vulnerable | Unknown |
static int vp8_encode(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *frame, int *got_packet)
{
VP8Context *ctx = avctx->priv_data;
struct vpx_image *rawimg = NULL;
struct vpx_image *rawimg_alpha = NULL;
int64_t timestamp = 0;
int res, coded_size;
vpx_enc_frame_flags_t... | vuln | Safe | C/C++ |
struct dir_iterator *dir_iterator_begin(const char *path, unsigned int flags)
{
struct dir_iterator_int *iter = xcalloc(1, sizeof(*iter));
struct dir_iterator *dir_iterator = &iter->base;
int saved_errno;
strbuf_init(&iter->base.path, PATH_MAX);
strbuf_addstr(&iter->base.path, path);
ALLOC_GROW(iter->levels, 10... | vuln | Vulnerable | C/C++ |
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_di_hash.c -- Copy incoming data into a hash
*
* While this implementation copies the data, its memory use is limited,
* which makes it a good choice when we have a lot of stream frames
* coming in.
*
* Another difference is tha... | vuln | Safe | C/C++ |
static void _on_suback(asymcute_con_t *con, const uint8_t *data, size_t len)
{
mutex_lock(&con->lock);
asymcute_req_t *req = _req_preprocess(con, len, MINLEN_SUBACK,
data, IDPOS_SUBACK);
if (req == NULL) {
mutex_unlock(&con->lock);
return;
}
... | vuln | Vulnerable | C/C++ |
check_compat_entry_size_and_hooks(struct compat_ipt_entry *e,
struct xt_table_info *newinfo,
unsigned int *size,
const unsigned char *base,
const unsigned char *limit,
const unsigned int *hook_entries,
const unsigned int *underflows,
const char *name)
{
struct xt_entry_match *... | vuln | Vulnerable | C/C++ |
static gboolean ga_channel_listen_accept(GIOChannel *channel,
GIOCondition condition, gpointer data)
{
GAChannel *c = data;
int ret, client_fd;
bool accepted = false;
struct sockaddr_un addr;
socklen_t addrlen = sizeof(addr);
g_assert(channel != NULL);
... | vuln | Vulnerable | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.