code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
uint8_t ethereum_extractThorchainData(const EthereumSignTx *msg, char *buffer) { // Swap data begins 164 chars into data buffer: // offset = deposit function hash + address + address + uint256 uint16_t offset = 4 + (5 * 32); int16_t len = msg->data_length - offset; if...
vuln
Safe
C/C++
int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir) { unsigned int nr; struct task_struct *reaper; struct tgid_iter iter; struct pid_namespace *ns; if (filp->f_pos >= PID_MAX_LIMIT + TGID_OFFSET) goto out_no_task; nr = filp->f_pos - FIRST_PROCESS_ENTRY; reaper = get_proc_task(filp->f_p...
vuln
Vulnerable
Unknown
->first(function (User $user) { return $user->getPreference('blocksPd', false); }) !== null;
vuln
Vulnerable
JavaScript
/* * * Copyright 2019 Asylo 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 agree...
vuln
Vulnerable
C/C++
public static void scaleLookAndFeel(float scale) { if (scale == 1.0f) { return; } Set<String> unknownValueTypesEncountered = new HashSet<>(); for (Map.Entry<Object, Object> entry: UIManager.getDefaults().entrySet()) { Object key = entry.getKey(); Objec...
vuln
Safe
Java
async function decrypt(oid, cipher_algo, hash_algo, V, C, d, fingerprint) { const curve = new Curve(oid); const S = await genPrivateEphemeralKey(curve, V, d); const param = buildEcdhParam(enums.publicKey.ecdh, oid, cipher_algo, hash_algo, fingerprint); cipher_algo = enums.read(enums.symmetric, cipher_algo); t...
vuln
Safe
JavaScript
static void virgl_cmd_get_capset_info(VirtIOGPU *g, struct virtio_gpu_ctrl_command *cmd) { struct virtio_gpu_get_capset_info info; struct virtio_gpu_resp_capset_info resp; VIRTIO_GPU_FILL_CMD(info); memset(&resp, 0, sizeof(resp)); if (info.capset_index == 0) { ...
vuln
Safe
C/C++
public void onTouchEvent(MotionEvent event) { switch (event.getActionMasked()) { case MotionEvent.ACTION_DOWN: { touchPointerId0 = event.getPointerId(0); screenPointer1.set(event.getX(), event.getY()); Point cropCenter = image.getCropCenter(); vector0.set(cropCenter.x - image.getCropWidth() / 2f...
vuln
Vulnerable
Java
GetCode_(gdIOCtx *fd, CODE_STATIC_DATA *scd, int code_size, int flag, int *ZeroDataBlockP) { int i, j, ret; unsigned char count; if(flag) { scd->curbit = 0; scd->lastbit = 0; scd->last_byte = 0; scd->done = FALSE; return 0; } if((scd->curbit + code_size) >= scd->lastbit) { if(scd->done) { if(scd->...
vuln
Safe
C/C++
public static synchronized void send(@NotNull String message) throws Exception { if (bw != null) { if (!message.contains(System.lineSeparator())) { bw.write(message + System.lineSeparator()); } else { bw.write(message); } bw.flush()...
vuln
Vulnerable
Java
# Copyright (c) 2021-2022, NVIDIA CORPORATION. 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 ...
vuln
Safe
Python
void close_thread_table(THD *thd, TABLE **table_ptr) { TABLE *table= *table_ptr; DBUG_ENTER("close_thread_table"); DBUG_PRINT("tcache", ("table: '%s'.'%s' %p", table->s->db.str, table->s->table_name.str, table)); DBUG_ASSERT(!table->file->keyread_enabled()); DBUG_ASSERT(!table->file ||...
vuln
Safe
Unknown
static int vobsub_read_seek(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags) { MpegDemuxContext *vobsub = s->priv_data; if (stream_index == -1 && s->nb_streams != 1) { int i, ret = 0; AVRational time_base = s->streams[0...
vuln
Safe
C/C++
static int nfs_file_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { NFSClient *client = bs->opaque; int64_t ret; client->aio_context = bdrv_get_aio_context(bs); ret = nfs_client_open(client, options, (flags & BDRV_O_RDWR) ? O_RDWR ...
vuln
Vulnerable
C/C++
public function getFilePath($fileName = null) { if ($fileName === null) { $fileName = $this->fileName; } // Limit paths to those under the assets directory $directory = $this->theme->getPath() . '/' . $this->dirName . '/'; $path = realpath($directory . $fileName)...
vuln
Safe
PHP
@GET @Produces(MediaType.APPLICATION_JSON) @ApiOperation( value = "List all the applications accessible to authenticated user", notes = "User must have MANAGEMENT_APPLICATION[READ] and PORTAL_APPLICATION[READ] permission to list applications." ) @ApiResponses( { @ApiR...
vuln
Safe
Java
/* radare2 - LGPL - Copyright 2016-2017 - Davis, Alex Kornitzer */ #include <r_util.h> #include "mdmp.h" // XXX: this is a random number, no idea how long it should be. #define COMMENTS_SIZE 32 ut64 r_bin_mdmp_get_paddr(struct r_bin_mdmp_obj *obj, ut64 vaddr) { /* FIXME: Will only resolve exact matches, probably no...
vuln
Safe
C/C++
{% load i18n %} /* global inventreeLoad, inventreeSave, */ /* exported customGroupSorter, downloadTableData, reloadtable, renderLink, reloadTableFilters, */ /** * Reload a named table * @param table */ function reloadtable(table) { $(table).bootstrapTable('refresh'); } /** * Dow...
vuln
Safe
Python
# -*- coding: utf-8 -*- # This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web) # Copyright (C) 2012-2019 cervinko, idalin, SiphonSquirrel, ouzklcn, akushsky, # OzzieIsaacs, bodybybuddha, jkrehm, matthazinski, janeczku # # This program is free software: you can ...
vuln
Safe
Python
f_py3eval(typval_T *argvars, typval_T *rettv) { char_u *str; char_u buf[NUMBUFLEN]; if (p_pyx == 0) p_pyx = 3; str = tv_get_string_buf(&argvars[0], buf); do_py3eval(str, rettv); }
vuln
Vulnerable
Unknown
cib_remote_listen(gpointer data) { int lpc = 0; int csock = 0; unsigned laddr; time_t now = 0; time_t start = time(NULL); struct sockaddr_in addr; int ssock = *(int *)data; #ifdef HAVE_GNUTLS_GNUTLS_H gnutls_session *session = NULL; #endif cib_client_t *new_client = NULL; xmlNo...
vuln
Vulnerable
C/C++
public synchronized void destroyAllBehaviors() { behaviors.shutdownNow(); while (!behaviors.isShutdown()) { try { wait(1); } catch (InterruptedException exception) { throw new IllegalStateException(exception); } } for (B...
vuln
Safe
Java
package com.zrlog.web.controller.blog; import com.zrlog.common.Constants; import com.zrlog.common.request.CreateCommentRequest; import com.zrlog.common.response.CreateCommentResponse; import com.zrlog.model.Comment; import com.zrlog.model.Log; import com.zrlog.model.Type; import com.zrlog.service.ArticleService; impor...
vuln
Vulnerable
Java
static opj_image_t *mj2_create_image(AVCodecContext *avctx, opj_cparameters_t *parameters) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); opj_image_cmptparm_t cmptparm[4] = {{0}}; opj_image_t *img; int i; int sub_dx[4]; int sub_dy[4]; int numcomps; OPJ_COLOR_SPAC...
vuln
Vulnerable
C/C++
static void IBusBusNameOwnerChangedCallback( void IBusBusNameOwnerChanged(IBusBus* bus, const gchar* name, const gchar* old_name, const gchar* new_name) { DCHECK(name); DCHECK(old_name); DCHECK(new_name); V...
vuln
Safe
C/C++
vnc_display_setup_auth(VncDisplay *vs, bool password, bool sasl, bool tls, bool x509, bool websocket) { if (password) { if (tls) { vs->auth = VNC_AUTH_VENCRYPT; if ...
vuln
Vulnerable
C/C++
static void dp8393x_realize(DeviceState *dev, Error **errp) { dp8393xState *s = DP8393X(dev); int i, checksum; uint8_t *prom; Error *local_err = NULL; address_space_init(&s->as, s->dma_mr, "dp8393x"); memory_region_init_io(&s->mmio, OBJECT(dev), &dp8393x_ops, s, "dp8393...
vuln
Safe
C/C++
@SubscribeEvent public static void onCakeEat(PlayerInteractEvent.RightClickBlock event) { if (event.getWorld().isRemote()) return; if (event.getWorld().getDimensionKey() != Vault.VAULT_KEY) return; if (event.getWorld().getBlockState(event.getPos()).getBlock() == Blocks.CAKE) { i...
vuln
Safe
Java
int nfc_llcp_send_connect(struct nfc_llcp_sock *sock) { struct nfc_llcp_local *local; struct sk_buff *skb; u8 *service_name_tlv = NULL, service_name_tlv_length; u8 *miux_tlv = NULL, miux_tlv_length; u8 *rw_tlv = NULL, rw_tlv_length, rw; int err; u16 size = 0; __be16 miux; pr_debug("Sending CONNECT\n"); loca...
vuln
Vulnerable
C/C++
parse_args(int argc, char **argv, int *old_optind, int *nargc, char ***nargv, struct sudo_settings **settingsp, char ***env_addp) { struct environment extra_env; int mode = 0; /* what mode is sudo to be run in? */ int flags = 0; /* mode flags */ int valid_flags = DEFAULT_VALID_FLAGS; int ch, i...
vuln
Vulnerable
C/C++
mock func() expectErr error client fosite.Client }{ { description: "should fail - token was issued to another client", expectErr: fosite.ErrUnauthorizedClient, client: &fosite.DefaultClient{ID: "bar"}, mock: func() { token = "foo" tokenType = fosite.RefreshToken rtStr...
vuln
Safe
Go
from django.contrib import admin from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.auth.views import redirect_to_login from django.urls import reverse from .models import MFAKey original_login = admin.AdminSite.login def custom_login(self, request, extra_context=None): next_url = ( ...
vuln
Safe
Python
static struct ldb_parse_tree *ldb_parse_simple(TALLOC_CTX *mem_ctx, const char **s) { char *attr, *value; struct ldb_parse_tree *ret; enum ldb_parse_op filtertype; ret = talloc_zero(mem_ctx, struct ldb_parse_tree); if (!ret) { errno = ENOMEM; return NULL; } filtertype = ldb_parse_filtertype(ret, &attr, &va...
vuln
Safe
Unknown
static int ehci_fill_queue(EHCIPacket *p) { USBEndpoint *ep = p->packet.ep; EHCIQueue *q = p->queue; EHCIqtd qtd = p->qtd; uint32_t qtdaddr; for (;;) { if (NLPTR_TBIT(qtd.next) != 0) { break; } qtdaddr = qtd.next; QTAILQ_FOREACH(p, &q->packets, ne...
vuln
Safe
C/C++
int sctp_verify_asconf(const struct sctp_association *asoc, /* Verify the ASCONF packet before we process it. */ bool sctp_verify_asconf(const struct sctp_association *asoc, struct sctp_chunk *chunk, bool addr_param_needed, struct sctp_paramhdr **errp) { sctp_addip_chunk_t *addip = (sctp_addip_chunk_t *) chunk->...
vuln
Safe
C/C++
/* * Licensed to GraphHopper GmbH under one or more contributor * license agreements. See the NOTICE file distributed with this work for * additional information regarding copyright ownership. * * GraphHopper GmbH licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not ...
vuln
Vulnerable
Java
static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC) /* {{{ */ { HashTable *data; int dirlen = strlen(dir); phar_zstr key; char *entry, *found, *save, *str_key; uint keylen; ulong unused; ALLOC_HASHTABLE(data); zend_hash_init(data, 64, zend_get_hash_value, NULL, 0); if ((*dir == '...
vuln
Safe
Unknown
"use strict"; const sanitizeHtml = require("sanitize-html"); const initializeOptions = (options) => { const sanitizerOptions = {}; if ( Object.hasOwn(options, "allowedTags") && Array.isArray(options.allowedTags) && options.allowedTags.length > 0 ) { sanitizerOptions.allowedTags = options.allowed...
vuln
Safe
JavaScript
@ReactMethod public void peerConnectionSetLocalDescription(int pcId, ReadableMap desc, Promise promise) { ThreadUtils.runOnExecutor(() -> { PeerConnection peerConnection = getPeerConnection(pcId);...
vuln
Vulnerable
Java
/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
vuln
Safe
Python
static double ApplyEvaluateOperator(RandomInfo *random_info,const Quantum pixel, const MagickEvaluateOperator op,const double value) { double result; result=0.0; switch (op) { case UndefinedEvaluateOperator: break; case AbsEvaluateOperator: { result=(double) fabs((double) (pixel+v...
vuln
Vulnerable
C/C++
/* * 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 ...
vuln
Safe
Java
private void addDocuments(boolean importZip, String charset, boolean immediateIndexing, final GUIDocument metadata, final Session session, List<GUIDocument> createdDocs) throws PersistenceException, ServerException, ParseException, IOException { checkWritePermission(metadata, session); Map<String, File> upl...
vuln
Vulnerable
Java
@Override public void onRecentsAnimationCanceled(ThumbnailData thumbnailData) { mRecentsAnimationCanceledSnapshot = thumbnailData; mStateCallback.setState(STATE_RECENTS_ANIMATION_CANCELED); mStateCallback.setState(STATE_RECENTS_ANIMATION_ENDED); if (mRecentsAnimationCanceledSnapshot ...
vuln
Safe
Java
bool CSPSource::schemeMatches(const KURL& url) const { if (m_scheme.isEmpty()) return m_policy->protocolMatchesSelf(url); if (equalIgnoringCase(m_scheme, "http")) return equalIgnoringCase(url.protocol(), "http") || equalIgnoringCase(url.protocol(), "https"); if (equalIgnoringCase(m_scheme...
vuln
Safe
C/C++
@Override public boolean processMessage(ByteArrayReader msg) throws IOException { switch(msg.read()) { case SSH_MSG_USERAUTH_PK_OK: { isAuthenticating = true; try { doPublicKeyAuth(); } catch (SshException | IOException e) { failure(); } return true; } case AuthenticationProtocolCli...
vuln
Safe
Java
void Compute(OpKernelContext* context) final { const Tensor& superdiag = context->input(0); const Tensor& maindiag = context->input(1); const Tensor& subdiag = context->input(2); const Tensor& rhs = context->input(3); const int ndims = rhs.dims(); OP_REQUIRES( context, ndims >= 2, ...
vuln
Safe
Unknown
struct tls_params *tls_initialise(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) { return talloc_new(mem_ctx); }
vuln
Vulnerable
Unknown
static int crypto_aead_report(struct sk_buff *skb, struct crypto_alg *alg) { struct crypto_report_aead raead; struct aead_alg *aead = &alg->cra_aead; strncpy(raead.type, "aead", sizeof(raead.type)); strncpy(raead.geniv, aead->geniv ?: "<built-in>", sizeof(raead.geniv)); raead.blocksize = alg->cra_blocksize; rae...
vuln
Safe
C/C++
static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define BitSet(byte,bit) (((byte) & (bit)) == (bit)) #define LSBFirstOrder(x,y) (((y) << 8) | (x)) #define ThrowGIFException(exception,message) \ { \ if (profiles != (LinkedListInfo *) NULL) \ profiles=DestroyLinkedList(profiles,...
vuln
Vulnerable
Unknown
/* * Copyright (c) 2012-2019 Belledonne Communications SARL. * * This file is part of belle-sip. * * 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 * (...
vuln
Safe
C/C++
int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags) { int noblock = flags & MSG_DONTWAIT; struct sock *sk = sock->sk; struct sk_buff *skb; size_t copied; int err; BT_DBG("sock %p sk %p len %zu", sock, sk, len); if (flags & (MSG_OOB)) return -EOPNOTSUPP;...
vuln
Vulnerable
Unknown
bool PrintRenderFrameHelper::PrintPagesNative(blink::WebLocalFrame* frame, int page_count) { const PrintMsg_PrintPages_Params& params = *print_pages_params_; const PrintMsg_Print_Params& print_params = params.params; std::vector<int> printed_pages = GetPrintedPages(p...
vuln
Safe
C/C++
private Map<String, Object> parseFile() { HashMap<String, Object> config = null; try { Gson gson = new GsonBuilder().setLenient().create(); config = gson.fromJson(new FileReader(mConfigFile), new TypeToken<HashMap<String, Object>>(){}.getType()); } cat...
vuln
Vulnerable
Java
static int psf_close (SF_PRIVATE *psf) { uint32_t k ; int error = 0 ; if (psf->codec_close) { error = psf->codec_close (psf) ; /* To prevent it being called in psf->container_close(). */ psf->codec_close = NULL ; } ; if (psf->container_close) error = psf->container_close (psf) ; error = psf_fclose (psf)...
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
Vulnerable
Python
@Override public boolean startAnimation(@NonNull IBinder transition, @NonNull TransitionInfo info, @NonNull SurfaceControl.Transaction startTransaction, @NonNull SurfaceControl.Transaction finishTransaction, @NonNull Transitions.TransitionFinishCallback finishCallback...
vuln
Safe
Java
@Nonnull public String asString() { if (myStringCachedValue == null) { myStringCachedValue = get(myKey, ""); } return myStringCachedValue; }
vuln
Safe
Java
int ZEXPORT inflate(strm, flush) z_streamp strm; int flush; { struct inflate_state FAR *state; z_const unsigned char FAR *next; /* next input */ unsigned char FAR *put; /* next output */ unsigned have, left; /* available input and output */ unsigned long hold; /* bit buffer */ ...
vuln
Safe
C/C++
def try_compile_and_link(compiler, source = '', flags = []): ensure_tmp_dir_exists() with tempfile.NamedTemporaryFile() as sfile: ofile = tempfile.mktemp() try: sfile.file.write(bytes(source, 'utf-8')) sfile.file.flush() # We can't write to /dev/null, since in...
vuln
Vulnerable
Python
package io.hawt.web.proxy; import java.io.IOException; import java.io.OutputStream; import java.net.ConnectException; import java.net.URI; import java.net.URISyntaxException; import java.net.UnknownHostException; import java.security.KeyManagementException; import java.security.KeyStoreException; import java.security....
vuln
Safe
Java
async def _map_userinfo_to_user( self, userinfo: UserInfo, token: Token, user_agent: str, ip_address: str ) -> str: """Maps a UserInfo object to a mxid. UserInfo should have a claim that uniquely identifies users. This claim is usually `sub`, but can be configured with `oidc_config....
vuln
Safe
Python
def request(self, method, url, body, headers, content_type=None): """Low-level networking. All HTTP-method methods call this""" if headers is None: headers = {} if content_type is not None: headers['Content-Type'] = content_type if self.auth_header is not None: ...
vuln
Vulnerable
Python
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { V210DecContext *s = avctx->priv_data; int h, w, stride, aligned_input; AVFrame *pic = avctx->coded_frame; const uint8_t *psrc = avpkt->data; uint16_t *y, *u, *v; if (s->custom_st...
vuln
Safe
C/C++
print_ccp_config_options(netdissect_options *ndo, const u_char *p, int length) { int len, opt; if (length < 2) return 0; ND_TCHECK2(*p, 2); len = p[1]; opt = p[0]; if (length < len) return 0; if (len < 2) { ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u (length bogus, should ...
vuln
Vulnerable
C/C++
private DataStore getDataStoreInternal( AuthenticationSubject authenticationSubject, int pageSize, ByteBuffer pagingState, Map<String, String> headers) { Parameters parameters = Parameters.builder() .pageSize(pageSize) .pagingState(Optional.ofNullable(pagingSt...
vuln
Vulnerable
Java
async def savepoint(self, name: t.Optional[str] = None) -> Savepoint: name = name or f"savepoint_{self.get_savepoint_id()}" validate_savepoint_name(name) await self.connection.execute(f"SAVEPOINT {name}") return Savepoint(name=name, transaction=self)
vuln
Safe
Python
void HTMLFormControlElement::updateVisibleValidationMessage() { Page* page = document().page(); if (!page) return; String message; if (layoutObject() && willValidate()) message = validationMessage().stripWhiteSpace(); m_hasValidationMessage = true; ValidationMessageClient* client = &page->valid...
vuln
Vulnerable
C/C++
//= require ./table_data_view var alias = Ember.computed.alias; var unbindScroll = function() { var scrollable = this.get('scrollable'); if (scrollable) { scrollable.off('scroll'); } }; Flame.TableView = Flame.View.extend(Flame.Statechart, { MIN_COLUMN_WIDTH: 30, classNames: ['flame-tabl...
vuln
Vulnerable
JavaScript
# -*- coding: utf-8 -*- # See https://zulip.readthedocs.io/en/latest/subsystems/thumbnailing.html import base64 import os import sys import urllib from urllib.parse import urljoin, urlsplit, urlunsplit from django.conf import settings from libthumbor import CryptoURL ZULIP_PATH = os.path.dirname(os.path.dirname(os.pat...
vuln
Safe
Python
@Override public void onCatalystInstanceDestroy() { super.onCatalystInstanceDestroy(); try { stop(ZeroConfImplFactory.NSD_IMPL); stop(ZeroConfImplFactory.DNSSD_IMPL); } catch (Exception e) { Log.e(getClass().getName(), e.getMessage(), e); sendE...
vuln
Vulnerable
Java
public static String await(DeviceTokenCallback callback, String clientId) { AtomicReference<Pair<RefreshTokenResult, String>> refreshToken = new AtomicReference<>(get(callback, clientId)); while (refreshToken.get().getKey() == RefreshTokenResult.AUTHORIZATION_PENDING) { FishingBot.getLog()....
vuln
Safe
Java
static int cdrom_ioctl_media_changed(struct cdrom_device_info *cdi, unsigned long arg) { struct cdrom_changer_info *info; int ret; cd_dbg(CD_DO_IOCTL, "entering CDROM_MEDIA_CHANGED\n"); if (!CDROM_CAN(CDC_MEDIA_CHANGED)) return -ENOSYS; /* cannot select disc or select current disc */ if (!CDROM_CAN(CDC_SEL...
vuln
Safe
Unknown
public void updateViewProp(ViewManager viewManager, View viewToUpdate, Object value) { try { Object[] args; if (mIndex == null) { args = VIEW_MGR_ARGS.get(); args[0] = viewToUpdate; args[1] = getValueOrDefault(value, viewToUpdate.getContext()); } else { ...
vuln
Safe
Java
from django.contrib import admin import import_export.widgets as widgets from import_export.admin import ImportExportModelAdmin from import_export.fields import Field from InvenTree.admin import InvenTreeResource from part.models import Part from .models import (Company, ManufacturerPart, ManufacturerPartAttachment,...
vuln
Safe
Python
int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name) { int i,n=0,len,nid, first, use_bn; BIGNUM *bl; unsigned long l; const unsigned char *p; char tbuf[DECIMAL_SIZE(i)+DECIMAL_SIZE(l)+2]; /* Ensure that, at every state, |buf| is NUL-terminated. */ if (buf && buf_...
vuln
Safe
Unknown
read_system_page (Bit_Chain *dat, int64_t size_comp, int64_t size_uncomp, int64_t repeat_count) { int i; int error = 0; int64_t pesize; // Pre RS encoded size int64_t block_count; // Number of RS encoded blocks int64_t page_size; long pedata_size; BITCODE_RC *rsdata; // RS encoded...
vuln
Safe
Unknown
static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len) { struct inet_sock *inet = inet_sk(sk); struct ipcm_cookie ipc; struct rtable *rt = NULL; int free = 0; __be32 daddr; __be32 saddr; u8 tos; int err; struct ip_options_data opt_copy; err = -EMSGSIZE; if (len...
vuln
Safe
Unknown
var O=mxText.prototype.redraw;mxText.prototype.redraw=function(){O.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(u,D,K){function T(){for(var ja=R.getSelectionCells(),Ba=[],Da=0;Da<ja.length;Da++)R.isCellVisible(ja[Da])...
vuln
Safe
JavaScript
static int date_from_ISO8601 (const char *text, time_t * value) { struct tm tm; * Begin Time Functions * ***********************/ static int date_from_ISO8601 (const char *text, time_t * value) { struct tm tm; int n; int i; char buf[18]; if (strchr (text, '-')) { cha...
vuln
Vulnerable
Unknown
static int trusted_update(struct key *key, struct key_preparsed_payload *prep) { struct trusted_key_payload *p; struct trusted_key_payload *new_p; struct trusted_key_options *new_o; size_t datalen = prep->datalen; char *datablob; int ret = 0; if (test_bit(KEY_FLAG_NEGATIVE, &key->flags)) return -ENOKEY; p = ...
vuln
Vulnerable
Unknown
DictionaryValue* ExtensionTabUtil::CreateTabValue( const WebContents* contents, TabStripModel* tab_strip, int tab_index, const Extension* extension) { DictionaryValue *result = CreateTabValue(contents, tab_strip, tab_index); ScrubTabValueForExtension(contents, extension, result); return result;...
vuln
Safe
C/C++
pkcs11rsa_fromdns(dst_key_t *key, isc_buffer_t *data) { pk11_object_t *rsa; isc_region_t r; unsigned int e_bytes, mod_bytes; CK_BYTE *exponent = NULL, *modulus = NULL; CK_ATTRIBUTE *attr; unsigned int length; unsigned int bits; isc_result_t ret = ISC_R_SUCCESS; isc_buffer_remainingregion(data, &r); if (r.len...
vuln
Safe
Unknown
static void ikev2_parent_inI2outR2_continue(struct pluto_crypto_req_cont *pcrc, struct pluto_crypto_req *r, err_t ugh) { struct dh_continuation *dh = (struct dh_continuation *)pcrc; struct msg_digest *md = dh->md; struct state *const st = md->st; stf_status e; DBG(DBG_CONTROLMORE, DBG_log("...
vuln
Vulnerable
Unknown
function ft(t){return q(t)?new et(t):F(t)?new it(t):Q(t)?new nt(t):void 0}
vuln
Safe
JavaScript
ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai) { ASN1_INTEGER *ret; int len, j; if (ai == NULL) ret = M_ASN1_INTEGER_new(); else ret = ai; if (ret == NULL) { ASN1err(ASN1_F_BN_TO_ASN1_INTEGER, ERR_R_NESTED_ASN1_ERROR); goto err; } if (BN...
vuln
Vulnerable
Unknown
public static ObjectSet<Path> downloadLibraries(String version, Path libDir) { if(version == null || version.isBlank()) { LOGGER.fine("Invalid version, skipping downloading libs"); return ObjectSets.emptySet(); } ObjectOpenHashSet<Path> libs = new ObjectOpenHashSet<>(); ...
vuln
Safe
Java
def prepare_group_visit_payment(self): # Prepare invoice for group visit payment mode_pay_bvr = self.env['account.payment.mode'].sudo().search([ ('name', '=', 'BVR') ], limit=1) self.ensure_one() event = self.compassion_event_id invl_vals = [] tickets ...
vuln
Vulnerable
Python
static int virtio_blk_device_init(VirtIODevice *vdev) { DeviceState *qdev = DEVICE(vdev); VirtIOBlock *s = VIRTIO_BLK(vdev); VirtIOBlkConf *blk = &(s->blk); static int virtio_blk_id; if (!blk->conf.bs) { error_report("drive property not set"); return -1; } if (!bdrv_is_insert...
vuln
Safe
C/C++
!function(a,b){if(a){var c=function(){b(a.lazySizes),a.removeEventListener("lazyunveilread",c,!0)};b=b.bind(null,a,a.document),"object"==typeof module&&module.exports?b(require("lazysizes")):a.lazySizes?c():a.addEventListener("lazyunveilread",c,!0)}}("undefined"!=typeof window?window:0,function(a,b,c){"use strict";func...
vuln
Vulnerable
JavaScript
vu_queue_fill(VuDev *dev, VuVirtq *vq, const VuVirtqElement *elem, unsigned int len, unsigned int idx) { struct vring_used_elem uelem; if (unlikely(dev->broken) || unlikely(!vq->vring.avail)) { return; } vu_log_queue_fill(dev, vq, elem, len); idx = (idx + ...
vuln
Safe
C/C++
ofputil_decode_group_mod(const struct ofp_header *oh, struct ofputil_group_mod *gm) { ofputil_init_group_properties(&gm->props); enum ofp_version ofp_version = oh->version; struct ofpbuf msg = ofpbuf_const_initializer(oh, ntohs(oh->length)); ofpraw_pull_assert(&msg); enum ...
vuln
Vulnerable
Unknown
PHP_FUNCTION(ldap_get_entries) { zval *link, *result; LDAPMessage *ldap_result, *ldap_result_entry; zval *tmp1, *tmp2; ldap_linkdata *ld; LDAP *ldap; int num_entries, num_attrib, num_values, i; BerElement *ber; char *attribute; size_t attr_len; struct berval **ldap_value; char *dn; if (zend_parse_parameter...
vuln
Safe
C/C++
@Override public void triggerSuccess(final BlockPos pos, final List<ItemStack> list, final boolean placement) { super.triggerSuccess(pos, list, placement); final BlockPos worldPos = getProgressPosInWorld(pos); final CompoundNBT teData = getBluePrint().getTileEntityData(worldPos, pos); ...
vuln
Safe
Java
backward_search(regex_t* reg, const UChar* str, const UChar* end, UChar* s, const UChar* range, UChar* adjrange, UChar** low, UChar** high) { UChar *p; p = s; retry: switch (reg->optimize) { case OPTIMIZE_STR: exact_method: p = slow_search_backward(reg->enc, reg->exact, reg->exact_end, ...
vuln
Safe
Unknown
@NonNull @Override public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) { final Context context = getContext(); final ContentResolver resolver = context.getContentResolver(); String selectedCalendar = getArguments().getString("calendar"); String selectedAccount; ...
vuln
Vulnerable
Java
function updatePageName() { pageMenu.innerHTML = ''; if (ui.currentPage != null) { mxUtils.write(pageMenu, ui.currentPage.getName()); var n = (ui.pages != null) ? ui.pages.length : 1; var idx = ui.getPageIndex(ui.currentPage); idx = (idx != null) ? idx + 1 : 1; var id =...
vuln
Vulnerable
JavaScript
ExifData::const_iterator isoSpeed(const ExifData& ed) { static const char* keys[] = { "Exif.Photo.ISOSpeedRatings", "Exif.Image.ISOSpeedRatings", "Exif.CanonSi.ISOSpeed", "Exif.CanonCs.ISOSpeed", "Exif.Nikon1.ISOSpeed", "Exif.Nikon2.ISO...
vuln
Safe
C/C++
static VALUE from_document(VALUE klass, VALUE document) { xmlDocPtr doc; xmlSchemaParserCtxtPtr ctx; xmlSchemaPtr schema; VALUE errors; VALUE rb_schema; Data_Get_Struct(document, xmlDoc, doc); /* In case someone passes us a node. ugh. */ doc = doc->doc; if (has_blank_nodes_p(DOC_NODE_CACHE(doc))) {...
vuln
Vulnerable
C/C++
sp<IMemory> MetadataRetrieverClient::getFrameAtTime(int64_t timeUs, int option) { ALOGV("getFrameAtTime: time(%lld us) option(%d)", timeUs, option); Mutex::Autolock lock(mLock); Mutex::Autolock glock(sLock); mThumbnail.clear(); if (mRetriever == NULL) { ALOGE("retriever is not initialized"); return ...
vuln
Safe
C/C++