code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
@Override public final ResultT get(DataFetchingEnvironment environment) throws Exception { HttpAwareContext httpAwareContext = environment.getContext(); String token = httpAwareContext.getAuthToken(); AuthenticationSubject authenticationSubject = authenticationService.validateToken(token, httpAwa...
vuln
Safe
Java
static vpx_image_t *img_alloc_helper(vpx_image_t *img, vpx_img_fmt_t fmt, unsigned int d_w, unsigned int d_h, unsigned int buf_align, unsigned int stride_align, unsigned char *img_data) { unsigned int h, w, s, xcs, ycs, bps; unsigned int stride_in_bytes; int align; /* Treat align==0 like align==1 */ if (!buf_...
vuln
Safe
C/C++
jSuites.editor = (function(el, options) { var obj = {}; obj.options = {}; // Default configuration var defaults = { // Initial HTML content value: null, // Initial snippet snippet: null, // Add toolbar toolbar: null, // Website parser is to read w...
vuln
Vulnerable
JavaScript
void Inspect::operator()(Complex_Selector_Ptr c) { Compound_Selector_Obj head = c->head(); Complex_Selector_Obj tail = c->tail(); Complex_Selector::Combinator comb = c->combinator(); if (comb == Complex_Selector::ANCESTOR_OF && (!head || head->empty())) { if (tail) tail->perform...
vuln
Safe
C/C++
@Override public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { Log.d(TAG, "LSPApplicationService.onTransact: code=" + code); switch (code) { case DEX_TRANSACTION_CODE: { var shm = ConfigManager.getInstance().getPreloadDex(); ...
vuln
Vulnerable
Java
/* * Copyright (c) 2019-2021 GeyserMC. http://geysermc.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,...
vuln
Vulnerable
Java
int __cil_resolve_ast_node_helper(struct cil_tree_node *node, uint32_t *finished, void *extra_args) { int rc = SEPOL_OK; struct cil_args_resolve *args = extra_args; enum cil_pass pass = args->pass; struct cil_tree_node *block = args->block; struct cil_tree_node *macro = args->macro; struct cil_tree_node *optional...
vuln
Safe
Unknown
static struct iovec *lock_iovec(int type, abi_ulong target_addr, int count, int copy) { struct target_iovec *target_vec; struct iovec *vec; abi_ulong total_len, max_len; int i; int err = 0; bool bad_address = false; if (count == 0) { errno = 0; ...
vuln
Safe
C/C++
int load_uimage(const char *filename, target_ulong *ep, target_ulong *loadaddr, int *is_linux) { int fd; int size; uboot_image_header_t h; uboot_image_header_t *hdr = &h; uint8_t *data = NULL; int ret = -1; fd = open(filename, O_RDONLY | O_BINARY); if (fd < 0) ret...
vuln
Vulnerable
C/C++
bool Permissions::check_create_datareader( const PermissionsHandle& local_handle, const uint32_t /*domain_id*/, const std::string& topic_name, const std::vector<std::string>& partitions, SecurityException& exception) { bool returned_value = false; const AccessPermissionsH...
vuln
Safe
Unknown
static int yuv4_read_packet(AVFormatContext *s, AVPacket *pkt) { int i; char header[MAX_FRAME_HEADER+1]; int ret; int64_t off = avio_tell(s->pb); for (i = 0; i < MAX_FRAME_HEADER; i++) { header[i] = avio_r8(s->pb); if (header[i] == '\n') { header[i + 1] = 0; b...
vuln
Safe
C/C++
static gboolean avdtp_setconf_cmd(struct avdtp *session, uint8_t transaction, struct setconf_req *req, unsigned int size) { struct conf_rej rej; struct avdtp_local_sep *sep; struct avdtp_stream *stream; uint8_t err, category = 0x00; struct btd_service *service; GSList *l; if (size < sizeof(struct setconf_re...
vuln
Vulnerable
Unknown
static UINT drdynvc_process_data(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) { UINT32 ChannelId; if (Stream_GetRemainingLength(s) < drdynvc_cblen_to_bytes(cbChId)) return ERROR_INVALID_DATA; ChannelId = drdynvc_read_variable_uint(s, cbChId); WLog_Print(drdynvc->log, ...
vuln
Safe
C/C++
IHEVCD_ERROR_T ihevcd_cabac_init(cab_ctxt_t *ps_cabac, bitstrm_t *ps_bitstrm, WORD32 qp, WORD32 cabac_init_idc, const UWORD8 *pu1_init_ctxt) { /* Sanity checks */ ASSERT(ps_cabac != NULL); ASSERT(ps_bitstrm != NULL); ASSERT((qp >= 0) && (q...
vuln
Vulnerable
C/C++
private Route handleFailedAuthentication(final Throwable reasonOfFailure, final Uri requestUri, final DittoHeaders dittoHeaders) { if (reasonOfFailure instanceof DittoRuntimeException dittoRuntimeException) { LOGGER.debug("Authentication for URI <{}> failed. Rethrow DittoRuntimeExceptio...
vuln
Vulnerable
Java
public static void startDetection(Player player){ if(ConfigManager.getConfig("config").getBoolean("hackdetector.chatexploit.enableChatExploit") && !player.hasPermission("clientdetector.bypass")){ verificationStarted.put(player, true); randomString.put(player, UUID.randomUUID().toString()...
vuln
Safe
Java
static void server_real_connect(SERVER_REC *server, IPADDR *ip, const char *unix_socket) { GIOChannel *handle; IPADDR *own_ip = NULL; const char *errmsg; char *errmsg2; char ipaddr[MAX_IP_LEN]; int port; g_return_if_fail(ip != NULL || unix_socket != NULL); signal_emit("server connecting", 2, server...
vuln
Vulnerable
Unknown
vg_resource_create_2d(VuGpu *g, struct virtio_gpu_ctrl_command *cmd) { pixman_format_code_t pformat; struct virtio_gpu_simple_resource *res; struct virtio_gpu_resource_create_2d c2d; VUGPU_FILL_CMD(c2d); virtio_gpu_bswap_32(&c2d, sizeof(c2d)); if (c2d.resource_id == 0) { ...
vuln
Safe
Unknown
saveNewOption:function(){ var newValF=$('#akSelectValueFieldNew'); var val = $('<div/>').text(newValF.val()).html(); if(val=='') { return; } var ts = 't' + new Date().getTime(); var template=document.getElementById('akSelectValueWrapTemplate'); var newRowEl=document.createElement('div'); newRowEl.in...
vuln
Safe
JavaScript
static zval **spl_array_get_dimension_ptr_ptr(int check_inherited, zval *object, zval *offset, int type TSRMLS_DC) /* {{{ */ { spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); zval **retval; char *key; uint len; long index; HashTable *ht = spl_array_get_hash_table(inte...
vuln
Safe
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
static zval *phar_rename_archive(phar_archive_data *phar, char *ext, zend_bool compress TSRMLS_DC) /* {{{ */ { const char *oldname = NULL; char *oldpath = NULL; char *basename = NULL, *basepath = NULL; char *newname = NULL, *newpath = NULL; zval *ret, arg1; zend_class_entry *ce; char *error; const char *pcr_err...
vuln
Safe
C/C++
#include "extensions/access_loggers/grpc/http_grpc_access_log_impl.h" #include "common/common/assert.h" #include "common/network/utility.h" #include "common/stream_info/utility.h" #include "extensions/access_loggers/grpc/grpc_access_log_utils.h" namespace Envoy { namespace Extensions { namespace AccessLoggers { name...
vuln
Vulnerable
C/C++
int main(int argc, char **argv) #endif { #ifdef __EMX__ /* OS/2 */ _wildcard (&argc, &argv); #endif int verify_only = 0, error_count = 0, add_extension = 0, output_spec = 0, c_count = 0, x_count = 0; char outpath, **matches = NULL, *outfilename = NULL, **argv_fn = NULL, selfname [PATH_MAX]; int use_stdi...
vuln
Safe
C/C++
XStoreName ( register Display *dpy, Window w, _Xconst char *name) { return XChangeProperty(dpy, w, XA_WM_NAME, XA_STRING, 8, PropModeReplace, (_Xconst unsigned char *)name, name ? (int) strlen(name) : 0); }
vuln
Vulnerable
Unknown
int partition_create(struct ldb_module *module, struct ldb_request *req) { unsigned int i; int ret; struct ldb_context *ldb = ldb_module_get_ctx(module); struct ldb_request *mod_req, *last_req = req; struct ldb_message *mod_msg; struct partition_private_data *data; struct dsdb_partition *partition = NULL; const...
vuln
Vulnerable
Unknown
@Override @SuppressWarnings("unchecked") public String execute( final Context context, final Map<String, String> params ) throws PluginException { final Engine engine = context.getEngine(); final StringBuilder res = new StringBuilder(); final String clazz = params.get( PARAM_CLASS )...
vuln
Vulnerable
Java
private int createSessionInternal(SessionParams params, String installerPackageName, int userId) throws IOException { final int callingUid = Binder.getCallingUid(); mPermissionManager.enforceCrossUserPermission( callingUid, userId, true, true, "createSession"); if (m...
vuln
Vulnerable
Java
private XMSSMTPrivateKeyParameters(Builder builder) { super(true); params = builder.params; if (params == null) { throw new NullPointerException("params == null"); } int n = params.getDigestSize(); byte[] privateKey = builder.privateKey; if...
vuln
Vulnerable
Java
chpass_principal3_2_svc(chpass3_arg *arg, struct svc_req *rqstp) { static generic_ret ret; char *prime_arg; gss_buffer_desc client_name = GSS_C_EMPTY_BUFFER; gss_buffer_desc service_name = GSS_C_EMPTY_BUFFER; OM_uint32 ...
vuln
Safe
C/C++
public void sendBatchSync(String groupId, String streamId, List<byte[]> bodyList, int retry, long dataTime, Map<String, String> extraMap) { if (retry > maxSenderRetry) { LOGGER.warn("max retry reached, retry count is {}, sleep and send again", retry); AgentUtils.silenceSleepInMs(...
vuln
Vulnerable
Java
private static KeyData convertToEcdsaKey(JsonObject jsonKey) throws GeneralSecurityException { JwtEcdsaAlgorithm algorithm; switch (getStringItem(jsonKey, "alg")) { case "ES256": expectStringItem(jsonKey, "crv", "P-256"); algorithm = JwtEcdsaAlgorithm.ES256; break; case "ES38...
vuln
Safe
Java
static ssize_t smtcfb_write(struct fb_info *info, const char __user *buf, size_t count, loff_t *ppos) { unsigned long p = *ppos; u32 *buffer, *src; u32 __iomem *dst; int c, i, cnt = 0, err = 0; unsigned long total_size; if (!info || !info->screen_base) return -ENODEV; if (info->state != FBINFO_STATE_...
vuln
Safe
C/C++
2)?O.substring(45,O.lastIndexOf("%26ex")):O.substring(2);this.showError(g,x,mxResources.get("openInNewWindow"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+O);this.handleError(d,g,k,l,p)}),L,mxResources.get("changeUser"),mxUtils.bind(this,function(){function u(){G.innerHTM...
vuln
Vulnerable
JavaScript
static int vmdaudio_decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size) { VmdAudioContext *s = (VmdAudioContext *)avctx->priv_data; unsigned char *output_samples = (unsigned char *)data; unsigned c...
vuln
Safe
C/C++
public function store($values) { if (!$this->check($values)) { return false; } $isnew = ($this->id === null); if ($this->old_name !== null) { $this->deleteTranslation($this->old_name); $this->addTranslation($this->name); } try { ...
vuln
Vulnerable
PHP
def has_access(permissions: Sequence[tuple[str, str]] | None = None) -> Callable[[T], T]: """Factory for decorator that checks current user's permissions against required permissions.""" def requires_access_decorator(func: T): @wraps(func) def decorated(*args, **kwargs): __traceback...
vuln
Vulnerable
Python
@SuppressWarnings("unchecked") public static Object FromSerpentDict(Map<Object, Object> dict) { Object[] args = (Object[]) dict.get("args"); String pythonExceptionType = (String) dict.get("__class__"); PyroException ex; if(args.length==0) { if(pythonExceptionType==null) ex = new PyroException(); els...
vuln
Vulnerable
Java
napi_status napi_get_value_string_latin1(napi_env env, napi_value value, char* buf, size_t bufsize, size_t* result) { CHECK_ENV(env); CHECK_ARG(env, val...
vuln
Safe
Unknown
static inline int z_vrfy_gpio_get_pending_int(struct device *dev) { return z_impl_gpio_get_pending_int((struct device *)dev); }
vuln
Vulnerable
C/C++
public static String c(String name) { if (name.equals("AsyncTask")) { return "Component.AsyncTask"; } for (int i = 0, customComponentsSize = cachedCustomComponents.size(); i < customComponentsSize; i++) { HashMap<String, Object> component = cachedCustomComponents.get(i);...
vuln
Safe
Java
static av_always_inline void filter_mb_dir(const H264Context *h, H264SliceContext *sl, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned in...
vuln
Safe
C/C++
static int fsmChown(int fd, int dirfd, const char *path, mode_t mode, uid_t uid, gid_t gid) { int rc; struct stat st; if (fd >= 0) { rc = fchown(fd, uid, gid); if (rc < 0) { if (fstat(fd, &st) == 0 && (st.st_uid == uid && st.st_gid == gid)) { rc = 0; } } } else { int flags = S_ISLNK(mod...
vuln
Safe
C/C++
/* * Copyright (c) 2019-2021 GeyserMC. http://geysermc.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,...
vuln
Safe
Java
static int autosieve_createfolder(const char *userid, const struct auth_state *auth_state, const char *internalname, int createsievefolder) { const char *subf ; int r = 0; int n; /* Check if internalname or userid are NULL */ if (userid == NULL || internalname == N...
vuln
Vulnerable
C/C++
private Route api(final RequestContext ctx, final CharSequence correlationId, final Map<String, String> queryParameters) { return rawPathPrefix(PathMatchers.slash().concat(HTTP_PATH_API_PREFIX), () -> // /api ensureSchemaVersion(apiVersion -> // /api/<apiVersion> ...
vuln
Vulnerable
Java
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
private void internalExpireMessagesByTimestampForSinglePartition(String subName, int expireTimeInSeconds, boolean authoritative) { if (topicName.isGlobal()) { validateGlobalNamespaceOwnership(namespaceName); } // If the topic name is a partition name, no need to get parti...
vuln
Safe
Java
Http::FilterMetadataStatus Context::onRequestMetadata() { if (!wasm_->onRequestMetadata_) { return Http::FilterMetadataStatus::Continue; } if (wasm_->onRequestMetadata_(this, id_).u64_ == 0) { return Http::FilterMetadataStatus::Continue; } return Http::FilterMetadataStatus::Continue; // This is curren...
vuln
Vulnerable
C/C++
/* Copyright (C) 2013, 2015, Alexey Botchkov and SkySQL Ab 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 ...
vuln
Safe
C/C++
/* 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
Safe
Python
package proxyutil import ( "net" "net/http" ) // PrepareProxyRequest prepares a request for being proxied. // Removes X-Forwarded-Host, X-Forwarded-Port, X-Forwarded-Proto headers. // Set X-Forwarded-For headers. func PrepareProxyRequest(req *http.Request) { req.Header.Del("X-Forwarded-Host") req.Header.Del("X-Fo...
vuln
Safe
Go
static Image *ReadDDSImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image; MagickBooleanType status, cubemap = MagickFalse, volume = MagickFalse, matte; CompressionType compression; DDSInfo dds_info; DDSDecoder *decoder; size_t n, num_images...
vuln
Safe
Unknown
static int create_filesystem_object(struct archive_write_disk *a) { /* Create the entry. */ const char *linkname; mode_t final_mode, mode; int r; /* these for check_symlinks_fsobj */ char *linkname_copy; /* non-const copy of linkname */ struct archive_string error_string; int error_number; /* We identify hard...
vuln
Safe
C/C++
@Override protected void configure(HttpSecurity http) throws Exception { http.headers().frameOptions().sameOrigin(); // Person pages only for authenticated users. http.authorizeRequests() .antMatchers("/persons/**").hasAnyAuthority("USER"); // Forum pages only for a...
vuln
Safe
Java
# -*- coding: utf-8 -*- # This file is part of wger Workout Manager. # # wger Workout Manager is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any ...
vuln
Vulnerable
Python
void DeviceTokenFetcher::SetState(FetcherState state) { state_ = state; if (state_ != STATE_TEMPORARY_ERROR) effective_token_fetch_error_delay_ms_ = kTokenFetchErrorDelayMilliseconds; backend_.reset(); // Stop any pending requests. base::Time delayed_work_at; switch (state_) { case STATE_INAC...
vuln
Safe
C/C++
// Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin,arm,!go1.12 package unix func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { return 0, ENOSYS } // Copyright 2019 Th...
vuln
Vulnerable
Go
public String[] getIds() { return ids != null ? ids.clone() : null; }
vuln
Safe
Java
/* Copyright 2021 The Fluid 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, softw...
vuln
Safe
Go
/* * The copyright in this software is being made available under the 2-clauses * BSD License, included below. This software may be subject to other third * party and contributor rights, including patent rights, and no such rights * are granted under this license. * * Copyright (c) 2002-2014, Universite catholi...
vuln
Vulnerable
C/C++
int ipmi_si_port_setup(struct si_sm_io *io) { unsigned int addr = io->addr_data; int idx; if (!addr) return -ENODEV; io->io_cleanup = port_cleanup; /* * Figure out the actual inb/inw/inl/etc routine to use based * upon the register size. */ switch (io->regsize) { case 1: io->inputb = p...
vuln
Vulnerable
C/C++
u_int juniper_atm2_print(netdissect_options *ndo, const struct pcap_pkthdr *h, register const u_char *p) { int llc_hdrlen; struct juniper_l2info_t l2info; l2info.pictype = DLT_JUNIPER_ATM2; if (juniper_parse_header(ndo, p, h, &l2info) == 0) return l2info....
vuln
Safe
C/C++
public void destroy() { mHandler.removeMessages(MSG_RESTART_TIMEOUT); if (!mBound) { return; } if (DEBUG) Slog.d(TAG, "TrustAgent unbound : " + mName.flattenToShortString()); mTrustManagerService.mArchive.logAgentStopped(mUserId, mName); mContext.unbindServic...
vuln
Vulnerable
Java
@Override public void step(boolean directionDown, boolean skipSubChannel) throws RemoteException { mEventLogger.logRadioEvent("Step with direction %s, skipSubChannel? %s", directionDown ? "down" : "up", skipSubChannel ? "yes" : "no"); if (!RadioServiceUserController.isCurrentOrSyste...
vuln
Safe
Java
XcursorImageCreate (int width, int height) { XcursorImage *image; if (width < 0 || height < 0) return NULL; if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) return NULL; image = malloc (sizeof (XcursorImage) + width * height * sizeof (XcursorPixel)); ...
vuln
Safe
C/C++
private void doBackupRestore(boolean isBackup) { Utils.showToast(R.string.select_backup_file); if (isBackup) { mBackupLauncher.launch("PermissionManagerX_" + Utils.getCurrDateTime(false) + ".xml"); } else { mRestoreLauncher.launch(new String[] {"text/xml"}); } }
vuln
Vulnerable
Java
bool kvmppc_is_mem_backend_page_size_ok(const char *obj_path) { Object *mem_obj = object_resolve_path(obj_path, NULL); char *mempath = object_property_get_str(mem_obj, "mem-path", NULL); long pagesize; if (mempath) { pagesize = qemu_mempath_getpagesize(mempath); } else { pagesize = g...
vuln
Vulnerable
C/C++
private String stripXSS(String value) { if (value != null) { // NOTE: It's highly recommended to use the ESAPI library and // uncomment the following line to // avoid encoded attacks. value = ESAPI.encoder().canonicalize(value); // Avoid null characters value = value.replaceAll("", ""); // Avoi...
vuln
Safe
Java
// SPDX-License-Identifier: GPL-2.0+ /* * EFI application loader * * Copyright (c) 2016 Alexander Graf */ #define LOG_CATEGORY LOGC_EFI #include <common.h> #include <bootm.h> #include <charset.h> #include <command.h> #include <dm.h> #include <efi_loader.h> #include <efi_selftest.h> #include <env.h> #include <er...
vuln
Safe
C/C++
void add_user_command(char *optarg) { cmdline = g_realloc(cmdline, ++ncmdline * sizeof(char *)); cmdline[ncmdline-1] = optarg; }
vuln
Safe
C/C++
static int cdxl_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *pkt) { CDXLVideoContext *c = avctx->priv_data; AVFrame * const p = data; int ret, w, h, encoding, aligned_width, buf_size = pkt->size; const uint8_t *buf = pkt->data; if (buf_size ...
vuln
Vulnerable
C/C++
static void truespeech_apply_twopoint_filter(TSContext *dec, int quart) { int16_t tmp[146 + 60], *ptr0, *ptr1; const int16_t *filter; int i, t, off; t = dec->offset2[quart]; if(t == 127){ memset(dec->newvec, 0, 60 * sizeof(*dec->newvec)); return; } for(i = 0; i < 146; i++) ...
vuln
Safe
C/C++
@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;" + "...
vuln
Safe
Java
def required_related_objects_errors( cls, output_for="ui", initial_data=None, relationships_key_specified=False, instance=None ): """ Args: output_for (str): either "ui" or "api" depending on usage initial_data (dict): submitted form/serializer data to validate agains...
vuln
Safe
Python
private void runScanRequest(ScanRequest scanRequest, List<VulnerabilityScanner> scanners) { ScanResults combinedResults = new ScanResults(); scanners.forEach(scanner -> { try{ ScanResults scanResults = scanner.scan(scanRequest); combinedResults.mergeWith(scan...
vuln
Safe
Java
@Override protected void configure(HttpSecurity http) throws Exception { http.servletApi() .and() .exceptionHandling() .and() .anonymous() .and() .addFilterBefore( new FiatAuthenticationFilter(fiatStatus, authenticationConverter), ...
vuln
Safe
Java
static int send_png_rect(VncState *vs, int x, int y, int w, int h, VncPalette *palette) { png_byte color_type; png_structp png_ptr; png_infop info_ptr; png_colorp png_palette = NULL; pixman_image_t *linebuf; int level = tight_png_conf[vs->tight.compression].png_zlib_leve...
vuln
Vulnerable
Unknown
void __qdisc_run(struct net_device *dev) { unsigned long start_time = jiffies; while (qdisc_restart(dev)) { if (netif_queue_stopped(dev)) break; /* * Postpone processing if * 1. another process needs the CPU; * 2. we've been doing it for too long. */ if (need_resched() || jiffies != start_time)...
vuln
Safe
Unknown
function enableCurrency(e) { var button = $(e.currentTarget); var currencyId = parseInt(button.data('id')); $.post(enableCurrencyUrl, { _token: token, id: currencyId }).done(function (data) { // lame but it works location.reload(); }).fail(function () { conso...
vuln
Safe
PHP
static CharDriverState *qmp_chardev_open_serial(ChardevHostdev *serial, Error **errp) { #ifdef HAVE_CHARDEV_TTY int fd; fd = qmp_chardev_open_file_source(serial->device, O_RDWR, errp); if (fd < 0) { return NULL; } qemu_set_nonblock(fd); ret...
vuln
Safe
C/C++
# Copyright 2014 Netflix, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
vuln
Safe
Python
load_image (const gchar *filename, GError **error) { FILE *ifp; gint depth, bpp; gint32 image_ID; L_XWDFILEHEADER xwdhdr; L_XWDCOLOR *xwdcolmap = NULL; ifp = g_fopen (filename, "rb"); if (!ifp) { g_set_error (error, G_FILE_ERROR, g_file_e...
vuln
Safe
Unknown
static void icp_pit_write(void *opaque, hwaddr offset, uint64_t value, unsigned size) { icp_pit_state *s = (icp_pit_state *)opaque; int n; n = offset >> 8; if (n > 2) { qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad timer %d\n", __func__, n); return; } arm_time...
vuln
Safe
C/C++
/* * MinIO Cloud Storage, (C) 2016, 2017 MinIO, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
vuln
Vulnerable
Go
int av_expr_parse(AVExpr **expr, const char *s, const char * const *const_names, const char * const *func1_names, double (* const *funcs1)(void *, double), const char * const *func2_names, double (* const *funcs2)(void *, double, double), int log_o...
vuln
Safe
C/C++
$query_link = $hp->purify($this->getFileHTMLUrl($fileinfo)); $sanitized_description = $hp->purify($fileinfo->getDescription(), CODENDI_PURIFIER_CONVERT_HTML); $link_show = '<a href="' . $query_link . '"' . $this->getVisioningAttributeForLink($...
vuln
Safe
PHP
static void hci_le_adv_report_evt(struct hci_dev *hdev, struct sk_buff *skb) { u8 num_reports = skb->data[0]; void *ptr = &skb->data[1]; hci_dev_lock(hdev); while (num_reports--) { struct hci_ev_le_advertising_info *ev = ptr; s8 rssi; if (ev->length <= HCI_MAX_AD_LENGTH) { rssi = ev->data[ev->length]; ...
vuln
Safe
Unknown
void snd_pcm_detach_substream(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime; if (PCM_RUNTIME_CHECK(substream)) return; runtime = substream->runtime; if (runtime->private_free != NULL) runtime->private_free(runtime); free_pages_exact(runtime->status, PAGE_ALIGN(sizeof(struct s...
vuln
Vulnerable
Unknown
/** * <a href="http://www.openolat.org"> * OpenOLAT - Online Learning and Training</a><br> * <p> * Licensed under the Apache License, Version 2.0 (the "License"); <br> * you may not use this file except in compliance with the License.<br> * You may obtain a copy of the License at the * <a href="http://www.apache...
vuln
Vulnerable
Java
static av_cold int movie_common_init(AVFilterContext *ctx) { MovieContext *movie = ctx->priv; AVInputFormat *iformat = NULL; int64_t timestamp; int nb_streams = 1, ret, i; char default_streams[16], *stream_specs, *spec, *cursor; char name[16]; AVStream *st; if (!movie->file_name) { ...
vuln
Safe
C/C++
private static Collection<ResourceLocation> filter(final ITargetingRule rule, final Collection<ResourceLocation> fullExclusions) { final Map<ResourceLocation, WrapperRecipe> map = GenericRecipesManager.RECIPES.getRecipeMap(); // Holy hell if it's inefficient otherwise return Util.make(...
vuln
Vulnerable
Java
parse_wbxml_attribute_list_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset, guint32 str_tbl, guint8 level, guint8 *codepage_attr, const wbxml_decoding *map) { guint32 tvb_len = tvb_reported_length (tvb); guint32 off = offset; guint32 len; guint str_len; guint32 ...
vuln
Vulnerable
C/C++
# # Copyright (c) 2013 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a copy of...
vuln
Vulnerable
Python
explicit AsStringOp(OpKernelConstruction* ctx) : OpKernel(ctx) { int32 precision; bool scientific; bool shortest; int32 width; string fill_string; DataType dtype; OP_REQUIRES_OK(ctx, ctx->GetAttr("T", &dtype)); OP_REQUIRES_OK(ctx, ctx->GetAttr("precision", &precision)); OP_REQUIRES_O...
vuln
Vulnerable
C/C++
@Override public void processPublish(MqttPublishMessage msg) { final int packetId = msg.variableHeader().packetId(); if (log.isDebugEnabled()) { log.debug("[Proxy Publish] publish to topic = {}, CId={}", msg.variableHeader().topicName(), connection.getClientId()); ...
vuln
Vulnerable
Java
package com.salesmanager.shop.admin.controller.user; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import javax.inject.Inject; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.validat...
vuln
Safe
Java
BufCompressedFill (BufFilePtr f) { CompressedFile *file; register char_type *stackp, *de_stack; register char_type finchar; register code_int code, oldcode, incode; BufChar *buf, *bufend; file = (CompressedFile *) f->private; buf = f->buffer; bufend = buf + BUFFILESIZE; stackp...
vuln
Vulnerable
Unknown
"""Base Tornado handlers for the notebook server.""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import datetime import functools import ipaddress import json import mimetypes import os import re import sys import traceback import types import warnings from htt...
vuln
Safe
Python
// Copyright (C) Extensible Service Proxy Authors // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this lis...
vuln
Safe
C/C++