code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
patches.forEach(patch => {
const {path, op} = patch
let base: any = draft
for (let i = 0; i < path.length - 1; i++) {
const parentType = getArchtype(base)
const p = "" + path[i]
// See #738, avoid prototype pollution
if (
(parentType === Archtype.Object || parentType === Archtype.Array) &... | vuln | Safe | JavaScript |
public static Typeface loadTypeface(Context context, int font) {
if (fontArray.get(font) == null) {
try {
File file = new File(context.getApplicationInfo().dataDir
+ "/fonts");
if (!file.exists()) {
file.mkdirs();
}
file = new File(file, Integer.toHexString(font));
if (file.exists())... | vuln | Safe | Java |
def get(self):
"""Cron handler that hard-deletes all models that were marked as deleted
(have deleted field set to True) more than some period of time ago.
Also, for some types of models (that we shouldn't keep for long time)
mark them as deleted if they were last updated more than some ... | vuln | Vulnerable | Python |
@Override
public <T> Publisher<T> executeReactiveWithLockReactive(MailboxPath path, Publisher<T> execution, LockType lockType) {
StampedLock stampedLock = getStampedLock(path);
switch (lockType) {
case Read:
return Mono.using(stampedLock::readLock,
sta... | vuln | Safe | Java |
private void drawIcon(ItemStack item, int slotX, int slotY) {
if (!(item instanceof UnidentifiedItemStack unidentifiedItem)) return;
RenderUtils.drawTexturedRect(
new PoseStack(),
Texture.GEAR_ICONS.resource(),
slotX + 2,
slotY + 2,
... | vuln | Vulnerable | Java |
static void opl3_panning(int dev, int voice, int value)
{
if (voice < 0 || voice >= devc->nr_voice)
return;
devc->voc[voice].panning = value;
} | vuln | Safe | C/C++ |
static void flush_queued_data(VirtIOSerialPort *port, bool discard)
{
assert(port);
do_flush_queued_data(port, port->ovq, &port->vser->vdev, discard);
} | vuln | Safe | C/C++ |
xmlNodePtr SimpleXMLElement_exportNode(const Object& sxe) {
if (!sxe->instanceof(SimpleXMLElement_classof())) return nullptr;
auto data = Native::data<SimpleXMLElement>(sxe.get());
return php_sxe_get_first_node(data, data->nodep());
} | vuln | Safe | C/C++ |
void apply_sample_adaptive_offset_sequential(de265_image* img)
{
const seq_parameter_set& sps = img->get_sps();
if (sps.sample_adaptive_offset_enabled_flag==0) {
return;
}
int lumaImageSize = img->get_image_stride(0) * img->get_height(0) * img->get_bytes_per_pixel(0);
int chromaImageSize = img->get_im... | vuln | Vulnerable | Unknown |
static void sasl_input(sasl_message_t *smsg)
{
sasl_session_t *p = make_session(smsg->uid, smsg->server);
int len = strlen(smsg->buf);
char *tmpbuf;
int tmplen;
switch(smsg->mode)
{
case 'H':
/* (H)ost information */
p->host = sstrdup(smsg->buf);
p->ip = sstrdup(smsg->ext);
return;
case 'S':
/* (S... | vuln | Safe | Unknown |
@Override
public void scrollSelectionIntoView() {
if (selectedIndices.isEmpty()) { return; }
ItemInfo itemInfo = orderedItems.get(selectedIndices.get(0));
getScroller().scrollIntoView(itemInfo);
} | vuln | Vulnerable | Java |
static int mtv_read_header(AVFormatContext *s)
{
MTVDemuxContext *mtv = s->priv_data;
AVIOContext *pb = s->pb;
AVStream *st;
unsigned int audio_subsegments;
avio_skip(pb, 3);
mtv->file_size = avio_rl32(pb);
mtv->segments = avio_rl32(pb);
avio_skip(pb, 32);
... | vuln | Vulnerable | C/C++ |
public Logger getLogger(String category) {
return new Log4JLogger(category, org.apache.log4j.Logger
.getLogger(category));
} | vuln | Vulnerable | Java |
def validate_code(cls, code, code_validations: Dict[str, Any]):
try:
code_tree = ast.parse(code)
except (SyntaxError, UnicodeDecodeError):
raise ValueError(f"Generated code is not valid python code: {code}")
except TypeError:
raise ValueError(f"Generated code ... | vuln | Vulnerable | Python |
void OffscreenCanvasFrameReceiverImpl::SubmitCompositorFrame(
const cc::SurfaceId& surface_id,
cc::CompositorFrame frame) {
cc::Surface* surface = GetSurfaceManager()->GetSurfaceForId(surface_id);
if (surface) {
surface->QueueFrame(std::move(frame), base::Closure());
}
} | vuln | Vulnerable | C/C++ |
static void host_callback(void *arg, int status, int timeouts,
unsigned char *abuf, int alen)
{
struct host_query *hquery = (struct host_query*)arg;
int addinfostatus = ARES_SUCCESS;
hquery->timeouts += timeouts;
hquery->remaining--;
if (status == ARES_SUCCESS)
{
addinfost... | vuln | Safe | C/C++ |
function escape_command($command) {
return preg_replace("/(\\\$|;`)/", "", $command);
} | vuln | Safe | PHP |
struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data)
{
int ret = -ENOMEM, i, node;
struct io_wq *wq;
wq = kcalloc(1, sizeof(*wq), GFP_KERNEL);
if (!wq)
return ERR_PTR(-ENOMEM);
wq->nr_wqes = num_online_nodes();
wq->wqes = kcalloc(wq->nr_wqes, sizeof(struct io_wqe *), GFP_KERNEL);
if (!wq->wq... | vuln | Safe | Unknown |
void decode_mb_mode(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y,
uint8_t *segment, uint8_t *ref, int layout, int is_vp7)
{
VP56RangeCoder *c = &s->c;
static const char *vp7_feature_name[] = { "q-index",
"lf-delta",
... | vuln | Vulnerable | C/C++ |
nfssvc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd_writeargs *args)
{
unsigned int len, hdr, dlen;
struct kvec *head = rqstp->rq_arg.head;
int v;
p = decode_fh(p, &args->fh);
if (!p)
return 0;
p++; /* beginoffset */
args->offset = ntohl(*p++); /* offset */
p++; /* totalcount *... | vuln | Vulnerable | C/C++ |
private static void movePage(int number) {
currPageNumber += number;
} | vuln | Vulnerable | Java |
/*
** gc.c - garbage collector for mruby
**
** See Copyright Notice in mruby.h
*/
#include <string.h>
#include <stdlib.h>
#include <mruby.h>
#include <mruby/array.h>
#include <mruby/class.h>
#include <mruby/data.h>
#include <mruby/hash.h>
#include <mruby/proc.h>
#include <mruby/range.h>
#include <mruby/string.h>
#incl... | vuln | Vulnerable | C/C++ |
static void spapr_finalize_fdt(sPAPREnvironment *spapr,
target_phys_addr_t fdt_addr,
target_phys_addr_t rtas_addr,
target_phys_addr_t rtas_size)
{
int ret;
void *fdt;
sPAPRPHBState *phb;
fdt = g_malloc(FDT_MAX_S... | vuln | Vulnerable | C/C++ |
xmlParseNameComplex(xmlParserCtxtPtr ctxt) {
int len = 0, l;
int c;
int count = 0;
#ifdef DEBUG
nbParseNameComplex++;
#endif
/*
* Handler for more complex cases
*/
GROW;
if (ctxt->instate == XML_PARSER_EOF)
return(NULL);
c = CUR_CHAR(l);
if ((ctxt->options & XML_P... | vuln | Vulnerable | C/C++ |
function refreshTags(tags, selected)
{
tagCloud.innerHTML = '';
if (tags.length > 0)
{
var table = document.createElement('table');
table.setAttribute('cellpadding', '2');
table.style.boxSizing = 'border-box';
table.style.tableLayout = 'fixed';
table.style.width = '100%';
var tbod... | vuln | Vulnerable | JavaScript |
static int nc_email(ASN1_IA5STRING *eml, ASN1_IA5STRING *base)
{
const char *baseptr = (char *)base->data;
const char *emlptr = (char *)eml->data;
const char *baseat = strchr(baseptr, '@');
const char *emlat = strchr(emlptr, '@');
if (!emlat)
return X509_V_ERR_UNSUPPORTED_NAME_SYNTAX;
/... | vuln | Vulnerable | Unknown |
private void setOptions() {
if (view == null || getContext() == null)
return;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
String startup = prefs.getString("startup", "unified");
String[] startupValues = getResources().getStringArra... | vuln | Safe | Java |
NIAddSpell(IspellDict *Conf, const char *word, const char *flag)
{
if (Conf->nspell >= Conf->mspell)
{
if (Conf->mspell)
{
Conf->mspell *= 2;
Conf->Spell = (SPELL **) repalloc(Conf->Spell, Conf->mspell * sizeof(SPELL *));
}
else
{
Conf->mspell = 1024 * 20;
Conf->Spell = (SPELL **) tmpalloc(Conf-... | vuln | Vulnerable | Unknown |
@Override
public void onChange(boolean selfChange, Uri uri) {
// TODO(b/198002034): Content observers currently can still be called back after being
// unregistered, and in this case we can ignore the change if the nav bar has been
// destroyed already
if (mNaviga... | vuln | Safe | Java |
const got = require('@/utils/got');
const cheerio = require('cheerio');
const iconv = require('iconv-lite');
const timezone = require('@/utils/timezone');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const rootUrl = ctx.path.split('/').slice(1, 4).join('/');
const curr... | vuln | Vulnerable | JavaScript |
Prism.languages.neon = {
'comment': {
pattern: /#.*/,
greedy: true
},
'datetime': {
pattern: /(^|[[{(=:,\s])\d\d\d\d-\d\d?-\d\d?(?:(?:[Tt]| +)\d\d?:\d\d:\d\d(?:\.\d*)? *(?:Z|[-+]\d\d?(?::?\d\d)?)?)?(?=$|[\]}),\s])/,
lookbehind: true,
alias: 'number'
},
'key': {
pattern: /(^|[[{(,\s])[^,:=[\]{}()'"\s]+(... | vuln | Vulnerable | JavaScript |
static int
same_leader(
linenr_T lnum,
int leader1_len,
char_u *leader1_flags,
int leader2_len,
char_u *leader2_flags)
{
int idx1 = 0, idx2 = 0;
char_u *p;
char_u *line1;
char_u *line2;
if (leader1_len == 0)
return (leader2_len == 0);
// If first leader ha... | vuln | Vulnerable | C/C++ |
void bpf_jit_compile(struct sk_filter *fp)
{
u8 temp[64];
u8 *prog;
unsigned int proglen, oldproglen = 0;
int ilen, i;
int t_offset, f_offset;
u8 t_op, f_op, seen = 0, pass;
u8 *image = NULL;
u8 *func;
int pc_ret0 = -1; /* bpf index of first RET #0 instruction (if any) */
unsigned int cleanup_addr; /* epilogu... | vuln | Vulnerable | C/C++ |
static void iwl_sta_ucode_activate(struct iwl_priv *priv, u8 sta_id)
{
if (!(priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE))
IWL_ERR(priv, "ACTIVATE a non DRIVER active station id %u "
"addr %pM\n",
sta_id, priv->stations[sta_id].sta.sta.addr);
if (priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE... | vuln | Vulnerable | C/C++ |
public void downloadFile(URL u, File localFile) throws IOException {
logger.info("Downloading " + u);
File tmp = File.createTempFile("tmp","phosphosite");
InputStream is = u.openStream();
BufferedInputStream in = new BufferedInputStream(is);
FileOutputStream w = new FileOutputStream(tmp);
int i= 0;
... | vuln | Vulnerable | Java |
private static void correctGenotypePloidy(final GenotypeBuilder builder, final Genotype g, final int ploidy,
final Allele refAllele) {
final ArrayList<Allele> alleles = new ArrayList<>(g.getAlleles().stream().filter(a -> !a.isNoCall()).collect(Collectors.toList()));... | vuln | Safe | Java |
/* Copyright 2020 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 |
int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info)
{
struct fib6_node *fn, *pn = NULL;
int err = -ENOMEM;
int allow_create = 1;
int replace_required = 0;
if (info->nlh) {
if (!(info->nlh->nlmsg_flags & NLM_F_CREATE))
allow_create = 0;
if (info->nlh->nlmsg_flags & NLM_F_REPLACE)... | vuln | Safe | C/C++ |
const GitHubApi = require('github');
const Menu = require('terminal-menu');
const {
execSync
} = require('child_process');
const parse = require('parse-github-repo-url');
class Pullit {
constructor() {
this.init();
this.github = new GitHubApi({});
}
init() {
const url = execSync(`git config --get ... | vuln | Vulnerable | JavaScript |
int X509_check_trust(X509 *x, int id, int flags)
{
X509_TRUST *pt;
int idx;
/* We get this as a default value */
if (id == 0) {
int rv;
rv = obj_trust(NID_anyExtendedKeyUsage, x, 0);
if (rv != X509_TRUST_UNTRUSTED)
return rv;
return trust_compat(NULL, x, 0);
... | vuln | Vulnerable | Unknown |
parse_group_prop_ntr_selection_method(struct ofpbuf *payload,
enum ofp11_group_type group_type,
enum ofp15_group_mod_command group_cmd,
struct ofputil_group_props *gp)
{
struct ntr_group_prop_selection_... | vuln | Vulnerable | C/C++ |
static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
AVPacket *avpkt)
{
PCXContext * const s = avctx->priv_data;
AVFrame *picture = data;
AVFrame * const p = &s->picture;
GetByteContext gb;
int compressed, xmin, ymin, xmax, ymax, ret;
unsigne... | vuln | Safe | C/C++ |
void cli_set_container(cli_ctx *ctx, cli_file_t type, size_t size)
{
ctx->containers[ctx->recursion].type = type;
ctx->containers[ctx->recursion].size = size;
if (type >= CL_TYPE_MSEXE && type != CL_TYPE_OTHER && type != CL_TYPE_IGNORED)
ctx->containers[ctx->recursion].flag = CONTAINER_FLAG_VALID;
... | vuln | Safe | Unknown |
void AppCacheUpdateJob::OnDestructionImminent(AppCacheHost* host) {
PendingMasters::iterator found =
pending_master_entries_.find(host->pending_master_entry_url());
DCHECK(found != pending_master_entries_.end());
PendingHosts& hosts = found->second;
PendingHosts::iterator it = std::find(hosts.begin(),... | vuln | Vulnerable | C/C++ |
bool Document::SetFocusedElement(Element* new_focused_element,
const FocusParams& params) {
DCHECK(!lifecycle_.InDetach());
clear_focused_element_timer_.Stop();
if (new_focused_element && (new_focused_element->GetDocument() != this))
return true;
if (NodeChildRemovalTrack... | vuln | Safe | Unknown |
write_f(int argc, char **argv)
{
struct timeval t1, t2;
int Cflag = 0, pflag = 0, qflag = 0;
int c, cnt;
char *buf;
int64_t offset;
int count;
int total = 0;
int pattern = 0xcd;
while ((c = getopt(argc, argv, "CpP:q")) != EOF) {
switch (c) {
case 'C':
Cflag = 1;
break;
case 'p':
... | vuln | Vulnerable | C/C++ |
parse_tag_11_packet(unsigned char *data, unsigned char *contents,
size_t max_contents_bytes, size_t *tag_11_contents_size,
size_t *packet_size, size_t max_packet_size)
{
size_t body_size;
size_t length_size;
int rc = 0;
(*packet_size) = 0;
(*tag_11_contents_size) = 0;
/* This format is inspired by Op... | vuln | Vulnerable | Unknown |
PHP_METHOD(Phar, buildFromDirectory)
{
char *dir, *error, *regex = NULL;
size_t dir_len, regex_len = 0;
zend_bool apply_reg = 0;
zval arg, arg2, iter, iteriter, regexiter;
struct _phar_t pass;
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
zend_throw_exception_ex(spl_ce_Unexpec... | vuln | Safe | C/C++ |
else{var z=c.getFileData(!0,null,null,null,null,!0),L=A.getGraphBounds(),M=Math.floor(L.width*m/A.view.scale),n=Math.floor(L.height*m/A.view.scale);if(z.length<=MAX_REQUEST_SIZE&&M*n<MAX_AREA)if(c.hideDialog(),"png"!=g&&"jpg"!=g&&"jpeg"!=g||!c.isExportToCanvas()){var y={globalVars:A.getExportVariables()};x&&(y.grid={si... | vuln | Vulnerable | JavaScript |
private <T extends TransportResponse> void sendWithUser(
Transport.Connection connection,
String action,
TransportRequest request,
TransportRequestOptions options,
TransportResponseHandler<T> handler,
AsyncSender sender
) {
if (securityContext.getAuthenticatio... | vuln | Safe | Java |
void ManualFillingControllerImpl::OnGenerationRequested() {
DCHECK(pwd_controller_);
pwd_controller_->OnGenerationRequested();
} | vuln | Vulnerable | C/C++ |
sub_font_params(gs_memory_t *mem, const ref *op, gs_matrix *pmat, gs_matrix *pomat, ref *pfname)
{
ref *pmatrix, *pfontname, *pfontstyle, *porigfont, *pfontinfo;
if (dict_find_string(op, "FontMatrix", &pmatrix) <= 0 ||
read_matrix(mem, pmatrix, pmat) < 0
)
return_error(gs_error_invalidf... | vuln | Vulnerable | Unknown |
@Override
public void registerAuthenticationHandlerWithPrincipalResolver(final AuthenticationHandler handler,
final PrincipalResolver principalResolver) {
if (BeanSupplier.isNotProxy(handler)) {
LOGGER.trace("Registering handler ... | vuln | Safe | Java |
static int parse_hex8(DeviceState *dev, Property *prop, const char *str)
{
uint8_t *ptr = qdev_get_prop_ptr(dev, prop);
char *end;
if (str[0] != '0' || str[1] != 'x') {
return -EINVAL;
}
*ptr = strtoul(str, &end, 16);
if ((*end != '\0') || (end == str)) {
return -EINVAL;
}
... | vuln | Safe | C/C++ |
public void closeContext() {
EXTThreadLocalContext.alcSetThreadContext(0L);
checkAlcError(device);
} | vuln | Safe | Java |
def rebuild_auth(self, prepared_request, response):
"""When being redirected we may want to strip authentication from the
request to avoid leaking credentials. This method intelligently removes
and reapplies authentication where possible to avoid credential loss.
"""
headers = pr... | vuln | Safe | Python |
function OA_runMPE()
{
$objResponse = new xajaxResponse();
$objResponse->addAssign("run-mpe", "innerHTML", "<img src='run-mpe.php' />");
return $objResponse;
} | vuln | Vulnerable | PHP |
/*
* 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 ... | vuln | Safe | Java |
def _call(
self,
inputs: Dict[str, Any],
run_manager: Optional[CallbackManagerForChainRun] = None,
) -> Dict[str, str]:
_run_manager = run_manager or CallbackManagerForChainRun.get_noop_manager()
code = self.llm_chain.predict(
stop=[self.stop], callbacks=_run_mana... | vuln | Safe | Python |
Prism.languages.rest={table:[{pattern:/(\s*)(?:\+[=-]+)+\+(?:\r?\n|\r)(?:\1(?:[+|].+)+[+|](?:\r?\n|\r))+\1(?:\+[=-]+)+\+/,lookbehind:!0,inside:{punctuation:/\||(?:\+[=-]+)+\+/}},{pattern:/(\s*)(?:=+ +)+=+(?:(?:\r?\n|\r)\1.+)+(?:\r?\n|\r)\1(?:=+ +)+=+(?=(?:\r?\n|\r){2}|\s*$)/,lookbehind:!0,inside:{punctuation:/[=-]+/}}]... | vuln | Vulnerable | JavaScript |
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;
if (gp_validate_path(mem, fname, access) !... | vuln | Vulnerable | Unknown |
@auth.public
def get(self, build_id):
try:
build_id = int(build_id)
except ValueError:
self.response.write('invalid build id')
self.abort(400)
build = model.Build.get_by_id(build_id)
can_view = build and user.can_view_build_async(build).get_result()
if not can_view:
if au... | vuln | Safe | Python |
public void doTest(
String testname,
KeyPairGenerator g,
String cipher,
IESParameterSpec p)
throws Exception
{
byte[] message = Hex.decode("0102030405060708090a0b0c0d0e0f10111213141516");
byte[] out1, out2;
// Gener... | vuln | Vulnerable | Java |
static void fio_signal_handler_setup(void) {
/* setup signal handling */
struct sigaction act;
if (fio_old_sig_int.sa_handler)
return;
memset(&act, 0, sizeof(act));
act.sa_handler = sig_int_handler;
sigemptyset(&act.sa_mask);
act.sa_flags = SA_RESTART | SA_NOCLDSTOP;
if (sigaction(SIGINT, &act, &... | vuln | Vulnerable | C/C++ |
#
# The Python Imaging Library
# $Id$
#
# map CSS3-style colour description strings to RGB
#
# History:
# 2002-10-24 fl Added support for CSS-style color strings
# 2002-12-15 fl Added RGBA support
# 2004-03-27 fl Fixed remaining int() problems for Python 1.5.2
# 2004-07-19 fl Fixed gray/grey spelling issues
# 2... | vuln | Vulnerable | Python |
static int __br_mdb_del(struct net_bridge *br, struct br_mdb_entry *entry)
{
struct net_bridge_mdb_htable *mdb;
struct net_bridge_mdb_entry *mp;
struct net_bridge_port_group *p;
struct net_bridge_port_group __rcu **pp;
struct br_ip ip;
int err = -EINVAL;
if (!netif_running(br->dev) || br->multicast_disabled)
... | vuln | Vulnerable | C/C++ |
PrintMsg_Print_Params::PrintMsg_Print_Params()
: page_size(),
content_size(),
printable_area(),
margin_top(0),
margin_left(0),
dpi(0),
min_shrink(0),
max_shrink(0),
desired_dpi(0),
document_cookie(0),
selection_only(false),
supports_alpha_blend(false),
preview_ui_id(... | vuln | Safe | C/C++ |
PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
zval *subpats, int global, int use_flags, long flags, long start_offset TSRMLS_DC)
{
zval *result_set, /* Holds a set of subpatterns after
a global match */
**match_sets = NULL; /* An arra... | vuln | Safe | Unknown |
#define PGEN
#include "parsetok.c"
| vuln | Safe | Python |
static inline void ConvertLuvToXYZ(const double L,const double u,const double v,
double *X,double *Y,double *Z)
{
double
gamma;
assert(X != (double *) NULL);
assert(Y != (double *) NULL);
assert(Z != (double *) NULL);
if (L > (CIEK*CIEEpsilon))
*Y=(double) pow((L+16.0)/116.0,3.0);
else
*Y=L/C... | vuln | Vulnerable | Unknown |
static MagickBooleanType SetGrayscaleImage(Image *image)
{
CacheView
*image_view;
ExceptionInfo
*exception;
MagickBooleanType
status;
PixelPacket
*colormap;
register ssize_t
i;
ssize_t
*colormap_index,
j,
y;
assert(image != (Image *) NULL);
assert(image->signature =... | vuln | Vulnerable | C/C++ |
static int iff_read_header(AVFormatContext *s)
{
IffDemuxContext *iff = s->priv_data;
AVIOContext *pb = s->pb;
AVStream *st;
uint8_t *buf;
uint32_t chunk_id, data_size;
uint32_t screenmode = 0, num, den;
unsigned transparency = 0;
unsigned masking = 0;
uint8_t fmt[16];
int fmt_s... | vuln | Safe | C/C++ |
static int vqf_read_header(AVFormatContext *s)
{
VqfContext *c = s->priv_data;
AVStream *st = avformat_new_stream(s, NULL);
int chunk_tag;
int rate_flag = -1;
int header_size;
int read_bitrate = 0;
int size;
uint8_t comm_chunk[12];
if (!st)
return AVERROR(ENOMEM);
avio_s... | vuln | Vulnerable | C/C++ |
static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t size,
int flags)
{
struct sock_iocb *siocb = kiocb_to_siocb(iocb);
struct scm_cookie tmp_scm;
struct sock *sk = sock->sk;
struct unix_sock *u = unix_sk(sk);
struct sockaddr_un *sunaddr = msg->msg_... | vuln | Vulnerable | C/C++ |
/*
*
* Copyright 2019 Asylo authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | vuln | Vulnerable | C/C++ |
private void sortGroups() {
if (mapMarkersGroups.size() > 0) {
AndroidUtils.sortCopyOnWriteList(mapMarkersGroups, (group1, group2) -> {
long t1 = group1.getCreationDate();
long t2 = group2.getCreationDate();
return (t1 > t2) ? -1 : ((t1 == t2) ? 0 : 1);
});
}
} | vuln | Safe | Java |
function copyRecurse(source, destination) {
var h = destination.$$hashKey;
var key;
if (isArray(source)) {
for (var i = 0, ii = source.length; i < ii; i++) {
destination.push(copyElement(source[i]));
}
} else if (isBlankObject(source)) {
// createMap() fast path --- Safe to avoid hasOwnProperty che... | vuln | Safe | JavaScript |
#include "curveMath.h"
#include <string.h>
int pointZZ_pEqual(const PointZZ_p * op1, const PointZZ_p * op2) {
// check x coords
if(mpz_cmp(op1->x, op2->x) != 0) {
return 0;
}
// check y coords
if(mpz_cmp(op1->y, op2->y) != 0) {
return 0;
}
return 1;
}
int pointZZ_pIsIdent... | vuln | Safe | C/C++ |
static unsigned int mszh_decomp(unsigned char * srcptr, int srclen, unsigned char * destptr, unsigned int destsize)
{
unsigned char *destptr_bak = destptr;
unsigned char *destptr_end = destptr + destsize;
unsigned char mask = 0;
unsigned char maskbit = 0;
unsigned int ofs, cnt;
while (srclen > 0... | vuln | Safe | C/C++ |
_Unpickler_ResizeMemoList(UnpicklerObject *self, Py_ssize_t new_size)
{
Py_ssize_t i;
assert(new_size > self->memo_size);
PyObject **memo_new = self->memo;
PyMem_RESIZE(memo_new, PyObject *, new_size);
if (memo_new == NULL) {
PyErr_NoMemory();
return -1;
}
self->memo = memo... | vuln | Vulnerable | C/C++ |
TfLiteStatus ResizeOutput(TfLiteContext* context, TfLiteNode* node) {
TfLiteIntArray* output_shape = GetOutputShape(context, node);
std::unique_ptr<TfLiteIntArray, void (*)(TfLiteIntArray*)>
scoped_output_shape(output_shape, TfLiteIntArrayFree);
const TfLiteTensor* input = GetInput(context, node, kInputTen... | vuln | Vulnerable | C/C++ |
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | vuln | Vulnerable | Python |
#include "jsi.h"
#include "jsvalue.h"
#include "jsbuiltin.h"
#include "regexp.h"
void js_newregexp(js_State *J, const char *pattern, int flags)
{
const char *error;
js_Object *obj;
Reprog *prog;
int opts;
obj = jsV_newobject(J, JS_CREGEXP, J->RegExp_prototype);
opts = 0;
if (flags & JS_REGEXP_I) opts |= REG_I... | vuln | Safe | C/C++ |
@EventHandler
public void disableItemFrameRotation(PlayerInteractEntityEvent e) {
if (e == null) return;
if (e.getRightClicked().getType() == EntityType.ITEM_FRAME) {
if (((ItemFrame) e.getRightClicked()).getItem().getType().equals(Material.AIR)) {
//prevent from putting ... | vuln | Safe | Java |
GF_EXPORT
u32 gf_isom_guess_specification(GF_ISOFile *file)
{
u32 count, i, nb_any, nb_m4s, nb_a, nb_v, nb_auxv,nb_scene, nb_od, nb_mp3, nb_aac, nb_m4v, nb_avc, nb_amr, nb_h263, nb_qcelp, nb_evrc, nb_smv, nb_text, nb_pict;
nb_m4s = nb_a = nb_v = nb_auxv = nb_any = nb_scene = nb_od = nb_mp3 = nb_aac = nb_m4v = nb_avc... | vuln | Vulnerable | Unknown |
var exec = require('child_process').exec;
var aspect = require('aspectratio');
var dirname = require('path').dirname;
var basename = require('path').basename;
var extname = require('path').extname;
var join = require('path').join;
var sprintf = require('util').format;
module.exports = function(image, output, cb) {
i... | vuln | Safe | JavaScript |
horizontalDifference16(unsigned short *ip, int n, int stride,
unsigned short *wp, uint16 *From14)
{
register int r1, g1, b1, a1, r2, g2, b2, a2, mask;
/* assumption is unsigned pixel values */
#undef CLAMP
#define CLAMP(v) From14[(v) >> 2]
mask = CODE_MASK;
if (n >= stride) {
if (stride == 3) {
... | vuln | Safe | C/C++ |
int X509_check_trust(X509 *x, int id, int flags)
{
X509_TRUST *pt;
int idx;
if(id == -1) return 1;
/* We get this as a default value */
if (id == 0)
{
int rv;
rv = obj_trust(NID_anyExtendedKeyUsage, x, 0);
if (rv != X509_TRUST_UNTRUSTED)
return rv;
return trust_compat(NULL, x, 0);
}
idx = X509_TRUS... | vuln | Safe | Unknown |
@app.route('/sloka')
def sloka():
sloka_number = request.args.get('sloka_number')
sloka_number_parts = sloka_number.split('.')
sloka_number_previous = "%s.%s.%d" % (sloka_number_parts[0], sloka_number_parts[1], int(sloka_number_parts[2])-1)
sloka_number_next = "%s.%s.%d" % (sloka_number_parts[0], slo... | vuln | Vulnerable | Python |
Compute(OpKernelContext* context, bool sorted, int k,
const typename TTypes<T, 2>::ConstTensor& input, const int64 num_rows,
const int64 num_cols, typename TTypes<T, 2>::Tensor values,
typename TTypes<int, 2>::Tensor indices) {
const CPUDevice& d = context->eigen_device<CPUDevice>();
... | vuln | Vulnerable | Unknown |
Proto_SecurityCheckRequest(ServiceConnection *conn,
ProtoRequest *req)
{
VGAuthError err;
gboolean isSecure = ServiceNetworkIsConnectionPrivateSuperUser(conn);
switch (req->reqType) {
/*
* This comes over the public connection; alwsys let it through.
*/
case P... | vuln | Vulnerable | Unknown |
TaskFragmentContainer newContainer(@NonNull Activity activity, int taskId) {
return newContainer(activity, activity, taskId);
} | vuln | Safe | Java |
same_color(NCURSES_CONST char *oldcap, NCURSES_CONST char *newcap, int limit)
{
bool result = FALSE;
if (limit > 16)
limit = 16;
if (limit >= 8) {
int n;
int same;
for (n = same = 0; n < limit; ++n) {
char *oldvalue = strdup(TPARM_1(oldcap, n));
char *newvalue = strdup(TPARM_1(newcap, n));
... | vuln | Vulnerable | Unknown |
ztype(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
ref tnref;
int code = array_get(imemory, op, (long)r_btype(op - 1), &tnref);
if (code < 0)
return code;
if (!r_has_type(&tnref, t_name)) {
/* Must be either a stack underflow or a t_[a]struct. */
check_op(2);
{ ... | vuln | Safe | C/C++ |
static bool nfc_worker_read_bank_card(NfcWorker* nfc_worker, FuriHalNfcTxRxContext* tx_rx) {
bool read_success = false;
EmvApplication emv_app = {};
EmvData* result = &nfc_worker->dev_data->emv_data;
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
reader_analyzer_prepare_tx_rx(nfc_worker->r... | vuln | Safe | C/C++ |
public void tick() {
// TODO: investigate why the goal is even running when the attack target is null
// Probably has something to do with the goal switching
if (this.attacker.getAttackTarget() != null)
super.tick();
} | vuln | Safe | Java |
do_tabs(int *tab_list)
{
int last = 1;
int stop;
putchar('\r');
while ((stop = *tab_list++) > 0) {
if (last < stop) {
while (last++ < stop) {
if (last > max_cols)
break;
putchar(' ');
}
}
if (stop <= max_cols) {
tputs(tparm(set_tab, stop), 1, putch);
last = stop;
} els... | vuln | Vulnerable | Unknown |
$text .= varset($val['helpText']) ? "<div class='field-help'>".$val['helpText']."</div>" : "";
$text .= "</td>\n</tr>\n";
}
$text .="<tr>
<td>".EPL_ADLAN_59."</td>
<td>{$del_text}
<div class='field-help'>".EPL_ADLAN_60."</div>
</td>
</tr>
</table>
<div class='buttons-bar center'>";
... | vuln | Vulnerable | PHP |
processFinished(struct module_qstate* qstate, struct val_qstate* vq,
struct val_env* ve, int id)
{
enum val_classification subtype = val_classify_response(
qstate->query_flags, &qstate->qinfo, &vq->qchase,
vq->orig_msg->rep, vq->rrset_skip);
/* store overall validation result in orig_msg */
if(vq->rrset_skip... | vuln | Vulnerable | Unknown |
static void put_ebml_uint(ByteIOContext *pb, unsigned int elementid, uint64_t val)
{
int i, bytes = 1;
while (bytes < 8 && val >> bytes*8) bytes++;
put_ebml_id(pb, elementid);
put_ebml_num(pb, bytes, 0);
for (i = bytes - 1; i >= 0; i--)
put_byte(pb, val >> i*8);
} | vuln | Safe | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.