code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
/* eslint-disable */ // import assign from "nano-assign"; // import sqlAutoCompletions from "./sqlAutoCompletions"; // import {ext} from "vee-validate/dist/rules.esm"; export default { name: "MonacoJsonEditor", props: { value: { default: "", type: String }, theme: { type: String, ...
vuln
Safe
JavaScript
BlobStorageContext::BlobFlattener::BlobFlattener( const BlobDataBuilder& input_builder, BlobEntry* output_blob, BlobStorageRegistry* registry) { const std::string& uuid = input_builder.uuid_; std::set<std::string> dependent_blob_uuids; size_t num_files_with_unknown_size = 0; size_t num_building_dep...
vuln
Safe
C/C++
int vfs_rename(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry, struct inode **delegated_inode, unsigned int flags) { int error; bool is_dir = d_is_dir(old_dentry); const unsigned char *old_name; struct inode *source = old_dentry->d_inode; struct i...
vuln
Vulnerable
C/C++
def requires_access_decorator(func: T): @wraps(func) def decorated(*args, **kwargs): __tracebackhide__ = True # Hide from pytest traceback. appbuilder = current_app.appbuilder dag_id = ( kwargs.get("dag_id") or request.args.get("dag_...
vuln
Vulnerable
Python
QPDF::insertPage(QPDFObjectHandle newpage, int pos) { // pos is numbered from 0, so pos = 0 inserts at the beginning and // pos = npages adds to the end. flattenPagesTree(); if (! newpage.isIndirect()) { QTC::TC("qpdf", "QPDF insert non-indirect page"); newpage = makeIndirectObject...
vuln
Safe
Unknown
int snmp_helper(void *context, size_t hdrlen, unsigned char tag, const void *data, size_t datalen) { struct snmp_ctx *ctx = (struct snmp_ctx *)context; __be32 *pdata; if (datalen != 4) return -EINVAL; pdata = (__be32 *)data; if (*pdata == ctx->from) { pr_debug("%s: %pI4 to %pI4\n", __func__, (voi...
vuln
Safe
C/C++
static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk, struct sctp_association *assoc, sctp_socket_type_t type) { struct sctp_sock *oldsp = sctp_sk(oldsk); struct sctp_sock *newsp = sctp_sk(newsk); struct sctp_bind_bucket *pp; /* hash list port iterator */ struct sctp_endpoint *newe...
vuln
Vulnerable
C/C++
/* ruleset.c - rsyslog's ruleset object * * We have a two-way structure of linked lists: one global linked list * (llAllRulesets) hold alls rule sets that we know. Included in each * list is a list of rules (which contain a list of actions, but that's * a different story). * * Usually, only a single rule set is ...
vuln
Vulnerable
C/C++
@Override public Intent createAdminSupportIntent(String restriction) { Objects.requireNonNull(restriction); final CallerIdentity caller = getCallerIdentity(); Intent intent = null; if (DevicePolicyManager.POLICY_DISABLE_CAMERA.equals(restriction) || DevicePolicyManage...
vuln
Vulnerable
Java
kg_seal_iov(OM_uint32 *minor_status, gss_ctx_id_t context_handle, int conf_req_flag, gss_qop_t qop_req, int *conf_state, gss_iov_buffer_desc *iov, int iov_count, int toktype) { krb5_gss_ctx_id_rec *ctx; krb5_error_code code; ...
vuln
Safe
C/C++
GET_DCC_REC *dcc_get_create(IRC_SERVER_REC *server, CHAT_DCC_REC *chat, const char *nick, const char *arg) { GET_DCC_REC *dcc; dcc = g_new0(GET_DCC_REC, 1); dcc->orig_type = module_get_uniq_id_str("DCC", "SEND"); dcc->type = module_get_uniq_id_str("DCC", "GET"); dcc->fhandle = -1; dcc_init_rec(DCC(dcc), ...
vuln
Vulnerable
Unknown
void srandmemberWithCountCommand(client *c) { long l; unsigned long count, size; int uniq = 1; robj *set; sds ele; int64_t llele; int encoding; dict *d; if (getRangeLongFromObjectOrReply(c,c->argv[2],-LONG_MAX,LONG_MAX,&l,NULL) != C_OK) return; if (l >= 0) { count = (un...
vuln
Safe
C/C++
public function meta_box_subject() { $placeholder = __( 'What is your conversation about?', 'supportflow' ); echo '<h4>' . __( 'Subject', 'supportflow' ) . '</h4>'; echo '<input type="text" id="subject" name="post_title" class="sf_autosave" placeholder="' . $placeholder . '" value="' . get_the_title() . '" autoc...
vuln
Vulnerable
PHP
def annotate(path, identifier=nil) p = CGI.escape(scm_iconv(@path_encoding, 'UTF-8', path)) blame = Annotate.new hg 'rhannotate', '-ncu', "-r#{CGI.escape(hgrev(identifier))}", '--', hgtarget(p) do |io| io.each_line do |line| line.force_encoding('ASCII-8BIT') ...
vuln
Safe
Ruby
public void onClick(int index, View anyView) { final EntryItem result; try { result = results.get(index); } catch (ArrayIndexOutOfBoundsException e) { Log.e(TAG, "pos=" + index + " size=" + results.size(), e); return; } onClick(result, anyView...
vuln
Vulnerable
Java
int dtls1_accept(SSL *s) { BUF_MEM *buf; unsigned long Time=(unsigned long)time(NULL); void (*cb)(const SSL *ssl,int type,int val)=NULL; unsigned long alg_k; int ret= -1; int new_state,state,skip=0; int listen; #ifndef OPENSSL_NO_SCTP unsigned char sctpauthkey[64]; char labelbuffer[sizeof(DTLS1_SCTP_AUTH_LABE...
vuln
Safe
Unknown
enum nss_status _nss_mymachines_getgrnam_r( const char *name, struct group *gr, char *buffer, size_t buflen, int *errnop) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; _cleanup_bus_message_unref_ sd_bus_message* reply ...
vuln
Safe
C/C++
/************************************************************************* This project implements a complete(!) JPEG (Recommendation ITU-T T.81 | ISO/IEC 10918-1) codec, plus a library that can be used to encode and decode JPEG streams. It also implements ISO/IEC 18477 aka JPEG XT which is an extensi...
vuln
Safe
C/C++
private void saveFile(PluginCall call, File file, String data) { String encoding = call.getString("encoding"); boolean append = call.getBoolean("append", false); Charset charset = implementation.getEncoding(encoding); if (encoding != null && charset == null) { call.reject("U...
vuln
Safe
Java
// Code generated by go-swagger; DO NOT EDIT. // This file is part of MinIO Console Server // Copyright (c) 2021 MinIO, Inc. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either ...
vuln
Vulnerable
Go
public void updateChecklist() { checklist.required.clear(); checklist.damageRequired.clear(); checklist.blocksNotLoaded = false; if (printer.isLoaded()) { blocksToPlace = blocksPlaced; blocksToPlace += printer.markAllBlockRequirements(checklist, level, this::shouldPlace); printer.markAllEntityRequirem...
vuln
Vulnerable
Java
static const char *parse_string( cJSON *item, const char *str ) static const char *parse_string(cJSON *item,const char *str,const char **ep) { const char *ptr=str+1,*end_ptr=str+1;char *ptr2;char *out;int len=0;unsigned uc,uc2; if (*str!='\"') {*ep=str;return 0;} /* not a string! */ while (*end_ptr!='\"' && *end...
vuln
Safe
C/C++
private boolean testngXmlExistsInJar(File jarFile, List<String> classes) throws IOException { try (JarFile jf = new JarFile(jarFile)) { Enumeration<JarEntry> entries = jf.entries(); File file = java.nio.file.Files.createTempDirectory("testngXmlPathInJar-").toFile(); String suitePath = null; ...
vuln
Safe
Java
private void walkAllSuitableFiles(File dirPath, final Collection<File> collectResult, int maxNum) throws IOException { if (collectResult.size() > maxNum) { LOGGER.warn("max num of files is {}, please check", maxNum); return; } if (dirPath.isFile() && dateForma...
vuln
Vulnerable
Java
static int create_vterm(term_T *term, int rows, int cols) { VTerm *vterm; VTermScreen *screen; VTermState *state; VTermValue value; vterm = vterm_new_with_allocator(rows, cols, &vterm_allocator, NULL); term->tl_vterm = vterm; if (vterm == NULL) return FAIL; // Allocate...
vuln
Safe
C/C++
static void ufs_mtk_init_va09_pwr_ctrl(struct ufs_hba *hba) { struct ufs_mtk_host *host = ufshcd_get_variant(hba); host->reg_va09 = regulator_get(hba->dev, "va09"); if (!host->reg_va09) dev_info(hba->dev, "failed to get va09"); else host->caps |= UFS_MTK_CAP_VA09_PWR_CTRL; }
vuln
Vulnerable
C/C++
def run(self, command: str) -> str: """Run command with own globals/locals and returns anything printed.""" old_stdout = sys.stdout sys.stdout = mystdout = StringIO() try: exec(command, self.globals, self.locals) sys.stdout = old_stdout output = mystdo...
vuln
Vulnerable
Python
var formatValue = function (name, value) { if (name == 'user_host') { return value.replace(/(\[.*?\])+/g, ''); } return escapeHtml(value); };
vuln
Safe
JavaScript
enum SCP_SERVER_STATES_E scp_v1s_list_sessions(struct SCP_CONNECTION *c, int sescnt, struct SCP_DISCONNECTED_SESSION *ds, SCP_SID *sid) { tui32 version = 1; tui32 size = 12; tui16 cmd = 40; int pktcnt; int idx; int sidx; int pidx; struct SCP_DISCONNECTED_SESSION *cds; /* first we se...
vuln
Safe
C/C++
static inline int gen_iwmmxt_shift(uint32_t insn, uint32_t mask, TCGv dest) { int rd = (insn >> 0) & 0xf; TCGv tmp; if (insn & (1 << 8)) { if (rd < ARM_IWMMXT_wCGR0 || rd > ARM_IWMMXT_wCGR3) { return 1; } else { tmp = iwmmxt_load_creg(rd); } } else { ...
vuln
Safe
C/C++
static int acurite_00275rm_decode(r_device *decoder, bitbuffer_t *bitbuffer) { int result = 0; bitbuffer_invert(bitbuffer); // This sensor repeats a signal three times. Combine as fallback. uint8_t *b_rows[3] = {0}; int n_rows = 0; for (int row = 0; row < bitbuffer->num_rows; ++row) { ...
vuln
Vulnerable
Unknown
void fx_String_prototype_pad(txMachine* the, txBoolean flag) { txString string = fxCoerceToString(the, mxThis), filler; txInteger stringLength = c_strlen(string), fillerLength; txInteger stringSize = fxUnicodeLength(string), fillerSize; txInteger resultSize = (txInteger)fxArgToRange(the, 0, 0, 0, 0x7FFFFFFF); *mxR...
vuln
Vulnerable
C/C++
private void sortGroups() { if (mapMarkersGroups.size() > 0) { Collections.sort(mapMarkersGroups, (group1, group2) -> { long t1 = group1.getCreationDate(); long t2 = group2.getCreationDate(); return (t1 > t2) ? -1 : ((t1 == t2) ? 0 : 1); }); } }
vuln
Vulnerable
Java
static int filter_frame(AVFilterLink *inlink, AVFrame *in) { AVFilterContext *ctx = inlink->dst; FlipContext *s = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; AVFrame *out; uint8_t *inrow, *outrow; int i, j, plane, step; out = ff_get_video_buffer(outlink, outlink->w, outlink->h)...
vuln
Safe
C/C++
static int serial_load(QEMUFile *f, void *opaque, int version_id) { SerialState *s = opaque; uint8_t fcr = 0; if(version_id > 3) return -EINVAL; if (version_id >= 2) qemu_get_be16s(f, &s->divider); else s->divider = qemu_get_byte(f); qemu_get_8s(f,&s->rbr); qemu_get_8...
vuln
Safe
C/C++
int Reverb_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize, void *pCmdData, uint32_t *replySize, void *pReplyData){ android::ReverbContext * pContext = (android::ReverbContext *) self; int retsize; LVREV_ControlParams_st ActiveParams; /* Current control Parameter...
vuln
Safe
C/C++
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ /* * HEADERS stream logic */ #include <assert.h> #include <errno.h> #include <inttypes.h> #include <stdarg.h> #include <stdlib.h> #include <string.h> #include <sys/queue.h> #include "lsquic.h" #include "lsquic_types.h" #include "lsquic_int_ty...
vuln
Safe
C/C++
/* Copyright 2017 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
@Override protected void rawResponseHandler(String response) { String processed = response; try { boolean verbose = false; if (GrblUtils.isOkResponse(response)) { this.commandComplete(processed); } // Error case. else if (...
vuln
Vulnerable
Java
IDNSpoofChecker::IDNSpoofChecker() { UErrorCode status = U_ZERO_ERROR; checker_ = uspoof_open(&status); if (U_FAILURE(status)) { checker_ = nullptr; return; } uspoof_setRestrictionLevel(checker_, USPOOF_HIGHLY_RESTRICTIVE); SetAllowedUnicodeSet(&status); int32_t checks = uspoof_getChecks(check...
vuln
Safe
C/C++
public InteractionResultHolder<ItemStack> itemRightClick(Player player, InteractionHand hand) { if (player instanceof ServerPlayer && FTBChunksAPI.getManager().protect(player, hand, new BlockPos(player.getEyePosition(1F)), Protection.RIGHT_CLICK_ITEM).get()) { return InteractionResultHolder.fail(player.getItemInHa...
vuln
Safe
Java
static int mxf_compute_index_tables(MXFContext *mxf) { int i, j, k, ret, nb_sorted_segments; MXFIndexTableSegment **sorted_segments = NULL; if ((ret = mxf_get_sorted_table_segments(mxf, &nb_sorted_segments, &sorted_segments)) || nb_sorted_segments <= 0) { av_log(mxf->fc, AV_LOG_WARNING, "bro...
vuln
Safe
C/C++
/* * The copyright in this software is being made available under the 2-clauses * BSD License, included below. This software may be subject to other third * party and contributor rights, including patent rights, and no such rights * are granted under this license. * * Copyright (c) 2002-2014, Universite catholiqu...
vuln
Vulnerable
C/C++
def get_kube_client( in_cluster: bool = conf.getboolean("kubernetes_executor", "in_cluster"), cluster_context: str | None = None, config_file: str | None = None, ) -> client.CoreV1Api: """ Retrieves Kubernetes client. :param in_cluster: whether we are in cluster :param cluster_context: cont...
vuln
Safe
Python
int GetS8 (const unsigned int& nPos, bool *pbSuccess) { //*pbSuccess = true; if ( nPos >= m_nLen ) { *pbSuccess = false; return 0; } int nRes = m_sFile[ nPos ]; if ( nRes & 0x80 ) ...
vuln
Safe
C/C++
static int sof_set_get_large_ctrl_data(struct snd_sof_dev *sdev, struct sof_ipc_ctrl_data *cdata, struct sof_ipc_ctrl_data_params *sparams, bool send) { struct sof_ipc_ctrl_data *partdata; size_t send_bytes; size_t offset = 0; size_t msg_bytes; size_t pl_size; int err; int i; /...
vuln
Safe
C/C++
from typing import List import graphene from django.contrib.auth import get_user_model from django.contrib.auth import models as auth_models from graphene import relay from ...account import models from ...checkout.utils import get_user_checkout from ...core.exceptions import PermissionDenied from ...core.permissions...
vuln
Safe
Python
/* * Copyright (c) 2004-2021, University of Oslo * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this * list of cond...
vuln
Safe
Java
private void updateArrowHeadWith(List<Point> points) { double azimuth = TurfMeasurement.bearing(points.get(points.size() - 2), points.get(points.size() - 1)); arrowHeadGeoJsonFeature = Feature.fromGeometry(points.get(points.size() - 1)); arrowHeadGeoJsonFeature.addNumberProperty(ARROW_BEARING, (...
vuln
Vulnerable
Java
static void dvbsub_parse_region_segment(AVCodecContext *avctx, const uint8_t *buf, int buf_size) { DVBSubContext *ctx = avctx->priv_data; const uint8_t *buf_end = buf + buf_size; int region_id, object_id; int av_unused version; DVBSubRegion *region; DVBSub...
vuln
Vulnerable
C/C++
def datasets_summary(self): """Get a summary of datasets, including the datetime they were last updated and how many updates they've ever had. """ allowed_attrs = ["uri", "last_dataset_update"] # Grab query parameters limit = int(request.args.get("limit", 25)) of...
vuln
Safe
Python
def login(self): """Login endpoint for the API returns a JWT and optionally a refresh token --- post: description: >- Authenticate and get a JWT access and refresh token requestBody: required: true content: application/json: ...
vuln
Vulnerable
Python
# -*- coding: utf-8 -*- # (c) 2009-2022 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license.php """ WSGI middleware that handles GET requests on collections to display directories. """ import os import sys from fn...
vuln
Vulnerable
Python
/** * Copyright (c) 2006-2012, JGraph Ltd */ // Workaround for handling named HTML entities in mxUtils.parseXml // LATER: How to configure DOMParser to just ignore all entities? (function() { var entities = [ ['nbsp', '160'], ['shy', '173'] ]; var parseXml = mxUtils.parseXml; mxUtils.parseXml = function...
vuln
Vulnerable
JavaScript
static int64_t read_ts(const char *s) { int hh, mm, ss, ms; if (sscanf(s, "%u:%u:%u.%u", &hh, &mm, &ss, &ms) == 4) return (hh*3600 + mm*60 + ss) * 1000 + ms; if (sscanf(s, "%u:%u.%u", &mm, &ss, &ms) == 3) return ( mm*60 + ss) * 1000 + ms; return AV_NOPTS_VALUE; }
vuln
Vulnerable
C/C++
package com.salesmanager.shop.admin.controller.products; import com.salesmanager.core.business.services.catalog.product.ProductService; import com.salesmanager.core.business.services.catalog.product.file.DigitalProductService; import com.salesmanager.core.business.utils.ajax.AjaxResponse; import com.salesmanager.core....
vuln
Safe
Java
int pcistb_service_call(S390CPU *cpu, uint8_t r1, uint8_t r3, uint64_t gaddr, uint8_t ar) { CPUS390XState *env = &cpu->env; S390PCIBusDevice *pbdev; MemoryRegion *mr; int i; uint32_t fh; uint8_t pcias; uint8_t len; uint8_t buffer[128]; if (env->psw.mask & PSW_...
vuln
Vulnerable
C/C++
static void rng_egd_opened(RngBackend *b, Error **errp) { RngEgd *s = RNG_EGD(b); if (s->chr_name == NULL) { error_set(errp, QERR_INVALID_PARAMETER_VALUE, "chardev", "a valid character device"); return; } s->chr = qemu_chr_find(s->chr_name); if (s->chr == NULL) { ...
vuln
Safe
C/C++
cib_remote_perform_op(cib_t * cib, const char *op, const char *host, const char *section, xmlNode * data, xmlNode ** output_data, int call_options, const char *name) { int rc = pcmk_ok; xmlNode *op_msg = NULL; xmlNode *op_reply = NULL; cib_remote_opaque_t *private = cib->variant_...
vuln
Vulnerable
C/C++
constructor (opt) { opt = opt || {} // the order in which rules are applied. opt.ignoreFiles = [ rootBuiltinRules, 'package.json', '.npmignore', '.gitignore', packageNecessaryRules, ] opt.includeEmpty = false opt.path = opt.path || process.cwd() // only follo...
vuln
Safe
JavaScript
public static byte[] decryptAuthenticated(final SecretKey secretKey, final byte[] iv, final byte[] cipherText, final byte[] aad, final byte[] authTag, ...
vuln
Vulnerable
Java
static void dccp_v4_err(struct sk_buff *skb, u32 info) { const struct iphdr *iph = (struct iphdr *)skb->data; const u8 offset = iph->ihl << 2; const struct dccp_hdr *dh; struct dccp_sock *dp; struct inet_sock *inet; const int type = icmp_hdr(skb)->type; const int code = icmp_hdr(skb)->code; struct sock *sk; __...
vuln
Vulnerable
C/C++
function get_allowed_files_extensions_for_upload($fileTypes = 'images', $returnAsArray = false) { $are_allowed = ''; switch ($fileTypes) { case 'img': case 'image': case 'images': $are_allowed .= ',png,gif,jpg,jpeg,tiff,bmp,svg,webp,ico'; ...
vuln
Vulnerable
PHP
static bool pick_subchannel_locked( grpc_exec_ctx *exec_ctx, grpc_call_element *elem, grpc_metadata_batch *initial_metadata, uint32_t initial_metadata_flags, grpc_connected_subchannel **connected_subchannel, grpc_closure *on_ready, grpc_error *error) { GPR_TIMER_BEGIN("pick_subchannel", 0); channel...
vuln
Safe
C/C++
mxEvent.getSource(F);null!=G;){if(G==v||G==x){F.stopPropagation();F.preventDefault();break}G=G.parentNode}});var K=function(F){return function(G,N,J,E,H,S,U,Q,W){null!=W&&(/(\.v(dx|sdx?))($|\?)/i.test(W.name)||/(\.vs(x|sx?))($|\?)/i.test(W.name))?b.importVisio(W,mxUtils.bind(this,function(V){c(V,N,J,E,H,S,U,"fixed",mxE...
vuln
Vulnerable
JavaScript
static int ext4_writepage(struct page *page, struct writeback_control *wbc) { int ret = 0; loff_t size; unsigned int len; struct buffer_head *page_bufs; struct inode *inode = page->mapping->host; trace_ext4_writepage(inode, page); size = i_size_read(inode); if (page->index == size >> PAGE_CACHE_SHIFT) l...
vuln
Vulnerable
Unknown
static int magicmouse_raw_event(struct hid_device *hdev, struct hid_report *report, u8 *data, int size) { struct magicmouse_sc *msc = hid_get_drvdata(hdev); struct input_dev *input = msc->input; int x = 0, y = 0, ii, clicks = 0, npoints; switch (data[0]) { case TRACKPAD_REPORT_ID: /* Expect four bytes of pref...
vuln
Vulnerable
C/C++
long Cluster::CreateBlock(long long id, long long pos, // absolute pos of payload long long size, long long discard_padding) { assert((id == 0x20) || (id == 0x23)); // BlockGroup or SimpleBlock if (m_entries_count < 0) { // haven't parsed anything yet assert(m_entries == NULL); assert(m_entries_size == ...
vuln
Safe
C/C++
int rpmPackageFilesRemove(rpmts ts, rpmte te, rpmfiles files, rpmpsm psm, char ** failedFile) { struct diriter_s di = { -1 }; rpmfi fi = fsmIter(NULL, files, RPMFI_ITER_BACK, &di); rpmfs fs = rpmteGetFileStates(te); rpmPlugins plugins = rpmtsPlugins(ts); int fc = rpmfilesFC(files); ...
vuln
Vulnerable
C/C++
@Override public void onError(Exception exception) { Log.e(TAG, exception.getMessage()); Toast.makeText(requireContext(), exception.getMessage(), Toast.LENGTH_LONG).show(); }
vuln
Vulnerable
Java
WebKit::WebFrame* RenderViewImpl::GetFrameByMappedID(int frame_id) { WebKit::WebFrame* RenderViewImpl::GetFrameByRemoteID(int remote_frame_id) { std::map<int, int>::const_iterator it = active_frame_id_map_.begin(); for (; it != active_frame_id_map_.end(); ++it) { if (it->second == remote_frame_id) return ...
vuln
Safe
C/C++
BufCompressedFill (BufFilePtr f) { CompressedFile *file; register char_type *stackp, *de_stack; register char_type finchar; register code_int code, oldcode, incode; BufChar *buf, *bufend; file = (CompressedFile *) f->private; buf = f->buffer; bufend = buf + BUFFILESIZE; stackp...
vuln
Safe
Unknown
PHP_XML_API zend_string *xml_utf8_encode(const char *s, size_t len, const XML_Char *encoding) { size_t pos = len; zend_string *str; unsigned int c; unsigned short (*encoder)(unsigned char) = NULL; xml_encoding *enc = xml_get_encoding(encoding); if (enc) { encoder = enc->encoding_function; } else { /* If the...
vuln
Vulnerable
C/C++
* Elliptic Curve Key Exchange */ static int curve25519_sha256(LIBSSH2_SESSION *session, unsigned char *data, size_t data_len, unsigned char public_key[LIBSSH2_ED25519_KEY_LEN], unsigned char private_key[LIBSSH2_ED25519_KEY_LEN], km...
vuln
Vulnerable
Unknown
import { sanitizeUrl } from '@braintree/sanitize-url'; import { curveBasis, curveBasisClosed, curveBasisOpen, curveLinear, curveLinearClosed, curveMonotoneX, curveMonotoneY, curveNatural, curveStep, curveStepAfter, curveStepBefore, select, } from 'd3'; import common from './diagrams/common/commo...
vuln
Safe
JavaScript
private List<String> buildAppOpsList() { if (mMySettings.isDebug()) { Util.debugLog(TAG, "buildAppOpsList() called"); } if (mMySettings.excludeAppOpsPerms() || !mMySettings.canReadAppOps()) { return null; } if (mMySettings.canUseHiddenAPIs()) { try { return mPrivTasks.buil...
vuln
Safe
Java
size_t overrun(size_t itemSize, size_t nItems) { size_t len = ptr - start + itemSize * nItems; if (len < (size_t)(end - start) * 2) len = (end - start) * 2; U8* newStart = new U8[len]; memcpy(newStart, start, ptr - start); ptr = newStart + (ptr - start); delete [] start; ...
vuln
Safe
C/C++
@Override public void handleNotification(INotification notification) { switch (notification.getName()) { case MsgAPI.SHOW_ADD_LIBRARY_DIALOG: Sandbox sandbox = Sandbox.getInstance(); int item = notification.getBody(); Dialogs.showInputDialog(sand...
vuln
Safe
Java
static int enable_write_target(BDRVVVFATState *s, Error **errp) { BlockDriver *bdrv_qcow; QEMUOptionParameter *options; int ret; int size = sector2cluster(s, s->sector_count); s->used_clusters = calloc(size, 1); array_init(&(s->commits), sizeof(commit_t)); s->qcow_filename = g_malloc(1024); ...
vuln
Safe
C/C++
private void internalDeleteSubscriptionForNonPartitionedTopicForcefully(AsyncResponse asyncResponse, String subName, boolean authoritative) { validateTopicOwnershipAsync(topicName, authoritative) .thenRun(() -> validateT...
vuln
Vulnerable
Java
static void cmd_help(void) { prot_printf(nntp_out, "100 Supported commands:\r\n"); if ((nntp_capa & MODE_READ) && (nntp_userid || allowanonymous)) { prot_printf(nntp_out, "\tARTICLE [ message-id | number ]\r\n" "\t\tRetrieve entirety of the specified article.\r\n"); } if (!nntp_authstate) { if ...
vuln
Vulnerable
Unknown
/* * Copyright 2021 ThoughtWorks, Inc. * * 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 agr...
vuln
Safe
Java
schannel_connect_step3(struct Curl_easy *data, struct connectdata *conn, int sockindex) { CURLcode result = CURLE_OK; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; SECURITY_STATUS sspi_status = SEC_E_OK; CERT_CONTEXT *ccert_context = NULL; bool isproxy = SSL_IS_PROXY(); #ifd...
vuln
Safe
Unknown
MagickExport void *ResizeQuantumMemory(void *memory,const size_t count, const size_t quantum) { size_t extent; if (HeapOverflowSanityCheck(count,quantum) != MagickFalse) { memory=RelinquishMagickMemory(memory); return((void *) NULL); } extent=count*quantum; return(ResizeMagickMemory(m...
vuln
Safe
C/C++
bool ChanPage(CWebSock& WebSock, CTemplate& Tmpl, CIRCNetwork* pNetwork, CChan* pChan = NULL) { CSmartPtr<CWebSession> spSession = WebSock.GetSession(); Tmpl.SetFile("add_edit_chan.tmpl"); CUser* pUser = pNetwork->GetUser(); if (!pUser) { WebSock.PrintErrorPage("That user doesn't exist"); return true; ...
vuln
Vulnerable
Unknown
public static void square(int[] x, int[] zz) { long x_0 = x[0] & M; long zz_1; int c = 0, w; { int i = 6, j = 14; do { long xVal = (x[i--] & M); long p = xVal * xVal; zz[--j] = (c << 31) | (int)(p >>...
vuln
Safe
Java
package io.onedev.server.web.component.markdown; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import javax.activation.MimetypesFileTypeM...
vuln
Safe
Java
public static void earlyLoad(String name) { try { Class.forName(name); } catch(Exception error) { Client.LOGGER.error("Could not early load " + name + ". This may cause further issues."); } }
vuln
Vulnerable
Java
static ErlDrvSSizeT ejabberd_zlib_drv_control(ErlDrvData handle, unsigned int command, char *buf, ErlDrvSizeT len, char **rbuf, ErlDrvSizeT rlen) { ejabberd_zlib_data *d = (ejabberd_zlib_data *)handle; int err; int size; ErlDrvBinary *b; switch (command) { case DEFLAT...
vuln
Vulnerable
C/C++
static boolean jpeg_empty_output_buffer(j_compress_ptr cinfo) { VncState *vs = cinfo->client_data; Buffer *buffer = &vs->tight->jpeg; buffer->offset = buffer->capacity; buffer_reserve(buffer, 2048); jpeg_init_destination(cinfo); return TRUE; }
vuln
Safe
Unknown
static void inc_refcounts(BlockDriverState *bs, BdrvCheckResult *res, uint16_t *refcount_table, int refcount_table_size, int64_t offset, int64_t size) { BDRVQcowState *s = bs->opaque; int64_t start, last, clu...
vuln
Vulnerable
C/C++
def update_sources(conn, sqlite, k10plus, ai): """ Update the source table. """ current_sources = get_all_current_sources(k10plus, ai) old_sources = get_all_old_sources(conn, sqlite) # Check if the source table is allready filled and this is not the first checkup source_table_is_filled = le...
vuln
Vulnerable
Python
renderCoTable(struct table *tbl, int maxlimit) { struct readbuffer obuf; struct html_feed_environ h_env; struct environment envs[MAX_ENV_LEVEL]; struct table *t; int i, col, row; int indent, maxwidth; if (cotable_level >= MAX_COTABLE_LEVEL) return; /* workaround to prevent infinite recursi...
vuln
Vulnerable
C/C++
static void sasl_start(IRC_SERVER_REC *server, const char *data, const char *from) { IRC_SERVER_CONNECT_REC *conn; conn = server->connrec; switch (conn->sasl_mechanism) { case SASL_MECHANISM_PLAIN: irc_send_cmd_now(server, "AUTHENTICATE PLAIN"); break; case SASL_MECHANISM_EXTERNAL: irc_send_cmd_now(s...
vuln
Vulnerable
Unknown
gst_date_time_new_from_iso8601_string (const gchar * string) { gint year = -1, month = -1, day = -1, hour = -1, minute = -1; gint gmt_offset_hour = -99, gmt_offset_min = -99; gdouble second = -1.0; gfloat tzoffset = 0.0; guint64 usecs; gint len, ret; g_return_val_if_fail (string != NULL, NULL); GST_DE...
vuln
Safe
C/C++
render() { let item = null; const story = this.state.story; if (story) { // 如果没有 img 要处理,否则不好看。 item = ( <div id={`story${story.id}`} className="flex-tile" > <div class...
vuln
Safe
JavaScript
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This 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 * th...
vuln
Safe
Java
@Override public void processEvent(Event evt) { if(evt.getId()==EventCodes.EVENT_DISCONNECTED) { transport.getDisconnectFuture().disconnected(); if(!getAuthenticatedFuture().isDone()) { getAuthenticatedFuture().authenticated(false); } } }
vuln
Safe
Java
cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, struct nameidata *nd) { int xid; int rc = 0; /* to get around spurious gcc warning, set to zero here */ __u32 oplock = enable_oplocks ? REQ_OPLOCK : 0; __u16 fileHandle = 0; bool posix_open = false; struct cifs_sb_info *cifs_sb; struct tco...
vuln
Safe
C/C++
#!/usr/bin/python -u # # p7zr library # # Copyright (c) 2019-2021 Hiroshi Miura <miurahr@linux.com> # Copyright (c) 2004-2015 by Joachim Bauch, mail@joachim-bauch.de # 7-Zip Copyright (C) 1999-2010 Igor Pavlov # LZMA SDK Copyright (C) 1999-2010 Igor Pavlov # # This library is free software; you can redistribute it and/...
vuln
Safe
Python