code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
(function(module) { "use strict"; var Comments = {}; var db = require.main.require('./src/database'); var meta = require.main.require('./src/meta'); var posts = require.main.require('./src/posts'); var topics = require.main.require('./src/topics'); var user = require.main.require('./src/user'); var groups = r...
vuln
Vulnerable
JavaScript
int parse_unix(grpc_uri *uri, grpc_resolved_address *resolved_addr) { struct sockaddr_un *un = (struct sockaddr_un *)resolved_addr->addr; const size_t maxlen = sizeof(un->sun_path); const size_t path_len = strnlen(uri->path, maxlen); if (path_len == maxlen) return 0; un->sun_family = AF_UNIX; strcpy(un->sun...
vuln
Safe
C/C++
protected Response internalPeekNthMessage(String subName, int messagePosition, boolean authoritative) { // If the topic name is a partition name, no need to get partition topic metadata again if (!topicName.isPartitioned() && getPartitionedTopicMetadata(topicName, authoritative, false).p...
vuln
Vulnerable
Java
private void flush() { sendStopPacket(); if (!encoder.isClosed()) { encoder.resetState(); //TODO maybe this has a weird side effect when called every 10ms } if (client == null) { return; } AudioRecorder recorder = client.getRecorder(); if (...
vuln
Safe
Java
static void mcf_fec_do_tx(mcf_fec_state *s) { uint32_t addr; mcf_fec_bd bd; int frame_size; int len; uint8_t frame[FEC_MAX_FRAME_SIZE]; uint8_t *ptr; DPRINTF("do_tx\n"); ptr = frame; frame_size = 0; addr = s->tx_descriptor; while (1) { mcf_fec_read_bd(&bd, addr); ...
vuln
Vulnerable
Unknown
def email_login raise Discourse::NotFound if !SiteSetting.enable_local_logins_via_email second_factor_token = params[:second_factor_token] second_factor_method = params[:second_factor_method].to_i token = params[:token] valid_token = !!EmailToken.valid_token_format?(token) user = EmailToken.conf...
vuln
Vulnerable
Ruby
protected void launchItems() { ItemStack heldItemStack = depotBehaviour.getHeldItemStack(); Direction funnelFacing = getFacing().getOpposite(); if (AbstractFunnelBlock.getFunnelFacing(level.getBlockState(worldPosition.above())) == funnelFacing) { DirectBeltInputBehaviour directOutput = getBehaviour(DirectBelt...
vuln
Safe
Java
static RzDyldRebaseInfos *get_rebase_infos(RzDyldCache *cache) { RzDyldRebaseInfos *result = RZ_NEW0(RzDyldRebaseInfos); if (!result) { return NULL; } if (!cache->hdr->slideInfoOffset || !cache->hdr->slideInfoSize) { ut32 total_slide_infos = 0; ut32 n_slide_infos[MAX_N_HDR]; ut32 i; for (i = 0; i < cach...
vuln
Vulnerable
C/C++
ews_client_autodiscover_response_cb (SoupSession *session, SoupMessage *msg, gpointer user_data) { GError *error; AutodiscoverData *data = user_data; GTlsCertificateFlags cert_flags; gboolean op_res; gboolean using_https; guint status; gint idx; gsize size; xmlDoc *doc; xmlNode *node; status = ms...
vuln
Vulnerable
Unknown
package teamserver import ( "encoding/json" "net/http" "code.cloudfoundry.org/lager" "github.com/concourse/concourse/atc" "github.com/concourse/concourse/atc/api/accessor" "github.com/concourse/concourse/atc/api/present" ) type SetTeamResponse struct { Errors []string `json:"errors,omitempty"` ...
vuln
Safe
Go
static int snd_timer_user_release(struct inode *inode, struct file *file) { struct snd_timer_user *tu; if (file->private_data) { tu = file->private_data; file->private_data = NULL; mutex_lock(&tu->ioctl_lock); if (tu->timeri) snd_timer_close(tu->timeri); mutex_unlock(&tu->ioctl_lock); kfree(tu->...
vuln
Safe
C/C++
public SerializedInfoflowResults readResults(String fileName) throws XMLStreamException, IOException { SerializedInfoflowResults results = new SerializedInfoflowResults(); InfoflowPerformanceData perfData = null; XMLStreamReader reader = null; try (InputStream in = new FileInputStream(fileName)) { reader = ...
vuln
Vulnerable
Java
public boolean onActionClick(final Context context, final MenuItem item) { final AppViewModel selection = mSelection.getValue(); if (selection == null) return false; final IslandAppInfo app = selection.info(); final String pkg = app.packageName; final int id = item.getItemId(); if (id == R.id.menu_clone) {...
vuln
Vulnerable
Java
"""Domain related views.""" from functools import reduce from reversion import revisions as reversion from django.contrib.auth import mixins as auth_mixins from django.contrib.auth.decorators import ( login_required, permission_required, user_passes_test ) from django.db.models import Q, Sum from django.http imp...
vuln
Safe
Python
u32 gf_base64_encode(const u8 *_in, u32 inSize, u8 *_out, u32 outSize) { s32 padding; u32 i = 0, j = 0; unsigned char *in = (unsigned char *)_in; unsigned char *out = (unsigned char *)_out; if (outSize < (inSize * 4 / 3)) return 0; while (i < inSize) { padding = 3 - (inSize - i); if (padding == 2) { out[...
vuln
Vulnerable
Unknown
'use strict'; var BN = require('bn.js'); var utils = require('../utils'); var assert = utils.assert; function KeyPair(ec, options) { this.ec = ec; this.priv = null; this.pub = null; // KeyPair(ec, { priv: ..., pub: ... }) if (options.priv) this._importPrivate(options.priv, options.privEnc); if (optio...
vuln
Safe
Java
@Override @Nullable public JsonAdapter<?> create( @Nonnull final Type type, @Nonnull final Set<? extends Annotation> annotations, @Nonnull final Moshi moshi) { final Class<?> rawType = Types.getRawType(type); if (Source.class.equals(rawType)) { for (final Annotation annotation : anno...
vuln
Safe
Java
protected function getTempFile($path = '') { static $cache = array(); static $rmfunc; $key = ''; if ($path !== '') { $key = $this->id . '#' . $path; if (isset($cache[$key])) { return $cache[$key]; } } if ($tmpdir = $this->getTempPath()) { if (!$rmfunc) { $rmfunc = create_function('...
vuln
Safe
JavaScript
static int rtcp_parse_packet(RTPDemuxContext *s, const unsigned char *buf, int len) { int payload_len; while (len >= 2) { switch (buf[1]) { case RTCP_SR: if (len < 16) { av_log(NULL, AV_LOG_ERROR, "Invalid length for RTCP SR packet\n"); return AVERROR_...
vuln
Vulnerable
C/C++
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #include <inttypes.h> #include <stddef.h> #include <stdint.h> #include <sys/queue.h> #include "lsquic_int_types.h" #include "lsquic_types.h" #include "lsquic_hash.h" #include "lsquic.h" #include "lsquic_conn.h" #include "lsqu...
vuln
Vulnerable
C/C++
static PreviewContext of(ItemStack stack, @Nullable PlayerEntity owner) { return new PreviewContextImpl(stack.copy(), owner); }
vuln
Safe
Java
int ff_h264_decode_picture_parameter_set(GetBitContext *gb, AVCodecContext *avctx, H264ParamSets *ps, int bit_length) { AVBufferRef *pps_buf; const SPS *sps; unsigned int pps_id = get_ue_golomb(gb); PPS *pps; int qp_bd_offset; int bits_left; int ret; ...
vuln
Safe
C/C++
static int nppscale_resize(AVFilterContext *ctx, NPPScaleStageContext *stage, AVFrame *out, AVFrame *in) { NPPScaleContext *s = ctx->priv; NppStatus err; int i; for (i = 0; i < FF_ARRAY_ELEMS(stage->planes_in) && i < FF_ARRAY_ELEMS(in->data) && in->data[i]; i++) { int ...
vuln
Safe
C/C++
GF_Err adts_dmx_process(GF_Filter *filter) { GF_ADTSDmxCtx *ctx = gf_filter_get_udta(filter); GF_FilterPacket *pck, *dst_pck; u8 *data, *output; u8 *start; u32 pck_size, remain, prev_pck_size; u64 cts = GF_FILTER_NO_TS; //always reparse duration if (!ctx->duration.num) adts_dmx_check_dur(filter, ctx); if (...
vuln
Vulnerable
C/C++
private void registerApi1PhoneStateListener() { Timber.d("Registering API 1 phone state listener"); boolean collectNeighboringCells = MyApplication.getPreferencesProvider().getCollectNeighboringCells(); measurementParser = new MeasurementParserFactory().CreateApi1Parser(transportMode.getAccuracy...
vuln
Vulnerable
Java
ProcPutImage(ClientPtr client) { GC *pGC; DrawablePtr pDraw; long length; /* length of scanline server padded */ long lengthProto; /* length of scanline protocol padded */ char *tmpImage; REQUEST(xPutImageReq); REQUEST_AT_LEAST_SIZE(xPutImageReq); VALIDATE_DRAW...
vuln
Safe
C/C++
def to_decimal(expr, args, kwargs, context): in_arg = args[0] input_type, _ = get_type(in_arg) if input_type == "Bytes": if in_arg.typ.maxlen > 32: raise TypeMismatch( f"Cannot convert bytes array of max length {in_arg.typ.maxlen} to decimal", expr, ...
vuln
Safe
Python
LogL16Decode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s) { static const char module[] = "LogL16Decode"; LogLuvState* sp = DecoderState(tif); int shft; tmsize_t i; tmsize_t npixels; unsigned char* bp; int16* tp; int16 b; tmsize_t cc; int rc; assert(s == 0); assert(sp != NULL); npixels = occ / sp->pixel_...
vuln
Safe
Unknown
@Override public Changes executeCode(String code) throws InterruptedException, ExecutionException, TimeoutException { return executeCodeFuture(code).get(config.executeTimeout().toNanos(), TimeUnit.NANOSECONDS); }
vuln
Safe
Java
x_catch_free_colors(Display * dpy, XErrorEvent * err) { if (err->request_code == X_FreeColors) return 0; return x_error_handler.orighandler(dpy, err); }
vuln
Vulnerable
Unknown
function send(res, statusCode, response) { if (typeof response === 'string') { res.status(statusCode).send(response); return response.length; } else { const json = JSON.stringify(response); res.setHeader("Content-Type", "application/json"); res.status(statusCode).se...
vuln
Vulnerable
JavaScript
function D(){var b,c,d,e,f,h;if(xc++,b=sc,c=sc,d=P(),d!==X){if(e=sc,f=[],Wa.test(a.charAt(sc))?(h=a.charAt(sc),sc++):(h=X,0===xc&&g(Xa)),h!==X)for(;h!==X;)f.push(h),Wa.test(a.charAt(sc))?(h=a.charAt(sc),sc++):(h=X,0===xc&&g(Xa));else f=X;f!==X&&(tc=e,f=mb(f)),e=f,e===X&&(e=v()),e!==X?(f=Q(),f!==X?(tc=c,d=nb(e),c=d):(sc...
vuln
Safe
JavaScript
static ssize_t read_and_process_frames(struct audio_stream_in *stream, void* buffer, ssize_t frames_num) { struct stream_in *in = (struct stream_in *)stream; ssize_t frames_wr = 0; /* Number of frames actually read */ size_t bytes_per_sample = audio_bytes_per_sample(stream->common.get_format(&stream->common...
vuln
Vulnerable
C/C++
def load(self): self.unpriv_uid = None self.unpriv_gid = None if self.enabled is True and self.unsafe_extraction is False: if os.getuid() != 0: raise ModuleException("Binwalk requires root privileges to safely execute external extraction utilities as an unprivileged ...
vuln
Safe
Python
php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */ { php_stream *stream = NULL; php_url *resource = NULL; int use_ssl; int use_proxy = 0; char *scratch...
vuln
Vulnerable
Unknown
@Override public void close() throws Exception { //executeJavaScript("process.exit();", 0); debugOutput.println("CLOSING " + this); process.destroy(); }
vuln
Safe
Java
int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec) { if (*spec <= '9' && *spec >= '0') return strtol(spec, NULL, 0) == st->index; else if (*spec == 'v' || *spec == 'a' || *spec == 's' || *spec == 'd' || *spec == 't') { enum AVMediaType type; swi...
vuln
Vulnerable
C/C++
static void qtrle_decode_24bpp(QtrleContext *s, int stream_ptr, int row_ptr, int lines_to_change) { int rle_code; int pixel_ptr; int row_inc = s->frame.linesize[0]; unsigned char r, g, b; unsigned char *rgb = s->frame.data[0]; int pixel_limit = s->frame.linesize[0] * s->avctx->height; while ...
vuln
Safe
C/C++
/* * ***** BEGIN LICENSE BLOCK ***** * Zimbra Collaboration Suite Server * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2014, 2016 Synacor, Inc. * * 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 Softw...
vuln
Vulnerable
Java
/* * GPAC Multimedia Framework * * Authors: Cyril Concolato, Jean Le Feuvre * Copyright (c) Telecom ParisTech 2004-2022 * All rights reserved * * This file is part of GPAC / SVG Loader module * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser...
vuln
Vulnerable
C/C++
zsetdevice(i_ctx_t *i_ctx_p) { gx_device *odev = NULL, *dev = gs_currentdevice(igs); gx_device *ndev = NULL; os_ptr op = osp; int code = dev_proc(dev, dev_spec_op)(dev, gxdso_current_output_device, (void *)&odev, 0); if (code < 0) return code; check_write_type(*o...
vuln
Safe
Unknown
static HashTable *zend_generator_get_gc(zval *object, zval **table, int *n) /* {{{ */ { zend_generator *generator = (zend_generator*) Z_OBJ_P(object); zend_execute_data *execute_data = generator->execute_data; zend_op_array *op_array; zval *gc_buffer; uint32_t gc_buffer_size; if (!execute_data) { /* If the gen...
vuln
Safe
Unknown
inline void AveragePool(const PoolParams& params, const RuntimeShape& input_shape, const int8* input_data, const RuntimeShape& output_shape, int8* output_data) { ruy::profiler::ScopeLabel label("AveragePool/8bitWith32bitAccumulator"); // Here, and in other pooling op...
vuln
Vulnerable
C/C++
@Override public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { setPreferencesFromResource(R.xml.crash_report_action, rootKey); telegram = (Preference) findPreference("report_telegram"); github = (Preference) findPreference("report_github"); ...
vuln
Vulnerable
Java
struct resource_pool *dce110_create_resource_pool( uint8_t num_virtual_links, struct dc *dc, struct hw_asic_id asic_id) { struct dce110_resource_pool *pool = kzalloc(sizeof(struct dce110_resource_pool), GFP_KERNEL); if (!pool) return NULL; if (construct(num_virtual_links, dc, pool, asic_id)) return &pool-...
vuln
Safe
C/C++
int target_munmap(target_ulong start, target_ulong len) { target_ulong end, real_start, real_end, addr; int prot, ret; #ifdef DEBUG_MMAP printf("munmap: start=0x%lx len=0x%lx\n", start, len); #endif if (start & ~TARGET_PAGE_MASK) return -EINVAL; len = TARGET_PAGE_ALIGN(len); if (len == 0...
vuln
Safe
C/C++
/* * base64.c * base64 encode/decode implementation * * Copyright (c) 2011 Nikias Bassen, All Rights Reserved. * * 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 Software Foundation; either * version ...
vuln
Vulnerable
C/C++
void ComputeAsync(OpKernelContext* c, DoneCallback done) override { auto col_params = new CollectiveParams(); auto done_with_cleanup = [col_params, done = std::move(done)]() { done(); col_params->Unref(); }; core::RefCountPtr<CollectiveGroupResource> resource; OP_REQUIRES_OK_ASYNC(c, Loo...
vuln
Vulnerable
C/C++
static void timerfd_remove_cancel(struct timerfd_ctx *ctx) { spin_lock(&ctx->cancel_lock); __timerfd_remove_cancel(ctx); spin_unlock(&ctx->cancel_lock); }
vuln
Safe
Unknown
static void file_change(struct diff_options *options, unsigned old_mode, unsigned new_mode, const unsigned char *old_sha1, const unsigned char *new_sha1, const char *base, const char *path) { tree_difference = REV_TREE_DIFFERENT; DIFF_OPT_SET(options, HAS_CHANGES); }
vuln
Vulnerable
Unknown
prepareContextResource(data) { (Array.isArray(data) ? data : [data]).forEach((resource) => { // feature_image_caption contains HTML, making it a SafeString spares theme devs from triple-curlies if (resource.feature_image_caption) { resource.feature_image_caption = new Saf...
vuln
Safe
JavaScript
u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, __be16 dport) { struct keydata *keyptr = get_keyptr(); u32 hash[12]; memcpy(hash, saddr, 16); hash[4] = (__force u32)dport; memcpy(&hash[5], keyptr->secret, sizeof(__u32) * 7); return twothirdsMD4Transform((const __u32 *)daddr, h...
vuln
Vulnerable
Unknown
ssize_t enc_untrusted_recvfrom(int sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen) { int klinux_flags = TokLinuxRecvSendFlag(flags); if (klinux_flags == 0 && flags != 0) { errno = EINVAL; return -1; } MessageWriter input; input.P...
vuln
Safe
C/C++
spell_read_tree( FILE *fd, char_u **bytsp, idx_T **idxsp, int prefixtree, /* TRUE for the prefix tree */ int prefixcnt) /* when "prefixtree" is TRUE: prefix count */ { int len; int idx; char_u *bp; idx_T *ip; /* The tree size was computed when writing the file, so that we ca...
vuln
Safe
C/C++
/* * 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
Safe
Java
static void ed_mul_reg_imp(ed_t r, const ed_t p, const bn_t k) { bn_t _k; int i, j, n; int8_t s, reg[RLC_CEIL(RLC_FP_BITS + 1, ED_WIDTH - 1)]; ed_t t[1 << (ED_WIDTH - 2)], u, v; size_t l; bn_null(_k); if (bn_is_zero(k)) { ed_set_infty(r); return; } RLC_TRY { bn_new(_k); ed_new(u); ed_new(v); /* P...
vuln
Safe
C/C++
package net import ( "fmt" "net" "strings" "time" "github.com/coreos/go-iptables/iptables" "github.com/j-keck/arping" "github.com/vishvananda/netlink" "github.com/vishvananda/netns" ) // create and attach a veth to the Weave bridge func CreateAndAttachVeth(name, peerName, bridgeName string, mtu int, keepTXOn...
vuln
Vulnerable
Go
static struct sk_buff *xfrm_policy_netlink(struct sk_buff *in_skb, struct xfrm_policy *xp, int dir, u32 seq) { struct xfrm_dump_info info; struct sk_buff *skb; skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); if (!skb) return ERR_PTR(-ENOMEM); info.in_skb = in_skb; info.out_skb = skb; info.nlms...
vuln
Safe
C/C++
package com.salesmanager.shop.admin.controller.content; import java.io.ByteArrayInputStream; import java.net.URLConnection; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.htt...
vuln
Vulnerable
Java
static int decode_band_hdr(IVI4DecContext *ctx, IVIBandDesc *band, AVCodecContext *avctx) { int plane, band_num, indx, transform_id, scan_indx; int i; int quant_mat; plane = get_bits(&ctx->gb, 2); band_num = get_bits(&ctx->gb, 4); if (band->plane != plane || band->b...
vuln
Vulnerable
C/C++
/* * Ut Video decoder * Copyright (c) 2011 Konstantin Shishkov * * This file is part of FFmpeg. * * FFmpeg 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 the License, o...
vuln
Safe
C/C++
static int vhdx_create_bat(BlockDriverState *bs, BDRVVHDXState *s, uint64_t image_size, VHDXImageType type, bool use_zero_blocks, uint64_t file_offset, uint32_t length) { int ret = 0; uint64_t data_file_offset; uint64_t total_s...
vuln
Vulnerable
C/C++
function escapeArgBash(arg, interpolation, quoted) { let result = arg.replace(/\0/gu, ""); if (interpolation) { result = result .replace(/\\/gu, "\\\\") .replace(/\n/gu, " ") .replace(/(^|\s)(~|#)/gu, "$1\\$2") .replace(/(\*|\?)/gu, "\\$1") .replace(/([$&;|])/gu, "\\$1") .re...
vuln
Vulnerable
JavaScript
def render(self): response = super().render() if not self.component or not self.component.component_id: return response content = response.content.decode("utf-8") frontend_context_variables = self.component.get_frontend_context_variables() frontend_context_variable...
vuln
Safe
Python
static void setup_namespaces(struct lo_data *lo, struct fuse_session *se) { pid_t child; /* * Create a new pid namespace for *child* processes. We'll have to * fork in order to enter the new pid namespace. A new mount namespace * is also needed so that we can remount /proc for the new pid ...
vuln
Safe
C/C++
xsltCompileLocationPathPattern(xsltParserContextPtr ctxt, int novar) { SKIP_BLANKS; if ((CUR == '/') && (NXT(1) == '/')) { /* * since we reverse the query * a leading // can be safely ignored */ NEXT; NEXT; ctxt->comp->priority = 0.5; /* '//' means not 0 priority */ xsltCompileRelativePathPattern(ctx...
vuln
Safe
C/C++
static void fwnet_receive_broadcast(struct fw_iso_context *context, u32 cycle, size_t header_length, void *header, void *data) { struct fwnet_device *dev; struct fw_iso_packet packet; __be16 *hdr_ptr; __be32 *buf_ptr; int retval; u32 length; unsigned long offset; unsigned long flags; dev = data; hdr_ptr = ...
vuln
Safe
Unknown
fn exit_document(&mut self, ctx: &mut ValidatorContext<'a, S>, _: &'a Document<S>) { assert!(self.current_fragment.is_none()); let mut detector = CycleDetector { visited: HashSet::new(), spreads: &self.spreads, errors: Vec::new(), }; for frag in &sel...
vuln
Safe
Rust
package lfs import ( "bytes" "crypto/sha256" "encoding/hex" "fmt" "hash" "io" "os" "strings" "github.com/git-lfs/git-lfs/config" "github.com/git-lfs/git-lfs/subprocess" ) type pipeRequest struct { action string reader io.Reader fileName string extensions []config.Extension } type pipeRespons...
vuln
Safe
Go
void ArthurOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, int *maskColors, GBool inlineImg) { unsigned char *buffer; unsigned int *dest; int x, y; ImageStream *imgStr; Guchar *pix; int i; double *ctm; QMatrix matrix; int...
vuln
Safe
C/C++
int pmixp_coll_ring_unpack(Buf buf, pmixp_coll_type_t *type, pmixp_coll_ring_msg_hdr_t *ring_hdr, pmixp_proc_t **r, size_t *nr) { pmixp_proc_t *procs = NULL; uint32_t nprocs = 0; uint32_t tmp; int rc, i; char *temp_ptr; /* 1. extract the type of collective */ if (SLURM_SUCCESS != (rc = unpack32(&tmp...
vuln
Safe
Unknown
public boolean isLandscape() { // DisplayMetrics from activity context knows about MultiWindow feature // while DisplayMetrics from app context doesn't return DeviceUtils.isLandscape( getParentActivity().map(Context.class::cast).orElse(player.getService())); }
vuln
Safe
Java
oa=F.actions.get("resetView");Q=F.actions.get("fullscreen");var Ba=F.actions.get("undo"),Ea=F.actions.get("redo"),Ka=C("",Ba.funct,null,mxResources.get("undo")+" ("+Ba.shortcut+")",Ba,Editor.undoImage),Fa=C("",Ea.funct,null,mxResources.get("redo")+" ("+Ea.shortcut+")",Ea,Editor.redoImage),Ha=C("",Q.funct,null,mxResourc...
vuln
Vulnerable
JavaScript
static int asf_read_picture(AVFormatContext *s, int len) { ASFContext *asf = s->priv_data; AVPacket pkt = { 0 }; const CodecMime *mime = ff_id3v2_mime_tags; enum AVCodecID id = AV_CODEC_ID_NONE; char mimetype[64]; uint8_t *desc = NULL; AVStream *st = NULL; int ret, ...
vuln
Vulnerable
C/C++
def on_send_join_request(self, origin, pdu): """ We have received a join event for a room. Fully process it and respond with the current state and auth chains. """ event = pdu logger.debug( "on_send_join_request: Got event: %s, signatures: %s", event.even...
vuln
Vulnerable
Python
@Override public void render(float partialTicks, ItemTransforms.TransformType transformType, ItemStack stack, ItemStack parent, @Nullable LivingEntity entity, PoseStack poseStack, MultiBufferSource renderTypeBuffer, int light, int overlay) { if(OptifineHelper.isShadersEnabled()) { do...
vuln
Safe
Java
static int build_vlc(AVCodecContext *avctx, VLC *vlc, const uint32_t *table) { Node nodes[512]; uint32_t bits[256]; int16_t lens[256]; uint8_t xlat[256]; int cur_node, i, j, pos = 0; ff_free_vlc(vlc); for (i = 0; i < 256; i++) { nodes[i].count = table[i]; nodes[i].sym = i; ...
vuln
Vulnerable
C/C++
@Override public void perform(PlayerEntity attacker, Hand hand, ItemModularHandheld item, ItemStack itemStack, LivingEntity target, Vector3d hitVec, int chargedTicks) { int armor = target.getTotalArmorValue(); AbilityUseResult result = item.hitEntity(itemStack, attacker, target, 1, 0.2f, 0.2f); ...
vuln
Safe
Java
public void test_notLike_endsWith() { Entity from = from(Entity.class); where(from.getCode()).notLike().endsWith("test"); Query<Entity> select = select(from); assertEquals("select entity_0 from Entity entity_0 where entity_0.code not like '%test'", select.getQuery()); }
vuln
Vulnerable
Java
this.defaultFilename,!0);q.getHash=function(){return k};this.fileLoaded(q);"csv"==c.format&&this.importCsv(v,mxUtils.bind(this,function(M){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=c.update){var y=null!=c.interval?parseInt(c.interval):6E4,A=null,z=mxUtils.bind(thi...
vuln
Safe
JavaScript
static int parse_eops(extop **result, bool critical, int elem) { extop *eop = NULL, *prev = NULL; extop **tail = result; int sign; int i = tokval.t_type; int oper_num = 0; bool do_subexpr = false; *tail = NULL; /* End of string is obvious; ) ends a sub-expression list e.g. DUP */ f...
vuln
Vulnerable
C/C++
it "does not activate user invited via links" do invite = Fabricate(:invite, email: 'walter.white@email.com', emailed_status: Invite.emailed_status_types[:not_required]) user = InviteRedeemer.create_user_from_invite(invite: invite, email: invite.email, username: 'walter', name: 'Walter White') expect...
vuln
Safe
Ruby
static MagickBooleanType load_tile(Image *image,Image *tile_image, XCFDocInfo *inDocInfo,XCFLayerInfo *inLayerInfo,size_t data_length, ExceptionInfo *exception) { ssize_t y; register ssize_t x; register Quantum *q; ssize_t count; unsigned char *graydata; XCFPixelInfo *xcfda...
vuln
Vulnerable
C/C++
private List<PermissionFactory> parsePermissions(final VirtualFile file, final ModuleLoader loader, final ModuleIdentifier identifier, final Function<String, String> exprExpandFunction) throws DeploymentUnitProcessingException { InputStream inputStream = null; try { inputStream ...
vuln
Safe
Java
void InferenceContext::PreInputInit( const OpDef& op_def, const std::vector<const Tensor*>& input_tensors, const std::vector<ShapeHandle>& input_tensors_as_shapes) { // TODO(mdan): This is also done at graph construction. Run only here instead? const auto ret = full_type::SpecializeType(attrs_, op_def); D...
vuln
Vulnerable
C/C++
private void loadFragment(@NonNull ParsedResult parsedResult) { FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); ResultFragment resultFragment; switch (parsedResult.getType()) { case ADDRESSBOOK: resultFragment = new ContactResultFragment(); ...
vuln
Vulnerable
Java
exports.killByPort = function (port) { var processId = null try { processId = exec(`lsof -t -i:${parseInt(port, 10)}`) } catch (e) { } if (processId !== null) { // if exists kill exec(`kill ${processId}`) } }
vuln
Safe
JavaScript
package install import ( "fmt" "net/url" "strings" "github.com/answerdev/answer/internal/base/reason" "github.com/answerdev/answer/internal/base/validator" "github.com/answerdev/answer/pkg/checker" "github.com/segmentfault/pacman/errors" "xorm.io/xorm/schemas" ) // CheckConfigFileResp check config file if ex...
vuln
Safe
Go
long video_ioctl2(struct file *file, unsigned int cmd, unsigned long arg) { char sbuf[128]; void *mbuf = NULL; void *parg = (void *)arg; long err = -EINVAL; bool has_array_args; size_t array_size = 0; void __user *user_ptr = NULL; void **kernel_ptr = NULL; /* Copy arguments into temp kernel buff...
vuln
Vulnerable
C/C++
@web.authenticated def get(self, value): user_id = self.current_user_id() try: subm_id = int(value) except: raise web.HTTPError(400) error_log = contest.get_error_log(user_id, subm_id, is_admin=self.is_admin()) if not error_log: raise web...
vuln
Vulnerable
Python
status_t MediaPlayer::setDataSource(int fd, int64_t offset, int64_t length) { ALOGV("setDataSource(%d, %" PRId64 ", %" PRId64 ")", fd, offset, length); status_t err = UNKNOWN_ERROR; const sp<IMediaPlayerService>& service(getMediaPlayerService()); if (service != 0) { sp<IMediaPlayer> player...
vuln
Vulnerable
C/C++
void qbus_free(BusState *bus) { DeviceState *dev; while ((dev = QLIST_FIRST(&bus->children)) != NULL) { qdev_free(dev); } if (bus->parent) { QLIST_REMOVE(bus, sibling); bus->parent->num_child_bus--; } if (bus->qdev_allocated) { qemu_free(bus); } }
vuln
Vulnerable
C/C++
private void updateInferredExecutableParameterTypes( ExecutableElement methodElt, List<Node> arguments, @Nullable Node receiver, ExpressionTree invocationTree) { String file = storage.getFileForElement(methodElt); // Need to check both that receiver is non-null and that this is not a co...
vuln
Safe
Java
/* * rfbserver.c - deal with server-side of the RFB protocol. */ /* * Copyright (C) 2009-2019 D. R. Commander. All Rights Reserved. * Copyright (C) 2010 University Corporation for Atmospheric Research. * All Rights Reserved. * Copyright (C) 2005-2008 Sun Microsystems, Inc. All Rights Res...
vuln
Safe
C/C++
__acquires(kernel_lock) { char *orig_data = kstrdup(data, GFP_KERNEL); struct buffer_head *bh; struct ext4_super_block *es = NULL; struct ext4_sb_info *sbi; ext4_fsblk_t block; ext4_fsblk_t sb_block = get_sb_block(&data); ext4_fsblk_t logical_sb_block; unsigned long offset = 0; unsigned long journal_devnum = 0...
vuln
Safe
Unknown
sendFile(path, destination) { const workingDir = p.dirname(path); const fileName = p.basename(path).replace(singleSlash, "\\"); const cmdArgs = util.format( "%s %s", fileName, destination.replace(singleSlash, "\\") ); return this.execute("put", cmdArgs, workingDir); }
vuln
Vulnerable
JavaScript
addPlugin(name, instance) { const lowerName = name.toLowerCase(); if (this.hasPlugin(lowerName)) { throw new Error(`A plugin called "${name}" is already registered.`); } if (typeof instance !== 'function' && instance instanceof PluginBase === false) { throw new ...
vuln
Safe
JavaScript
@NeverInline("access stack pointer") @Uninterruptible(reason = "write stack", calleeMustBe = false) private Object enter1(boolean isContinue) { Pointer currentSP = KnownIntrinsics.readCallerStackPointer(); CodePointer currentIP = KnownIntrinsics.readReturnAddress(); if (isContinue) { ...
vuln
Vulnerable
Java
zfont_info(gs_font *font, const gs_point *pscale, int members, gs_font_info_t *info) { int code = gs_default_font_info(font, pscale, members & ~(FONT_INFO_COPYRIGHT | FONT_INFO_NOTICE | FONT_INFO_FAMILY_NAME | FONT_INFO_FULL_NAME), ...
vuln
Vulnerable
Unknown
private void handleChoice(final String selectedChoiceKey) { final List<String> validChoicesList = Arrays.asList(getResources() .getStringArray(R.array.preferred_open_action_values_list)); if (validChoicesList.contains(selectedChoiceKey)) { PreferenceManager.getDefaultSharedPr...
vuln
Vulnerable
Java