code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
@Override public void login(String username, String password) throws ServletException { if (webApplication.getAuthenticationManager() != null) { webApplication.getAuthenticationManager().login(this, username, password); } else { LOGGER.log(WARNING, "No authentication manager ...
vuln
Safe
Java
public BigInteger calculateAgreement( DHPublicKeyParameters pub, BigInteger message) { if (!pub.getParameters().equals(dhParams)) { throw new IllegalArgumentException("Diffie-Hellman public key has wrong parameters."); } BigInteger p = dhPa...
vuln
Vulnerable
Java
static int iwch_l2t_send(struct t3cdev *tdev, struct sk_buff *skb, struct l2t_entry *l2e) { int error = 0; struct cxio_rdev *rdev; rdev = (struct cxio_rdev *)tdev->ulp; if (cxio_fatal_error(rdev)) { kfree_skb(skb); return -EIO; } error = l2t_send(tdev, skb, l2e); if (error < 0) kfree_skb(skb); return err...
vuln
Safe
Unknown
"""Parameters viewsets.""" from drf_spectacular.utils import extend_schema, OpenApiParameter from rest_framework import response, viewsets from rest_framework.decorators import action from modoboa.lib.throttle import GetThrottleViewsetMixin from . import serializers from ... import tools class ParametersViewSet(Ge...
vuln
Vulnerable
Python
/* * 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
scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, struct query_info* qinfo, struct regional* region) { uint8_t* sname = qinfo->qname; size_t snamelen = qinfo->qname_len; struct rrset_parse* rrset, *prev, *nsset=NULL; if(FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NOERROR && FLAGS_GET_RCODE(msg->flags) !=...
vuln
Safe
Unknown
static void wsgi_setup_access(WSGIDaemonProcess *daemon) { /* Setup the umask for the effective user. */ if (daemon->group->umask != -1) umask(daemon->group->umask); /* Change to chroot environment. */ if (daemon->group->root) { if (chroot(daemon->group->root) == -1) { ap_...
vuln
Vulnerable
C/C++
int ext4_setattr(struct dentry *dentry, struct iattr *attr) { struct inode *inode = d_inode(dentry); int error, rc = 0; int orphan = 0; const unsigned int ia_valid = attr->ia_valid; error = inode_change_ok(inode, attr); if (error) return error; if (is_quota_modification(inode, attr)) { error = dquot_initia...
vuln
Safe
C/C++
void Compute(OpKernelContext* context) override { const Tensor& x = context->input(0); const Tensor& y = context->input(1); const float min_x = context->input(2).flat<float>()(0); const float max_x = context->input(3).flat<float>()(0); const float min_y = context->input(4).flat<float>()(0); cons...
vuln
Vulnerable
Unknown
gst_rmdemux_parse_audio_packet (GstRMDemux * rmdemux, GstRMDemuxStream * stream, GstBuffer * in, guint offset, guint16 version, GstClockTime timestamp, gboolean key) { GstFlowReturn ret; GstBuffer *buffer; if (gst_buffer_get_size (in) < offset) goto not_enough_data; buffer = gst_buffer_copy_region...
vuln
Safe
Unknown
private function userCanSeeUserGroups($project_id) { $project = $this->project_manager->getProject($project_id); $user = $this->user_manager->getCurrentUser(); ProjectAuthorization::userCanAccessProject($user, $project, $this->getURLVerification()); return true; }
vuln
Safe
PHP
write_message( RenderState state ) { ADisplay adisplay = (ADisplay)state->display.disp; if ( state->message == NULL ) { FontFace face = &state->faces[state->face_index]; int idx, total; idx = face->index; total = 1; while ( total + state->face_index < state->nu...
vuln
Vulnerable
C/C++
/* * rfbserver.c - deal with server-side of the RFB protocol. */ /* * Copyright (C) 2011-2012 D. R. Commander * Copyright (C) 2005 Rohit Kumar, Johannes E. Schindelin * Copyright (C) 2002 RealVNC Ltd. * OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk@incompleteness.net>. * Original Xvnc code Copyright (C) 1...
vuln
Safe
C/C++
static int init_tile(Jpeg2000DecoderContext *s, int tileno) { int compno; int tilex = tileno % s->numXtiles; int tiley = tileno / s->numXtiles; Jpeg2000Tile *tile = s->tile + tileno; if (!tile->comp) return AVERROR(ENOMEM); tile->coord[0][0] = av_clip(tilex * (int64_t)s->tile_width...
vuln
Safe
C/C++
Variant HHVM_FUNCTION(mcrypt_get_block_size, const String& cipher, const Variant& module /* = null_string */) { MCRYPT td = mcrypt_module_open((char*)cipher.data(), (char*)MCG(algorithms_dir).data(), (char*)module.as...
vuln
Vulnerable
C/C++
public static XMLMemento createReadRoot(Reader reader, String baseDir) throws WorkbenchException { String errorMessage = null; Exception exception = null; DocumentBuilderFactory factory = null; Object attributeDTDOldValue = null; Object attributeSchemaOldValue = null; try { factory = DocumentBuilderFacto...
vuln
Safe
Java
px_crypt_des(const char *key, const char *setting) { int i; uint32 count, salt, l, r0, r1, keybuf[2]; char *p; uint8 *q; static char output[21]; if (!des_initialised) des_init(); /* * Copy the key, shifting each character up by one bit and padding with * zeros. */ q = ...
vuln
Vulnerable
Unknown
/* JSON_parser.c */ /* 2005-12-30 */ /* Copyright (c) 2005 JSON.org 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 the rights to use, copy, mod...
vuln
Safe
C/C++
static int initFilter(int16_t **outFilter, int16_t **filterPos, int *outFilterSize, int xInc, int srcW, int dstW, int filterAlign, int one, int flags, int cpu_flags, SwsVector *srcFilter, SwsVector *dstFilter, double param[2], int is_horizontal) { int i; int filterSiz...
vuln
Safe
C/C++
/************************************************************************ * 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
static void virtio_balloon_set_config(VirtIODevice *vdev, const uint8_t *config_data) { VirtIOBalloon *dev = VIRTIO_BALLOON(vdev); struct virtio_balloon_config config; uint32_t oldactual = dev->actual; memcpy(&config, config_data, 8); dev->actual = le32_to_cpu(c...
vuln
Safe
C/C++
PCIBus *pci_grackle_init(uint32_t base, qemu_irq *pic) { DeviceState *dev; SysBusDevice *s; GrackleState *d; dev = qdev_create(NULL, "grackle"); qdev_init(dev); s = sysbus_from_qdev(dev); d = FROM_SYSBUS(GrackleState, s); d->host_state.bus = pci_register_bus(&d->busdev.qdev, "pci", ...
vuln
Vulnerable
C/C++
static int fuse_xattr_get(const struct xattr_handler *handler, struct dentry *dentry, struct inode *inode, const char *name, void *value, size_t size) { if (fuse_is_bad(inode)) return -EIO; return fuse_getxattr(inode, name, value, size); }
vuln
Safe
Unknown
private void setOptions() { if (view == null || getContext() == null) return; boolean pro = ActivityBilling.isPro(getContext()); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); swNewestFirst.setChecked(prefs.getBoolean("notify_newest_f...
vuln
Safe
Java
int tls1_set_server_sigalgs(SSL *s) { int al; size_t i; /* Clear any shared sigtnature algorithms */ if (s->cert->shared_sigalgs) { OPENSSL_free(s->cert->shared_sigalgs); s->cert->shared_sigalgs = NULL; } /* Clear certificate digests and validity flags */ for (i = 0; i ...
vuln
Vulnerable
C/C++
static inline void xan_wc3_copy_pixel_run(XanContext *s, int x, int y, int pixel_count, int motion_x, int motion_y) { int stride; int line_inc; int curframe_index, prevframe_index; int curframe_x, prevframe_x; int width = s->avctx->width; unsigned char *palette_plane, *prev_palette_plane; ...
vuln
Vulnerable
C/C++
int parse_config(char *filename, bridge_t **bridges) { dictionary *ubridge_config = NULL; const char *value; const char *bridge_name; int i, nsec; if ((ubridge_config = iniparser_load(filename, HIDE_ERRORED_LINE_CONTENT)) == NULL) { return FALSE; } nsec = iniparser_getnsec(ubridge_c...
vuln
Safe
Unknown
@handler.unsupported_on_local_server @handler.get(handler.HTML) def get(self): """Handle a get request.""" self.render( 'login.html', { 'apiKey': local_config.ProjectConfig().get('firebase.api_key'), 'authDomain': auth.auth_domain(), 'dest': self.request.get('dest...
vuln
Vulnerable
Python
static CURLcode file_connect(struct connectdata *conn, bool *done) { struct Curl_easy *data = conn->data; char *real_path; struct FILEPROTO *file = data->req.protop; int fd = -1; #ifdef DOS_FILESYSTEM size_t i; char *actual_path; #endif size_t real_path_len; CURLcode result = Curl_urldecode(data, data-...
vuln
Safe
Unknown
/* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) | +---------...
vuln
Vulnerable
C/C++
static int seqvideo_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; SeqVideoContext *seq = avctx->priv_data; seq->frame.reference = 1; se...
vuln
Vulnerable
C/C++
private void moveToLastMeasurement() { Measurement lastMeasurement = MeasurementsDatabase.getInstance(MyApplication.getApplication()).getLastMeasurement(); if (lastMeasurement != null) { moveToLocation(lastMeasurement.getLatitude(), lastMeasurement.getLongitude()); } else { ...
vuln
Safe
Java
public void handle(HttpExchange pExchange) throws IOException { if (requestHandler == null) { throw new IllegalStateException("Handler not yet started"); } JSONAware json = null; URI uri = pExchange.getRequestURI(); ParsedUri parsedUri = new ParsedUri(uri,context); ...
vuln
Vulnerable
Java
absl::optional<std::string> HeaderValueSelector::extract(Http::HeaderMap& map) const { const Http::HeaderEntry* header_entry = map.get(header_); if (header_entry == nullptr) { return absl::nullopt; } // Catch the value in the header before removing. absl::optional<std::string> value = std::string(header_e...
vuln
Vulnerable
Unknown
@NonNull List<Result> reverseWayNodeTags(List<Node> nodes) { List<Result> result = new ArrayList<>(); for (Node n : nodes) { Map<String, String> nodeDirTags = Reverse.getDirectionDependentTags(n); if (nodeDirTags != null) { undo.save(n); Result...
vuln
Vulnerable
Java
def cluster_disable(params, request, auth_user) if params[:name] code, response = send_request_with_token( auth_user, params[:name], 'cluster_disable', true ) else if not allowed_for_local_cluster(auth_user, Permissions::WRITE) return 403, 'Permission denied' end success = disable_cl...
vuln
Safe
Ruby
static int snd_seq_ioctl_remove_events(struct snd_seq_client *client, void __user *arg) { struct snd_seq_remove_events info; if (copy_from_user(&info, arg, sizeof(info))) return -EFAULT; /* * Input mostly not implemented XXX. */ if (info.remove_mode & SNDRV_SEQ_REMOVE_INPUT) { /* * No restr...
vuln
Safe
Unknown
void TakeScreenshot(const char *fileName) { #if defined(SUPPORT_MODULE_RTEXTURES) // Security check to (partially) avoid malicious code on PLATFORM_WEB if (strchr(fileName, '\'') != NULL) { TRACELOG(LOG_WARNING, "SYSTEM: Provided fileName could be potentially malicious, avoid [\'] character"); return; } V...
vuln
Safe
C/C++
int MAIN(int argc, char **argv) { int build_chain = 0; SSL *con=NULL; #ifndef OPENSSL_NO_KRB5 KSSL_CTX *kctx; #endif int s,k,width,state=0; char *cbuf=NULL,*sbuf=NULL,*mbuf=NULL; int cbuf_len,cbuf_off; int sbuf_len,sbuf_off; fd_set readfds,writefds; short port=PORT; int full_log=1; char *host=SSL_HOST_NAME;...
vuln
Safe
Unknown
rsvg_new_filter_primitive_component_transfer (void) { RsvgFilterPrimitiveComponentTransfer *filter; filter = g_new (RsvgFilterPrimitiveComponentTransfer, 1); _rsvg_node_init (&filter->super.super); filter->super.result = g_string_new ("none"); filter->super.in = g_string_new ("none"); filter->s...
vuln
Vulnerable
Unknown
/* * Copyright 2000-2020 Vaadin Ltd. * * 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...
vuln
Safe
Java
static int cuvid_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { CuvidContext *ctx = avctx->priv_data; AVHWDeviceContext *device_ctx = (AVHWDeviceContext*)ctx->hwdevice->data; AVCUDADeviceContext *device_hwctx = device_ctx->hwctx; CUcontext dummy, cuda_ctx = device_hwc...
vuln
Safe
C/C++
void HELPER(exception_return)(CPUARMState *env) { int cur_el = arm_current_el(env); unsigned int spsr_idx = aarch64_banked_spsr_index(cur_el); uint32_t spsr = env->banked_spsr[spsr_idx]; int new_el; bool return_to_aa64 = (spsr & PSTATE_nRW) == 0; aarch64_save_sp(env, cur_el); env->exclusive_...
vuln
Safe
C/C++
/* * This file is part of Espruino, a JavaScript interpreter for Microcontrollers * * Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http...
vuln
Vulnerable
C/C++
/* Copyright 2019 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
function showAndHideMessage (message) { try { var newMessage = (!message) ? GrunionFB_i18n.savedMessage : message; jQuery('#fb-success').text(newMessage); jQuery('#fb-success').slideDown('fast'); setTimeout(function () { jQuery('#fb-success').slideUp('fast'); }, 2500); } catch(e) { if (debug)...
vuln
Safe
JavaScript
// Copyright 2017 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package repo import ( "bytes" "compress/gzip" "fmt" "net/http" "os" "os/exec" "path" "path/filepath" "strconv" "strings" "time" "gopkg.in/macaro...
vuln
Vulnerable
Go
import { getWindow } from 'ssr-window'; function deleteProps(obj) { const object = obj; Object.keys(object).forEach((key) => { try { object[key] = null; } catch (e) { // no getter for object } try { delete object[key]; } catch (e) { // something got wrong } }); } f...
vuln
Vulnerable
JavaScript
char *FLTGetIsLikeComparisonExpression(FilterEncodingNode *psFilterNode) { const size_t bufferSize = 1024; char szBuffer[1024]; char szTmp[256]; char *pszValue = NULL; const char *pszWild = NULL; const char *pszSingle = NULL; const char *pszEscape = NULL; int bCaseInsensitive = 0; int nLength=0, i=...
vuln
Vulnerable
C/C++
rsa_sec_blind (const struct rsa_public_key *pub, void *random_ctx, nettle_random_func *random, mp_limb_t *c, mp_limb_t *ri, const mp_limb_t *m) { const mp_limb_t *ep = mpz_limbs_read (pub->e); const mp_limb_t *np = mpz_limbs_read (pub->n); mp_bitcnt_t ebn = mpz_sizeinbase (pub->e, 2)...
vuln
Safe
Unknown
def self.from_yaml(input) Gem.load_yaml input = normalize_yaml_input input spec = Gem::SafeYAML.safe_load input if spec && spec.class == FalseClass then raise Gem::EndOfYAMLException end unless Gem::Specification === spec then raise Gem::Exception, "YAML data doesn't evaluate to g...
vuln
Safe
Ruby
import certifi import requests import flask_login from app.auth.oauth_auth import OAuthLoginManager, OAUTH_CALLBACK_PATH from app.db import with_session, DBSession from env import QuerybookSettings, get_env_config from flask import Markup, request, session as flask_session, redirect from lib.logger import get_logger f...
vuln
Safe
Python
int af_alg_release(struct socket *sock) { if (sock->sk) sock_put(sock->sk); return 0; }
vuln
Vulnerable
C/C++
static int tls_read(URLContext *h, uint8_t *buf, int size) { TLSContext *c = h->priv_data; size_t available = 0, processed = 0; int ret; SSLGetBufferedReadSize(c->ssl_context, &available); if (available) size = FFMIN(available, size); ret = SSLRead(c->ssl_context, buf, size, &processed);...
vuln
Safe
C/C++
public final Race getPlayerPonyRace() { return getPlayerPonyRace(MinecraftClient.getInstance().player); }
vuln
Vulnerable
Java
@Override public boolean startBackgroundScan() { synchronized (mLock) { checkNotClosedLocked(); return nativeStartBackgroundScan(mNativeContext); } }
vuln
Vulnerable
Java
static void mov_parse_stsd_subtitle(MOVContext *c, AVIOContext *pb, AVStream *st, MOVStreamContext *sc, int size) { MOVAtom fake_atom = { .size = size }; if (st->codec->codec_tag != AV_RL32("mp4s")) mov_read_glbl(c, p...
vuln
Vulnerable
C/C++
void DocumentLoader::CommitNavigation(const AtomicString& mime_type, const KURL& overriding_url) { if (state_ != kProvisional) return; if (!GetFrameLoader().StateMachine()->CreatingInitialEmptyDocument()) { SetHistoryItemStateForCommit( GetFrameLoader().GetDocu...
vuln
Vulnerable
C/C++
static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception) { char buffer[MagickPathExtent], name[MagickPathExtent]; Image *image; int c; MagickBooleanType status; register ssize_t i, x; register Quantum *q; register unsigned char *p; short...
vuln
Safe
C/C++
package oci import ( "bytes" "io" "io/ioutil" "os" "path/filepath" "strconv" "strings" "sync" "syscall" "time" cgroups "github.com/containerd/cgroups/stats/v1" tasktypes "github.com/containerd/containerd/api/types/task" ctrio "github.com/containerd/containerd/cio" "github.com/containerd/containerd/names...
vuln
Safe
Go
@Override public Component getPreferencesDecorationPanel() { HtmlPanel pnlMessage = new HtmlPanel(); HTMLEditorKit kit = (HTMLEditorKit)pnlMessage.getEditorPane().getEditorKit(); kit.getStyleSheet().addRule(".warning-body {background-color:rgb(253,255,221);padding: 10pt; border-color:rgb(128...
vuln
Vulnerable
Java
void gicv3_cpuif_update(GICv3CPUState *cs) { int irqlevel = 0; int fiqlevel = 0; ARMCPU *cpu = ARM_CPU(cs->cpu); CPUARMState *env = &cpu->env; g_assert(qemu_mutex_iothread_locked()); trace_gicv3_cpuif_update(gicv3_redist_affid(cs), cs->hppi.irq, cs->hppi.grp, cs...
vuln
Safe
C/C++
public static void markColonyDeleted(final int colonyID, final RegistryKey<World> dimensionID) { @NotNull final File saveDir = new File(ServerLifecycleHooks.getCurrentServer().func_240776_a_(FolderName.DOT).toFile(), FILENAME_MINECOLONIES_PATH); final File toDelete = new File(saveDir, getF...
vuln
Safe
Java
/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\...
vuln
Vulnerable
C/C++
// SPDX-License-Identifier: BSD-2-Clause /* * Copyright (c) 2015-2016, Linaro Limited * Copyright (c) 2014, STMicroelectronics International N.V. */ #include <assert.h> #include <bench.h> #include <compiler.h> #include <initcall.h> #include <io.h> #include <kernel/linker.h> #include <kernel/msg_param.h> #include <k...
vuln
Vulnerable
C/C++
int msmpeg4_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) { int cbp, code, i; int pred, val; UINT8 *coded_val; if (s->mb_x == 0) { if (s->slice_height && (s->mb_y % s->slice_height) == 0) { int wrap; wrap = 2 * s->mb_width + 2...
vuln
Safe
C/C++
v8::Handle<v8::Value> AppWindowCustomBindings::GetView( const v8::Arguments& args) { if (args.Length() != 1) return v8::Undefined(); if (!args[0]->IsInt32()) return v8::Undefined(); int view_id = args[0]->Int32Value(); if (view_id == MSG_ROUTING_NONE) return v8::Undefined(); FindViewByID v...
vuln
Safe
C/C++
static int cloop_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { BDRVCloopState *s = bs->opaque; uint32_t offsets_size, max_compressed_block_size = 1, i; int ret; bs->read_only = 1; /* read header */ ret = bdrv_pread(bs->file, 128, &s->block_size, 4)...
vuln
Safe
Unknown
it "should reject a critical extension that isn't on the whitelist" do @request.stubs(:request_extensions).returns [{ "oid" => "banana", "value" => "yumm", "critical" => true }] expect { @ca.che...
vuln
Safe
Ruby
private void run(CodeAttribute codeAttribute) { LinkedHashSet<Integer> workList = new LinkedHashSet<>(); workList.add(0); while (!workList.isEmpty()) { int offset = workList.stream() .skip(workList.size() - 1) ...
vuln
Vulnerable
Java
@Override public MediaResource handle(String relPath, HttpServletRequest request) { GlossaryItemManager gIM = CoreSpringFactory.getImpl(GlossaryItemManager.class); String[] parts = relPath.split("/"); String glossaryId = parts[1]; String glossaryFolderString = FolderConfig.getCanonicalRoot() + FolderConfig.ge...
vuln
Safe
Java
def setup_handlers(web_app, serverproxy_config): host_allowlist = serverproxy_config.host_allowlist rewrite_response = serverproxy_config.non_service_rewrite_response web_app.add_handlers( ".*", [ ( url_path_join( web_app.settings["base_url"], ...
vuln
Safe
Python
static void gprinter_free(struct usb_function *f) { struct printer_dev *dev = func_to_printer(f); struct f_printer_opts *opts; opts = container_of(f->fi, struct f_printer_opts, func_inst); kfree(dev); mutex_lock(&opts->lock); --opts->refcnt; mutex_unlock(&opts->lock); }
vuln
Vulnerable
C/C++
__poll_t psi_trigger_poll(void **trigger_ptr, struct file *file, poll_table *wait) { __poll_t ret = DEFAULT_POLLMASK; struct psi_trigger *t; if (static_branch_likely(&psi_disabled)) return DEFAULT_POLLMASK | EPOLLERR | EPOLLPRI; rcu_read_lock(); t = rcu_dereference(*(void __rcu __force **)trigger_ptr); i...
vuln
Vulnerable
Unknown
static inline void RENAME(vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst1, uint8_t *dst2, long width, long height, long srcStride1, long srcStride2, long dstStride1, long dstStride2) { long y,x,w,h; w=width/2; h=height/2; #ifdef HAVE_MMX asm volatile( PREFETCH" %0\n\t" PRE...
vuln
Safe
C/C++
ext4_xattr_block_set(handle_t *handle, struct inode *inode, struct ext4_xattr_info *i, struct ext4_xattr_block_find *bs) { struct super_block *sb = inode->i_sb; struct buffer_head *new_bh = NULL; struct ext4_xattr_search *s = &bs->s; struct mb_cache_entry *ce = NULL; int error = 0; struct mb_cache *...
vuln
Vulnerable
C/C++
send(envelope, message, done) { if (!message) { return done(this._formatError('Empty message', 'EMESSAGE', false, 'API')); } const isDestroyedMessage = this._isDestroyedMessage('send message'); if (isDestroyedMessage) { return done(this._formatError(isDestroyedMe...
vuln
Safe
JavaScript
def patch(self, id): """Update role --- description: >- Updates roles if the user has permission to do so.\n ### Permission Table\n |Rule name|Scope|Operation|Assigned to node|Assigned to container| Description|\n |--|--|--|--|--|--|\n ...
vuln
Safe
Python
@app.route('/referrer_count') def referrer_count(): account_id = request.args.get('account_id') if not isObject(account_id): ws.send('{"id":1, "method":"call", "params":[0,"lookup_account_names",[["' + account_id + '"], 0]]}') result_l = ws.recv() j_l = json.loads(result_l) acc...
vuln
Vulnerable
Python
BrowserContext* SharedWorkerDevToolsAgentHost::GetBrowserContext() { if (!worker_host_) return nullptr; RenderProcessHost* rph = RenderProcessHost::FromID(worker_host_->process_id()); return rph ? rph->GetBrowserContext() : nullptr; }
vuln
Safe
C/C++
static apr_byte_t oidc_validate_redirect_url(request_rec *r, oidc_cfg *c, const char *redirect_to_url, apr_byte_t restrict_to_host, char **err_str, char **err_desc) { apr_uri_t uri; const char *c_host = NULL; apr_hash_index_t *hi = NULL; size_t i = 0; char *url = apr_pstrndup(r->pool, redirect_to_url, OIDC_MAX...
vuln
Safe
C/C++
# -*- coding: utf-8 -*- # rdiffweb, A web interface to rdiff-backup repositories # Copyright (C) 2012-2021 rdiffweb contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version ...
vuln
Vulnerable
Python
zephyr_print(netdissect_options *ndo, const u_char *cp, int length) { struct z_packet z; const char *parse = (const char *) cp; int parselen = length; const char *s; int lose = 0; /* squelch compiler warnings */ z.kind = 0; z.class = 0; z.inst = 0; z.opcode = 0; z.sender = ...
vuln
Vulnerable
C/C++
@Override public User auth(String username, String token) { for (IdentityProvider identityProvider : providers) { try { User user = identityProvider.auth(username, token); if (user != null) { return user; } } catch (BadRequestException e) { // ignore bad request exceptions coming from prov...
vuln
Safe
Java
static int treo_attach(struct usb_serial *serial) { struct usb_serial_port *swap_port; /* Only do this endpoint hack for the Handspring devices with * interrupt in endpoints, which for now are the Treo devices. */ if (!((le16_to_cpu(serial->dev->descriptor.idVendor) == HANDSPRING_VENDOR_ID) || (le16_to_cp...
vuln
Vulnerable
C/C++
static int parse_meter(DBEContext *s) { if (s->meter_size) skip_input(s, s->key_present + s->meter_size + 1); return 0; }
vuln
Vulnerable
C/C++
/* * Copyright (c) by Jaroslav Kysela <perex@perex.cz> * Copyright (c) 2009 by Krzysztof Helt * Routines for control of MPU-401 in UART mode * * MPU-401 supports UART mode which is not capable generate transmit * interrupts thus output is done via polling. Also, if irq < 0, then * input is done also via po...
vuln
Safe
C/C++
juniper_monitor_print(netdissect_options *ndo, const struct pcap_pkthdr *h, register const u_char *p) { struct juniper_l2info_t l2info; struct juniper_monitor_header { uint8_t pkt_type; uint8_t padding; uint8_t iif[2]; uint8_t service...
vuln
Vulnerable
C/C++
@Override public void setConfigFlag(int flag, boolean value) { if (flag == RadioManager.CONFIG_FORCE_ANALOG) { synchronized (mLock) { checkNotClosedLocked(); nativeSetAnalogForced(mNativeContext, value); return; } } thro...
vuln
Vulnerable
Java
function d(ja,U,J,V){function P(){U.removeChild(la);U.removeChild(ta);ia.style.display="block";R.style.display="block"}H={div:U,comment:ja,saveCallback:J,deleteOnCancel:V};var R=U.querySelector(".geCommentTxt"),ia=U.querySelector(".geCommentActionsList"),la=document.createElement("textarea"); la.className="geCommentEdi...
vuln
Safe
JavaScript
dir_globs(long argc, const VALUE *argv, int flags) { VALUE ary = rb_ary_new(); long i; for (i = 0; i < argc; ++i) { int status; VALUE str = argv[i]; GlobPathValue(str, TRUE); status = push_glob(ary, str, flags); if (status) GLOB_JUMP_TAG(status); } return ary; }
vuln
Vulnerable
Unknown
// Copyright 2017 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library 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 3 of the License...
vuln
Safe
Go
static int get_int32_le(QEMUFile *f, void *pv, size_t size) { int32_t loaded; int32_t loaded; qemu_get_sbe32s(f, &loaded); if (loaded <= *cur) { *cur = loaded; return 0; } }
vuln
Vulnerable
Unknown
static void usb_net_handle_destroy(USBDevice *dev) { USBNetState *s = (USBNetState *) dev; qemu_del_vlan_client(s->vc); }
vuln
Safe
C/C++
############################################################################## # # Copyright (c) 2001 Zope Foundation and Contributors # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this # distribution. # THIS SOFTWARE IS PROVIDED "AS ...
vuln
Vulnerable
Python
static INLINE int vpx_read(vpx_reader *r, int prob) { unsigned int bit = 0; BD_VALUE value; BD_VALUE bigsplit; int count; unsigned int range; unsigned int split = (r->range * prob + (256 - prob)) >> CHAR_BIT; if (r->count < 0) vpx_reader_fill(r); value = r->value; count = r->count; bigsplit = (BD...
vuln
Safe
Unknown
package util import ( "context" "fmt" "time" errs "github.com/pkg/errors" "github.com/rancher/rancher/pkg/serviceaccounttoken" v3 "github.com/rancher/rke/types" "gopkg.in/yaml.v2" v1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/m...
vuln
Vulnerable
Go
@Override public void deserialize(PacketBuffer buf) { entityId = buf.readInt(); tilePos = readBlockPos(buf); }
vuln
Vulnerable
Java
void ep4_write_bin(uint8_t *bin, int len, const ep4_t a, int pack) { ep4_t t; ep4_null(t); memset(bin, 0, len); if (ep4_is_infty(a)) { if (len < 1) { RLC_THROW(ERR_NO_BUFFER); return; } else { return; } } RLC_TRY { ep4_new(t); ep4_norm(t, a); if (len < 8 * RLC_FP_BYTES + 1) { RLC_THR...
vuln
Vulnerable
C/C++
# -*- coding: utf-8 -*- # rdiffweb, A web interface to rdiff-backup repositories # Copyright (C) 2012-2021 rdiffweb contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version ...
vuln
Vulnerable
Python