code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
/* * 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 may n...
vuln
Vulnerable
Java
gx_begin_image1(gx_device * dev, const gs_gstate * pgs, const gs_matrix * pmat, const gs_image_common_t * pic, const gs_int_rect * prect, const gx_drawing_color * pdcolor, const gx_clip_path * pcpath, gs_memory_t * mem, gx_image_enum_common_t ** pinfo) { ...
vuln
Safe
Unknown
save_config( struct recvbuf *rbufp, int restrict_mask ) { #ifdef SAVECONFIG static const char savedconfig_eq[] = "savedconfig="; char filespec[128]; char filename[128]; char fullpath[512]; char savedconfig[sizeof(savedconfig_eq) + sizeof(filename)]; time_t now; int fd; FILE *fptr; int prc; size_t reqlen;...
vuln
Vulnerable
C/C++
static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c, int64_t timestamp, int flags) { const AVDVProfile *sys = av_dv_codec_profile2(c->vst->codec->width, c->vst->codec->height, c->vst->codec->pix_fmt, c->vst->codec-...
vuln
Vulnerable
C/C++
'use strict' const SemVerStore = require('semver-store') function build (enabled) { if (enabled) { return { storage: SemVerStore, deriveVersion: function (req, ctx) { return req.headers['accept-version'] } } } return { storage: SemVerStore, deriveVersion: function (req,...
vuln
Safe
JavaScript
async def create_pres( self, pres_ex_record: V20PresExRecord, request_data: dict = {}, ) -> Tuple[V20PresFormat, AttachDecorator]: """Create a presentation.""" proof_request = pres_ex_record.pres_request.attachment( DIFPresFormatHandler.format ) pr...
vuln
Safe
Python
package com.salesmanager.shop.admin.controller; import java.util.HashMap; import java.util.Map; import javax.inject.Inject; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.stereoty...
vuln
Safe
Java
@Override protected void createItemStack(Consumer<ItemStack> list, LootContext ctx) { LootRarity rarity = LootRarity.random(ctx.getRandom()); AffixLootEntry entry = AffixLootManager.getRandomEntry(ctx.getRandom()); ItemStack stack = entry.getStack().copy(); stack.getOrCreateTag().putBoolean("apoth_rchest"...
vuln
Safe
Java
def duration(self, dag_id: str, session: Session = NEW_SESSION): """Get Dag as duration graph.""" dag = get_airflow_app().dag_bag.get_dag(dag_id, session=session) dag_model = DagModel.get_dagmodel(dag_id, session=session) if not dag: flash(f'DAG "{dag_id}" seems to be missing...
vuln
Vulnerable
Python
import logging from decimal import Decimal from typing import Any, Callable, Dict import Adyen from babel.numbers import get_currency_precision from django.conf import settings from django_countries.fields import Country from ....checkout.models import Checkout from ....core.prices import quantize_price from ... impo...
vuln
Safe
Python
public void deleteMDImg(Long fileId) throws StatusFailException, StatusForbiddenException { Session session = SecurityUtils.getSubject().getSession(); UserRolesVo userRolesVo = (UserRolesVo) session.getAttribute("userInfo"); top.hcode.hoj.pojo.entity.common.File file = fileEntityService.getById...
vuln
Safe
Java
@Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { switch (holder.getItemViewType()) { case 0: { HeaderCell headerCell = (HeaderCell) holder.itemView; if (false) { //durov relogin! ...
vuln
Vulnerable
Java
/***************************************************************** | | AP4 - Atom Factory | | Copyright 2002-2012 Axiomatic Systems, LLC | | | This file is part of Bento4/AP4 (MP4 Atom Processing Library). | | Unless you have obtained Bento4 under a difference license, | this version of Bento4 is Bento4|...
vuln
Safe
C/C++
void SoftAACEncoder2::onQueueFilled(OMX_U32 /* portIndex */) { if (mSignalledError) { return; } List<BufferInfo *> &inQueue = getPortQueue(0); List<BufferInfo *> &outQueue = getPortQueue(1); if (!mSentCodecSpecificData) { if (outQueue.empty()) { return; } if (AACENC_OK != aacEncEncode(mAACEncoder, NULL, N...
vuln
Safe
C/C++
static int dn_nl_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh) { struct net *net = sock_net(skb->sk); struct nlattr *tb[IFA_MAX+1]; struct net_device *dev; struct dn_dev *dn_db; struct ifaddrmsg *ifm; struct dn_ifaddr *ifa; int err; if (!capable(CAP_NET_ADMIN)) return -EPERM; if (!net_eq(net, &init_ne...
vuln
Vulnerable
Unknown
Database::Database() { QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE")); QSettings qs; QStringList datapaths; int i; datapaths << g.qdBasePath.absolutePath(); datapaths << QDesktopServices::storageLocation(QDesktopServices::DataLocation); #if defined(Q_OS_UNIX) && ! defined(Q_OS_MAC) datapa...
vuln
Safe
Unknown
@Override protected void onResume() { super.onResume(); String title = getIntent().getStringExtra("title") + ""; // Firebase Analytics Logging Bundle bundle = new Bundle(); bundle.putString(FirebaseAnalytics.Param.SCREEN_CLASS, "WebViewActivity"); bundle.putString(F...
vuln
Safe
Java
def _clean_code(self, code: str) -> str: """ A method to clean the code to prevent malicious code execution Args: code(str): A python code Returns (str): Returns a Clean Code String """ tree = ast.parse(code) new_body = [] # clear recent ...
vuln
Safe
Python
/** * 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
selaComputeCompositeParameters(const char *fileout) { char *str, *nameh1, *nameh2, *namev1, *namev2; char buf[L_BUFSIZE]; l_int32 size, size1, size2, len; SARRAY *sa; SELA *selabasic, *selacomb; selabasic = selaAddBasic(NULL); selacomb = selaAddDwaCombs(NULL); sa = sarrayCreate(64); for (s...
vuln
Safe
C/C++
pktap_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p) { uint32_t dlt, hdrlen, rectype; u_int caplen = h->caplen; u_int length = h->len; if_printer printer; const pktap_header_t *hdr; if (caplen < sizeof(pktap_header_t) || length < sizeof(pktap_header_t)) { ND_PRIN...
vuln
Vulnerable
C/C++
zbuildfont0(i_ctx_t *i_ctx_p) { os_ptr op = osp; gs_type0_data data; ref fdepvector; ref *pprefenc; gs_font_type0 *pfont; font_data *pdata; ref save_FID; int i; int code = 0; check_type(*op, t_dictionary); { ref *pfmaptype; ref *pfdepvector; if (dict...
vuln
Safe
Unknown
@Override public void read (Json json, JsonValue jsonData) { String gameResourceIdentifier = GameResourceOwner.readGameResourceFromComponent(jsonData); loadTextureFromIdentifier(gameResourceIdentifier); color = json.readValue(Color.class, jsonData.get("color")); if(color == null) c...
vuln
Safe
Java
void bdrv_append_temp_snapshot(BlockDriverState *bs, Error **errp) { char tmp_filename[PATH_MAX + 1]; int64_t total_size; BlockDriver *bdrv_qcow2; QEMUOptionParameter *create_options; QDict *snapshot_options; BlockDriverState *bs_snapshot; Error *local_err; int ret; to...
vuln
Vulnerable
C/C++
private final void servlet31(HttpServletRequest request) { try { for(Part part:request.getParts()) { if(part.getContentType() != null && (StringHelper.containsNonWhitespace(part.getSubmittedFileName()) || !part.getContentType().startsWith("text/plain"))) { contentType = part.getContentType(); filenam...
vuln
Vulnerable
Java
def get_content_length() -> Optional[int]: # payload length length_hdr = msg.headers.get(CONTENT_LENGTH) if length_hdr is None: return None try: ...
vuln
Vulnerable
Python
readSampleCountForLineBlock(InputStreamMutex* streamData, DeepScanLineInputFile::Data* data, int lineBlockId) { streamData->is->seekg(data->lineOffsets[lineBlockId]); if (isMultiPart(data->version)) { int partNumber; OPENEXR_IMF_INTERN...
vuln
Safe
C/C++
static int __init xfrm6_tunnel_init(void) { int rv; rv = xfrm_register_type(&xfrm6_tunnel_type, AF_INET6); if (rv < 0) goto err; rv = xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6); if (rv < 0) goto unreg; rv = xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET); if (rv < 0) goto dereg6; rv = ...
vuln
Vulnerable
C/C++
static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int index, const char *filt_name, const char *args, AVClass *log_ctx) { AVFilter *filt; char inst_name[30]; char tmp_args[256]; int ret; snprintf(inst_name, sizeof(inst_name), "Parsed filter %d %s", ind...
vuln
Safe
C/C++
void fxPushSubstitutionString(txMachine* the, txSlot* string, txInteger size, txInteger offset, txSlot* match, txInteger length, txInteger count, txSlot* captures, txSlot* groups, txSlot* replace) { txString r; txInteger m; txInteger l; txBoolean flag; txByte c, d; txInteger i, j; txSlot* capture; txString s; ...
vuln
Safe
C/C++
writev_f(int argc, char **argv) { struct timeval t1, t2; int Cflag = 0, qflag = 0; int c, cnt; char *buf; int64_t offset; int total; int nr_iov; int pattern = 0xcd; QEMUIOVector qiov; while ((c = getopt(argc, argv, "CqP:")) != EOF) { switch (c) { case 'C': Cflag = 1; break; case 'q': qflag = 1;...
vuln
Vulnerable
C/C++
async def _get_form(self) -> FormData: if self._form is None: assert ( parse_options_header is not None ), "The `python-multipart` library must be installed to use form parsing." content_type_header = self.headers.get("Content-Type") content_type: ...
vuln
Vulnerable
Python
private boolean isAutoStopEnabled() { if (prefs == null) return false; return prefs.getBoolean("autoStop", true) && !prefs.getBoolean("bootStart", false); }
vuln
Safe
Java
// Copyright 2009 Indeed package com.indeed.util.varexport.servlet; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Joiner; import com.google.common.base.Strings; import com.google.common.collect.*; import com.indeed.util.varexport.VarExporter; import com.indeed.util.varexport.Var...
vuln
Vulnerable
Java
function yourls_verify_nonce( $action, $nonce = false, $user = false, $return = '' ) { // get user if( false == $user ) $user = defined( 'YOURLS_USER' ) ? YOURLS_USER : '-1'; // get current nonce value if( false == $nonce && isset( $_REQUEST['nonce'] ) ) $nonce = $_REQUEST['nonce']; // Allow plugins to short...
vuln
Vulnerable
PHP
import base64 import re from datetime import datetime import logging import ssl from xml.etree import ElementTree import iso8601 import six import recurly import recurly.errors from recurly.link_header import parse_link_value from six.moves import http_client from six.moves.urllib.parse import urlencode, urljoin, url...
vuln
Vulnerable
Python
/* radare - LGPL - Copyright 2015-2018 - Dax89, pancake */ #include <string.h> #include <r_types.h> #include <r_lib.h> #include <r_bin.h> #include "../i/private.h" #include "psxexe/psxexe.h" static bool check_buffer(RBinFile *bf, RBuffer *b) { ut8 magic[PSXEXE_ID_LEN]; if (r_buf_read_at (b, 0, magic, sizeof (magic)...
vuln
Safe
C/C++
@Override public void create() { GuiParent left = new GuiParent(GuiFlow.STACK_Y).setAlign(Align.STRETCH); add(left); LittleElement element = ItemLittleChisel.getElement(tool.get()); Color color = new Color(element.color); left.add(new GuiColorPicker("picker", color, ...
vuln
Vulnerable
Java
private int applyHierarchyOp(WindowContainerTransaction.HierarchyOp hop, int effects, int syncId, @Nullable Transition transition, boolean isInLockTaskMode, @NonNull CallerInfo caller, @Nullable IBinder errorCallbackToken, @Nullable ITaskFragmentOrganizer organizer) { final i...
vuln
Safe
Java
static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom) { AVStream *st; MOVStreamContext *sc; int entries, i, j; if (c->fc->nb_streams < 1) return 0; st = c->fc->streams[c->fc->nb_streams-1]; sc = st->priv_data; avio_rb32(pb); // version + flags entries = avio_rb...
vuln
Vulnerable
C/C++
spnego_gss_inquire_sec_context_by_oid( OM_uint32 *minor_status, const gss_ctx_id_t context_handle, const gss_OID desired_object, gss_buffer_set_t *data_set) { OM_uint32 ret; spnego_gss_ctx_id_t sc = (spnego_gss_ctx_id_t)context_handle; /* There are no SPNEGO-specific OIDs for this function. */ if (sc->ctx_...
vuln
Safe
C/C++
public boolean loginValidate(String userName, String password, String email) { String sql = "select * from voter_table where voter_name=? and password=? and email=?"; try { ps = DbUtil.getConnection().prepareStatement(sql); ps.setString(1, userName); ps.setString(2, password); ps.setString(3, email); ...
vuln
Vulnerable
Java
rsvg_new_filter_primitive_flood (void) { RsvgFilterPrimitive *filter; filter = g_new (RsvgFilterPrimitive, 1); _rsvg_node_init (&filter->super); filter->in = g_string_new ("none"); filter->result = g_string_new ("none"); filter->x.factor = filter->y.factor = filter->width.factor = filter->height...
vuln
Vulnerable
Unknown
/* * . .o8 oooo * .o8 "888 `888 * .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo * 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P' * 888 888 888 888 8...
vuln
Vulnerable
JavaScript
def process_form(): # see https://docs.python.org/3.4/library/cgi.html for the basic usage # here. form = cgi.FieldStorage() # connect to the database conn = MySQLdb.connect(host = pnsdp.SQL_HOST, user = pnsdp.SQL_USER, passwd = pnsdp.SQL_P...
vuln
Safe
Python
void hbitmap_iter_init(HBitmapIter *hbi, const HBitmap *hb, uint64_t first) { unsigned i, bit; uint64_t pos; hbi->hb = hb; pos = first >> hb->granularity; assert(pos < hb->size); hbi->pos = pos >> BITS_PER_LEVEL; hbi->granularity = hb->granularity; for (i = HBITMAP_LEVELS; i-- > 0; ) { ...
vuln
Safe
C/C++
private static boolean isResearchable(ItemStack stack) { Item item = stack.getItem(); if (item instanceof LostKnowledgeItem) { KnowledgeKey key = LostKnowledgeItem.getKnowledgeKey(stack); return key == null; } else if (item == EssencesModule.BLOCK_ABSORBER_ITEM.get()) { ...
vuln
Vulnerable
Java
/* * Rufus: The Reliable USB Formatting Utility * Standard Dialog Routines (Browse for folder, About, etc) * Copyright © 2011-2017 Pete Batard <pete@akeo.ie> * * 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 ...
vuln
Safe
C/C++
import dayjs from 'dayjs' import utc from 'dayjs/plugin/utc' import { FlowRouter } from 'meteor/ostrio:flow-router-extra' import { saveAs } from 'file-saver' import { NullXlsx } from '@neovici/nullxlsx' import './dailytimetable.html' import './pagination.js' import './limitpicker.js' import { getGlobalSetting, numb...
vuln
Vulnerable
JavaScript
static int vnc_worker_thread_loop(VncJobQueue *queue) { VncJob *job; VncRectEntry *entry, *tmp; VncState vs; int n_rectangles; int saved_offset; vnc_lock_queue(queue); while (QTAILQ_EMPTY(&queue->jobs) && !queue->exit) { qemu_cond_wait(&queue->cond, &queue->mutex); } job...
vuln
Safe
C/C++
donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size, int clazz, int swap, size_t align, int *flags, uint16_t *notecount) { Elf32_Nhdr nh32; Elf64_Nhdr nh64; size_t noff, doff; uint32_t namesz, descsz; unsigned char *nbuf = CAST(unsigned char *, vbuf); if (*notecount == 0) return 0; --*note...
vuln
Safe
C/C++
cib_send_plaintext(int sock, xmlNode * msg) { char *xml_text = dump_xml_unformatted(msg); if (xml_text != NULL) { int rc = 0; char *unsent = xml_text; int len = strlen(xml_text); len++; /* null char */ crm_trace("Message on socket %d: size=%d", sock,...
vuln
Vulnerable
C/C++
public void sendBatchSync(String groupId, String streamId, List<byte[]> bodyList, int retry, long dataTime, Map<String, String> extraMap) { if (retry > maxSenderRetry) { LOGGER.warn("max retry reached, retry count is {}, sleep and send again", retry); AgentUtils.silenceSleepInMs(...
vuln
Safe
Java
int read_file(struct sc_card *card, char *str_path, unsigned char **data, size_t *data_len) { struct sc_path path; struct sc_file *file; unsigned char *p; int ok = 0; int r; size_t len; sc_format_path(str_path, &path); if (SC_SUCCESS != sc_select_file(card, &path, &file)) { goto err; } len = file ? file->...
vuln
Vulnerable
Unknown
function Socket (uri, opts) { if (!(this instanceof Socket)) return new Socket(uri, opts); opts = opts || {}; if (uri && 'object' === typeof uri) { opts = uri; uri = null; } if (uri) { uri = parseuri(uri); opts.hostname = uri.host; opts.secure = uri.protocol === 'https' || uri.protocol ...
vuln
Vulnerable
JavaScript
/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com * Copyright (c) 2016 Facebook * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. * * This program is distributed in th...
vuln
Vulnerable
C/C++
static int decode_dds1(GetByteContext *gb, uint8_t *frame, int width, int height) { const uint8_t *frame_start = frame; const uint8_t *frame_end = frame + width * height; int mask = 0x10000, bitbuf = 0; int i, v, offset, count, segments; segments = bytestream2_get_le16(gb); while (segments--)...
vuln
Vulnerable
C/C++
int uev_init1(uev_ctx_t *ctx, int maxevents) { if (!ctx || maxevents < 1) { errno = EINVAL; return -1; } if (maxevents > UEV_MAX_EVENTS) maxevents = UEV_MAX_EVENTS; memset(ctx, 0, sizeof(*ctx)); ctx->maxevents = maxevents; return _init(ctx, 0); }
vuln
Safe
C/C++
rsock_strbuf(VALUE str, long buflen) { long len; if (NIL_P(str)) return rb_str_new(0, buflen); StringValue(str); len = RSTRING_LEN(str); if (len >= buflen) { rb_str_modify(str); } else { rb_str_modify_expand(str, buflen - len); } return str; }
vuln
Safe
Unknown
void ChildThread::Shutdown() { file_system_dispatcher_.reset(); quota_dispatcher_.reset(); }
vuln
Vulnerable
C/C++
} void print_udta(GF_ISOFile *file, u32 track_number, Bool has_itags) { u32 i, count; count = gf_isom_get_udta_count(file, track_number); if (!count) return; if (has_itags) { for (i=0; i<count; i++) { u32 type; bin128 uuid; gf_isom_get_udta_type(file, track_number, i+1, &type, &uuid); if (type == ...
vuln
Vulnerable
C/C++
public boolean doesApply(CachedBlockPosition pos) { return blockCondition == null || blockCondition.test(pos); }
vuln
Safe
Java
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #include <string.h> #include <sys/queue.h> #include <sys/types.h> #include "lsquic.h" #include "lsquic_types.h" #include "lsquic_int_types.h" #include "lsquic_packet_common.h" #include "lsquic_packet_in.h" #include "lsquic_pa...
vuln
Vulnerable
C/C++
def lesen(self, params, name, words): if len(params.args) == 1: keks = 0 anrede = u"Du hast" if params.args[0]==params.target: keks = self.aendern(params.target, 0, name) else: keks = self.aendern(params.args[0],0, name) ...
vuln
Vulnerable
Python
static stmt_ty ast_for_async_funcdef(struct compiling *c, const node *n, asdl_seq *decorator_seq) { /* async_funcdef: 'async' funcdef */ REQ(n, async_funcdef); REQ(CHILD(n, 0), NAME); assert(strcmp(STR(CHILD(n, 0)), "async") == 0); REQ(CHILD(n, 1), funcdef); return ast_for_funcdef_impl(c, n, de...
vuln
Safe
C/C++
static void report_unavailable_features(FeatureWord w, uint32_t mask) { FeatureWordInfo *f = &feature_word_info[w]; int i; for (i = 0; i < 32; ++i) { if (1 << i & mask) { const char *reg = get_register_name_32(f->cpuid_reg); assert(reg); fprintf(stderr, "warning: ...
vuln
Vulnerable
C/C++
virtual void seekg (Int64 pos) { if( pos < 0 ) { THROW (IEX_NAMESPACE::InputExc, "internal error: seek to " << pos << " requested"); } const char* newcurrent = base + pos; if( newcurrent < base || newcurrent > end) { THROW (IEX_NAMESPACE::Inpu...
vuln
Safe
Unknown
private void handleSignNearbyProtection(SignChangeEvent event, Protection protection) { Block block = event.getBlock(); Player player = event.getPlayer(); Profile playerProfile = plugin.getProfileFactory().fromPlayer(player); Optional<SignType> newSignType = plugin.getSignParser().getSi...
vuln
Vulnerable
Java
static s32 gf_hevc_read_vps_bs_internal(GF_BitStream *bs, HEVCState *hevc, Bool stop_at_vps_ext) { u8 vps_sub_layer_ordering_info_present_flag, vps_extension_flag; u32 i, j; s32 vps_id; HEVC_VPS *vps; u8 layer_id_included_flag[MAX_LHVC_LAYERS][64]; //nalu header already parsed vps_id = gf_bs_read_int_log(bs, 4,...
vuln
Vulnerable
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
vuln
Vulnerable
C/C++
static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion, void *opaque) { GtkDisplayState *s = opaque; int x, y; int mx, my; int fbh, fbw; int ww, wh; fbw = surface_width(s->ds) * s->scale_x; fbh = surface_height(s->ds) * s->scale_y; gdk_d...
vuln
Safe
C/C++
void dump_client_config(Options *o, const char *host) { int i, r; char buf[8], *all_key; /* * Expand HostKeyAlgorithms name lists. This isn't handled in * fill_default_options() like the other algorithm lists because * the host key algorithms are by default dynamically chosen based * on the host's keys foun...
vuln
Vulnerable
C/C++
@Override public Response modifyToken(String tokenID, TokenData tokenData) { String method = "TokenService.modifyToken"; Map<String, String> auditModParams = new HashMap<String, String>(); if (tokenID == null) { BadRequestException e = new BadRequestException("Token ID is null."...
vuln
Vulnerable
Java
rsvg_node_use_draw (RsvgNode * self, RsvgDrawingCtx * ctx, int dominate) { RsvgNodeUse *use = (RsvgNodeUse *) self; RsvgNode *child; RsvgState *state; double affine[6]; double x, y, w, h; x = _rsvg_css_normalize_length (&use->x, ctx, 'h'); y = _rsvg_css_normalize_length (&use->y, ctx, 'v'); ...
vuln
Safe
Unknown
static uint64_t get_cluster_offset(BlockDriverState *bs, uint64_t offset, int *num) { BDRVQcowState *s = bs->opaque; int l1_index, l2_index; uint64_t l2_offset, *l2_table, cluster_offset; int l1_bits, c; int index_in_cluster, nb_available, nb_needed, nb_clusters; ...
vuln
Vulnerable
C/C++
recv_and_process_client_pkt(void /*int fd*/) { ssize_t size; len_and_sockaddr *to; struct sockaddr *from; msg_t msg; uint8_t query_status; l_fixedpt_t query_xmttime; to = get_sock_lsa(G_listen_fd); from = xzalloc(to->len); size = recv_from_to(G_listen_fd, &msg, sizeof(msg),...
vuln
Safe
Unknown
void SoftAMR::onQueueFilled(OMX_U32 /* portIndex */) { List<BufferInfo *> &inQueue = getPortQueue(0); List<BufferInfo *> &outQueue = getPortQueue(1); if (mSignalledError || mOutputPortSettingsChange != NONE) { return; } while (!inQueue.empty() && !outQueue.empty()) { BufferInfo *inInfo = *inQueue.begi...
vuln
Safe
Unknown
@Override public void registerAuthenticationPolicies(final Collection<AuthenticationPolicy> authenticationPolicy) { this.authenticationPolicies.addAll(authenticationPolicy.stream().filter(BeanSupplier::isNotProxy).collect(Collectors.toList())); }
vuln
Safe
Java
private function _addlasteditor( $option ) { //Addlasteditor can not be used with addauthor. if ( !isset( $this->parametersProcessed['addauthor'] ) || !$this->parametersProcessed['addauthor'] ) { $this->addTable( 'revision_actor_temp', 'rev' ); $this->addWhere( [ $this->tableNames['page'] . '.page_id...
vuln
Vulnerable
PHP
static int io_sq_thread(void *data) { struct io_ring_ctx *ctx = data; struct mm_struct *cur_mm = NULL; const struct cred *old_cred; mm_segment_t old_fs; DEFINE_WAIT(wait); unsigned inflight; unsigned long timeout; int ret; complete(&ctx->completions[1]); old_fs = get_fs(); set_fs(USER_DS); old_cred = over...
vuln
Safe
Unknown
static int tiff_decode_tag(TiffContext *s, AVFrame *frame) { unsigned tag, type, count, off, value = 0, value2 = 0; int i, start; int pos; int ret; double *dp; ret = ff_tread_tag(&s->gb, s->le, &tag, &type, &count, &start); if (ret < 0) { goto end; } off = bytestream2_tell(&s...
vuln
Safe
C/C++
package certs import ( "bytes" "crypto" "crypto/ecdsa" "crypto/rand" "crypto/rsa" "crypto/sha256" "crypto/tls" "crypto/x509" "crypto/x509/pkix" "encoding/hex" "encoding/pem" "errors" "io/ioutil" "net/http" "strings" "time" cache "github.com/pmylund/go-cache" "github.com/sirupsen/logrus" ) // Storag...
vuln
Safe
Go
MagickExport void *ResizeQuantumMemory(void *memory,const size_t count, const size_t quantum) { size_t extent; if (CheckMemoryOverflow(count,quantum) != MagickFalse) { memory=RelinquishMagickMemory(memory); return((void *) NULL); } extent=count*quantum; return(ResizeMagickMemory(memor...
vuln
Vulnerable
C/C++
bool ChromeContentBrowserClientExtensionsPart::ShouldAllowOpenURL( content::SiteInstance* site_instance, const GURL& to_url, bool* result) { DCHECK(result); url::Origin to_origin(to_url); if (to_origin.scheme() != kExtensionScheme) { return false; } ExtensionRegistry* registry = Exten...
vuln
Vulnerable
C/C++
CURLcode Curl_auth_create_plain_message(struct Curl_easy *data, const char *userp, const char *passwdp, char **outptr, size_t *outlen) { CURLcode result; char *plainauth; size_t ulen; size_t p...
vuln
Safe
C/C++
@Environment(EnvType.CLIENT) @Inject(method = {"addPickBlock", "scrollInHotbar"}, at = @At(value = "FIELD", opcode = Opcodes.PUTFIELD, target = "Lnet/minecraft/entity/player/PlayerInventory;selectedSlot:I", shift = At.Shift.AFTER) ) private void preventClientHotbarSelection(CallbackInfo ci) { ...
vuln
Safe
Java
static inline struct htx_blk *htx_add_trailer(struct htx *htx, const struct ist name, const struct ist value) { struct htx_blk *blk; if (name.len > 255 || value.len > 1048575) return NULL; blk = htx_add_blk(htx, HTX_BLK_TLR, name.len + value.len); if (!blk) return NULL; blk->info += (value.len <<...
vuln
Safe
C/C++
static long do_sigreturn_v1(CPUARMState *env) { abi_ulong frame_addr; struct sigframe_v1 *frame = NULL; target_sigset_t set; sigset_t host_set; int i; frame_addr = env->regs[13]; if (frame_addr & 7) { goto badframe; } if (!lock_user_struct(VERIFY_R...
vuln
Safe
C/C++
package tunnelserver import ( "context" "encoding/base64" "encoding/json" "fmt" "io/ioutil" "os" "strings" "sync" "github.com/pkg/errors" "github.com/rancher/norman/types/set" "github.com/rancher/rancher/pkg/peermanager" "github.com/rancher/rancher/pkg/serviceaccounttoken" "github.com/rancher/rancher/pkg...
vuln
Vulnerable
Go
var create_tag_html = function(text, description, id, parent_id, is_tagset) { var cls = is_tagset ? "alltags-tagset" : (parent_id ? "alltags-childtag" : "alltags-tag"); var html = "<div class='" + cls + "' data-id='" + id + "'"; if (parent_id) { ...
vuln
Safe
JavaScript
/* ELF executable support for BFD. Copyright (C) 1993-2020 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. 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 Sof...
vuln
Vulnerable
C/C++
public static void replace(StringBuilder builder, String search, String replacement) { int index = builder.indexOf(search); if (index == -1) { return; } int searchLength = search.length(); int replacementLength = replacement.length(); while ((index = builder.replace(index, index + searchLength, replac...
vuln
Safe
Java
compute_O_value(std::string const& user_password, std::string const& owner_password, QPDF::EncryptionData const& data) { // Algorithm 3.3 from the PDF 1.7 Reference Manual unsigned char O_key[OU_key_bytes_V4]; compute_O_rc4_key(user_password, owner_password, data, O_key); char upass[key_bytes]; ...
vuln
Safe
Unknown
refreshTabs : function(){ "use strict"; window.console.log('refreshTabs'); var self = this; var pltabs = ''; for(var i=0; i<this.managedPlaylists.length; i++){ var pl = this.managedPlaylists[i]; var isactive = '' if(pl.id == this.editingPlayli...
vuln
Vulnerable
JavaScript
static int aac_parse_packet(AVFormatContext *ctx, PayloadContext *data, AVStream *st, AVPacket *pkt, uint32_t *timestamp, const uint8_t *buf, int len, uint16_t seq, int flags) { int ret; if (rtp_parse_mp4_au(data, buf, len)) ...
vuln
Safe
C/C++
@Override public void invoke(SysUserImportVo userVo, AnalysisContext context) { SysUser user = this.userService.selectUserByUserName(userVo.getUserName()); try { // 验证是否存在这个用户 if (StringUtils.isNull(user)) { user = BeanUtil.toBean(userVo, SysUser.class); ...
vuln
Vulnerable
Java
static CURLcode read_data(struct connectdata *conn, curl_socket_t fd, struct krb5buffer *buf) { int len; CURLcode result; result = socket_read(fd, &len, sizeof(len)); if(result) return result; if(len) { /* only realloc if there was a length */ ...
vuln
Vulnerable
Unknown
Agraph_t *agroot(void* obj) { switch (AGTYPE(obj)) { case AGINEDGE: case AGOUTEDGE: return ((Agedge_t *) obj)->node->root; case AGNODE: return ((Agnode_t *) obj)->root; case AGRAPH: return ((Agraph_t *) obj)->root; default: /* actually can't occur if only 2 bit tags */ agerr(AGERR, "agroot...
vuln
Vulnerable
Unknown
s64 ntfs_get_attribute_value(const ntfs_volume *vol, const ATTR_RECORD *a, u8 *b) { runlist *rl; s64 total, r; int i; /* Sanity checks. */ if (!vol || !a || !b) { errno = EINVAL; return 0; } /* Complex attribute? */ /* * Ignore the flags in case they are not zero for an attribute list * attribute. W...
vuln
Vulnerable
Unknown
private void buildCache(){ if (isBuildingCache) return; synchronized (lockObj) { if (this.hasCache) return; isBuildingCache = true; this.mobLevel = main.levelInterface.isLevelled(livingEntity) ? main.levelInterface.getLevelOfMob(livingEntity) : nul...
vuln
Vulnerable
Java