code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
ChildProcessTerminationInfo ChildProcessLauncherHelper::GetTerminationInfo( const ChildProcessLauncherHelper::Process& process, bool known_dead) { ChildProcessTerminationInfo info; if (!java_peer_avaiable_on_client_thread_) return info; Java_ChildProcessLauncherHelperImpl_getTerminationInfo( ...
vuln
Vulnerable
C/C++
// Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. define([ 'jquery', 'components/sanitizer/index', ], function($, sanitizer) { "use strict"; var noop = function (x) { return x; }; var defaultSanitizer = sanitizer.defaultSanitizer; var sanit...
vuln
Safe
Python
@Override public Object getParam(@NonNull String key, Object defVal) { if (FINGERPRINT_TYPE.equals(key)) { return fingerprintType != FINGERPRINT_TYPE_UNDEFINE ? fingerprintType : defVal; } else if (FINGERPRINT_HARDWARE_POSITION.equals(key)) { return fingerprintPosition != nul...
vuln
Vulnerable
Java
public void stop(){ logger.info("Closing..."); isConnected = false; client.close(); client = null; }
vuln
Vulnerable
Java
static uint32_t get_cmd(ESPState *s, uint8_t *buf, uint8_t buflen) { uint32_t dmalen; int target; target = s->wregs[ESP_WBUSID] & BUSID_DID; if (s->dma) { dmalen = s->rregs[ESP_TCLO]; dmalen |= s->rregs[ESP_TCMID] << 8; dmalen |= s->rregs[ESP_TCHI] << 16; if (dmalen > buf...
vuln
Safe
C/C++
static int vfio_start_eventfd_injection(VFIOINTp *intp) { int ret; ret = vfio_set_trigger_eventfd(intp, vfio_intp_interrupt); if (ret) { error_report("vfio: Error: Failed to pass IRQ fd to the driver: %m"); } return ret; }
vuln
Vulnerable
C/C++
def is_cgi(self): """Test whether self.path corresponds to a CGI script, and return a boolean. This function sets self.cgi_info to a tuple (dir, rest) when it returns True, where dir is the directory part before the CGI script name. Note that rest begins with a slash if...
vuln
Vulnerable
Python
snmp_ber_encode_string_len(snmp_packet_t *snmp_packet, const char *str, uint32_t length) { uint32_t i; str += length - 1; for(i = 0; i < length; ++i) { if(snmp_packet->used == snmp_packet->max) { return 0; } *snmp_packet->out-- = (uint8_t)*str--; snmp_packet->used++; } if(!snmp_ber_en...
vuln
Safe
C/C++
def fence_device_metadata(params, request, auth_user) if not allowed_for_local_cluster(auth_user, Permissions::READ) return 403, 'Permission denied' end return 200 if not params[:resourcename] or params[:resourcename] == "" @fenceagent = FenceAgent.new(params[:resourcename]) @fenceagent.required_options, ...
vuln
Safe
Ruby
static errno_t sssctl_backup(bool force) { const char *files[] = {SSS_BACKUP_USER_OVERRIDES, SSS_BACKUP_GROUP_OVERRIDES, NULL}; enum sssctl_prompt_result prompt; errno_t ret; ret = sssctl_create_backup_dir(SSS_BACKUP_DIR); if (ret != EOK) { ...
vuln
Safe
Unknown
static void lys_deviation_free(struct lys_module *module, struct lys_deviation *dev, void (*private_destructor)(const struct lys_node *node, void *priv)) { int i, j, k; struct ly_ctx *ctx; struct lys_node *next, *elem; ctx = module->ctx; lydict_remove(ctx, dev->target_name); ...
vuln
Safe
C/C++
/** * @file resolve.c * @author Michal Vasko <mvasko@cesnet.cz> * @brief libyang resolve functions * * Copyright (c) 2015 - 2018 CESNET, z.s.p.o. * * This source code is licensed under BSD 3-Clause License (the "License"). * You may not use this file except in compliance with the License. * You may obtain a co...
vuln
Vulnerable
C/C++
void restore() { System.arraycopy(rSave, 0, r, 0, blockSize); int ret; synchronized (this) { ret = nativeCrypto.CBCInit(nativeContext, mode, r, r.length, key, key.length); } if (ret == -1) { throw new ProviderException("Error in Native CipherBlockChaining"...
vuln
Safe
Java
@ReactMethod public void unregisterService(String serviceName, String implType) { try { getZeroconfImpl(implType).unregisterService(serviceName); } catch (Throwable e) { Log.e(getClass().getName(), e.getMessage(), e); sendEvent(getReactApplicationContext(), Zeroco...
vuln
Safe
Java
/************************************************************************ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. * Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko * Website: https://www.espocrm.com * * EspoCRM is free software: you can redistribute i...
vuln
Vulnerable
JavaScript
decode_bundle(bool load, const struct nx_action_bundle *nab, const struct vl_mff_map *vl_mff_map, uint64_t *tlv_bitmap, struct ofpbuf *ofpacts) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); struct ofpact_bundle *bundle; uint32_t slave_type; size_t slaves_si...
vuln
Safe
C/C++
word32 DSA_Signer::Sign(const byte* sha_digest, byte* sig, RandomNumberGenerator& rng) { const Integer& p = key_.GetModulus(); const Integer& q = key_.GetSubGroupOrder(); const Integer& g = key_.GetSubGroupGenerator(); const Integer& x = key_.GetPrivatePart(); Integer k(rng,...
vuln
Vulnerable
Unknown
/* The MIT License (MIT) Copyright (c) 2014-2017 DutchCoders [https://github.com/dutchcoders/] 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 th...
vuln
Vulnerable
Go
package io.onedev.server.migration; import java.beans.IntrospectionException; import java.beans.PropertyDescriptor; import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collection; import java.util.Comparator...
vuln
Vulnerable
Java
static struct inet_frag_queue *inet_frag_intern(struct netns_frags *nf, struct inet_frag_queue *qp_in, struct inet_frags *f, void *arg) { struct inet_frag_bucket *hb; struct inet_frag_queue *qp; unsigned int hash; read_lock(&f->lock); /* Protects against hash rebuild */ /* * While we stayed w/o the lock oth...
vuln
Safe
C/C++
package de.presti.ree6.commands.impl.community; import de.presti.ree6.commands.Category; import de.presti.ree6.commands.CommandEvent; import de.presti.ree6.commands.interfaces.Command; import de.presti.ree6.commands.interfaces.ICommand; import de.presti.ree6.main.Main; import net.dv8tion.jda.api.Permission; import net...
vuln
Vulnerable
Java
static void btif_dm_upstreams_evt(UINT16 event, char* p_param) { tBTA_DM_SEC *p_data = (tBTA_DM_SEC*)p_param; tBTA_SERVICE_MASK service_mask; uint32_t i; bt_bdaddr_t bd_addr; BTIF_TRACE_EVENT("btif_dm_upstreams_cback ev: %s", dump_dm_event(event)); switch (event) { case BTA_DM_ENABLE_EVT: { ...
vuln
Safe
C/C++
public BCXMSSPrivateKey(PrivateKeyInfo keyInfo) throws IOException { XMSSKeyParams keyParams = XMSSKeyParams.getInstance(keyInfo.getPrivateKeyAlgorithm().getParameters()); this.treeDigest = keyParams.getTreeDigest().getAlgorithm(); XMSSPrivateKey xmssPrivateKey = XMSSPrivateKey.getI...
vuln
Safe
Java
static USBDevice *usb_net_init(const char *cmdline) { USBDevice *dev; QemuOpts *opts; int idx; opts = qemu_opts_parse(&qemu_net_opts, cmdline, NULL); if (!opts) { return NULL; } qemu_opt_set(opts, "type", "nic"); qemu_opt_set(opts, "model", "usb"); idx = net_client_init(NULL,...
vuln
Safe
C/C++
@Inject(method = "<init>", at = @At(value = "RETURN")) public void setupActivationStates(EntityType<?> type, Level level, CallbackInfo ci) { if (!this.level.isClientSide) { final Entity entity = (Entity) (Object) this; this.activationType = ActivationRange.initializeEntityActivationT...
vuln
Safe
Java
void Compute(OpKernelContext* context) override { INDEX_TYPE first_dimension; const Tensor first_partition_tensor = context->input(kFirstPartitionInputIndex); OP_REQUIRES(context, first_partition_tensor.NumElements() > 0, errors::InvalidArgument("Invalid first partition input. Tensor...
vuln
Safe
Unknown
static Image *ReadVIFFImage(const ImageInfo *image_info, ExceptionInfo *exception) { #define VFF_CM_genericRGB 15 #define VFF_CM_ntscRGB 1 #define VFF_CM_NONE 0 #define VFF_DEP_DECORDER 0x4 #define VFF_DEP_NSORDER 0x8 #define VFF_DES_RAW 0 #define VFF_LOC_IMPLICIT 1 #define VFF_MAPTYP_NONE 0 #define VFF_MAPTY...
vuln
Safe
Unknown
def process_delta(data, delta): if not delta.specific.delta: return data if delta.specific.delta == 'cat': datalines = data.split('\n') for line in delta.data.split('\n'): if not line: continue if line[0] == '+': datalines.append(li...
vuln
Safe
Python
static int futex_requeue(u32 __user *uaddr1, unsigned int flags, u32 __user *uaddr2, int nr_wake, int nr_requeue, u32 *cmpval, int requeue_pi) { union futex_key key1 = FUTEX_KEY_INIT, key2 = FUTEX_KEY_INIT; int drop_count = 0, task_count = 0, ret; struct futex_pi_state *pi_state = NULL; struct futex_hash_bu...
vuln
Vulnerable
Unknown
@SuppressLint("SetTextI18n") @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); RequestNetwork requestNetwork = new RequestNetwork(this); WebhookListener listener = new WebhookListener(); Intent intent = getIntent(); if (inten...
vuln
Safe
Java
@TdlibThread void onUpdateNewMessage (TdApi.UpdateNewMessage update) { if (update.message.isOutgoing || update.message.sendingState != null) return; ViewController<?> c = null; try { c = UI.getCurrentStackItem(); } catch (ArrayIndexOutOfBoundsException ignored) { } if (c instanceof Mes...
vuln
Safe
Java
public String[] getToIds() { return toIds != null ? toIds.clone() : null; }
vuln
Safe
Java
static int read_dialogue(ASSContext *ass, AVBPrint *dst, const uint8_t *p, int64_t *start, int *duration) { int pos = 0; int64_t end; int hh1, mm1, ss1, ms1; int hh2, mm2, ss2, ms2; if (sscanf(p, "Dialogue: %*[^,],%d:%d:%d%*c%d,%d:%d:%d%*c%d,%n", &hh1, &mm1, &...
vuln
Safe
C/C++
void WebContentsImpl::AttachInterstitialPage( InterstitialPageImpl* interstitial_page) { DCHECK(!interstitial_page_ && interstitial_page); interstitial_page_ = interstitial_page; CancelActiveAndPendingDialogs(); for (auto& observer : observers_) observer.DidAttachInterstitialPage(); if (frame_tre...
vuln
Safe
C/C++
void Lua::setParamsTable(lua_State* vm, const char* table_name, const char* query) const { char outbuf[FILENAME_MAX]; char *where; char *tok; char *query_string = query ? strdup(query) : NULL; lua_newtable(L); if (query_string) { // ntop->getTrace()->traceEvent(TRACE_WARNING, "[HTTP] %s", query_s...
vuln
Safe
C/C++
static struct mobj *alloc_ta_mem(size_t size) { #ifdef CFG_PAGED_USER_TA return mobj_paged_alloc(size); #else struct mobj *mobj = mobj_mm_alloc(mobj_sec_ddr, size, &tee_mm_sec_ddr); if (mobj) memset(mobj_get_va(mobj, 0), 0, size); return mobj; #endif }
vuln
Vulnerable
C/C++
/* * 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
// Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: Hasher) // Package internal is a generated GoMock package. package internal import ( context "context" reflect "reflect" gomock "github.com/golang/mock/gomock" ) // MockHasher is a mock of Hasher interface type MockHasher st...
vuln
Vulnerable
Go
void do_405_check_sat (void) { if (!likely((((uint32_t)T1 ^ (uint32_t)T2) >> 31) || !(((uint32_t)T0 ^ (uint32_t)T2) >> 31))) { if (T2 >> 31) { T0 = INT32_MIN; } else { T0 = INT32_MAX; } } }
vuln
Safe
C/C++
static void vgacon_scrolldelta(struct vc_data *c, int lines) { vc_scrolldelta_helper(c, lines, vga_rolled_over, (void *)vga_vram_base, vga_vram_size); vga_set_mem_top(c); }
vuln
Safe
C/C++
protected boolean checkLineAndColumn(int line, int column, boolean allowEqual) { checkLine(line); int len = mLines.get(line).length(); if (column > len || (!allowEqual && column == len)) { return false; } return true; }
vuln
Safe
Java
static int do_setxattr(struct btrfs_trans_handle *trans, struct inode *inode, const char *name, const void *value, size_t size, int flags) { struct btrfs_dir_item *di = NULL; struct btrfs_root *root = BTRFS_I(inode)->root; struct btrfs_path *path; size_t name_len = strlen(name); int ret = 0; if...
vuln
Safe
C/C++
exports.extract = function (cwd, opts) { if (!cwd) cwd = '.' if (!opts) opts = {} var xfs = opts.fs || fs var ignore = opts.ignore || opts.filter || noop var map = opts.map || noop var mapStream = opts.mapStream || echo var own = opts.chown !== false && !win32 && processGetuid() === 0 var extract = opt...
vuln
Vulnerable
JavaScript
compute_O_rc4_key(std::string const& user_password, std::string const& owner_password, QPDF::EncryptionData const& data, unsigned char key[OU_key_bytes_V4]) { if (data.getV() >= 5) { throw std::logic_error( "compute_O_rc4_key called for file with V >= 5"); } std::string password = owne...
vuln
Safe
Unknown
@EventHandler(priority = EventPriority.HIGHEST) public void onNoteblockPowered(final GenericGameEvent event) { Block block = event.getLocation().getBlock(); NamespacedKey eventKey = NamespacedKey.minecraft("note_block_play"); // This GameEvent only exists in 1.19 // If server is 1.1...
vuln
Vulnerable
Java
HpackDecoder::HpackDecoder(const HpackHuffmanTable& table) : max_string_literal_size_(kDefaultMaxStringLiteralSize), regular_header_seen_(false), huffman_table_(table) {}
vuln
Safe
C/C++
LOCAL int populate_description_metadata(MMDB_s *mmdb, MMDB_s *metadata_db, MMDB_entry_s *metadata_start) { MMDB_entry_data_s entry_data; const char *path[] = { "description", NULL }; int status = MMDB_aget_value(metadata_start, &entry_data, path); if (MMDB_SUCCES...
vuln
Safe
Unknown
main(int argc, char *argv[]) { static char buff[16384]; struct cpio _cpio; /* Allocated on stack. */ struct cpio *cpio; const char *errmsg; int uid, gid; int opt; cpio = &_cpio; memset(cpio, 0, sizeof(*cpio)); cpio->buff = buff; cpio->buff_size = sizeof(buff); #if defined(HAVE_SIGACTION) && defined(SIGPIPE)...
vuln
Vulnerable
C/C++
void ep4_read_bin(ep4_t a, const uint8_t *bin, size_t len) { if (len == 1) { if (bin[0] == 0) { ep4_set_infty(a); return; } else { RLC_THROW(ERR_NO_BUFFER); return; } } if (len != (8 * RLC_FP_BYTES + 1)) { RLC_THROW(ERR_NO_BUFFER); return; } a->coord = BASIC; fp4_set_dig(a->z, 1); fp4_rea...
vuln
Safe
C/C++
const {readFileSync, statSync} = require('fs'); const propertyAppender = require('./property-appender').propertyAppender; const propertyWriter = require('./property-writer').propertyWriter; const has = Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty); const SECTION = Symbol('SECTION'); func...
vuln
Safe
JavaScript
int ssl3_get_client_certificate(SSL *s) { int i, ok, al, ret = -1; X509 *x = NULL; unsigned long l, nc, llen, n; const unsigned char *p, *q; unsigned char *d; STACK_OF(X509) *sk = NULL; n = s->method->ssl_get_message(s, SSL3_ST_SR_CERT_A, ...
vuln
Safe
Unknown
@Method(0x80114e60L) public static FlowControl FUN_80114e60(final RunningScript a0) { final EffectManagerData6c manager = (EffectManagerData6c)scriptStatePtrArr_800bc1c0[a0.params_20[0].get()].innerStruct_00; manager._10.vec_24.component(a0.params_20[1].get()).set(a0.params_20[2].get()); return FlowContro...
vuln
Vulnerable
Java
void ScreenOrientationDispatcherHost::OnLockRequest( RenderFrameHost* render_frame_host, blink::WebScreenOrientationLockType orientation, int request_id) { if (current_lock_) { NotifyLockError(current_lock_->request_id, blink::WebLockOrientationErrorCanceled); } current_loc...
vuln
Vulnerable
C/C++
@Override public void load(FastJCanvas canvas) { playerMetadata = createPlayerMetaData(); playerHealthBar = createPlayerHealthBar(); PlayerHealthBar playerHealthBarScript = new PlayerHealthBar(playerMetadata, this); playerHealthBar.addBehavior(playerHealthBarScript, this) ...
vuln
Vulnerable
Java
// --- BEGIN COPYRIGHT BLOCK --- // 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; version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT...
vuln
Safe
C/C++
private static void evaluateStartNewSiegeAttempt(Player player, Town residentsTown, Nation residentsNation, TownBlock nearbyTownBlock, Town nearbyTown, Block bannerBlock ) throws TownyException { if (SiegeWarSettings.getWarCommo...
vuln
Vulnerable
Java
'use strict'; var request = require('request'), cheerio = require('cheerio'); var shorthandProperties = { "image": "image:url", "video": "video:url", "audio": "audio:url" } var keyBlacklist = [ '__proto__', 'constructor', 'prototype' ] exports = module.exports = function(url, cb, options){ var userAgent =...
vuln
Safe
JavaScript
int ssl_cipher_list_to_bytes(SSL *s,STACK_OF(SSL_CIPHER) *sk,unsigned char *p, int (*put_cb)(const SSL_CIPHER *, unsigned char *)) { int i,j=0; SSL_CIPHER *c; unsigned char *q; int no_scsv = s->renegotiate; /* Set disabled masks for this session */ ssl_set_client_disabled(s); if (sk == NULL) return(0);...
vuln
Vulnerable
Unknown
cupsdCreateProfile(int job_id, /* I - Job ID or 0 for none */ int allow_networking)/* I - Allow networking off machine? */ { #ifdef HAVE_SANDBOX_H cups_file_t *fp; /* File pointer */ char profile[1024], /* File containing the profile */ bin[1024], /* Quoted ServerBin */ cache[1024], /*...
vuln
Safe
Unknown
private void applyState(Sign sign, SignConfigurationEntry signConfiguration, ServiceInfoSnapshot serviceInfoSnapshot, ServiceInfoStateWatcher.ServiceInfoState state) { switch (state) { case STOPPED: { sign.setServiceInfoSnapshot(null); if (!signConfiguration.getSearchLayouts().getSignLayo...
vuln
Vulnerable
Java
static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) { AVIOContext *pb = s->pb; AVCodecContext *enc = s->streams[pkt->stream_index]->codec; FLVContext *flv = s->priv_data; FLVStreamContext *sc = s->streams[pkt->stream_index]->priv_data; unsigned ts; int size = pkt->size; ...
vuln
Safe
C/C++
static int jpc_dec_process_siz(jpc_dec_t *dec, jpc_ms_t *ms) { jpc_siz_t *siz = &ms->parms.siz; int compno; int tileno; jpc_dec_tile_t *tile; jpc_dec_tcomp_t *tcomp; int htileno; int vtileno; jpc_dec_cmpt_t *cmpt; dec->xstart = siz->xoff; dec->ystart = siz->yoff; dec->xend = siz->width; dec->yend = siz->he...
vuln
Safe
Unknown
static int av_cold libopus_encode_init(AVCodecContext *avctx) { LibopusEncContext *opus = avctx->priv_data; const uint8_t *channel_mapping; OpusMSEncoder *enc; int ret = OPUS_OK; int coupled_stream_count, header_size, frame_size; coupled_stream_count = opus_coupled_streams[avctx->channels - 1]; ...
vuln
Vulnerable
C/C++
theora_gptopts(AVFormatContext *ctx, int idx, uint64_t gp, int64_t *dts) { struct ogg *ogg = ctx->priv_data; struct ogg_stream *os = ogg->streams + idx; struct theora_params *thp = os->private; uint64_t iframe = gp >> thp->gpshift; uint64_t pframe = gp & thp->gpmask; if (thp->version < 0x030201)...
vuln
Vulnerable
C/C++
static void compactxref(fz_context *ctx, pdf_document *doc, pdf_write_state *opts) { int num, newnum; int xref_len = pdf_xref_len(ctx, doc); /* * Update renumber_map in-place, clustering all used * objects together at low object ids. Objects that * already should be renumbered will have their new * object i...
vuln
Vulnerable
Unknown
bool ECDSA_Verification_Operation::verify(const uint8_t msg[], size_t msg_len, const uint8_t sig[], size_t sig_len) { if(sig_len != m_group.get_order_bytes() * 2) return false; const BigInt e(msg, msg_len, m_group.get_order_bits()); const BigInt r(sig, sig_l...
vuln
Vulnerable
C/C++
gss_wrap( OM_uint32 *minor_status, gss_ctx_id_t context_handle, int conf_req_flag, gss_qop_t qop_req, gss_buffer_t input_message_buffer, int *conf_state, gss_buffer_t output_message_buffer) { /* EXPORT DELETE START */ OM_uint32 status; ...
vuln
Vulnerable
C/C++
static int print_media_desc(const pjmedia_sdp_media *m, char *buf, pj_size_t len) { char *p = buf; char *end = buf+len; unsigned i; int printed; /* check length for the "m=" line. */ if (len < (pj_size_t)m->desc.media.slen+m->desc.transport.slen+12+24) { return -1; } *p++ = 'm'; /*...
vuln
Vulnerable
C/C++
krb5_gss_wrap_size_limit(minor_status, context_handle, conf_req_flag, qop_req, req_output_size, max_input_size) OM_uint32 *minor_status; gss_ctx_id_t context_handle; int conf_req_flag; gss_qop_t qop_req; OM_uint32 req_outp...
vuln
Vulnerable
C/C++
/** * Copyright (c) 2006-2012, JGraph Ltd */ Format = function(editorUi, container) { this.editorUi = editorUi; this.container = container; }; /** * Background color for inactive tabs. */ Format.inactiveTabBackgroundColor = '#f1f3f4'; /** * Icons for markers (24x16). */ Format.classicFilledMarkerImage = Graph...
vuln
Vulnerable
JavaScript
Variant HHVM_FUNCTION(mcrypt_generic_init, const Resource& td, const String& key, const String& iv) { auto pm = get_valid_mcrypt_resource(td); if (!pm) { return false; } int max_key_size = mcrypt_enc_get_key_size(pm->m_td...
vuln
Safe
C/C++
static void ConvertLoopSequence(ModSample &smp, STPLoopList &loopList) { if(!smp.HasSampleData() || loopList.size() < 2) return; ModSample newSmp = smp; newSmp.nLength = 0; newSmp.pSample = nullptr; size_t numLoops = loopList.size(); for(size_t i = 0; i < numLoops; i++) { STPLoopInfo &info = loopList[...
vuln
Vulnerable
C/C++
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { log.warn("Exception on {}: {}", this.toString(), cause.getMessage()); ctx.close(); }
vuln
Safe
Java
#include "encoding.h" #include <Windows.h> namespace { // Wrapper for Windows API MultiByteToWideChar. std::wstring MB2WC(const std::string& input, unsigned int code_page) { if (input.empty()) { return L""; } int length = ::MultiByteToWideChar(code_page, 0, &input[0], ...
vuln
Safe
C/C++
@SuppressWarnings({"RedundantCast", "RedundantSuppression"}) public boolean start(View parent) { // Initializations Context context = parent.getContext() ; LayoutInflater inflater = LayoutInflater.from(context) ; // Prepare the popup view View popupView = inflater.inflate(R.layout.view_popup, (ViewGroup)nu...
vuln
Safe
Java
void reconnect(TCSocketAddress socket) throws Exception { TCConnection connection = connect(socket); Assert.eval(!isConnected()); if (wireNewConnection(connection)) { try { handshakeConnection(); if (!connection.isConnected()) { throw new IOException("closed"); ...
vuln
Vulnerable
Java
static Jsi_RC jsi_ArraySliceCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,Jsi_Value **ret, Jsi_Func *funcPtr) { if (_this->vt != JSI_VT_OBJECT || !Jsi_ObjIsArray(interp, _this->d.obj)) return Jsi_LogError("expected array object"); Jsi_RC rc = JSI_OK; int istart = 0, iend, n, nsiz; Js...
vuln
Vulnerable
C/C++
static int Mat_VarWriteStruct73(hid_t id,matvar_t *matvar,const char *name,hid_t *refs_id,hsize_t *dims,hsize_t* max_dims) { int err; hsize_t nelems; { size_t tmp = 1; err = SafeMulDims(matvar, &tmp); nelems = (hsize_t)tmp; } if ( err || 0 == nelems || NULL == matvar->d...
vuln
Safe
C/C++
static MagickBooleanType WriteCALSImage(const ImageInfo *image_info, Image *image) { char header[MaxTextExtent]; Image *group4_image; ImageInfo *write_info; MagickBooleanType status; register ssize_t i; size_t density, length, orient_x, orient_y; ssize_t cou...
vuln
Vulnerable
C/C++
public boolean isChannelPresent(Integer channelKey) { Cursor cursor = null; try { SQLiteDatabase database = dbHelper.getReadableDatabase(); cursor = database.rawQuery( "SELECT COUNT(*) FROM channel WHERE channelKey=?", new String[]{String.valueOf(channelKey)})...
vuln
Vulnerable
Java
import io import mimetypes import uuid import warnings from collections.abc import Mapping from http.cookiejar import CookieJar from urllib.parse import quote_plus, urlencode as _urlencode from twisted.internet.interfaces import IProtocol from twisted.internet.defer import Deferred from twisted.python.components impor...
vuln
Vulnerable
Python
MagickExport MagickStatusType ParseMetaGeometry(const char *geometry,ssize_t *x, ssize_t *y,size_t *width,size_t *height) { GeometryInfo geometry_info; MagickStatusType flags; size_t former_height, former_width; /* Ensure the image geometry is valid. */ assert(x != (ssize_t *) NULL)...
vuln
Safe
C/C++
static void port_show_vhci(char **out, int hub, int port, struct vhci_device *vdev) { if (hub == HUB_SPEED_HIGH) *out += sprintf(*out, "hs %04u %03u ", port, vdev->ud.status); else /* hub == HUB_SPEED_SUPER */ *out += sprintf(*out, "ss %04u %03u ", port, vdev->ud.status); if (vdev->ud.stat...
vuln
Safe
Unknown
static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport) { struct sock *sk = skb->sk; struct ipv6_pinfo *np = inet6_sk(sk); struct flowi6 fl6; memset(&fl6, 0, sizeof(fl6)); fl6.flowi6_proto = sk->sk_protocol; /* Fill in the dest address from the route entry passed with the skb * and the...
vuln
Vulnerable
Unknown
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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) an...
vuln
Vulnerable
Python
static PyObject * PyCArg_repr(PyCArgObject *self) { char buffer[256]; switch(self->tag) { case 'b': case 'B': sprintf(buffer, "<cparam '%c' (%d)>", self->tag, self->value.b); break; case 'h': case 'H': sprintf(buffer, "<cparam '%c' (%d)>", self->ta...
vuln
Vulnerable
C/C++
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import json, inspect import frappe from frappe import _ from frappe.utils import cint from six import text_type, string_types @frappe.whitelist() def runserverobj(method, docs=No...
vuln
Safe
Python
static void gif_out_code( gif_t /* in */ *g, unsigned short /* in */ code ) { /* recurse to decode the prefixes, since the linked-list is backwards, and working backwards through an interleaved image would be nasty */ if (g->codes[code].prefix >= 0) { gif_out_code(g, (unsigned ...
vuln
Vulnerable
C/C++
void QuotaTask::DeleteSoon() { MessageLoop::current()->DeleteSoon(FROM_HERE, this); }
vuln
Vulnerable
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
vuln
Safe
C/C++
u.appendChild(D));return u}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.recentCustomFonts={};Graph.isGoogleFontUr...
vuln
Safe
JavaScript
static int read_user_chunk_callback(png_struct *ping, png_unknown_chunkp chunk) { Image *image; /* The unknown chunk structure contains the chunk data: png_byte name[5]; png_byte *data; png_size_t size; Note that libpng has already taken care of the CRC handling. Returns one of the ...
vuln
Vulnerable
Unknown
call_qftf_func(qf_list_T *qfl, int qf_winid, long start_idx, long end_idx) { callback_T *cb = &qftf_cb; list_T *qftf_list = NULL; static int recursive = FALSE; if (recursive) return NULL; // this doesn't work properly recursively recursive = TRUE; // If 'quickfixtextfunc' is set, then use th...
vuln
Safe
C/C++
bool ResourceFetcher::canRequest(Resource::Type type, const KURL& url, const ResourceLoaderOptions& options, bool forPreload, FetchRequest::OriginRestriction originRestriction) const { SecurityOrigin* securityOrigin = options.securityOrigin.get(); if (!securityOrigin && document()) securityOrigin = docu...
vuln
Vulnerable
C/C++
async def check_device_registered( self, user_id: str, device_id: Optional[str], initial_device_display_name: Optional[str] = None, auth_provider_id: Optional[str] = None, auth_provider_session_id: Optional[str] = None, ) -> str: """ If the given devic...
vuln
Safe
Python
static bool checkreturn pb_dec_string(pb_istream_t *stream, const pb_field_t *field, void *dest) { uint32_t size; size_t alloc_size; bool status; if (!pb_decode_varint32(stream, &size)) return false; /* Space for null terminator */ alloc_size = size + 1; if (alloc_size < si...
vuln
Safe
C/C++
static int halfpel_interpol(SnowContext *s, uint8_t *halfpel[4][4], AVFrame *frame){ int p,x,y; for(p=0; p<3; p++){ int is_chroma= !!p; int w= is_chroma ? s->avctx->width >>s->chroma_h_shift : s->avctx->width; int h= is_chroma ? s->avctx->height>>s->chroma_v_shift : s->avctx->height; ...
vuln
Safe
C/C++
input_csi_dispatch(struct input_ctx *ictx) { struct screen_write_ctx *sctx = &ictx->ctx; struct screen *s = sctx->s; struct input_table_entry *entry; int n, m; if (ictx->flags & INPUT_DISCARD) return (0); if (input_split(ictx) != 0) return (0); log_debug("%s: '%c' \"%s\" \"%s\"", ...
vuln
Vulnerable
Unknown
async def check_streams(self): for stream in self.streams: with contextlib.suppress(Exception): try: if stream.__class__.__name__ == "TwitchStream": await self.maybe_renew_twitch_bearer_token() embed, is_rerun = awai...
vuln
Safe
Python
int ecc_map(ecc_point* P, mp_int* modulus, mp_digit mp) { #ifndef WOLFSSL_SP_MATH #ifdef WOLFSSL_SMALL_STACK mp_int* t1 = NULL; mp_int* t2 = NULL; #ifdef ALT_ECC_SIZE mp_int* rx = NULL; mp_int* ry = NULL; mp_int* rz = NULL; #endif #else mp_int t1[1], t2[1]; #ifdef ALT_ECC_SIZE mp_int rx[1], ry[1]...
vuln
Vulnerable
Unknown