code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
_clone_pdu_header(netsnmp_pdu *pdu)
{
netsnmp_pdu *newpdu;
struct snmp_secmod_def *sptr;
int ret;
if (!pdu)
return NULL;
newpdu = (netsnmp_pdu *) malloc(sizeof(netsnmp_pdu));
if (!newpdu)
return NULL;
memmove(newpdu, pdu, sizeof(netsnmp_pdu));
/*
* reset copied... | vuln | Vulnerable | Unknown |
int jpc_streamlist_insert(jpc_streamlist_t *streamlist, int streamno,
jas_stream_t *stream)
{
jas_stream_t **newstreams;
int newmaxstreams;
int i;
/* Grow the array of streams if necessary. */
if (streamlist->numstreams >= streamlist->maxstreams) {
newmaxstreams = streamlist->maxstreams + 1024;
if (!(newstre... | vuln | Vulnerable | Unknown |
static ssize_t cpu_capacity_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct cpu *cpu = container_of(dev, struct cpu, dev);
return sysfs_emit(buf, "%lu\n", topology_get_cpu_scale(cpu->dev.id));
} | vuln | Safe | Unknown |
def self.setup_tmpl_folder
begin
tmpl_folder = Folder.where(name: TMPL_ROOT).first
rescue
end
if tmpl_folder.nil?
# Setup initial template-folders
folder = Folder.new
folder.name = TMPL_ROOT
folder.parent_id = 0
folder.owner_id = 0
folder.xtype = Folder::XTYPE_... | vuln | Safe | Ruby |
/* Copyright 2022 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 | Python |
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.app.itemimport;
import gr.ekt.bte.core.DataLoader;
import gr.ekt.bte.core.Transform... | vuln | Vulnerable | Java |
Perl_my_setenv(pTHX_ const char *nam, const char *val)
{
dVAR;
#ifdef __amigaos4__
amigaos4_obtain_environ(__FUNCTION__);
#endif
#ifdef USE_ITHREADS
/* only parent thread can modify process environment */
if (PL_curinterp == aTHX)
#endif
{
#ifndef PERL_USE_SAFE_PUTENV
if (!PL_use_safe_putenv) {
/*... | vuln | Vulnerable | C/C++ |
flatpak_run_app (FlatpakDecomposed *app_ref,
FlatpakDeploy *app_deploy,
FlatpakContext *extra_context,
const char *custom_runtime,
const char *custom_runtime_version,
const char *custom_runtime_commit,
... | vuln | Safe | Unknown |
function readSync (cache, integrity, opts = {}) {
const { size } = opts
return withContentSriSync(cache, integrity, (cpath, sri) => {
const data = fs.readFileSync(cpath, { encoding: null })
if (typeof size === 'number' && size !== data.length) {
throw sizeError(size, data.length)
}
if (ssri.c... | vuln | Safe | JavaScript |
void FrameLoader::receivedFirstData()
{
begin(m_workingURL, false);
dispatchDidCommitLoad();
dispatchWindowObjectAvailable();
if (m_documentLoader) {
String ptitle = m_documentLoader->title();
if (!ptitle.isNull())
m_client->dispatchDidReceiveTitle(ptitle);
}
m... | vuln | Safe | C/C++ |
ncp_read_kernel(struct ncp_server *server, const char *file_id,
__u32 offset, __u16 to_read, char *target, int *bytes_read)
{
const char *source;
int result;
ncp_init_request(server);
ncp_add_byte(server, 0);
ncp_add_mem(server, file_id, 6);
ncp_add_be32(server, offset);
ncp_add_be16(server, to_read);
i... | vuln | Vulnerable | C/C++ |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite (interfaces: AuthorizeEndpointHandler)
// Package internal is a generated GoMock package.
package internal
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
fosite "github.com/ory/fosite"
)
// MockAuth... | vuln | Vulnerable | Go |
package model;
import java.sql.PreparedStatement;
import object.Region;
import object.Variant;
import util.DBManager;
import java.sql.ResultSet;
import java.util.ArrayList;
/**
*
* @author Nick
*/
public class Output {
public static ArrayList<Variant> variantList = new ArrayList<Variant>();
public static ... | vuln | Safe | JavaScript |
ps_parser_to_token( PS_Parser parser,
T1_Token token )
{
FT_Byte* cur;
FT_Byte* limit;
FT_Int embed;
token->type = T1_TOKEN_TYPE_NONE;
token->start = NULL;
token->limit = NULL;
/* first of all, skip leading whitespace */
ps_parser_skip_spaces( parser )... | vuln | Safe | Unknown |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you m... | vuln | Safe | Java |
pci_set_cfgdata32(struct pci_vdev *dev, int offset, uint32_t val)
{
if ((offset > PCI_REGMAX - 3) || (offset & 3) != 0) {
pr_err("%s: out of range of PCI config space!\n", __func__);
return;
}
*(uint32_t *)(dev->cfgdata + offset) = val;
} | vuln | Safe | C/C++ |
void ImageBitmapFactories::ImageBitmapLoader::DidFinishLoading() {
DOMArrayBuffer* array_buffer = loader_->ArrayBufferResult();
if (!array_buffer) {
RejectPromise(kAllocationFailureImageBitmapRejectionReason);
return;
}
ScheduleAsyncImageBitmapDecoding(array_buffer);
} | vuln | Vulnerable | C/C++ |
static int ldb_wildcard_compare(struct ldb_context *ldb,
const struct ldb_parse_tree *tree,
const struct ldb_val value, bool *matched)
{
const struct ldb_schema_attribute *a;
struct ldb_val val;
struct ldb_val cnk;
struct ldb_val *chunk;
uint8_t *save_p = NULL;
unsigned int c = 0;
if (tree->operation !=... | vuln | Vulnerable | C/C++ |
it 'returns success' do
post "/session/email-login/#{email_token.token}.json"
expect(JSON.parse(response.body)["success"]).to eq("OK")
expect(session[:current_user_id]).to eq(user.id)
end | vuln | Safe | Ruby |
parse_tsquery(char *buf,
PushFunction pushval,
Datum opaque,
bool isplain)
{
struct TSQueryParserStateData state;
int i;
TSQuery query;
int commonlen;
QueryItem *ptr;
ListCell *cell;
/* init state */
state.buffer = buf;
state.buf = buf;
state.state = (isplain) ? WAITSINGLEOPERAND : WAI... | vuln | Vulnerable | C/C++ |
/**
* Copyright (c) 2006-2021, JGraph Ltd
* Copyright (c) 2006-2021, draw.io AG
*/
// urlParams is null when used for embedding
window.urlParams = window.urlParams || {};
// isLocalStorage controls access to local storage
window.isLocalStorage = window.isLocalStorage || false;
// Disables loading settings in conf... | vuln | Vulnerable | JavaScript |
static USBDevice *usb_msd_init(const char *filename)
{
static int nr=0;
char id[8];
QemuOpts *opts;
DriveInfo *dinfo;
USBDevice *dev;
int fatal_error;
const char *p1;
char fmt[32];
snprintf(id, sizeof(id), "usb%d", nr++);
opts = qemu_opts_create(&qemu_drive_opts, id, 0);
... | vuln | Safe | C/C++ |
pipe_fopen(gx_io_device * iodev, const char *fname, const char *access,
gp_file ** pfile, char *rfname, uint rnamelen, gs_memory_t *mem)
{
#ifdef GS_NO_FILESYSTEM
return 0;
#else
gs_lib_ctx_t *ctx = mem->gs_lib_ctx;
gs_fs_list_t *fs = ctx->core->fs;
/* The pipe device can be reached in two wa... | vuln | Safe | Unknown |
# Natural Language Toolkit: Interface to MaltParser
#
# Author: Dan Garrette <dhgarrette@gmail.com>
# Contributor: Liling Tan, Mustufain, osamamukhtar11
#
# Copyright (C) 2001-2021 NLTK Project
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
import inspect
import os
import subprocess
import s... | vuln | Vulnerable | Python |
static void relocate_single_git_dir_into_superproject(const char *prefix,
const char *path)
{
char *old_git_dir = NULL, *real_old_git_dir = NULL, *real_new_git_dir = NULL;
const char *new_git_dir;
const struct submodule *sub;
if (submodule_uses_worktrees(path))
die(_("relocate_gitdir for submodule '%... | vuln | Vulnerable | Unknown |
static PyObject* patch(PyObject* self, PyObject* args)
{
char *origData, *newData, *diffBlock, *extraBlock, *diffPtr, *extraPtr;
Py_ssize_t origDataLength, newDataLength, diffBlockLength, extraBlockLength;
PyObject *controlTuples, *tuple, *results;
off_t oldpos, newpos, x, y, z;
int i, j, numTuples;... | vuln | Vulnerable | Unknown |
private boolean isDisabled(Plugin plugin) {
return Arrays.stream(plugin.getFeatureIds())
.map(this::getFeatureDefinition)
.filter(Objects::nonNull)
.noneMatch(FeatureDefinition::isEnabled);
} | vuln | Safe | Java |
ikev2_ke_print(netdissect_options *ndo, u_char tpay,
const struct isakmp_gen *ext,
u_int item_len _U_, const u_char *ep _U_,
uint32_t phase _U_, uint32_t doi _U_,
uint32_t proto _U_, int depth _U_)
{
struct ikev2_ke ke;
const struct ikev2_ke *k;
k = (const struct ikev2_ke *)ext;
ND_TCHECK(*ext);
UNALIGNED... | vuln | Vulnerable | C/C++ |
int main(int argc, char * argv[])
{
gr_face * face = 0;
try
{
if (argc != 2) throw std::length_error("not enough arguments: need a backing font");
dummyFace = face_handle(argv[1]);
testFeatTable<FeatTableTestA>(testDataA, "A\n");
testFeatTable<FeatTableTestB>(testDataB, "B\n");
testFeatTable<FeatTab... | vuln | Vulnerable | C/C++ |
static MprJson *queryCore(MprJson *obj, cchar *key, MprJson *value, int flags)
{
MprJson *result, *child;
char *property, *rest;
int termType;
if (obj == 0 || key == 0 || *key == '\0' || obj->type & MPR_JSON_VALUE) {
return 0;
}
result = 0;
for (property = getNext... | vuln | Safe | C/C++ |
int
xfs_attr3_leaf_list_int(
struct xfs_buf *bp,
struct xfs_attr_list_context *context)
{
struct attrlist_cursor_kern *cursor;
struct xfs_attr_leafblock *leaf;
struct xfs_attr3_icleaf_hdr ichdr;
struct xfs_attr_leaf_entry *entries;
struct xfs_attr_leaf_entry *entry;
int retval;
int i;
struct xfs_mount... | vuln | Safe | C/C++ |
static int idcin_probe(AVProbeData *p)
{
unsigned int number, sample_rate;
unsigned int w, h;
int i;
if (p->buf_size < 20 + HUFFMAN_TABLE_SIZE + 12)
return 0;
w = AV_RL32(&p->buf[0]);
if ((w == 0) || (w > 1024))
return 0;
h = AV_RL32(&p->buf[4]);
if ((h... | vuln | Safe | C/C++ |
makeOperatorDependencies(HeapTuple tuple, bool isUpdate)
{
Form_pg_operator oper = (Form_pg_operator) GETSTRUCT(tuple);
ObjectAddress myself,
referenced;
myself.classId = OperatorRelationId;
myself.objectId = HeapTupleGetOid(tuple);
myself.objectSubId = 0;
/*
* If we are updating the operator, delete any ... | vuln | Safe | Unknown |
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <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 the
* <a href="http://www.apache... | vuln | Safe | Java |
#include "PortForwardHandler.hpp"
namespace et {
PortForwardHandler::PortForwardHandler(
shared_ptr<SocketHandler> _networkSocketHandler,
shared_ptr<SocketHandler> _pipeSocketHandler)
: networkSocketHandler(_networkSocketHandler),
pipeSocketHandler(_pipeSocketHandler) {}
void PortForwardHandler::upd... | vuln | Safe | C/C++ |
static int scan_file(AVFormatContext *avctx, AVStream *vst, AVStream *ast, int file)
{
MlvContext *mlv = avctx->priv_data;
AVIOContext *pb = mlv->pb[file];
int ret;
while (!avio_feof(pb)) {
int type;
unsigned int size;
type = avio_rl32(pb);
size = avio_rl32(pb);
a... | vuln | Vulnerable | C/C++ |
static int mjpeg_decode_app(MJpegDecodeContext *s)
{
int len, id, i;
len = get_bits(&s->gb, 16);
if (len < 6)
return AVERROR_INVALIDDATA;
if (8 * len > get_bits_left(&s->gb))
return AVERROR_INVALIDDATA;
id = get_bits_long(&s->gb, 32);
len -= 6;
if (s->avctx->debug & FF_DEBU... | vuln | Safe | C/C++ |
int X509_verify_cert(X509_STORE_CTX *ctx)
{
X509 *x, *xtmp, *xtmp2, *chain_ss = NULL;
int bad_chain = 0;
X509_VERIFY_PARAM *param = ctx->param;
int depth, i, ok = 0;
int num, j, retry;
int (*cb) (int xok, X509_STORE_CTX *xctx);
STACK_OF(X509) *sktmp = NULL;
int trust = X509_TRUST_UNTRUST... | vuln | Safe | Unknown |
struct bus_id_priv *get_busid_priv(const char *busid)
{
int idx;
struct bus_id_priv *bid = NULL;
spin_lock(&busid_table_lock);
idx = get_busid_idx(busid);
if (idx >= 0) {
bid = &(busid_table[idx]);
/* get busid_lock before returning */
spin_lock(&bid->busid_lock);
}
spin_unlock(&busid_table_lock);
retur... | vuln | Safe | Unknown |
static int libusb_udev_isoch_transfer(IUDEVICE* idev, URBDRC_CHANNEL_CALLBACK* callback,
UINT32 MessageId, UINT32 RequestId, UINT32 EndpointAddress,
UINT32 TransferFlags, UINT32 StartFrame, UINT32 ErrorCount,
... | vuln | Vulnerable | C/C++ |
CImg<T>& _load_pandore(std::FILE *const file, const char *const filename) {
#define __cimg_load_pandore_case(nbdim,nwidth,nheight,ndepth,ndim,stype) \
cimg::fread(dims,nbdim,nfile); \
if (endian) cimg::invert_endianness(dims,nbdim); \
if ((ulongT)nwidth*nheight*ndepth*ndim>fsiz) \
thro... | vuln | Safe | Unknown |
@Override
public char charAt(final int index) {
// Temporarily disabled due to a rare condition upstream when we take this message
// and run it in a runnable, then this is still being evaluated past limit and it fails
//
//if (System.currentTimeMillis() > futureTimestampLimit)
// throw new RegexTimeoutExce... | vuln | Safe | Java |
enum SCP_SERVER_STATES_E
scp_v1s_mng_accept(struct SCP_CONNECTION *c, struct SCP_SESSION **s)
{
struct SCP_SESSION *session;
tui32 ipaddr;
tui16 cmd;
tui8 sz;
char buf[257];
/* reading command */
in_uint16_be(c->in_s, cmd);
if (cmd != 1) /* manager login */
{
return SCP_SER... | vuln | Vulnerable | C/C++ |
xmlParseStringPEReference(xmlParserCtxtPtr ctxt, const xmlChar **str) {
const xmlChar *ptr;
xmlChar cur;
xmlChar *name;
xmlEntityPtr entity = NULL;
if ((str == NULL) || (*str == NULL)) return(NULL);
ptr = *str;
cur = *ptr;
if (cur != '%')
return(NULL);
ptr++;
name = xmlP... | vuln | Safe | Unknown |
private static void rename(String oldFile, String newFile) {
if (!new File(oldFile).renameTo(new File(newFile))) {
logger.warn("Can't rename the file " + oldFile + " into " + newFile);
}
} | vuln | Vulnerable | Java |
/*
* Copyright 2002-2023 the original author or 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | vuln | Vulnerable | Java |
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onBreak(BlockBreakEvent e) {
final Block b = e.getBlock();
final Player p = e.getPlayer();
// If the shop was a chest
if (Util.canBeShop(b)) {
final Shop shop = getShopPlayer(b.getLocation(... | vuln | Vulnerable | Java |
export function escapeCommentText(value: string): string {
return value.replace(END_COMMENT, END_COMMENT_ESCAPED);
} | vuln | Vulnerable | JavaScript |
public void run() {
callback.showPrompts(name, instruction, prompts, new KeyboardInteractivePromptCompletor() {
@Override
public void complete() {
ByteArrayWriter baw = new ByteArrayWriter();
try {
baw.write(SSH_MSG_USERAUTH_INFO_RESPONSE);
baw.wri... | vuln | Safe | Java |
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | vuln | Vulnerable | Java |
sql_real_connect(char *host,char *database,char *user,char *password,
uint silent)
{
if (connected)
{
connected= 0;
mysql_close(&mysql);
}
mysql_init(&mysql);
if (opt_init_command)
mysql_options(&mysql, MYSQL_INIT_COMMAND, opt_init_command);
if (opt_connect_timeout)
{
uint timeout=opt_c... | vuln | Vulnerable | Unknown |
PassRefPtr<Attr> Element::setAttributeNode(Attr* attrNode, ExceptionCode& ec)
{
if (!attrNode) {
ec = TYPE_MISMATCH_ERR;
return 0;
}
RefPtr<Attr> oldAttrNode = attrIfExists(attrNode->qualifiedName());
if (oldAttrNode.get() == attrNode)
return attrNode; // This Attr is already at... | vuln | Vulnerable | C/C++ |
@register.filter
def json_dumps(value, indent=None):
if isinstance(value, QuerySet):
result = serialize('json', value, indent=indent)
else:
result = json.dumps(value, indent=indent, cls=DjbletsJSONEncoder)
return mark_safe(force_text(result).translate(_safe_js_escapes)) | vuln | Safe | Python |
public static void load(String originalName, ClassLoader loader) {
// Adjust expected name to support shading of native libraries.
String packagePrefix = calculatePackagePrefix().replace('.', '_');
String name = packagePrefix + originalName;
List<Throwable> suppressed = new ArrayList<>()... | vuln | Safe | Java |
static void prep_write_cb(struct bt_att_chan *chan, uint8_t opcode,
const void *pdu, uint16_t length,
void *user_data)
{
struct bt_gatt_server *server = user_data;
uint16_t handle = 0;
uint16_t offset;
struct gatt_db_attribute *attr;
struct prep_write_complete_data *pwcd;
uint8_t ecode, status;
if (le... | vuln | Safe | C/C++ |
cram_index *cram_index_query(cram_fd *fd, int refid, int pos,
cram_index *from) {
int i, j, k;
cram_index *e;
if (refid+1 < 0 || refid+1 >= fd->index_sz)
return NULL;
if (!from)
from = &fd->index[refid+1];
// Ref with nothing aligned against it.
if (!from->e)
return NULL;
// ... | vuln | Vulnerable | C/C++ |
public void disconnect(int reason, String description) {
if (description == null)
description = "Failure";
disconnectStarted = new Date();
if(Log.isInfoEnabled()) {
Log.info("Disconnect {} {}",
getConnectionAddress().toString(),
description);
}
postMessage(new DisconnectMessage(reason, descri... | vuln | Vulnerable | Java |
static void id3v2_read_ttag(AVFormatContext *s, int taglen, char *dst, int dstlen)
{
char *q;
int len;
if(dstlen > 0)
dst[0]= 0;
if(taglen < 1)
return;
taglen--;
dstlen--;
switch(get_byte(s->pb)) {
case 0:
q = dst;
while(taglen--) {
uint8_... | vuln | Safe | C/C++ |
def get_signature_status(signable, role=None, repository_name='default',
threshold=None, keyids=None):
"""
<Purpose>
Return a dictionary representing the status of the signatures listed in
'signable'. Signatures in the returned dictionary are identified by the
signature keyid and can have a status o... | vuln | Vulnerable | Python |
make_filter_table (PixopsFilter *filter)
{
int i_offset, j_offset;
int n_x = filter->x.n;
int n_y = filter->y.n;
gsize n_weights;
int *weights;
n_weights = SUBSAMPLE * SUBSAMPLE * n_x * n_y;
if (n_weights / (SUBSAMPLE * SUBSAMPLE * n_x) != n_y)
return NULL; /* overflow, bail */
weights = g_try_new... | vuln | Safe | Unknown |
static int pptp_bind(struct socket *sock, struct sockaddr *uservaddr,
int sockaddr_len)
{
struct sock *sk = sock->sk;
struct sockaddr_pppox *sp = (struct sockaddr_pppox *) uservaddr;
struct pppox_sock *po = pppox_sk(sk);
struct pptp_opt *opt = &po->proto.pptp;
int error = 0;
if (sockaddr_len < sizeof(struct ... | vuln | Safe | C/C++ |
static int
dbcs_ptr2len(char_u *p)
{
int len;
if (*p == NUL)
return 0;
// if the second byte is missing the length is 1
len = MB_BYTE2LEN(*p);
if (len == 2 && p[1] == NUL)
len = 1;
return len;
} | vuln | Safe | C/C++ |
int bdrv_get_dirty(BlockDriverState *bs, int64_t sector)
{
int64_t chunk = sector / (int64_t)BDRV_SECTORS_PER_DIRTY_CHUNK;
if (bs->dirty_bitmap &&
(sector << BDRV_SECTOR_BITS) < bdrv_getlength(bs)) {
return bs->dirty_bitmap[chunk / (sizeof(unsigned long) * 8)] &
(1 << (chunk % (sizeo... | vuln | Safe | C/C++ |
function update($vars, &$errors) {
if (!$vars['grace_period'])
$errors['grace_period'] = __('Grace period required');
elseif (!is_numeric($vars['grace_period']))
$errors['grace_period'] = __('Numeric value required (in hours)');
elseif ($vars['grace_period'] > 8760)
... | vuln | Vulnerable | PHP |
static int readContigStripsIntoBuffer (TIFF* in, uint8* buf)
{
uint8* bufp = buf;
int32 bytes_read = 0;
uint32 strip, nstrips = TIFFNumberOfStrips(in);
uint32 stripsize = TIFFStripSize(in);
uint32 rows = 0;
uint32 rps = TIFFGetFieldDefaulted(in, TIFFTAG_ROWSPERSTRIP, &... | vuln | Vulnerable | Unknown |
/* 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 | Safe | Python |
void cpu_reset(CPUSPARCState *env)
{
if (qemu_loglevel_mask(CPU_LOG_RESET)) {
qemu_log("CPU Reset (CPU %d)\n", env->cpu_index);
log_cpu_state(env, 0);
}
tlb_flush(env, 1);
env->cwp = 0;
#ifndef TARGET_SPARC64
env->wim = 1;
#endif
env->regwptr = env->regbase + (env->cwp * 16);
#if... | vuln | Vulnerable | C/C++ |
/** @file parse_rawml.c
* @brief Functions for parsing rawml markup
*
* Copyright (c) 2020 Bartek Fabiszewski
* http://www.fabiszewski.net
*
* This file is part of libmobi.
* Licensed under LGPL, either version 3, or any later.
* See <http://www.gnu.org/licenses/>
*/
#define _GNU_SOURCE 1
#ifndef __USE_BSD
#... | vuln | Vulnerable | C/C++ |
void intra_predict(VP8Context *s, uint8_t *dst[3], VP8Macroblock *mb,
int mb_x, int mb_y)
{
AVCodecContext *avctx = s->avctx;
int x, y, mode, nnz, tr;
if (!(avctx->flags & CODEC_FLAG_EMU_EDGE && !mb_y) && (s->deblock_filter || !mb_y))
xchg_mb_border(s->top_border[mb_x+1]... | vuln | Vulnerable | C/C++ |
@Override
public void onMessage(String message) {
try {
JSONObject json = new JSONObject(message);
String type = Helper.getJSONString("type", null, json);
if ("delta".equalsIgnoreCase(type) |... | vuln | Safe | Java |
@SubscribeEvent
public static void gatherData(GatherDataEvent event)
{
ExistingFileHelper exHelper = event.getExistingFileHelper();
StaticTemplateManager.EXISTING_HELPER = exHelper;
DataGenerator gen = event.getGenerator();
if(event.includeServer())
{
BlockTagsProvider blockTags = new IEBlockTags(gen, ex... | vuln | Vulnerable | Java |
static int cpu_sparc_find_by_name(sparc_def_t *cpu_def, const char *cpu_model)
{
unsigned int i;
const sparc_def_t *def = NULL;
char *s = strdup(cpu_model);
char *featurestr, *name = strtok(s, ",");
uint32_t plus_features = 0;
uint32_t minus_features = 0;
uint64_t iu_version;
uint32_t fp... | vuln | Vulnerable | C/C++ |
reexec_userns_join (int userns, int mountns, char *pause_pid_file_path)
{
pid_t ppid = getpid ();
char uid[16];
char gid[16];
char **argv;
int pid;
char *cwd = getcwd (NULL, 0);
sigset_t sigset, oldsigset;
if (cwd == NULL)
{
fprintf (stderr, "error getting current working directory: %s\n", st... | vuln | Vulnerable | Unknown |
int vhost_dev_enable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev)
{
BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev)));
VirtioBusState *vbus = VIRTIO_BUS(qbus);
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(vbus);
int i, r;
if (!k->set_host_notifier) {
fprintf(stderr, "binding does ... | vuln | Safe | C/C++ |
asn1_header_decode(struct asn1_ctx *ctx,
unsigned char **eoc,
unsigned int *cls, unsigned int *con, unsigned int *tag)
{
unsigned int def = 0;
unsigned int len = 0;
if (!asn1_id_decode(ctx, cls, con, tag))
return 0;
if (!asn1_length_decode(ctx, &def, &len))
return 0;
/* primitive shall be definite... | vuln | Safe | Unknown |
static int coroutine_fn cow_read(BlockDriverState *bs, int64_t sector_num,
uint8_t *buf, int nb_sectors)
{
BDRVCowState *s = bs->opaque;
int ret, n;
while (nb_sectors > 0) {
ret = cow_co_is_allocated(bs, sector_num, nb_sectors, &n);
if (ret < 0) {
... | vuln | Safe | 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 |
static int _gdImageWebpCtx (gdImagePtr im, gdIOCtx * outfile, int quality)
{
uint8_t *argb;
int x, y;
uint8_t *p;
uint8_t *out;
size_t out_size;
int ret = 0;
if (im == NULL) {
return 1;
}
if (!gdImageTrueColor(im)) {
gd_error("Palette image not supported by webp");
return 1;
}
if (quality == -1) ... | vuln | Vulnerable | C/C++ |
crypto_retrieve_X509_sans(krb5_context context,
pkinit_plg_crypto_context plgctx,
pkinit_req_crypto_context reqctx,
X509 *cert,
krb5_principal **princs_ret,
krb5_principal **upn_ret,
... | vuln | Safe | C/C++ |
FASTCALL_MSVC decode_string ( struct DecoderState *ds)
{
int index;
JSUINT32 *escOffset;
JSUINT32 *escStart;
size_t escLen = (ds->escEnd - ds->escStart);
JSUINT8 *inputOffset;
JSUTF16 ch = 0;
JSUINT8 *lastHighSurrogate = NULL;
JSUINT8 oct;
JSUTF32 ucs;
ds->lastType = JT_INVALID;
ds->start ++;
i... | vuln | Safe | C/C++ |
bucket_insert (index_bucket *bucket,
CK_OBJECT_HANDLE handle)
{
unsigned int alloc;
int at = 0;
if (bucket->elem) {
at = binary_search (bucket->elem, 0, bucket->num, handle);
if (at < bucket->num && bucket->elem[at] == handle)
return;
}
alloc = alloc_size (bucket->num);
if (bucket->num + 1... | vuln | Vulnerable | Unknown |
@Inject(method = "<init>*", at = @At("RETURN"))
private void onConstructed(CallbackInfo ci) {
if(VoiceClient.serverConfig == null) {
return;
}
SocialInteractionsManager socialInteractionsManager = client.getSocialInteractionsManager();
if (!client.player.getGameProfile(... | vuln | Safe | Java |
private void loadMoreWhenEndReached(@NonNull RecyclerView recyclerView, int dy) {
if (recyclerView.getLayoutManager() instanceof GridLayoutManager) {
GridLayoutManager gridLayoutManager = (GridLayoutManager) recyclerView.getLayoutManager();
// scroll down
if (dy > 0 && !phot... | vuln | Safe | Java |
int expand_upwards(struct vm_area_struct *vma, unsigned long address)
{
struct mm_struct *mm = vma->vm_mm;
struct vm_area_struct *next;
unsigned long gap_addr;
int error = 0;
if (!(vma->vm_flags & VM_GROWSUP))
return -EFAULT;
/* Guard against wrapping around to address 0. */
address &= PAGE_MASK;
address +=... | vuln | Safe | Unknown |
private void algAttackChanged() {
JComboBox<String> jCB = jwtST.getNoneAttackComboBox();
switch (jCB.getSelectedIndex()) {
default:
case 0:
algAttackMode = null;
break;
case 1:
algAttackMode = "none";
break;
case 2:
algAttackMode = "None";
break;
case 3:
algAttackMode = "nOnE";
bre... | vuln | Vulnerable | Java |
void release_pkcs11_module(pkcs11_handle_t *h)
{
SECStatus rv;
close_pkcs11_session(h);
if (h->is_user_module) {
rv = SECMOD_UnloadUserModule(h->module);
if (rv != SECSuccess) {
DBG1("Unloading UserModule failed: %s", SECU_Strerror(PR_GetError()));
}
}
if (h->module) {
SECMOD_DestroyMod... | vuln | Safe | Unknown |
static MagickBooleanType WriteSGIImage(const ImageInfo *image_info,Image *image)
{
CompressionType
compression;
const char
*value;
MagickBooleanType
status;
MagickOffsetType
scene;
MagickSizeType
number_pixels;
MemoryInfo
*pixel_info;
SGIInfo
iris_info;
register const ... | vuln | Safe | Unknown |
##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | vuln | Vulnerable | Python |
static int jpc_pi_nextrpcl(register jpc_pi_t *pi)
{
int rlvlno;
jpc_pirlvl_t *pirlvl;
jpc_pchg_t *pchg;
int prchind;
int prcvind;
int *prclyrno;
int compno;
jpc_picomp_t *picomp;
int xstep;
int ystep;
uint_fast32_t r;
uint_fast32_t rpx;
uint_fast32_t rpy;
uint_fast32_t trx0;
uint_fast32_t try0;
pchg = ... | vuln | Vulnerable | C/C++ |
it 'should return the right response' do
email_token.update!(created_at: 999.years.ago)
post "/session/email-login/#{email_token.token}.json"
expect(response.status).to eq(200)
expect(JSON.parse(response.body)["error"]).to eq(
I18n.t('email_login.invalid_token')
... | vuln | Safe | Ruby |
#include "cache.h"
#include "object-store.h"
#include "repository.h"
#include "object.h"
#include "attr.h"
#include "blob.h"
#include "tree.h"
#include "tree-walk.h"
#include "commit.h"
#include "tag.h"
#include "fsck.h"
#include "refs.h"
#include "url.h"
#include "utf8.h"
#include "decorate.h"
#include "oidset.h"
#inc... | vuln | Safe | C/C++ |
private void showAddWord() {
if (currentInputConnection == null) {
return;
}
currentInputConnection.finishComposingText();
clearSuggestions();
UI.showAddWordDialog(this, mLanguage.getId(), InputFieldHelper.getSurroundingWord(currentInputConnection));
} | vuln | Safe | Java |
static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof)
{
char *ksep, *vsep, *val;
size_t klen, vlen;
size_t new_vlen;
if (var->ptr >= var->end) {
return 0;
}
vsep = memchr(var->ptr, '&', var->end - var->ptr);
if (!vsep) {
if (!eof) {
return 0;
} else {
vsep = var->end;
}
}... | vuln | Vulnerable | C/C++ |
static av_cold int libopus_decode_init(AVCodecContext *avc)
{
struct libopus_context *opus = avc->priv_data;
int ret, channel_map = 0, gain_db = 0, nb_streams, nb_coupled;
uint8_t mapping_arr[8] = { 0, 1 }, *mapping;
avc->sample_rate = 48000;
avc->sample_fmt = avc->request_sample_fmt == AV_SA... | vuln | Vulnerable | C/C++ |
package server
import (
"context"
"errors"
"fmt"
"sort"
"sync"
"time"
"github.com/ipfs/go-cid"
blockstore "github.com/ipfs/go-ipfs-blockstore"
"github.com/ipfs/go-libipfs/bitswap/internal/defaults"
"github.com/ipfs/go-libipfs/bitswap/message"
pb "github.com/ipfs/go-libipfs/bitswap/message/pb"
bmetrics "gi... | vuln | Vulnerable | Go |
static int mp_decode_frame(MPADecodeContext *s, OUT_INT **samples,
const uint8_t *buf, int buf_size)
{
int i, nb_frames, ch, ret;
OUT_INT *samples_ptr;
init_get_bits(&s->gb, buf + HEADER_SIZE, (buf_size - HEADER_SIZE) * 8);
if (s->error_protection)
skip_bits(&s->g... | vuln | Safe | C/C++ |
static struct ldb_parse_tree *ldap_decode_filter_tree(TALLOC_CTX *mem_ctx,
struct asn1_data *data)
{
uint8_t filter_tag;
struct ldb_parse_tree *ret;
if (!asn1_peek_uint8(data, &filter_tag)) {
return NULL;
}
filter_tag &= 0x1f; /* strip off the asn1 stuff */
ret = talloc(mem_ctx, struct ldb_parse... | vuln | Vulnerable | Unknown |
function escapeArgPowerShell(arg, interpolation, quoted) {
let result = arg.replace(/\0/g, "").replace(/`/g, "``").replace(/\$/g, "`$$");
if (interpolation) {
result = result
.replace(/\n|\r/g, " ")
.replace(/(^|\s|\u0085)([*1-6]?)(>)/g, "$1$2`$3")
.replace(/(^|\s|\u0085)([#\-:<@\]])/g, "$1`$... | vuln | Safe | JavaScript |
int ff_hevc_decode_short_term_rps(GetBitContext *gb, AVCodecContext *avctx,
ShortTermRPS *rps, const HEVCSPS *sps, int is_slice_header)
{
uint8_t rps_predict = 0;
int delta_poc;
int k0 = 0;
int k1 = 0;
int k = 0;
int i;
if (rps != sps->st_rps && sps->nb_st_... | vuln | Safe | C/C++ |
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2014-2020, NVIDIA CORPORATION. All rights reserved.
*/
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/mailbox_client.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/phy/phy.h>
#include <linux/... | vuln | Vulnerable | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.