code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
static void usbredir_bulk_packet(void *priv, uint32_t id, struct usb_redir_bulk_packet_header *bulk_packet, uint8_t *data, int data_len) { USBRedirDevice *dev = priv; uint8_t ep = bulk_packet->endpoint; int len = bulk_packet->length; AsyncURB *aurb; DPRINTF("bulk-in status %d ep %02X len %d ...
vuln
Safe
C/C++
# -*- coding: utf-8 -*- # rdiffweb, A web interface to rdiff-backup repositories # Copyright (C) 2012-2021 rdiffweb contributors # # 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 Software Foundation, either version ...
vuln
Safe
Python
static int legacy_parse_param(struct fs_context *fc, struct fs_parameter *param) { struct legacy_fs_context *ctx = fc->fs_private; unsigned int size = ctx->data_size; size_t len = 0; int ret; ret = vfs_parse_fs_param_source(fc, param); if (ret != -ENOPARAM) return ret; if (ctx->param_type == LEGACY_FS_MONOLI...
vuln
Safe
Unknown
static void reply_sesssetup_and_X_spnego(struct smb_request *req) { const uint8 *p; DATA_BLOB blob1; size_t bufrem; char *tmp; const char *native_os; const char *native_lanman; const char *primary_domain; const char *p2; uint16 data_blob_len = SVAL(req->vwv+7, 0); enum remote_arch_types ra_type = get_remote_a...
vuln
Safe
C/C++
0==this.hiddenTags.length)return!1;u=u.split(" ");if(u.length>this.hiddenTags.length)return!1;for(var E=0;E<u.length;E++)if(0>mxUtils.indexOf(this.hiddenTags,u[E]))return!1;return!0};Graph.prototype.getCellsForTags=function(u,E,J,T){var N=[];if(null!=u){E=null!=E?E:this.model.getDescendants(this.model.getRoot());for(va...
vuln
Vulnerable
JavaScript
static inline void RENAME(rgb15tobgr24)(const uint8_t *src, uint8_t *dst, int src_size) { const uint16_t *end; const uint16_t *mm_end; uint8_t *d = dst; const uint16_t *s = (const uint16_t*)src; end = s + src_size/2; __asm__ volatile(PREFETCH" %0"::"m"(*s):"memory"); mm_end = end - 7; ...
vuln
Safe
C/C++
static int nbd_co_request(BlockDriverState *bs, NBDRequest *request, QEMUIOVector *qiov) { NBDClientSession *client = nbd_get_client_session(bs); int ret; if (qiov) { assert(request->type == NBD_CMD_WRITE || request->type == NBD_CMD_READ); ...
vuln
Vulnerable
C/C++
static int scsi_req_length(SCSICommand *cmd, SCSIDevice *dev, uint8_t *buf) { cmd->xfer = scsi_cdb_length(buf); switch (buf[0]) { case TEST_UNIT_READY: case REWIND: case START_STOP: case SET_CAPACITY: case WRITE_FILEMARKS: case WRITE_FILEMARKS_16: case SPACE: case RESERVE: ca...
vuln
Vulnerable
C/C++
toMathMLclass: function (attr) { var CLASS = []; if (this["class"]) {CLASS.push(this["class"])} if (this.isa(MML.TeXAtom) && SETTINGS.texHints) { var TEXCLASS = ["ORD","OP","BIN","REL","OPEN","CLOSE","PUNCT","INNER","VCENTER"][this.texClass]; if (TEXCLASS) { CLASS.push("MJX-TeXAtom...
vuln
Vulnerable
JavaScript
str_lower_case_match(OnigEncoding enc, int case_fold_flag, const UChar* t, const UChar* tend, const UChar* p, const UChar* end) { int lowlen; UChar *q, lowbuf[ONIGENC_MBC_CASE_FOLD_MAXLEN]; while (t < tend) { lowlen = ONIGENC_MBC_CASE_FOLD(enc, case_fold_flag, &p, en...
vuln
Vulnerable
C/C++
ScriptValue ScriptController::executeScriptInMainWorld(const ScriptSourceCode& sourceCode, AccessControlStatus corsStatus) { String sourceURL = sourceCode.url(); const String* savedSourceURL = m_sourceURL; m_sourceURL = &sourceURL; v8::HandleScope handleScope; v8::Handle<v8::Context> v8Context = Sc...
vuln
Safe
C/C++
@Override public void callSessionMergeComplete(IImsCallSession newSession) { TelephonyUtils.runWithCleanCallingIdentity(()-> { if (mListener != null) { if (newSession != null) { // New session created after conference ...
vuln
Safe
Java
xfs_attr_leaf_addname(xfs_da_args_t *args) { xfs_inode_t *dp; struct xfs_buf *bp; int retval, error, committed, forkoff; trace_xfs_attr_leaf_addname(args); /* * Read the (only) block in the attribute list in. */ dp = args->dp; args->blkno = 0; error = xfs_attr3_leaf_read(args->trans, args->dp, args->blkno...
vuln
Vulnerable
C/C++
static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref) { AResampleContext *aresample = inlink->dst->priv; const int n_in = insamplesref->audio->nb_samples; int n_out = FFMAX(n_in * aresample->ratio * 2, 1); AVFilterLink *const outlink = inlink->dst->outputs[0]; AVFil...
vuln
Safe
C/C++
void cJSON_Delete( cJSON *c ) void cJSON_Delete(cJSON *c) { cJSON *next; while (c) { next=c->next; if (!(c->type&cJSON_IsReference) && c->child) cJSON_Delete(c->child); if (!(c->type&cJSON_IsReference) && c->valuestring) cJSON_free(c->valuestring); if (!(c->type&cJSON_StringIsConst) && c->string) cJSON_fre...
vuln
Safe
C/C++
@Override protected void onHitEntity(EntityRayTraceResult ray) { super.onHitEntity(ray); if (getStuckEntity() != null) return; Vector3d hit = ray.getLocation(); Entity target = ray.getEntity(); PotatoCannonProjectileTypes projectileType = getProjectileType(); float damage = projectileType.getDamage() ...
vuln
Vulnerable
Java
nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev) { struct sk_buff *fp, *op, *head = fq->q.fragments; int payload_len; fq_kill(fq); WARN_ON(head == NULL); WARN_ON(NFCT_FRAG6_CB(head)->offset != 0); /* Unfragmented part is taken from the first segment. */ payload_len = ((head->data - s...
vuln
Vulnerable
C/C++
@Override public void onPackageDeleted(String basePackageName, int returnCode, String msg) { if (PackageManager.DELETE_SUCCEEDED == returnCode && mNotification != null) { NotificationManager notificationManager = (NotificationManager) mContext.getSystemService...
vuln
Vulnerable
Java
irc_server_set_prefix_modes_chars (struct t_irc_server *server, const char *prefix) { char *pos; int i, old_length_chars, length_modes, length_chars; if (!server || !prefix) return; old_length_chars = (server->prefix_chars) ? strlen (server->prefix_ch...
vuln
Safe
C/C++
public void obtainCertificates() { HttpUriRequest request = RequestBuilder.post() .setUri(MOJANG_ENDPOINT + "/player/certificates") .setHeader(HttpHeaders.CONTENT_TYPE, "application/json") .setHeader(HttpHeaders.AUTHORIZATION, "Bearer " + authData.getAccessToken()...
vuln
Safe
Java
bool parseXMLDocumentFragment(const String& chunk, DocumentFragment* fragment, Element* parent) { if (!chunk.length()) return true; XMLTokenizer tokenizer(fragment, parent); CString chunkAsUtf8 = chunk.utf8(); tokenizer.initializeParserContext(chunkAsUtf8.data()); xmlParseContent...
vuln
Safe
C/C++
require('../lib/initConf'); require('../lib/setupProxy'); var unzipper = require('unzipper'); var path = require('path'); var archiver = require('archiver'); var cas = require('../lib/add_certs'); var os = require('os'); var fs = require('fs'); var http = require('http'); var express = require('express'); var bodyPars...
vuln
Vulnerable
JavaScript
def respondToQuestion(pollId: String, questionID: Int, responseID: Int, responder: Responder, polls: Polls) { polls.polls.get(pollId) match { case Some(p) => { p.respondToQuestion(questionID, responseID, responder) } case None => } }
vuln
Vulnerable
Scala
def get_request_handler( dependant: Dependant, body_field: Optional[ModelField] = None, status_code: int = 200, response_class: Union[Type[Response], DefaultPlaceholder] = Default(JSONResponse), response_field: Optional[ModelField] = None, response_model_include: Optional[Union[SetIntStr, DictIn...
vuln
Safe
Python
/* * Kernel-based Virtual Machine driver for Linux * * This module enables machines with Intel VT-x extensions to run virtual * machines without emulation or binary translation. * * Copyright (C) 2006 Qumranet, Inc. * Copyright 2010 Red Hat, Inc. and/or its affiliates. * * Authors: * Avi Kivity <avi@qumra...
vuln
Vulnerable
C/C++
/* * Copyright (C) 2005-2018 Team Kodi * This file is part of Kodi - https://kodi.tv * * SPDX-License-Identifier: GPL-2.0-or-later * See LICENSES/README.md for more information. */ #include "PlayListPLS.h" #include "PlayListFactory.h" #include "Util.h" #include "filesystem/File.h" #include "music/tags/Music...
vuln
Safe
C/C++
static uint64_t ReadBits(BitReader* reader, int num_bits) { DCHECK_GE(reader->bits_available(), num_bits); DCHECK((num_bits > 0) && (num_bits <= 64)); uint64_t value; reader->ReadBits(num_bits, &value); return value; }
vuln
Vulnerable
C/C++
Init_date_core(void) { #ifdef HAVE_RB_EXT_RACTOR_SAFE RB_EXT_RACTOR_SAFE(true); #endif id_cmp = rb_intern_const("<=>"); id_le_p = rb_intern_const("<="); id_ge_p = rb_intern_const(">="); id_eqeq_p = rb_intern_const("=="); half_days_in_day = rb_rational_new2(INT2FIX(1), INT2FIX(2)); #if (LO...
vuln
Vulnerable
Unknown
/* 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
Safe
Python
int qtree_scan_dquots(struct quota_handle *h, int (*process_dquot) (struct dquot *, void *), void *data) { char *bitmap; struct v2_mem_dqinfo *v2info = &h->qh_info.u.v2_mdqi; struct qtree_mem_dqinfo *info = &v2info->dqi_qtree; struct dquot *dquot = get_empty_dquot(); if (!dquot) return -1; dqu...
vuln
Vulnerable
Unknown
ms_escher_get_data (MSEscherState *state, gint offset, /* bytes from logical start of the stream */ gint num_bytes, /*how many bytes we want, NOT incl prefix */ gboolean * needs_free) { BiffQuery *q = state->q; guint8 *res; g_return_val_if_fail (offset >= state->start_offset, NULL); /* find t...
vuln
Safe
Unknown
KCleanup::expandVariables( const KFileInfo * item, const QString & unexpanded ) const { QString expanded = unexpanded; expanded.replace( QRegExp( "%p" ), "'" + QString::fromLocal8Bit( item->url() ) + "'" ); expanded.replace( QRegExp( "%n" ), "'" + QString::fromLocal8Bit( item->name()...
vuln
Vulnerable
C/C++
cmdloop(int top) { union node *n; struct stackmark smark; int inter; int status = 0; int numeof = 0; TRACE(("cmdloop(%d) called\n", top)); for (;;) { int skip; setstackmark(&smark); if (jobctl) showjobs(out2, SHOW_CHANGED); inter = 0; if (iflag && top) { inter++; chkmail(); } n = parsecm...
vuln
Safe
Unknown
private void powerLongPress(long eventTime) { final int behavior = getResolvedLongPressOnPowerBehavior(); Slog.d(TAG, "powerLongPress: eventTime=" + eventTime + " mLongPressOnPowerBehavior=" + mLongPressOnPowerBehavior); switch (behavior) { case LONG_PRESS_POWER_NOTH...
vuln
Vulnerable
Java
ZEND_METHOD(exception, getTraceAsString) { zval *trace; char *res, **str, *s_tmp; int res_len = 0, *len = &res_len, num = 0; DEFAULT_0_PARAMS; res = estrdup(""); str = &res; trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC); zend_hash_apply_with_arguments(Z...
vuln
Vulnerable
Unknown
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may n...
vuln
Vulnerable
Java
struct nfs_client *nfs4_alloc_client(const struct nfs_client_initdata *cl_init) { char buf[INET6_ADDRSTRLEN + 1]; const char *ip_addr = cl_init->ip_addr; struct nfs_client *clp = nfs_alloc_client(cl_init); int err; if (IS_ERR(clp)) return clp; err = nfs_get_cb_ident_idr(clp, cl_init->minorversion); if (err) ...
vuln
Safe
Unknown
session: session.fromPartition('about-window'), spellcheck: false, webviewTag: false, }, width: WINDOW_SIZE.WIDTH, }); aboutWindow.setMenuBarVisibility(false); // Prevent any kind of navigation // will-navigate is broken with sandboxed env, intercepting requests instead ...
vuln
Safe
JavaScript
char *qemu_find_file(int type, const char *name) { int i; const char *subdir; char *buf; if (access(name, R_OK) == 0) { trace_load_file(name, name); return g_strdup(name); } switch (type) { case QEMU_FILE_TYPE_BIOS: subdir = ""; break; case QEMU_FILE_...
vuln
Safe
C/C++
xmlParseEntityRef(xmlParserCtxtPtr ctxt) { const xmlChar *name; xmlEntityPtr ent = NULL; GROW; if (ctxt->instate == XML_PARSER_EOF) return(NULL); if (RAW != '&') return(NULL); NEXT; name = xmlParseName(ctxt); if (name == NULL) { xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIR...
vuln
Vulnerable
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; const char *vp7_feature_name[] = { "q-index", "lf-delta", ...
vuln
Safe
C/C++
# -*- coding: utf-8 -*- # rdiffweb, A web interface to rdiff-backup repositories # Copyright (C) 2012-2021 rdiffweb contributors # # 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 Software Foundation, either version ...
vuln
Vulnerable
Python
/* * * (C) 2013-17 - ntop.org * * * 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 Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distribu...
vuln
Vulnerable
C/C++
njs_vm_start(njs_vm_t *vm) { njs_int_t ret; ret = njs_module_load(vm); if (njs_slow_path(ret != NJS_OK)) { return ret; } ret = njs_vmcode_interpreter(vm, vm->start); return (ret == NJS_ERROR) ? NJS_ERROR : NJS_OK; }
vuln
Vulnerable
Unknown
static void timer_enable(struct xlx_timer *xt) { uint64_t count; D(printf("%s timer=%d down=%d\n", __func__, xt->nr, xt->regs[R_TCSR] & TCSR_UDT)); ptimer_stop(xt->ptimer); if (xt->regs[R_TCSR] & TCSR_UDT) count = xt->regs[R_TLR]; else count = ~0 - xt->regs[R_TLR]; ...
vuln
Safe
C/C++
private static BooleanFlag getDebugFlag(String key, boolean defaultValue, String description) { return Utilities.IS_DEBUG_DEVICE ? new DebugFlag(key, defaultValue, description) : new BooleanFlag(key, defaultValue); }
vuln
Vulnerable
Java
__xml_acl_post_process(xmlNode * xml) { xmlNode *cIter = __xml_first_child(xml); xml_private_t *p = xml->_private; if(is_set(p->flags, xpf_created)) { xmlAttr *xIter = NULL; char *path = xml_get_path(xml); /* Always allow new scaffolding, ie. node with no attributes or only an ...
vuln
Safe
C/C++
libraw_processed_image_t *LibRaw::dcraw_make_mem_thumb(int *errcode) { if (!T.thumb) { if (!ID.toffset && !(imgdata.thumbnail.tlength > 0 && load_raw == &LibRaw::broadcom_load_raw) // RPi ) { if (errcode) *errcode = LIBRAW_NO_THUMBNAIL; } else { i...
vuln
Vulnerable
C/C++
/* * Copyright (C) 2015 Adrien Vergé * * 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 Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is...
vuln
Vulnerable
C/C++
function addImsi(req) { var getImsiInfoFromReq = function(name) { if (req.query && req.query[name]) { return req.query[name]; } else if (req.body && req.body[name]) { return req.body[name]; } else if (req.params && req.params[name]) { return req.params[name]; } else { return nu...
vuln
Safe
JavaScript
private void sortMarkers(List<MapMarker> markers, boolean visited, @MapMarkersSortByDef int sortByMode, @Nullable LatLon location) { Collections.sort(markers, new Comparator<MapMarker>() { @Override public int compare(MapMarker mapMar...
vuln
Vulnerable
Java
_archive_write_data(struct archive *_a, const void *buff, size_t s) { struct archive_write *a = (struct archive_write *)_a; const size_t max_write = INT_MAX; archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC, ARCHIVE_STATE_DATA, "archive_write_data"); /* In particular, this catches attempts to pass neg...
vuln
Safe
C/C++
private void rebuildCaches() { Map<String, List<ActiveCosmetic>> activeCosmeticByType = new HashMap<>(); Map<UUID, List<ActiveCosmetic>> activeCosmeticByPlayer = new HashMap<>(); Map<String, List<ActiveCosmetic>> activeCosmeticByPlayerName = new HashMap<>(); for (ActiveCosmetic value : a...
vuln
Safe
Java
static void chr_read(void *opaque, const uint8_t *buf, int size) { SCLPConsole *scon = opaque; assert(scon); assert(size <= SIZE_BUFFER_VT220 - scon->iov_data_len); memcpy(&scon->iov[scon->iov_bs], buf, size); scon->iov_data_len += size; scon->iov_sclp_rest += size; scon->iov_bs +=...
vuln
Safe
C/C++
PCA *ff_pca_init(int n){ PCA *pca; if(n<=0) return NULL; pca= av_mallocz(sizeof(*pca)); if (!pca) return NULL; pca->n= n; pca->z = av_malloc_array(n, sizeof(*pca->z)); pca->count=0; pca->covariance= av_calloc(n*n, sizeof(double)); pca->mean= av_calloc(n, sizeof(double...
vuln
Safe
C/C++
void MidiManagerUsb::DispatchSendMidiData(MidiManagerClient* client, uint32_t port_index, const std::vector<uint8>& data, double timestamp) { DCHECK_LT(port_index, output_streams_.size()); ...
vuln
Vulnerable
C/C++
def clone(repo_url, checkout=None, clone_to_dir='.', no_input=False): """Clone a repo to the current directory. :param repo_url: Repo URL of unknown type. :param checkout: The branch, tag or commit ID to checkout after clone. :param clone_to_dir: The directory to clone to. Defa...
vuln
Vulnerable
Python
AvahiSDomainBrowser *avahi_s_domain_browser_new( AvahiServer *server, AvahiIfIndex interface, AvahiProtocol protocol, const char *domain, AvahiDomainBrowserType type, AvahiLookupFlags flags, AvahiSDomainBrowserCallback callback, void* userdata) { AvahiSDomainBrowser *b; ...
vuln
Vulnerable
Unknown
void AuthorizationSession::_refreshUserInfoAsNeeded(OperationContext* opCtx) { AuthorizationManager& authMan = getAuthorizationManager(); UserSet::iterator it = _authenticatedUsers.begin(); while (it != _authenticatedUsers.end()) { User* user = *it; if (!user->isValid()) { // Ma...
vuln
Safe
Unknown
static void spl_ptr_heap_insert(spl_ptr_heap *heap, spl_ptr_heap_element elem, void *cmp_userdata TSRMLS_DC) { /* {{{ */ int i; if (heap->count+1 > heap->max_size) { /* we need to allocate more memory */ heap->elements = (void **) safe_erealloc(heap->elements, sizeof(spl_ptr_heap_element), (heap->max_size), (si...
vuln
Vulnerable
Unknown
igraph_error_t igraph_read_graph_graphml(igraph_t *graph, FILE *instream, igraph_integer_t index) { #if HAVE_LIBXML == 1 xmlParserCtxtPtr ctxt; xmlGenericErrorFunc libxml_old_generic_error_handler; void* libxml_old_generic_error_context; xmlStructuredErrorFunc libxml_old_structured_error_handler; v...
vuln
Vulnerable
C/C++
/* putil-merge ------------------------ (c) 2017-present Panates This file may be freely distributed under the MIT license. */ const isObjectOrClass = (v) => v && ( (typeof v === 'object' && !Array.isArray(v)) || (typeof v === 'function' && v.prototype && v.prototype.constructor)); /** * * @param {Objec...
vuln
Safe
JavaScript
def extract_dents(ubifs, inodes, dent_node, path='', perms=False): if dent_node.inum not in inodes: error(extract_dents, 'Error', 'inum: %s not found in inodes' % (dent_node.inum)) return inode = inodes[dent_node.inum] dent_path = os.path.join(path, dent_node.name) if dent_node...
vuln
Vulnerable
Python
@Override public View getView(int position, View convertView, ViewGroup parent) { View view; if (convertView == null) { view = LayoutInflater.from(activityRef.get()).inflate(R.layout.contacts_entry, parent, false); view.setTag(new ContactsEntryCache(view)); } else { view = convertView; } final Re...
vuln
Safe
Java
status_t BnGraphicBufferProducer::onTransact( uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) { switch(code) { case REQUEST_BUFFER: { CHECK_INTERFACE(IGraphicBufferProducer, data, reply); int bufferIdx = data.readInt32(); sp<GraphicBuffer> buffer; int result = requestBuf...
vuln
Vulnerable
C/C++
'use strict'; var path = require('path'); var fs = require('fs'); var url = require('url'); var mime = require('mime'); module.exports = function(root) { if (typeof root !== 'string') return; root = path.normalize(root); return function(req, res, fn) { if (!/^(GET|HEAD)$/.test(req.method)) return fn(); ...
vuln
Vulnerable
JavaScript
icmp6_rrenum_print(netdissect_options *ndo, const u_char *bp, const u_char *ep) { const struct icmp6_router_renum *rr6; const char *cp; const struct rr_pco_match *match; const struct rr_pco_use *use; char hbuf[NI_MAXHOST]; int n; if (ep < bp) return; rr6 = (const struct icmp6_router_renum *)bp; cp = (const ...
vuln
Vulnerable
C/C++
pqParseInput3(PGconn *conn) { char id; int msgLength; int avail; /* * Loop to parse successive complete messages available in the buffer. */ for (;;) { /* * Try to read a message. First get the type code and length. Return * if not enough data. */ conn->inCursor = conn->inStart; if (pqGe...
vuln
Safe
Unknown
def update_theory_base(tag, link): theory = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + "\\theory.db") conn = theory.cursor() conn.execute("insert into ? values (?)", (tag, str(link))) theory.commit() theory.close()
vuln
Safe
Python
int ssl3_check_cert_and_algorithm(SSL *s) { int i,idx; long alg_k,alg_a; EVP_PKEY *pkey=NULL; SESS_CERT *sc; #ifndef OPENSSL_NO_RSA RSA *rsa; #endif #ifndef OPENSSL_NO_DH DH *dh; #endif alg_k=s->s3->tmp.new_cipher->algorithm_mkey; alg_a=s->s3->tmp.new_cipher->algorithm_auth; /* we don't have a certificate *...
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
int tls1_final_finish_mac(SSL *s, const char *str, int slen, unsigned char *out) { unsigned int i; EVP_MD_CTX ctx; unsigned char buf[2*EVP_MAX_MD_SIZE]; unsigned char *q,buf2[12]; int idx; long mask; int err=0; const EVP_MD *md; q=buf; if (s->s3->handshake_buffer) if (!ssl3_digest_cached_records(...
vuln
Safe
Unknown
static bool ok_jpg_read_dht(ok_jpg_decoder *decoder) { // JPEG spec: Table B.5 ok_jpg *jpg = decoder->jpg; uint8_t buffer[17]; if (!ok_read(decoder, buffer, 2)) { return false; } int length = readBE16(buffer) - 2; while (length >= 17) { if (!ok_read(decoder, buffer, 17)) { ...
vuln
Vulnerable
C/C++
static int film_read_header(AVFormatContext *s) { FilmDemuxContext *film = s->priv_data; AVIOContext *pb = s->pb; AVStream *st; unsigned char scratch[256]; int i; unsigned int data_offset; unsigned int audio_frame_counter; film->sample_table = NULL; film->stereo_buffer = NULL; fi...
vuln
Vulnerable
C/C++
0==T?ba():R()}else this.stoppingCustomActions=this.executingCustomActions=!1,R(),null!=E&&E()});ba()}};Graph.prototype.doUpdateCustomLinksForCell=function(u,E){var J=this.getLinkForCell(E);null!=J&&"data:action/json,"==J.substring(0,17)&&this.setLinkForCell(E,this.updateCustomLink(u,J));if(this.isHtmlLabel(E)){var T=do...
vuln
Vulnerable
JavaScript
var INVALID_ESCAPES = /[^\\]\\[^.*+?^${}()|[\]\\bBcdDfnrsStvwWxu0-9]/; var validators = require('./'), formats = { 'date-time': /^\d{4}-(0[0-9]{1}|1[0-2]{1})-[0-9]{2}[t ]\d{2}:\d{2}:\d{2}(\.\d+)?([zZ]|[+-]\d{2}:\d{2})$/i, 'date': /^\d{4}-(0[0-9]{1}|1[0-2]{1})-[0-9]{2}$/, 'time': /^\d{2}:\d{2}:\d{2}$/, 'color':...
vuln
Vulnerable
JavaScript
static int decode_subframe_fixed(FLACContext *s, int channel, int pred_order) { const int blocksize = s->blocksize; int32_t *decoded = s->decoded[channel]; int av_uninit(a), av_uninit(b), av_uninit(c), av_uninit(d), i; for (i = 0; i < pred_order; i++) { decoded[i] = get_sbits(&s->gb, s->cur...
vuln
Safe
C/C++
proto_read_attribute_array (p11_rpc_message *msg, CK_ATTRIBUTE_PTR *result, CK_ULONG *n_result) { CK_ATTRIBUTE_PTR attrs; uint32_t n_attrs, i; assert (msg != NULL); assert (result != NULL); assert (n_result != NULL); assert (msg->input != NULL); /* Make s...
vuln
Vulnerable
Unknown
import contextlib import enum from dataclasses import dataclass from typing import Any, Optional from vyper.codegen.ir_node import Encoding from vyper.evm.address_space import MEMORY, AddrSpace from vyper.exceptions import CompilerPanic, StateAccessViolation from vyper.semantics.types import VyperType class Constanc...
vuln
Safe
Python
int dccp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) { const struct dccp_sock *dp = dccp_sk(sk); const int flags = msg->msg_flags; const int noblock = flags & MSG_DONTWAIT; struct sk_buff *skb; int rc, size; long timeo; trace_dccp_probe(sk, len); if (len > dp->dccps_mss_cache) return -EMSGSIZE;...
vuln
Vulnerable
Unknown
var categoriesTable = $('#taskcategories-table').DataTable({ 'order': [[1, 'asc']], 'columnDefs': [ { 'orderable': false, 'targets': 0 }, { 'searchable': false, "targets": 0 } ] }); $('#taskcategories-table tbody').removeClass("d-none"); categoriesTable.columns.adjust().draw(); $("#search").on("keyup", Delay(f...
vuln
Safe
JavaScript
int flac__encode_file(FILE *infile, FLAC__off_t infilesize, const char *infilename, const char *outfilename, const FLAC__byte *lookahead, unsigned lookahead_length, encode_options_t options) { EncoderSession encoder_session; size_t channel_map[FLAC__MAX_CHANNELS]; int info_align_carry = -1, info_align_zero = -1; i...
vuln
Vulnerable
Unknown
static int add_push_report_sideband_pkt(git_push *push, git_pkt_data *data_pkt, git_buf *data_pkt_buf) { git_pkt *pkt; const char *line, *line_end; size_t line_len; int error; int reading_from_buf = data_pkt_buf->size > 0; if (reading_from_buf) { /* We had an existing partial packet, so add the new * packet...
vuln
Vulnerable
C/C++
_pixops_scale_real (guchar *dest_buf, int render_x0, int render_y0, int render_x1, int render_y1, int dest_rowstride, int dest_channels, gboolean dest_has_alpha, const guchar *src_buf, i...
vuln
Vulnerable
Unknown
def compose_cmd(cmd): if os.name != 'nt': cmd = ' '.join(cmd) return cmd
vuln
Vulnerable
Python
size_t IOBuf::goodExtBufferSize(std::size_t minCapacity) { if (minCapacity > kMaxIOBufSize) { throw_exception<std::bad_alloc>(); } // Determine how much space we should allocate. We'll store the SharedInfo // for the external buffer just after the buffer itself. (We store it just // after the buffer ra...
vuln
Safe
Unknown
setActiveElements(activeElements){const lastActive=this._active||[];const active=activeElements.map(({datasetIndex,index})=>{const meta=this.getDatasetMeta(datasetIndex);if(!meta){throw new Error('No dataset found at index '+datasetIndex);} return{datasetIndex,element:meta.data[index],index,};});const changed=!_element...
vuln
Safe
JavaScript
static reenc_status_t reencrypt_step(struct crypt_device *cd, struct luks2_hdr *hdr, struct luks2_reencrypt *rh, uint64_t device_size, bool online) { int r; /* in memory only */ r = reencrypt_make_segments(cd, hdr, rh, device_size); if (r) return REENC_ERR; r = reencrypt_assign_segments(cd, hdr, rh, 1,...
vuln
Safe
Unknown
SPL_METHOD(SplObjectStorage, unserialize) { spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); char *buf; int buf_len; const unsigned char *p, *s; php_unserialize_data_t var_hash; zval *pentry, *pmembers, *pcount = NULL, *pinf; long count; if (zend_parse_...
vuln
Vulnerable
Unknown
(function() { /** * Download from following URL as TSV and convert using https://jgraph.github.io/drawio-tools/tools/convert.html: * https://docs.google.com/spreadsheets/d/1sAL1zn-UtmJtKPH4cLApGjRX-TRSJa5dYdfZ9NKYfRs * Maps package and stencil names to additional tags. */ Sidebar.prototype.tagIndex = '5V1dV+M...
vuln
Safe
JavaScript
private boolean tryFlushBlockUpdates(ChannelHandlerContext ctx, boolean ignoreWritability) { final ObjectBidirectionalIterator<Long2ObjectMap.Entry<ChunkUpdateQueue>> iterator = this.chunkUpdateQueues.long2ObjectEntrySet().fastIterator(); boolean hasWork = false; while ((ignoreWritability || wri...
vuln
Safe
Java
"""Build database model definitions.""" import decimal import os from datetime import datetime from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.core.validators import MinValueValidator from django.db import models, transaction from django.db.models import Sum...
vuln
Vulnerable
Python
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(); }; OP_REQUIRES_OK_ASYNC(c, FillCollectiveParams(col_params, RE...
vuln
Vulnerable
C/C++
static void do_subtitle_out(AVFormatContext *s, AVOutputStream *ost, AVInputStream *ist, AVSubtitle *sub, int64_t pts) { static uint8_t *subtitle_out = NULL; int subtitle_out_max_size = 65536; int...
vuln
Vulnerable
C/C++
def _get_fc_wwpns(self): for key in self._storage_nodes: node = self._storage_nodes[key] ssh_cmd = 'svcinfo lsnode -delim ! %s' % node['id'] raw = self._run_ssh(ssh_cmd) resp = CLIResponse(raw, delim='!', with_header=False) wwpns = set(node['WWPN']) ...
vuln
Vulnerable
Python
bool CModules::GetModPathInfo(CModInfo& ModInfo, const CString& sModule, const CString& sModPath, CString& sRetMsg) { if (!ValidateModuleName(sModule, sRetMsg)) { return false; } ModInfo.SetName(sModule); ModInfo.SetPath(sModPath); ModHandle p = OpenModule(sMo...
vuln
Safe
Unknown
void vnc_zrle_clear(VncState *vs) { if (vs->zrle->stream.opaque) { deflateEnd(&vs->zrle->stream); } buffer_free(&vs->zrle->zrle); buffer_free(&vs->zrle->fb); buffer_free(&vs->zrle->zlib); }
vuln
Safe
Unknown
function updateGraph(xml) { spinner.stop(); errorNode.innerText = ''; var doc = mxUtils.parseXml(xml); var node = editorUi.editor.extractGraphModel(doc.documentElement, true); if (node != null) { pageSelect.style.display = 'none'; pageSelect.innerText = ''; ...
vuln
Safe
JavaScript
int wolfSSH_SFTP_RecvRename(WOLFSSH* ssh, int reqId, byte* data, word32 maxSz) { word32 sz = 0; char* old; char* nw; word32 idx = 0; int ret = WS_SUCCESS; byte* out; word32 outSz; byte type = WOLFSSH_FTP_OK; char suc[] = "Renamed File"; char err[] = "Rename File Error";...
vuln
Vulnerable
C/C++
string_vformat(uschar *buffer, int buflen, char *format, va_list ap) { enum { L_NORMAL, L_SHORT, L_LONG, L_LONGLONG, L_LONGDOUBLE }; BOOL yield = TRUE; int width, precision; char *fp = format; /* Deliberately not unsigned */ uschar *p = buffer; uschar *last = buffer + buflen - 1; string_datestamp_offset =...
vuln
Safe
Unknown