code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
private void queueMediaFile(final LocalFileLocation localFileLocation) { http_app.addLocalFilePath(localFileLocation); String url = http_app.getLinkToFile(); final HostConnection connection = hostManager.getConnection(); PlaylistType.Item item = new PlaylistType.Item(); item.fil...
vuln
Vulnerable
Java
static void xilinx_axidma_realize(DeviceState *dev, Error **errp) { XilinxAXIDMA *s = XILINX_AXI_DMA(dev); XilinxAXIDMAStreamSlave *ds = XILINX_AXI_DMA_DATA_STREAM(&s->rx_data_dev); XilinxAXIDMAStreamSlave *cs = XILINX_AXI_DMA_CONTROL_STREAM( &s->r...
vuln
Safe
C/C++
function dockerContainerInspect(containerID, payload) { containerID = containerID || ''; return new Promise((resolve) => { process.nextTick(() => { if (containerID) { if (!_docker_socket) { _docker_socket = new DockerSocket(); } _docker_socket.getInspect(containerID.tri...
vuln
Vulnerable
JavaScript
ews_connection_constructed (GObject *object) { EEwsConnection *cnc = E_EWS_CONNECTION (object); gint log_level; /* Chain up to parent's method. */ G_OBJECT_CLASS (e_ews_connection_parent_class)->constructed (object); cnc->priv->soup_thread = g_thread_new (NULL, e_ews_soup_thread, cnc); cnc->priv->soup_session ...
vuln
Safe
Unknown
public final synchronized int executeUpdate(CoreStatement stmt, Object[] vals) throws SQLException { try { if (execute(stmt, vals)) { throw new SQLException("query returns results"); } } finally { if (!stmt.pointer.isClosed()) { ...
vuln
Safe
Java
Pl_PNGFilter::decodePaeth() { QTC::TC("libtests", "Pl_PNGFilter decodePaeth"); unsigned char* buffer = this->cur_row + 1; unsigned char* above_buffer = this->prev_row + 1; unsigned int bpp = this->bytes_per_pixel; for (unsigned int i = 0; i < this->bytes_per_row; ++i) { int left = 0; ...
vuln
Safe
Unknown
import { mainPage } from "../../support/page_objects/mainPage"; import { isTestSuiteActive, isXcdb, getProjectString, isPostgres, } from "../../support/page_objects/projectConstants"; export const genTest = (apiType, dbType) => { if (!isTestSuiteActive(apiType, dbType)) return; describe(`${api...
vuln
Safe
JavaScript
http_splitline(struct worker *w, int fd, struct http *hp, const struct http_conn *htc, int h1, int h2, int h3) { char *p, *q; CHECK_OBJ_NOTNULL(htc, HTTP_CONN_MAGIC); CHECK_OBJ_NOTNULL(hp, HTTP_MAGIC); /* XXX: Assert a NUL at rx.e ? */ Tcheck(htc->rxbuf); /* Skip leading LWS */ for (p = htc->rxbuf.b ; vct...
vuln
Safe
C/C++
private Face Face_request(int i, int j) {//Find the surface by following the bar on the right side for the first time from the i-th point and the j-th point. Face tempFace = new Face(); tempFace.addPointId(i); tempFace.addPointId(j); int nextT; nextT = getRPoint(tempFace.getPoin...
vuln
Safe
Java
Database.prototype.register = function(attendee) { this.db.run( "INSERT INTO tb_events (uid, key, value, payload) VALUES ( ? , 'attendee', ? , ? );", [attendee.event, attendee.name, attendee.times] ); } // end of Database#register
vuln
Safe
JavaScript
public function redirect($route, $code = null) { /** @var Uri $uri */ $uri = $this['uri']; //Check for code in route $regex = '/.*(\[(30[1-7])\])$/'; preg_match($regex, $route, $matches); if ($matches) { $route = str_replace($matches[1], '', $matches[0]);...
vuln
Vulnerable
PHP
void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, Stream *maskStr, int maskWidth, int maskHeight, GBool maskInvert) { ImageStream *maskImgStr; maskImgStr = new ImageStream(maskStr, maskWidth, 1, 1); maskImgStr->reset(...
vuln
Vulnerable
C/C++
static void paint_mouse_pointer(AVFormatContext *s1, struct gdigrab *gdigrab) { CURSORINFO ci = {0}; #define CURSOR_ERROR(str) \ if (!gdigrab->cursor_error_printed) { \ WIN32_API_ERROR(str); \ gdigrab->cursor_error_printed = 1; \ } ci.cbSize = sizeo...
vuln
Safe
C/C++
private String formatArbitraryDecimalInput(String input) { // examples (monetary): 1 --> 0,01; 0,012 --> 0,12; 0,123 --> 1,23; 1,234 --> 12,34; 12,345 --> 123,45; 123,4 --> 12,34 String formattedAmount; // remove all decimal separators (this the final result for non-monetaries, where only integ...
vuln
Vulnerable
Java
xsltNumberFormatGetMultipleLevel(xsltTransformContextPtr context, xmlNodePtr node, xsltCompMatchPtr countPat, xsltCompMatchPtr fromPat, double *array, int max) { int amount = 0; int cnt; xmlNodePtr ancestor; xmlNodePtr preceding; xmlXPathParserContextPtr parser; context...
vuln
Vulnerable
Unknown
/* * 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
void NetworkHandler::GetAllCookies( std::unique_ptr<GetAllCookiesCallback> callback) { if (!process_) { callback->sendFailure(Response::InternalError()); return; } scoped_refptr<CookieRetriever> retriever = new CookieRetriever(std::move(callback)); BrowserThread::PostTask( Browser...
vuln
Vulnerable
C/C++
static void interface_get_init_info(QXLInstance *sin, QXLDevInitInfo *info) { SimpleSpiceDisplay *ssd = container_of(sin, SimpleSpiceDisplay, qxl); info->memslot_gen_bits = MEMSLOT_GENERATION_BITS; info->memslot_id_bits = MEMSLOT_SLOT_BITS; info->num_memslots = NUM_MEMSLOTS; info->num_memslots_grou...
vuln
Safe
C/C++
void Compute(OpKernelContext* context) override { const Tensor& diagonal = context->input(0); // MatrixDiag and MatrixDiagV2 both use this OpKernel. MatrixDiag only has // one input, so we have to check the number of inputs before reading // additional parameters in MatrixDiagV2. int32 lower_diag_i...
vuln
Safe
C/C++
static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len) { struct sk_buff *skb; int rc; struct l2tp_ip_sock *lsa = l2tp_ip_sk(sk); struct inet_sock *inet = inet_sk(sk); struct rtable *rt = NULL; int connected = 0; __be32 daddr; if (sock_flag(sk, SOCK_DEAD)) return -ENOT...
vuln
Safe
Unknown
'use strict'; const CDP = require('chrome-remote-interface'); class Renderer { _loadPage(client, url, options, config) { /** * Finds any meta tags setting the status code. * @return {?number} status code */ function getStatusCode() { const metaElement = document.querySelector('meta[name...
vuln
Vulnerable
JavaScript
public BlockState[] getAndCacheBlocks() { if (blocks == null) { blocks = CACHE.get(); BlockState[] array = blocks.takeArray(this.getLength()); ModUtil.traverseArea(start, end.offset(-1, -1, -1), new BlockPos.Mutable(), world, (state, pos, zyxIndex) -> array[zyxIndex] = state); } return blocks.array; }
vuln
Vulnerable
Java
/* 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
Vulnerable
Python
GF_Err gf_media_export_webvtt_metadata(GF_MediaExporter *dumper) { GF_ESD *esd; char szName[1000], szMedia[1000]; FILE *med, *vtt; u32 w, h; u32 track, i, di, count, pos; u32 mtype, mstype; Bool isText; char *mime = NULL; Bool useBase64 = GF_FALSE; u32 headerLength = 0; if (!(track = gf_isom_get_track_by_id...
vuln
Safe
C/C++
PHP_FUNCTION(openssl_seal) { zval *pubkeys, **pubkey, *sealdata, *ekeys; HashTable *pubkeysht; HashPosition pos; EVP_PKEY **pkeys; long * key_resources; /* so we know what to cleanup */ int i, len1, len2, *eksl, nkeys; unsigned char *buf = NULL, **eks; char * data; int data_len; char *method =NULL; int method...
vuln
Safe
C/C++
@Override public void retry() { logger.info("retry upStream msg start,seq:{},retryTimes:{},bizSeq:{}", this.seq, this.retryTimes, EventMeshUtil.getMessageBizSeq(this.event)); try { Command replyCmd = getReplyCmd(header.getCmd()); long sendTime = System.curren...
vuln
Safe
Java
from __future__ import annotations from datetime import timedelta as td from django import forms from django.contrib.auth import authenticate from django.contrib.auth.models import User from hc.accounts.models import REPORT_CHOICES, Member from hc.api.models import TokenBucket from hc.lib.tz import all_timezones c...
vuln
Safe
Python
nsPluginInstance::setupCookies(const std::string& pageurl) { std::string::size_type pos; pos = pageurl.find("/", pageurl.find("//", 0) + 2) + 1; std::string url = pageurl.substr(0, pos); std::string ncookie; char *cookie = 0; uint32_t length = 0; NPError rv = NPERR_GENERIC_ERROR; #if NPA...
vuln
Vulnerable
Unknown
unsigned long X509_issuer_and_serial_hash(X509 *a) { unsigned long ret = 0; EVP_MD_CTX *ctx = EVP_MD_CTX_new(); unsigned char md[16]; char *f; if (ctx == NULL) goto err; f = X509_NAME_oneline(a->cert_info.issuer, NULL, 0); if (!EVP_DigestInit_ex(ctx, EVP_md5(), NULL)) goto e...
vuln
Vulnerable
Unknown
init: function (editorInstance) { initPasteEvent(editorInstance); var pluginName = 'base64image-dialog'; editorInstance.ui.addToolbarGroup('base64image', 'insert'); editorInstance.ui.addButton('base64image', { label: editorInstance.lang.common.image, command: pluginName, toolbar: 'insert' }); CKEDI...
vuln
Vulnerable
JavaScript
/* The MIT License (MIT) * * Copyright (c) 2015 Main Street Softworks, Inc. * * 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 right...
vuln
Vulnerable
C/C++
static int32_t bmdma_prepare_buf(IDEDMA *dma, int is_write) { BMDMAState *bm = DO_UPCAST(BMDMAState, dma, dma); IDEState *s = bmdma_active_if(bm); PCIDevice *pci_dev = PCI_DEVICE(bm->pci_dev); struct { uint32_t addr; uint32_t size; } prd; int l, len; pci_dma_sglist_init(&s->s...
vuln
Vulnerable
C/C++
int bdrv_all_delete_snapshot(const char *name, BlockDriverState **first_bad_bs, Error **err) { int ret = 0; BlockDriverState *bs; BdrvNextIterator it; QEMUSnapshotInfo sn1, *snapshot = &sn1; for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) { AioContext *ctx = ...
vuln
Safe
C/C++
void fp4_read_bin(fp4_t a, const uint8_t *bin, size_t len) { if (len != 4 * RLC_FP_BYTES) { RLC_THROW(ERR_NO_BUFFER); return; } fp2_read_bin(a[0], bin, 2 * RLC_FP_BYTES); fp2_read_bin(a[1], bin + 2 * RLC_FP_BYTES, 2 * RLC_FP_BYTES); }
vuln
Safe
C/C++
public Optional<File> attemptToFind(String resourceName) { Path dir = config.get().getResourceSettings().getCustomizationDirectory(); if (dir.toFile().exists() && dir.toFile().isDirectory()) { Path asPath = dir.resolve(resourceName); File found = asPath.toFile(); if (...
vuln
Vulnerable
Java
static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear, double cutoff0, enum AVSampleFormat format, enum SwrFilterType filter_type, int kaiser_beta, double precision, int ch...
vuln
Vulnerable
C/C++
coap_status_t __attribute__((optimize("O0"))) #else coap_status_t #endif coap_parse_message(void *packet, uint8_t *data, uint16_t data_len) { coap_packet_t *const coap_pkt = (coap_packet_t *) packet; uint8_t *current_option; unsigned int option_number = 0; unsigned int option_delta = 0; size_t option_length =...
vuln
Vulnerable
C/C++
public static boolean match(byte[] array, int... pattern) { int patternLen; if (array == null || array.length < (patternLen = pattern.length)) return false; for (int i = 0; i < patternLen; i++) { int patternVal = pattern[i]; if (patternVal == WILD) continue; if (array[i] != patternVal) return ...
vuln
Vulnerable
Java
static Image *ReadCALSImage(const ImageInfo *image_info, ExceptionInfo *exception) { char filename[MagickPathExtent], header[MagickPathExtent], message[MagickPathExtent]; FILE *file; Image *image; ImageInfo *read_info; int c, unique_file; MagickBooleanType status; ...
vuln
Safe
C/C++
void red_channel_pipes_add_type(RedChannel *channel, int pipe_item_type) { RingItem *link; RING_FOREACH(link, &channel->clients) { red_channel_client_pipe_add_type( SPICE_CONTAINEROF(link, RedChannelClient, channel_link), pipe_item_type); } }
vuln
Vulnerable
C/C++
@Override public void setString(String key, String value, int userId) { checkWritePermission(); mStorage.setString(key, value, userId); }
vuln
Vulnerable
Java
static void snd_timer_user_tinterrupt(struct snd_timer_instance *timeri, unsigned long resolution, unsigned long ticks) { struct snd_timer_user *tu = timeri->callback_data; struct snd_timer_tread *r, r1; struct timespec tstamp; int prev, append = 0; memset(&tstamp, 0, sizeof(tstamp)); spin_lo...
vuln
Safe
C/C++
"""Admin API.""" from django import http from django.contrib.contenttypes.models import ContentType from django.utils.translation import ugettext as _ from django_filters import rest_framework as dj_filters from drf_spectacular.utils import extend_schema, extend_schema_view from rest_framework import filters, rendere...
vuln
Safe
Python
def __init__(self, protocol='http', hostname='localhost', port='8080', subsystem=None, accept='application/json', trust_env=None, verify=True, cert_paths=None):
vuln
Safe
Python
int av_image_alloc(uint8_t *pointers[4], int linesizes[4], int w, int h, enum AVPixelFormat pix_fmt, int align) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); int i, ret; uint8_t *buf; if (!desc) return AVERROR(EINVAL); if ((ret = av_image_check_size(w, h...
vuln
Safe
C/C++
public static void setAuthCookie(String name, String value, int maxAge, HttpServletRequest request, HttpServletResponse response) { String expires = DateFormatUtils.format(System.currentTimeMillis() + (maxAge * 1000), "EEE, dd-MMM-yyyy HH:mm:ss z", TimeZone.getTimeZone("GMT")); String contextPath = request.g...
vuln
Safe
Java
void ff_vp3_idct_dc_add_c(uint8_t *dest, int line_size, const DCTELEM *block){ int i, dc = (block[0] + 15) >> 5; for(i = 0; i < 8; i++){ dest[0] = av_clip_uint8(dest[0] + dc); dest[1] = av_clip_uint8(dest[1] + dc); dest[2] = av_clip_uint8(dest[2] + dc); dest[3] = av_clip_uint8(de...
vuln
Safe
C/C++
static int find_optimal_param(uint32_t sum, int n) { int k; uint32_t sum2; if (sum <= n >> 1) return 0; sum2 = sum - (n >> 1); k = av_log2(n < 256 ? FASTDIV(sum2, n) : sum2 / n); return FFMIN(k, MAX_RICE_PARAM); }
vuln
Vulnerable
C/C++
static krb5_error_code verify_client_san(krb5_context context, pkinit_kdc_context plgctx, pkinit_kdc_req_context reqctx, krb5_kdcpreauth_callbacks cb, krb5_kdcpreauth_rock rock, krb5_const_principal client, int *...
vuln
Vulnerable
C/C++
asn1_get_octet_der (const unsigned char *der, int der_len, int *ret_len, unsigned char *str, int str_size, int *str_len) { int len_len = 0; if (der_len <= 0) return ASN1_GENERIC_ERROR; *str_len = asn1_get_length_der (der, der_len, &len_len); if (*str_len < 0) return ASN1_DER_ERROR; *re...
vuln
Safe
Unknown
public long getDateModified() { return Collections.max( albums, (a1, a2) -> ComparatorUtil.compareLongInts(a1.getDateModified(), a2.getDateModified()) ).getDateModified(); }
vuln
Vulnerable
Java
/* * Driver for NAND support, Rick Bronson * borrowed heavily from: * (c) 1999 Machine Vision Holdings, Inc. * (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org> * * Ported 'dynenv' to 'nand env.oob' command * (C) 2010 Nanometrics, Inc. * 'dynenv' -- Dynamic environment offset in NAND OOB * (C) Copyright 200...
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
Safe
Unknown
private SendShuffleDataResponse doSendData(SendShuffleDataRequest rpcRequest) { int retryNum = 0; while (retryNum < maxRetryAttempts) { try { SendShuffleDataResponse response = blockingStub.withDeadlineAfter( rpcTimeout, TimeUnit.MILLISECONDS).sendShuffleData(rpcRequest); retur...
vuln
Vulnerable
Java
void rds6_inc_info_copy(struct rds_incoming *inc, struct rds_info_iterator *iter, struct in6_addr *saddr, struct in6_addr *daddr, int flip) { struct rds6_info_message minfo6; minfo6.seq = be64_to_cpu(inc->i_hdr.h_sequence); minfo6.len = be32_to_cpu(inc->i_hdr.h_len); minfo6.tos = inc->i_conn->c_tos; ...
vuln
Safe
C/C++
static av_cold int rv30_decode_init(AVCodecContext *avctx) { RV34DecContext *r = avctx->priv_data; int ret; r->rv30 = 1; if ((ret = ff_rv34_decode_init(avctx)) < 0) return ret; if(avctx->extradata_size < 2){ av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n"); return -1;...
vuln
Vulnerable
C/C++
printer_close(struct inode *inode, struct file *fd) { struct printer_dev *dev = fd->private_data; unsigned long flags; spin_lock_irqsave(&dev->lock, flags); dev->printer_cdev_open = 0; fd->private_data = NULL; /* Change printer status to show that the printer is off-line. */ dev->printer_status &= ~PRINTER_SEL...
vuln
Vulnerable
Unknown
/* radare - LGPL - Copyright 2009-2022 - ret2libc, pancake */ #include <r_types.h> #include <r_util.h> #include <r_io.h> typedef enum { R_BUFFER_FILE, R_BUFFER_IO, R_BUFFER_BYTES, R_BUFFER_MMAP, R_BUFFER_SPARSE, R_BUFFER_REF, } RBufferType; #include "buf_file.c" #include "buf_sparse.c" #include "buf_bytes.c" #...
vuln
Safe
C/C++
sp<MediaSource> MPEG4Extractor::getTrack(size_t index) { status_t err; if ((err = readMetaData()) != OK) { return NULL; } Track *track = mFirstTrack; while (index > 0) { if (track == NULL) { return NULL; } track = track->next; --index; } if (track == NULL) { return NULL; } Trex *trex = NULL;...
vuln
Vulnerable
C/C++
public void destroy() throws DestroyFailedException { try { first.destroy(); } catch (NoSuchMethodError ignore) { } }
vuln
Safe
Java
@Override public SQLStatement preHandle(DumpFileContext context, String stmt) throws SQLSyntaxErrorException { SQLStatement sqlStatement = RouteStrategyFactory.getRouteStrategy().parserSQL(stmt); String tableName; if (sqlStatement instanceof MySqlCreateTableStatement) { tableName...
vuln
Vulnerable
Java
0==this.hiddenTags.length)return!1;u=u.split(" ");if(u.length>this.hiddenTags.length)return!1;for(var D=0;D<u.length;D++)if(0>mxUtils.indexOf(this.hiddenTags,u[D]))return!1;return!0};Graph.prototype.getCellsForTags=function(u,D,K,T){var N=[];if(null!=u){D=null!=D?D:this.model.getDescendants(this.model.getRoot());for(va...
vuln
Safe
JavaScript
static void io_req_free_batch_finish(struct io_ring_ctx *ctx, struct req_batch *rb) { if (rb->to_free) __io_req_free_batch_flush(ctx, rb); if (rb->task) { atomic_long_add(rb->task_refs, &rb->task->io_uring->req_complete); put_task_struct_many(rb->task, rb->task_refs); rb->task = NULL; } }
vuln
Safe
Unknown
function ToolbarLink(props) { return <a className={classnames('maputnik-toolbar-link', props.className)} href={props.href} rel="noopener noreferrer" target={"_blank"} > {props.children} </a> }
vuln
Safe
JavaScript
$scope.provision = function() { $scope.isSaving = true; growl.info('The node ' + _.escape($scope.node.nodeLabel) + ' is being added to requisition ' + _.escape($scope.node.foreignSource) + '. Please wait...'); var successMessage = 'The node ' + _.escape($scope.node.nodeLabel) + ' has been added to req...
vuln
Safe
JavaScript
def _do_get_well_known(self, server_name): """Actually fetch and parse a .well-known, without checking the cache :param server_name: Name of the server, from the requested url :type server_name: bytes :returns a tuple of (result, cache period), where result is one of: - the...
vuln
Vulnerable
Python
static int cloop_open(BlockDriverState *bs, int flags) { BDRVCloopState *s = bs->opaque; uint32_t offsets_size, max_compressed_block_size = 1, i; bs->read_only = 1; if (bdrv_pread(bs->file, 128, &s->block_size, 4) < 4) { goto cloop_close; } s->block_size = be32_to_cpu(s->block_size)...
vuln
Vulnerable
C/C++
static inline abi_ulong do_shmat(int shmid, abi_ulong shmaddr, int shmflg) { abi_long raddr; void *host_raddr; struct shmid_ds shm_info; int i,ret; ret = get_errno(shmctl(shmid, IPC_STAT, &shm_info)); if (is_error(ret)) { return ret; } mmap_lock(); if (shmaddr) ...
vuln
Vulnerable
C/C++
protected File getWebRoot(File requestedWebroot, File warfile) throws IOException { if (warfile != null) { Logger.log(Logger.INFO, Launcher.RESOURCES, "HostConfig.BeginningWarExtraction"); // open the war file if (!warfile.exists() || !warfile.isFile()) ...
vuln
Safe
Java
def relative(self, relativePath) -> FileInputSource: return FileInputSource(os.path.join(self.directory(), relativePath), chroot=False, chrootPath=self.chrootPath)
vuln
Safe
Python
public void draw(){ for(StatusEntry e : statuses){ Draw.alpha(UnitType.alpha); e.effect.draw(self()); } }
vuln
Vulnerable
Java
struct timespec ns_to_timespec(const s64 nsec) { struct timespec ts; if (!nsec) return (struct timespec) {0, 0}; ts.tv_sec = div_long_long_rem_signed(nsec, NSEC_PER_SEC, &ts.tv_nsec); if (unlikely(nsec < 0)) set_normalized_timespec(&ts, ts.tv_sec, ts.tv_nsec); return ts; }
vuln
Vulnerable
C/C++
Response PageHandler::SetDownloadBehavior(const std::string& behavior, Maybe<std::string> download_path) { WebContentsImpl* web_contents = GetWebContents(); if (!web_contents) return Response::InternalError(); if (behavior == Page::SetDownloadBehavior::BehaviorEn...
vuln
Vulnerable
C/C++
private BiConsumer<Fetchable, Boolean> createFetchableBiConsumer( FetchParent fetchParent, QuerySpec querySpec, LoaderSqlAstCreationState creationState, List<Fetch> fetches) { return (fetchable, isKeyFetchable) -> { final NavigablePath fetchablePath; if ( isKeyFetchable ) { final EntityIdentifi...
vuln
Safe
Java
def self.get_childs(klass, node_id, recursive, ret_obj) SqlHelper.validate_token([node_id]) array = [] if recursive tree = klass.get_tree(Hash.new, nil, node_id) return array if tree.nil? tree.each do |parent_id, childs| if ret_obj array |= childs else ...
vuln
Vulnerable
Ruby
char *redisProtocolToLuaType(lua_State *lua, char* reply) { char *p = reply; switch(*p) { case ':': p = redisProtocolToLuaType_Int(lua,reply); break; case '$': p = redisProtocolToLuaType_Bulk(lua,reply); break; case '+': p = redisProtocolToLuaType_Status(lua,reply); break; case '-': p = redisPr...
vuln
Vulnerable
Unknown
protected UploadServer getOneServer() { if (host == null || host.length() == 0) { return null; } if (ipGroupList != null && ipGroupList.size() > 0) { int index = (int) (Math.random() * ipGroupList.size()); UploadIpGroup ipGroup = ipGrou...
vuln
Vulnerable
Java
package com.salesmanager.shop.model.catalog.product.attribute; import java.io.Serializable; public class ProductOptionEntity extends ProductPropertyOption implements Serializable { /** * */ private static final long serialVersionUID = 1L; private int order; private String type; public void setOrder(int o...
vuln
Safe
Java
/* * . .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
@EventHandler public void onCommand(PlayerCommandPreprocessEvent event) { Player player = event.getPlayer(); EdenEvent edenEvent = EdenEvent.getOnGoingEvent(); if (edenEvent == null) { return; } Party party = Party.getByPlayer(player); if (party == null) ...
vuln
Vulnerable
Java
/* Copyright 2015 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
Proto_SecurityCheckRequest(ServiceConnection *conn, ProtoRequest *req) { VGAuthError err; gboolean isSecure = ServiceNetworkIsConnectionPrivateSuperUser(conn); if (conn->isPublic && req->reqType != PROTO_REQUEST_SESSION_REQ) { return VGAUTH_E_PERMISSION_DENIED; } switch...
vuln
Safe
Unknown
int GetS32BE (int nPos, bool *pbSuccess) { //*pbSuccess = true; if ( nPos < 0 || nPos + 3 >= m_nLen ) { *pbSuccess = false; return 0; } int nRes = m_sFile[ nPos ]; nRes = (nRes << 8) + m_sFile[nPos ...
vuln
Vulnerable
C/C++
int ff_raw_read_header(AVFormatContext *s) { AVStream *st; enum CodecID id; st = avformat_new_stream(s, NULL); if (!st) return AVERROR(ENOMEM); id = s->iformat->raw_codec_id; if (id == CODEC_ID_RAWVIDEO) { st->codec->codec_type = AVMEDIA_TYPE_VIDEO; } else { ...
vuln
Safe
C/C++
bgp_update_print(netdissect_options *ndo, const u_char *dat, int length) { struct bgp bgp; const u_char *p; int withdrawn_routes_len; int len; int i; ND_TCHECK2(dat[0], BGP_SIZE); if (length < BGP_SIZE) goto trunc; memcpy(&bgp, dat, BGP_SIZE); p = dat + BGP_SIZE; /*XXX*/ length -= BGP_SIZE...
vuln
Vulnerable
Unknown
static int usb_hid_handle_data(USBDevice *dev, USBPacket *p) { USBHIDState *s = (USBHIDState *)dev; int ret = 0; switch(p->pid) { case USB_TOKEN_IN: if (p->devep == 1) { int64_t curtime = qemu_get_clock_ns(vm_clock); if (!s->changed && (!s->idle || s->next_idle_clock - cu...
vuln
Vulnerable
C/C++
static int evtchn_fifo_percpu_deinit(unsigned int cpu) { __evtchn_fifo_handle_events(cpu, NULL); return 0; }
vuln
Safe
Unknown
applySettings( input, settings ){ DEFAULTS.templates = this.templates var _s = this.settings = extend({}, DEFAULTS, settings) _s.disabled = input.hasAttribute('disabled') _s.readonly = _s.readonly || input.hasAttribute('readonly') _s.placeholder = escapeHTML(input.getAttribute(...
vuln
Safe
JavaScript
static int wma_decode_block(WMADecodeContext *s) { int n, v, a, ch, code, bsize; int coef_nb_bits, total_gain, parse_exponents; DECLARE_ALIGNED_16(float, window[BLOCK_MAX_SIZE * 2]); int nb_coefs[MAX_CHANNELS]; float mdct_norm; #ifdef TRACE tprintf("***decode_block: %d:%d\n", s->frame_count - 1,...
vuln
Vulnerable
C/C++
empe_inlinepgp_signed_parse (EMailParserExtension *extension, EMailParser *parser, CamelMimePart *part, GString *part_id, GCancellable *cancellable, GQueue *out_mail_parts) { ...
vuln
Vulnerable
Unknown
utf32le_mbc_to_code(const UChar* p, const UChar* end ARG_UNUSED) { return (OnigCodePoint )(((p[3] * 256 + p[2]) * 256 + p[1]) * 256 + p[0]); }
vuln
Vulnerable
Unknown
async def on_claim_client_keys( self, query: List[Tuple[str, str, str, int]], always_include_fallback_keys: bool ) -> Dict[str, Any]: if any( not self.hs.is_mine(UserID.from_string(user_id)) for user_id, _, _, _ in query ): raise SynapseError(400, "User is...
vuln
Safe
Python
private static IIdentifier load(XMLResource resource, InputStream inputStream) throws IOException { resource.getDefaultLoadOptions().put(XMLResource.OPTION_ENCODING, "UTF-8"); //$NON-NLS-1$ // Don't allow DTD loading in case of XSS exploits Map<String, Object> parserFeatures = new HashM...
vuln
Safe
Java
constructor(provider, options) { this[_provider] = provider; this[_options] = Object.assign({}, options); this[_destroyed] = false; }
vuln
Vulnerable
JavaScript
static struct dentry *proc_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { int err; struct super_block *sb; struct pid_namespace *ns; char *options; if (flags & MS_KERNMOUNT) { ns = (struct pid_namespace *)data; options = NULL; } else { ns = task_active_pid_ns(curren...
vuln
Safe
Unknown
static int open_group(char *name, int has_prefix, struct backend **ret, int *postable /* used for LIST ACTIVE only */) { char mailboxname[MAX_MAILBOX_BUFFER]; int r = 0; char *acl, *newserver; struct backend *backend_next = NULL; /* close local group */ if (group_state) index_close(&g...
vuln
Vulnerable
Unknown
static int protocol_client_auth_vnc(VncState *vs, uint8_t *data, size_t len) { unsigned char response[VNC_AUTH_CHALLENGE_SIZE]; size_t i, pwlen; unsigned char key[8]; time_t now = time(NULL); QCryptoCipher *cipher = NULL; Error *err = NULL; if (!vs->vd->password) { trace_vnc_auth_fai...
vuln
Safe
C/C++
/** * File: WebP IO * * Read and write WebP images. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include <stdio.h> #include <math.h> #include <string.h> #include <stdlib.h> #include "gd.h" #include "gd_errors.h" #include "gdhelpers.h" #ifdef HAVE_LIBWEBP #include "webp/decode.h" #incl...
vuln
Safe
C/C++
static void gen_mtsrin(DisasContext *ctx) { #if defined(CONFIG_USER_ONLY) GEN_PRIV; #else TCGv t0; CHK_SV; t0 = tcg_temp_new(); tcg_gen_shri_tl(t0, cpu_gpr[rB(ctx->opcode)], 28); tcg_gen_andi_tl(t0, t0, 0xF); gen_helper_store_sr(cpu_env, t0, cpu_gpr[rD(ctx->opcode)]); tcg_temp_free(t0); ...
vuln
Safe
C/C++
def __call__(self, environ, start_response): """Manage a request.""" log.LOGGER.info("%s request at %s received" % ( environ["REQUEST_METHOD"], environ["PATH_INFO"])) headers = pprint.pformat(self.headers_log(environ)) log.LOGGER.debug("Request headers:\n%s" % headers) ...
vuln
Vulnerable
Python