code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, xmlAttrPtr attr) { xmlIDPtr ret; xmlIDTablePtr table; if (doc == NULL) { return(NULL); } if ((value == NULL) || (value[0] == 0)) { return(NULL); } if (attr == NULL) { return(NULL); } /* * Create th...
vuln
Safe
Unknown
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ //===----------------------------------------------------------------------===// /// \file /// ES5.1 15.4 Initialize the Array co...
vuln
Vulnerable
C/C++
public static boolean canMerge(PlayerEntity possessor, PlayerEntity target, GameProfile shellProfile) { StatusEffectInstance penance = possessor.getStatusEffect(RequiemStatusEffects.PENANCE); return penance == null || penance.getAmplifier() < 1; }
vuln
Vulnerable
Java
brcmf_wowl_nd_results(struct brcmf_if *ifp, const struct brcmf_event_msg *e, void *data) { struct brcmf_cfg80211_info *cfg = ifp->drvr->config; struct wiphy *wiphy = cfg_to_wiphy(cfg); struct brcmf_pno_scanresults_le *pfn_result; struct brcmf_pno_net_info_le *netinfo; brcmf_dbg(SCAN, "Enter\n"); if (e->...
vuln
Safe
C/C++
function preprocessRFC2822(s) { // Remove comments and folding whitespace and replace multiple-spaces with a single space return s .replace(/\([a-zA-Z0-9\s]*\)|[\n\t]/g, ' ') .replace(/(\s\s+)/g, ' ') .replace(/^\s\s*/, '') .replace(/\s\s*$/, ''); }
vuln
Vulnerable
JavaScript
static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s, SingleChannelElement *sce, const float lambda) { int q, w, w2, g, start = 0; int i, j; int idx; TrellisPath paths[TRELLIS_STAGES][TRELLIS_STATES];...
vuln
Vulnerable
C/C++
int snd_usbmidi_create(struct snd_card *card, struct usb_interface *iface, struct list_head *midi_list, const struct snd_usb_audio_quirk *quirk) { struct snd_usb_midi *umidi; struct snd_usb_midi_endpoint_info endpoints[MIDI_MAX_ENDPOINTS]; int out_ports, in_ports; int i, err; umidi = kz...
vuln
Vulnerable
C/C++
@Override public void resizePipMenu(@Nullable SurfaceControl pipLeash, @Nullable SurfaceControl.Transaction t, Rect destinationBounds) { if (destinationBounds.isEmpty()) { return; } if (!checkPipMenuState()) { return; } final ...
vuln
Safe
Java
struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry, struct dentry *new_dir, const char *new_name) { int error; struct dentry *dentry = NULL, *trap; const char *old_name; trap = lock_rename(new_dir, old_dir); /* Source or destination directories don't exist? */ if (d_really_is_negat...
vuln
Vulnerable
C/C++
int ext4_mb_add_groupinfo(struct super_block *sb, ext4_group_t group, struct ext4_group_desc *desc) { int i; int metalen = 0; struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_group_info **meta_group_info; struct kmem_cache *cachep = get_groupinfo_cache(sb->s_blocksize_bits); /* * First check if this gr...
vuln
Vulnerable
Unknown
import base64 import datetime import json import logging import re from typing import Dict, List, Set, Tuple from flask import g, session, url_for from flask_babel import lazy_gettext as _ from flask_jwt_extended import current_user as current_user_jwt from flask_jwt_extended import JWTManager from flask_login import ...
vuln
Safe
Python
long do_io_submit(aio_context_t ctx_id, long nr, struct iocb __user *__user *iocbpp, bool compat) { struct kioctx *ctx; long ret = 0; int i; struct hlist_head batch_hash[AIO_BATCH_HASH_SIZE] = { { 0, }, }; if (unlikely(nr < 0)) return -EINVAL; if (unlikely(!access_ok(VERIFY_READ, iocbpp, (nr*sizeof(*iocbp...
vuln
Vulnerable
Unknown
static void vnc_zrle_stop(VncState *vs) { /* switch back to normal output/zlib buffers */ vs->zrle.zrle = vs->output; vs->output = vs->zrle.tmp; }
vuln
Vulnerable
Unknown
protected Response internalPeekNthMessage(String subName, int messagePosition, boolean authoritative) { // If the topic name is a partition name, no need to get partition topic metadata again if (!topicName.isPartitioned() && getPartitionedTopicMetadata(topicName, authoritative, false).p...
vuln
Safe
Java
public static boolean isParallelOrientedPortal(Portal currPortal, Portal outerPortal) { return currPortal.world.getRegistryKey() == outerPortal.dimensionTo && currPortal.getNormal().dotProduct(outerPortal.getContentDirection()) <= -0.9 && !outerPortal.isInside(currPortal.getOriginPos(), ...
vuln
Vulnerable
Java
ast_for_arguments(struct compiling *c, const node *n) { /* This function handles both typedargslist (function definition) and varargslist (lambda definition). parameters: '(' [typedargslist] ')' typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' [ '*' [tfpdef] (',' ...
vuln
Safe
C/C++
static void pci_host_config_write(void *opaque, target_phys_addr_t addr, uint64_t val, unsigned len) { PCIHostState *s = opaque; PCI_DPRINTF("%s addr " TARGET_FMT_plx " len %d val %"PRIx64"\n", __func__, addr, len, val); s->config_reg = val;
vuln
Vulnerable
C/C++
public static File writeAssetsToFile(Context context, String assetPath) throws IOException { String fileName = assetPath.substring(assetPath.lastIndexOf("/") + 1); File resultFile = checkCacheSize(context, assetPath); if (!resultFile.exists()) { boolean createResult = resultFile.crea...
vuln
Safe
Java
void FileSystemManagerImpl::CreateWriter(const GURL& file_path, CreateWriterCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); FileSystemURL url(context_->CrackURL(file_path)); base::Optional<base::File::Error> opt_error = ValidateFileSystemURL(url); if ...
vuln
Vulnerable
C/C++
static inline int check_entry_size_and_hooks(struct arpt_entry *e, struct xt_table_info *newinfo, const unsigned char *base, const unsigned char *limit, const unsigned int *hook_entries, const unsigned int *underflows, unsigned int valid_hooks) { unsigned int...
vuln
Safe
C/C++
@Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { final CycleAdapter.CycleItem cycle = (CycleAdapter.CycleItem) mCycleSpinner.getSelectedItem(); if (LOGD) { Log.d(TAG, "showing cycle " + cycle + ", start="...
vuln
Vulnerable
Java
public void resetAuthorization() { OsmEditingPlugin plugin = OsmandPlugin.getPlugin(OsmEditingPlugin.class); if (plugin == null) { return; } if (isValidToken()) { plugin.OSM_USER_ACCESS_TOKEN.resetToDefault(); plugin.OSM_USER_ACCESS_TOKEN_SECRET.resetToDefault(); getAuthorizationAdapter().resetToke...
vuln
Safe
Java
package sso import ( "bytes" "crypto/rand" "crypto/x509" "encoding/base64" "encoding/xml" "errors" "fmt" "strings" "time" "github.com/beevik/etree" "github.com/fleetdm/fleet/v4/server/fleet" rtvalidator "github.com/mattermost/xml-roundtrip-validator" dsig "github.com/russellhaering/goxmldsig" "github.co...
vuln
Vulnerable
Go
SPL_METHOD(SplFileObject, fread) { spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); long length = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &length) == FAILURE) { return; } if (length <= 0) { php_error_docref(NULL TSRMLS_CC, E_WARN...
vuln
Safe
C/C++
!function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t]+.+)*/m,lookbehind:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,inside:{atrule:/(?:@[\w-]+|[+=])/m}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\...
vuln
Vulnerable
JavaScript
@Override public Response removeToken(String tokenID) { String method = "TokenService.removeToken: "; Map<String, String> auditModParams = new HashMap<>(); if (tokenID == null) { BadRequestException ex = new BadRequestException(method + "Missing token ID"); auditCo...
vuln
Safe
Java
@Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); final int numCards = sa.hasParam("NumCards") ? AbilityUtils.calculateAmount(sa.getHostCard(), sa.getParam("NumCards"), sa) : 1; sb.append(Lang.joinHomogenous(getTargetPlayers(sa))...
vuln
Safe
Java
R_API RBinJavaAttrInfo *r_bin_java_source_debug_attr_new(RBinJavaObj *bin, ut8 *buffer, ut64 sz, ut64 buf_offset) { ut64 offset = 6; if (sz < 8) { return NULL; } RBinJavaAttrInfo *attr = r_bin_java_default_attr_new (bin, buffer, sz, buf_offset); if (!attr) { return NULL; } attr->type = R_BIN_JAVA_ATTR_TYPE_S...
vuln
Safe
Unknown
ModuleExport size_t RegisterXWDImage(void) { MagickInfo *entry; entry=SetMagickInfo("XWD"); #if defined(MAGICKCORE_X11_DELEGATE) entry->decoder=(DecodeImageHandler *) ReadXWDImage; entry->encoder=(EncodeImageHandler *) WriteXWDImage; #endif entry->magick=(IsImageFormatHandler *) IsXWD; entry->seekable_...
vuln
Safe
Unknown
/** * This file is part of alf.io. * * alf.io 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. * * alf.io is distributed in the ...
vuln
Vulnerable
Java
/* * DBeaver - Universal Database Manager * Copyright (C) 2010-2021 DBeaver Corp and others * * 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/LICE...
vuln
Safe
Java
req_get_traps( sockaddr_u *srcadr, endpt *inter, struct req_pkt *inpkt ) { struct info_trap *it; struct ctl_trap *tr; size_t i; if (num_ctl_traps == 0) { req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA); return; } it = (struct info_trap *)prepare_pkt(srcadr, inter, inpkt, v6sizeof(struct info_trap));...
vuln
Vulnerable
Unknown
/* Copyright The Helm Authors. 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 agreed to in writing, software di...
vuln
Vulnerable
Go
'use strict'; const path = require('path'); const { exec } = require('child_process'); const promisify = require('util.promisify'); const inspect = require('object-inspect'); const colors = require('colors/safe'); const copyFileCB = require('fs-copy-file'); const copyFile = promisify(copyFileCB); const readFile = pro...
vuln
Vulnerable
JavaScript
@Override public Object[] toArray() { // Don't call toList() -- in some cases, this can produce an infinite loop // For example, ArrayList may call toArray to get the initial array. However, since we are // creating a new ArrayList in toList with `this`, this creates an infinite recursion lo...
vuln
Safe
Java
/* 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
Vulnerable
Python
int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, ASN1_BIT_STRING *signature, void *asn, EVP_PKEY *pkey) { EVP_MD_CTX ctx; unsigned char *buf_in=NULL; int ret= -1,inl; int mdnid, pknid; if (!pkey) { ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ERR_R_PASSED_NULL_PARAMETER); return -1; } if (signature->...
vuln
Safe
C/C++
static void get_sensor_type(IPMIBmcSim *ibs, uint8_t *cmd, unsigned int cmd_len, uint8_t *rsp, unsigned int *rsp_len, unsigned int max_rsp_len) { IPMISensor *sens; IPMI_CHECK_CMD_LEN(3); if ((cmd[2] >= MAX_SENSORS) ...
vuln
Safe
C/C++
void ExtensionTtsController::CheckSpeechStatus() { if (!current_utterance_) return; if (!current_utterance_->extension_id().empty()) return; if (GetPlatformImpl()->IsSpeaking() == false) { FinishCurrentUtterance(); SpeakNextUtterance(); } if (current_utterance_ && current_utterance_->exte...
vuln
Vulnerable
C/C++
!function(n){for(var i="[^<()\"']|\\((?:<expr>)*\\)|<(?!#--)|<#--(?:[^-]|-(?!->))*--\x3e|\"(?:[^\\\\\"]|\\\\.)*\"|'(?:[^\\\\']|\\\\.)*'",e=0;e<2;e++)i=i.replace(/<expr>/g,function(){return i});i=i.replace(/<expr>/g,"[^\\s\\S]");var t={comment:/<#--[\s\S]*?-->/,string:[{pattern:/\br("|')(?:(?!\1)[^\\]|\\.)*\1/,greedy:!0...
vuln
Safe
JavaScript
public static boolean adjustCamera(IWrapperPlayer player, Point3D cameraAdjustedPosition, RotationMatrix cameraRotation, float partialTicks) { //Get variables. AEntityB_Existing ridingEntity = player.getEntityRiding(); PartSeat sittingSeat = ridingEntity instanceof PartSeat ? (PartSeat) ridingEn...
vuln
Vulnerable
Java
int get_devices_from_authfile(const char *authfile, const char *username, unsigned max_devs, int verbose, FILE *debug_file, device_t *devices, unsigned *n_devs) { char *buf = NULL; char *s_user, *s_token; int retval = 0; int fd = -1; struct stat st;...
vuln
Vulnerable
C/C++
static alias_ty alias_for_import_name(struct compiling *c, const node *n, int store) { /* import_as_name: NAME ['as' NAME] dotted_as_name: dotted_name ['as' NAME] dotted_name: NAME ('.' NAME)* */ identifier str, name; loop: switch (TYPE(n)) { case import_as_name: { ...
vuln
Safe
C/C++
static int do_ssl3_write(SSL *s, int type, const unsigned char *buf, unsigned int len, int create_empty_fragment) { unsigned char *p,*plen; int i,mac_size,clear=0; int prefix_len=0; int eivlen; long align=0; SSL3_RECORD *wr; SSL3_BUFFER *wb=&(s->s3->wbuf); SSL_SESSION *sess; if (wb->buf == NULL) if (!...
vuln
Vulnerable
Unknown
def decode_raw(input_bytes, out_type, little_endian=True, fixed_length=None, name=None): r"""Convert raw bytes from input tensor into numeric tensors. Every component of the input tensor is interpreted as a sequence of bytes. These bytes are then decode...
vuln
Safe
Python
static void spapr_machine_init(MachineState *machine) { sPAPRMachineState *spapr = SPAPR_MACHINE(machine); sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(machine); const char *kernel_filename = machine->kernel_filename; const char *initrd_filename = machine->initrd_filename; PCIHostState *phb; ...
vuln
Safe
C/C++
void *nlmsg_reserve(struct nl_msg *n, size_t len, int pad) { void *buf = n->nm_nlh; size_t nlmsg_len = n->nm_nlh->nlmsg_len; size_t tlen; tlen = pad ? ((len + (pad - 1)) & ~(pad - 1)) : len; if ((tlen + nlmsg_len) > n->nm_size) n->nm_nlh->nlmsg_len += tlen; if (tlen > len) mems...
vuln
Vulnerable
C/C++
static void worker_process(int fd, debugger_request_t& request) { std::string tombstone_path; int tombstone_fd = -1; switch (request.action) { case DEBUGGER_ACTION_DUMP_TOMBSTONE: case DEBUGGER_ACTION_CRASH: tombstone_fd = open_tombstone(&tombstone_path); if (tombstone_fd == -1) { ALOGE("debuggerd:...
vuln
Vulnerable
C/C++
/** * FreeRDP: A Remote Desktop Protocol Implementation * Input Virtual Channel Extension * * Copyright 2013 Marc-Andre Moreau <marcandre.moreau@gmail.com> * Copyright 2015 Thincast Technologies GmbH * Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com> * * Licensed under the Apache Licens...
vuln
Safe
C/C++
void LauncherView::ShowOverflowMenu() { void LauncherView::ShowOverflowBubble() { int first_overflow_index = last_visible_index_ + 1; DCHECK_LT(first_overflow_index, view_model_->view_size() - 1); if (!overflow_bubble_.get()) overflow_bubble_.reset(new OverflowBubble()); overflow_bubble_->Show(delegate_...
vuln
Safe
C/C++
/* nbdkit * Copyright (C) 2013-2019 Red Hat Inc. * * 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 conditions and the f...
vuln
Vulnerable
C/C++
public RspContractCompile contractCompile(String contractName, String sourceBase64) { File contractFile = null; try { // whether use guomi to compile boolean useSM2 = cryptoSuite.cryptoTypeConfig == CryptoType.SM_TYPE; // decode byte[] contractSourceByteA...
vuln
Vulnerable
Java
def maybe_send_to_registration( request: HttpRequest, email: str, full_name: str = "", mobile_flow_otp: Optional[str] = None, desktop_flow_otp: Optional[str] = None, is_signup: bool = False, password_required: bool = True, multiuse_object_key: str = "", full_name_validated: bool = Fa...
vuln
Safe
Python
snmp_engine_get_bulk(snmp_header_t *header, snmp_varbind_t *varbinds) { snmp_mib_resource_t *resource; snmp_oid_t oids[SNMP_MAX_NR_VALUES]; uint32_t j, original_varbinds_length; uint8_t repeater; uint8_t i, varbinds_length; /* * A local copy of the requested oids must be kept since * the varbinds ar...
vuln
Safe
C/C++
private void performRequest(IUploadServer server, final String action, final boolean isAsync, final byte[] data, final Map<String, String>header, final String m...
vuln
Vulnerable
Java
int avfilter_graph_queue_command(AVFilterGraph *graph, const char *target, const char *command, const char *arg, int flags, double ts) { int i; if(!graph) return 0; for (i = 0; i < graph->nb_filters; i++) { AVFilterContext *filter = graph->filters[i]; if(filter && (!strcmp(target, "a...
vuln
Safe
C/C++
static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */ { char *filename; int filename_len; zval *user; uid_t uid; int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/", &filename, &filename_len, &user) == FAILURE) { return; } if (strlen(filename) != filename_len) { R...
vuln
Safe
Unknown
xmlBufCreateSize(size_t size) { xmlBufPtr ret; ret = (xmlBufPtr) xmlMalloc(sizeof(xmlBuf)); if (ret == NULL) { xmlBufMemoryError(NULL, "creating buffer"); return(NULL); } ret->compat_use = 0; ret->use = 0; ret->error = 0; ret->buffer = NULL; ret->alloc = xmlBufferAllocSchem...
vuln
Vulnerable
Unknown
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % CCC U U TTTTT ...
vuln
Vulnerable
C/C++
void net_check_clients(void) { VLANState *vlan; VLANClientState *vc; int has_nic, has_host_dev; QTAILQ_FOREACH(vlan, &vlans, next) { QTAILQ_FOREACH(vc, &vlan->clients, next) { switch (vc->info->type) { case NET_CLIENT_TYPE_NIC: has_nic = 1; ...
vuln
Vulnerable
C/C++
QPDFObjectHandle::parseContentStream_data( PointerHolder<Buffer> stream_data, std::string const& description, ParserCallbacks* callbacks) { size_t length = stream_data->getSize(); PointerHolder<InputSource> input = new BufferInputSource(description, stream_data.getPointer()); QPDFTokeniz...
vuln
Safe
Unknown
static MagickBooleanType WriteMSLImage(const ImageInfo *image_info,Image *image) { Image *msl_image; assert(image_info != (const ImageInfo *) NULL); assert(image_info->signature == MagickCoreSignature); assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); if (image->debug !...
vuln
Vulnerable
C/C++
bool RequestParser::OnHeadersEnd() { // Decode the URL path before match. std::string url_path = Url::DecodeUnsafe(request_->url().path()); bool matched = view_matcher_(request_->method(), url_path, &stream_); if (!matched) { LOG_WARN("No view matches the request: %s %s", request_->method().c_str(), ...
vuln
Safe
Unknown
static int command_write(struct pci_dev *dev, int offset, u16 value, void *data) { struct xen_pcibk_dev_data *dev_data; int err; u16 val; struct pci_cmd_info *cmd = data; dev_data = pci_get_drvdata(dev); if (!pci_is_enabled(dev) && is_enable_cmd(value)) { if (unlikely(verbose_request)) printk(KERN_DEB...
vuln
Safe
C/C++
void RGWCORSRule::format_exp_headers(string& s) { s = ""; for (const auto& header : exposable_hdrs) { if (s.length() > 0) s.append(","); // these values are sent to clients in a 'Access-Control-Expose-Headers' // response header, so we escape '\n' to avoid header injection boost::replace_all_c...
vuln
Safe
Unknown
static inline void RENAME(yuv2rgbX)(int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize, int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, uint8_t *dest, int dstW, int dstbpp, int16_t * lumMmxFilter, int16_t * chrMmxFilter) { if(fullUVIpol) { } else { #ifdef HAVE_MMX if(dstbpp == 32) ...
vuln
Vulnerable
C/C++
radix__arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, const unsigned long len, const unsigned long pgoff, const unsigned long flags) { struct vm_area_struct *vma; struct mm_struct *mm = current->mm; unsigned long addr = addr0; struct vm_unmapped_area...
vuln
Safe
Unknown
_fr_window_ask_overwrite_dialog (OverwriteData *odata) { if ((odata->edata->overwrite == FR_OVERWRITE_ASK) && (odata->current_file != NULL)) { const char *base_name; GFile *destination; base_name = _g_path_get_relative_basename ((char *) odata->current_file->data, odata->edata->base_dir, odata->edata->junk...
vuln
Vulnerable
Unknown
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ var $0 = $$.length - 1; switch (yystate) { case 1: return $$[$0-1]; break; case 2: this.$ = yy.callVariable($$[$0][0]); break; case 3: this.$ = yy.toNu...
vuln
Safe
JavaScript
static void hash_object_body(const struct git_hash_algo *algo, git_hash_ctx *c, const void *buf, unsigned long len, struct object_id *oid, char *hdr, int *hdrlen) { algo->init_fn(c); algo->update_fn(c, hdr, *hdrlen); algo->update_fn(c, buf, len); algo->final_oid_fn(oid, c); }
vuln
Vulnerable
C/C++
internals.Traceroute.trace = function (host, callback) { Dns.lookup(host.toUpperCase(), (err) => { if (err && Net.isIP(host) === 0) { return callback(new Error('Invalid host')); } const command = (internals.isWin ? 'tracert -d ' : 'traceroute -q 1 -n ') + host; Child....
vuln
Vulnerable
JavaScript
void *_zend_shared_memdup(void *source, size_t size, zend_bool free_source) { void *old_p, *retval; if ((old_p = zend_hash_index_find_ptr(&xlat_table, (zend_ulong)source)) != NULL) { /* we already duplicated this pointer */ return old_p; } retval = ZCG(mem); ZCG(mem) = (void*)(((char*)ZCG(mem)) ...
vuln
Safe
C/C++
dictionary * iniparser_load(const char * ininame) { FILE * in ; char line [ASCIILINESZ+1] ; char section [ASCIILINESZ+1] ; char key [ASCIILINESZ+1] ; char tmp [(ASCIILINESZ * 2) + 1] ; char val [ASCIILINESZ+1] ; int last=0 ; int len ; int lineno=0 ; int errs=...
vuln
Safe
Unknown
@ModifyVariable(method = "getEmptySlot", at = @At(value = "LOAD", ordinal = 0)) private int skipLockedSlots(int slot) { InventoryLimiter limiter = this.requiemLimiter; while (limiter.isSlotLocked(slot) && slot < this.main.size()) { slot++; } return slot; }
vuln
Vulnerable
Java
@Override protected void beforeHookedMethod(MethodHookParam param) { try { Hookers.logD("ActivityThread#handleBindApplication() starts"); ActivityThread activityThread = (ActivityThread) param.thisObject; Object bindData = param.args[0]; final ApplicationInfo ...
vuln
Vulnerable
Java
apr_byte_t oidc_cache_set(request_rec *r, const char *section, const char *key, const char *value, apr_time_t expiry) { oidc_cfg *cfg = ap_get_module_config(r->server->module_config, &auth_openidc_module); int encrypted = oidc_cfg_cache_encrypt(r); char *encoded = NULL; apr_byte_t rc = FALSE; char *msg = NUL...
vuln
Safe
Unknown
private Response upgradeService(Service service, final UserGroupInformation ugi) throws IOException, InterruptedException { ServiceStatus status = new ServiceStatus(); ugi.doAs((PrivilegedExceptionAction<Void>) () -> { ServiceClient sc = getServiceClient(); sc.init(YARN_CONFIG); sc.start...
vuln
Vulnerable
Java
lys_augment_free(struct ly_ctx *ctx, struct lys_node_augment *aug, void (*private_destructor)(const struct lys_node *node, void *priv)) { struct lys_node *next, *sub; /* children from a resolved augment are freed under the target node */ if (!aug->target || (aug->flags & LYS_NOTAPPLIED)) {...
vuln
Safe
Unknown
int main (int argc, char **argv) { srand ((unsigned) jerry_port_get_current_time ()); JERRY_VLA (const char *, file_names, argc); int files_counter = 0; jerry_init_flag_t flags = JERRY_INIT_EMPTY; JERRY_VLA (const char *, exec_snapshot_file_names, argc); JERRY_VLA (uint32_t, exec_snapshot_file_indic...
vuln
Vulnerable
C/C++
static inline void vmsvga_update_rect(struct vmsvga_state_s *s, int x, int y, int w, int h) { #ifndef DIRECT_VRAM int line; int bypl; int width; int start; uint8_t *src; uint8_t *dst; if (x + w > s->width) { fprintf(stderr, "%s: update width too large x: %d, w: %d\n",...
vuln
Safe
C/C++
static void vga_draw_graphic(VGAState *s, int full_update) { int y1, y, update, page_min, page_max, linesize, y_start, double_scan, mask, depth; int width, height, shift_control, line_offset, page0, page1, bwidth, bits; int disp_width, multi_scan, multi_run; uint8_t *d; uint32_t v, addr1, addr; ...
vuln
Vulnerable
C/C++
@SubscribeEvent public void onPotionExpired(PotionEvent.PotionExpiryEvent event) { if (event.getEntity().world.isRemote && event.getPotionEffect().getPotion() == BloodMagicPotions.FLIGHT && event.getEntityLiving() instanceof PlayerEntity) { ((PlayerEntity) event.getEntityLiving()).abilities.allowFlying = ((Pla...
vuln
Safe
Java
struct error_obj run_pam_auth(const char *username, char *password) { // PAM frees pam_response for us. struct pam_response *reply = malloc(sizeof(struct pam_response)); if (reply == NULL) { struct error_obj ret_val; ret_val.status = 2; ret_val.func_name = "malloc"; ret_val.e...
vuln
Safe
Unknown
y.style.position="absolute";y.style.width="640px";y.style.top="260px";y.style.textAlign="center";y.style.fontSize="22px";y.style.color="#a0c3ff";mxUtils.write(y,mxResources.get("dragImagesHere"));f.appendChild(y);var A={},B=null,I=null,O=null;e=function(E){"true"!=mxEvent.getSource(E).getAttribute("contentEditable")&&n...
vuln
Safe
JavaScript
static int i8042_start(struct serio *serio) { struct i8042_port *port = serio->port_data; spin_lock_irq(&i8042_lock); port->exists = true; spin_unlock_irq(&i8042_lock); return 0; }
vuln
Safe
Unknown
TEE_Result crypto_asym_alloc_ecc_keypair(struct ecc_keypair *s, uint32_t key_type, size_t key_size_bits) { memset(s, 0, sizeof(*s)); switch (key_type) { case TEE_TYPE_ECDSA_KEYPAIR: case TEE_TYPE_ECDH_KEYPAIR: s->ops = &ecc_keypair_ops; break; case TEE_TYPE_SM2_DSA_KEYPAIR: if (!IS_ENABLED(CFG_C...
vuln
Safe
C/C++
package com.salesmanager.shop.admin.model.permission; import java.io.Serializable; import java.util.List; import javax.validation.Valid; import com.salesmanager.core.model.user.Group; public class GroupDetails implements Serializable { /** * */ private static final long serialVersionUID = 1L; @Valid priva...
vuln
Safe
Java
static void ip_expire(unsigned long arg) { struct ipq *qp; struct net *net; qp = container_of((struct inet_frag_queue *) arg, struct ipq, q); net = container_of(qp->q.net, struct net, ipv4.frags); spin_lock(&qp->q.lock); if (qp->q.last_in & INET_FRAG_COMPLETE) goto out; ipq_kill(qp); IP_INC_STATS_BH(net,...
vuln
Safe
C/C++
@SuppressLint("NewApi") protected void onPrepareActionBar(android.app.ActionBar actionBar) { if (actionBar == null) { return; } actionBar.setDisplayHomeAsUpEnabled(true); }
vuln
Safe
Java
private void fetchTranslation(CharSequence text, long minDuration, OnTranslationSuccess onSuccess, OnTranslationFail onFail) { if (!translateQueue.isAlive()) { translateQueue.start(); } translateQueue.postRunnable(() -> { TranslatorHelper.translate(new TranslatorHelper.Tr...
vuln
Vulnerable
Java
package com.salesmanager.shop.admin.model.customer.attribute; import java.io.Serializable; import com.salesmanager.shop.model.entity.ShopEntity; public class CustomerOptionValue extends ShopEntity implements Serializable { /** * */ private static final long serialVersionUID = 1L; private String name; p...
vuln
Vulnerable
Java
int slap_parse_user( struct berval *id, struct berval *user, struct berval *realm, struct berval *mech ) { char u; assert( id != NULL ); assert( !BER_BVISNULL( id ) ); assert( user != NULL ); assert( realm != NULL ); assert( mech != NULL ); u = id->bv_val[ 0 ]; if ( u != 'u' && u != 'U' ) { /* called w...
vuln
Vulnerable
C/C++
netsnmp_init_mib(void) { const char *prefix; char *env_var, *entry; PrefixListPtr pp = &mib_prefixes[0]; char *st = NULL; if (Mib) return; netsnmp_init_mib_internals(); /* * Initialise the MIB directory/ies */ netsnmp_fixup_mib_directory(); ...
vuln
Vulnerable
Unknown
static av_cold void uninit(AVFilterContext *ctx) { DynamicAudioNormalizerContext *s = ctx->priv; int c; av_freep(&s->prev_amplification_factor); av_freep(&s->dc_correction_value); av_freep(&s->compress_threshold); av_freep(&s->fade_factors[0]); av_freep(&s->fade_factors[1]); for (c = 0; ...
vuln
Safe
C/C++
@Override public void renderBackground(PoseStack matrix, float partialTick, int mouseX, int mouseY) { showButtons(); Font font = Minecraft.getInstance().font; TranslatableComponent title; switch (activeSubPage) { case CHILDREN: title = childrenTitle; ...
vuln
Vulnerable
Java
rpl_dio_printopt(netdissect_options *ndo, const struct rpl_dio_genoption *opt, u_int length) { if(length < RPL_DIO_GENOPTION_LEN) return; length -= RPL_DIO_GENOPTION_LEN; ND_TCHECK(opt->rpl_dio_len); while((opt->rpl_dio_type == RPL_OPT_PAD0 && ...
vuln
Safe
C/C++
@Override public void xMove(Lua other, int n) throws IllegalArgumentException { other.checkStack(n); C.lua_xmove(L, other.getPointer(), n); }
vuln
Safe
Java
static int vhost_set_vring_file(struct vhost_dev *dev, VhostUserRequest request, struct vhost_vring_file *file) { int fds[VHOST_MEMORY_MAX_NREGIONS]; size_t fd_num = 0; VhostUserMsg msg = { .request = request, .flags = VHOST_USE...
vuln
Safe
C/C++
void get_cmdln_options(int argc, char *argv[]) { int o; #if CONFIG_FILE && HAVE_GETPWUID static struct passwd *pwd_entry; char *str; #endif #ifdef LONG_OPTIONS int option_index = 0; static struct option long_options[] = { {"timeout", 1, 0, 't'}, #ifdef PROC_NET_DEV {"procfile",1,0,'f'},...
vuln
Vulnerable
C/C++
def createSessionIdAndXsrfToken(req: AuthnReqHeader, userId: PatId) : (SidOk, XsrfOk, List[Cookie]) = { AUDIT_LOG // Maybe log session id creation? val site = req.site val dao = req.dao val useOldSid = site.isFeatureEnabled("ffUseOldSid", globals.config.featureFlags) val ppt = dao.getPar...
vuln
Safe
Scala