code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
/** * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse....
vuln
Vulnerable
Java
cmd_readkey (assuan_context_t ctx, char *line) { ctrl_t ctrl = assuan_get_pointer (ctx); int rc; unsigned char *cert = NULL; size_t ncert, n; ksba_cert_t kc = NULL; ksba_sexp_t p; unsigned char *pk; size_t pklen; if ((rc = open_card (ctrl, NULL))) return rc; line = xstrdup (line); /* Need a co...
vuln
Vulnerable
Unknown
private void spawnCitizenFromBed() { final BlockPos spawn; final BlockState bedState = citizen.level.getBlockState(getBedLocation()); if (!getBedLocation().equals(BlockPos.ZERO) && bedState.is(BlockTags.BEDS)) { if (bedState.getValue(BedBlock.PART) == BedPart.HEAD) ...
vuln
Safe
Java
static void vnc_connect(VncDisplay *vd, int csock, bool skipauth, bool websocket) { VncState *vs = g_new0(VncState, 1); int i; vs->csock = csock; vs->vd = vd; if (skipauth) { vs->auth = VNC_AUTH_NONE; vs->subauth = VNC_AUTH_INVALID; } else { if (websocket) { ...
vuln
Safe
C/C++
public static boolean isGridEmpty(HandledScreen<?> handledScreen, int gridLength) { boolean isEmpty = true; List<Slot> slots = handledScreen.getScreenHandler().slots; for (int i = 0; i < gridLength; i++) { isEmpty &= slots.get(i + 1).hasStack(); } return isEmpty; }
vuln
Vulnerable
Java
static void ssl_write_renegotiation_ext( ssl_context *ssl, unsigned char *buf, size_t *olen ) { unsigned char *p = buf; const unsigned char *end = ssl->out_msg + SSL_MAX_CONTENT_LEN; *olen = 0; if( ssl->renegotiation != ...
vuln
Safe
C/C++
package com.salesmanager.shop.admin.controller.customers; import com.salesmanager.core.business.services.customer.CustomerService; import com.salesmanager.core.business.services.customer.attribute.CustomerAttributeService; import com.salesmanager.core.business.services.customer.attribute.CustomerOptionService; import ...
vuln
Vulnerable
Java
@Override public float baseValue(TechBiologicalWeapon t) { TechBiologicalWeapon curr = empire.tech().topBiologicalWeaponTech(); float val = 0; if(curr != null) val -= curr.level(); val += t.level(); val /= 10; val = max(1, val); return val; }
vuln
Safe
Java
ins_compl_next_buf(buf_T *buf, int flag) { static win_T *wp = NULL; if (flag == 'w') // just windows { if (buf == curbuf || !win_valid(wp)) // first call for this flag/expansion or window was closed wp = curwin; while ((wp = (wp->w_next != NULL ? wp->w_next : firstwin)) != curwin && wp->w_bu...
vuln
Safe
Unknown
int av_strerror(int errnum, char *errbuf, size_t errbuf_size) { int ret = 0, i; struct error_entry *entry = NULL; for (i = 0; i < FF_ARRAY_ELEMS(error_entries); i++) { if (errnum == error_entries[i].num) { entry = &error_entries[i]; break; } } if (entry) { ...
vuln
Vulnerable
C/C++
public void tick(World world, BlockPos pos, BlockState state) { if (world instanceof ServerWorld server) { boolean upsidedown = state.get(RegisterProperties.UPSIDE_DOWN); boolean waterlogged = state.get(Properties.WATERLOGGED); this.getEventListener().tick(world); ...
vuln
Safe
Java
@Override public Version parseWorkflowContent(String filePath, String content, Set<SourceFile> sourceFiles, Version version) { // parse the collab.cwl file to get important metadata if (content != null && !content.isEmpty()) { try { Yaml safeYaml = new Yaml(new SafeConstr...
vuln
Safe
Java
static Image *ReadTIFFImage(const ImageInfo *image_info, ExceptionInfo *exception) { #define ThrowTIFFException(severity,message) \ { \ if (tiff_pixels != (unsigned char *) NULL) \ tiff_pixels=(unsigned char *) RelinquishMagickMemory(tiff_pixels); \ if (quantum_info != (QuantumInfo *) NULL) \ quantum_info...
vuln
Safe
C/C++
LookupModMask(struct xkb_context *ctx, const void *priv, xkb_atom_t field, enum expr_value_type type, xkb_mod_mask_t *val_rtrn) { const char *str; xkb_mod_index_t ndx; const LookupModMaskPriv *arg = priv; const struct xkb_mod_set *mods = arg->mods; enum mod_type mod_type = arg->mod_typ...
vuln
Vulnerable
C/C++
""" Copyright 2007-2009, Red Hat, Inc and Others Michael DeHaan <michael.dehaan AT gmail> 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 2 of the License, or (at your option) any late...
vuln
Safe
Python
static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename, zend_bool raw_output_default) /* {{{ */ { char *algo, *data, *digest, *key, *K; int algo_len, data_len, key_len; zend_bool raw_output = raw_output_default; const php_hash_ops *ops; void *context; php_stream *stream = NULL; if (zend_...
vuln
Safe
Unknown
String UTF16BEDecoder::to_utf8(const StringView& input) { StringBuilder builder(input.length() / 2); size_t utf16_length = input.length() - (input.length() % 2); for (size_t i = 0; i < utf16_length; i += 2) { u16 code_point = (input[i] << 8) | input[i + 1]; builder.append_code_point(code_poi...
vuln
Safe
C/C++
function toString(stringify) { if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify; var query , url = this , protocol = url.protocol; if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':'; var result = protocol + ((url.protocol && url.slashes) |...
vuln
Vulnerable
JavaScript
static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, pte_t *page_table, pmd_t *pmd, unsigned int flags) { struct mem_cgroup *memcg; struct page *page; spinlock_t *ptl; pte_t entry; pte_unmap(page_table); /* Check if we need to add a guard page to the stac...
vuln
Vulnerable
C/C++
static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos, int *outFilterSize, int xInc, int srcW, int dstW, int filterAlign, int one, int flags, int cpu_flags, SwsVector *srcFilter, SwsV...
vuln
Safe
C/C++
def json_decode(obj) JSON.parse(obj, create_additions: false) end
vuln
Safe
Ruby
@Override public RunCategory valueFromString(String string) { return RunCategory.valueOf(string); }
vuln
Vulnerable
Java
gboolean cib_notify_client(gpointer key, gpointer value, gpointer user_data) { const char *type = NULL; gboolean do_send = FALSE; cib_client_t *client = value; xmlNode *update_msg = user_data; CRM_CHECK(client != NULL, return TRUE); CRM_CHECK(update_msg != NULL, return TRUE); if (client->...
vuln
Vulnerable
C/C++
import os import socket from flask import current_app, make_response, request from flask import send_file, render_template, safe_join from .redis_config import DecodedRedis from .redis_conn import FlaskRedis # from flaskapi.core.worker import celery # import celery.states as states from flask import Blueprint route...
vuln
Safe
Python
static int vp3_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; Vp3DecodeContext *s = avctx->priv_data; GetBitContext gb; int i, ret; if...
vuln
Safe
C/C++
public void onChange(){ if(storeSlot && getAmount() == 0) aspect = Aspects.EMPTY; }
vuln
Safe
Java
static int tls_construct_cke_dhe(SSL *s, unsigned char **p, int *len, int *al) { #ifndef OPENSSL_NO_DH DH *dh_clnt = NULL; const BIGNUM *pub_key; EVP_PKEY *ckey = NULL, *skey = NULL; skey = s->s3->peer_tmp; if (skey == NULL) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_DHE, ERR_R_INTERNAL_ERROR); ...
vuln
Safe
C/C++
function action_bandwidth(iface) luci.http.prepare_content("application/json") local bwc = io.popen("luci-bwc -i '%s' 2>/dev/null" % iface:gsub("'", "")) if bwc then luci.http.write("[") while true do local ln = bwc:read("*l") if not ln then break end luci.http.write(ln) end luci.http.write("]") ...
vuln
Safe
Lua
/*! Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved. rebuild is dual-licensed under commercial and open source licenses (GPLv3). See LICENSE and COMMERCIAL in the project root for license information. */ package com.rebuild.web.admin; import com.rebuild.core.Application; import...
vuln
Vulnerable
Java
@Override public String getIndexJson(AbuseReportContext reporter, int index) { ChatLogEntry receivedMessage = reporter.chatLog().get(index); return receivedMessage instanceof ReceivedMessage.ChatMessage chatMessage ? ObjectMapper.create().writeValueAsString(this.toReportChatMessage(i...
vuln
Safe
Java
/* * * drivers/staging/android/ion/ion.c * * Copyright (C) 2011 Google, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distribu...
vuln
Vulnerable
C/C++
static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb) { const HEVCSPS *sps = s->ps.sps; int max_poc_lsb = 1 << sps->log2_max_poc_lsb; int prev_delta_msb = 0; unsigned int nb_sps = 0, nb_sh; int i; rps->nb_refs = 0; if (!sps->long_term_ref_pics_present_flag) ...
vuln
Safe
C/C++
duint32 dwgCompressor::long20CompressionOffset(){ // duint32 cont = 0; duint32 cont = 0x0F; duint8 ll = compressedByte(); while (ll == 0x00 && compressedGood){ // cont += 0xFF; ll = compressedByte(); } cont += ll; return cont; }
vuln
Safe
Unknown
ews_backend_constructed (GObject *object) { EBackend *backend; ESource *source; ESourceAuthentication *auth_extension; const gchar *extension_name; gchar *host = NULL; guint16 port = 0; /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (e_ews_backend_parent_class)->constructed (object); backend...
vuln
Safe
Unknown
public static TransformerFactory createSecureTransformerFactory() { TransformerFactory transformerFactory = TransformerFactory.newInstance(); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); return transf...
vuln
Vulnerable
Java
/* * Copyright (c) 2008, Christoph Hellwig * All Rights Reserved. * * 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. * * This program is distributed in the hope that it would be useful, ...
vuln
Safe
C/C++
static int dshow_read_packet(AVFormatContext *s, AVPacket *pkt) { struct dshow_ctx *ctx = s->priv_data; AVPacketList *pktl = NULL; while (!ctx->eof && !pktl) { WaitForSingleObject(ctx->mutex, INFINITE); pktl = ctx->pktl; if (pktl) { *pkt = pktl->pkt; ctx->pktl...
vuln
Vulnerable
C/C++
public void addValidationNotice(ValidationNotice notice) { validationNotices.add(notice); }
vuln
Vulnerable
Java
static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject) { char *dirname; int dir_len; zval *zcontext = NULL; php_stream_context *context = NULL; php_stream *dirp; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &dirname, &dir_len, &zcontext) == FAILURE) { RETURN_NULL(); } con...
vuln
Vulnerable
Unknown
/* * linux/kernel/softirq.c * * Copyright (C) 1992 Linus Torvalds * * Distribute under GPLv2. * * Rewritten. Old one was good in 2.2, but in 2.3 it was immoral. --ANK (990903) */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/export.h> #include <linux/kernel_stat.h> #include <linux/interrupt.h> #...
vuln
Safe
C/C++
createenv(const struct rule *rule) { struct env *env; u_int i; env = malloc(sizeof(*env)); if (!env) err(1, NULL); RB_INIT(&env->root); env->count = 0; if (rule->options & KEEPENV) { extern char **environ; for (i = 0; environ[i] != NULL; i++) { struct envnode *node; const char *e, *eq; size_t l...
vuln
Vulnerable
C/C++
/* * Copyright ConsenSys AG. * * 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...
vuln
Safe
Java
public static String getCurrentCaptureDevice() { String deviceName = VoiceClient.getClientConfig().microphone.get(); if (VoiceClient.getClientConfig().javaxCapture.get()) { List<String> devices = JavaxCaptureDevice.getNames(); if (deviceName == null || !devices.contains(deviceNam...
vuln
Vulnerable
Java
//. # Fluture Node //. //. FP-style HTTP and streaming utils for Node based on [Fluture][]. //. //. Skip to the [Http section](#http) for the main code example. //. //. ## Usage //. //. ```console //. $ npm install --save fluture fluture-node //. ``` //. //. On Node 12 and up, this module can be loaded directly with `i...
vuln
Vulnerable
JavaScript
/* * Copyright 2017 Google Inc. 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 applica...
vuln
Safe
JavaScript
asmlinkage __visible void __init xen_start_kernel(void) { struct physdev_set_iopl set_iopl; unsigned long initrd_start = 0; int rc; if (!xen_start_info) return; __text_gen_insn(&early_xen_iret_patch, JMP32_INSN_OPCODE, &early_xen_iret_patch, &xen_iret, JMP32_INSN_SIZE); xen_domain_type = XEN_PV_DOMAIN;...
vuln
Vulnerable
C/C++
static Image *ExtractPostscript(Image *image,const ImageInfo *image_info, MagickOffsetType PS_Offset,ssize_t PS_Size,ExceptionInfo *exception) { char postscript_file[MagickPathExtent]; const MagicInfo *magic_info; FILE *ps_file; ImageInfo *clone_info; Image *image2; un...
vuln
Safe
C/C++
function checkProp(value, schema, path,i){ var l; path += path ? typeof i == 'number' ? '[' + i + ']' : typeof i == 'undefined' ? '' : '.' + i : i; function addError(message){ errors.push({property:path,message:message}); } if((typeof schema != 'object' || schema instanceof Array) && (path || typeof sche...
vuln
Safe
JavaScript
void cWebAdmin::HandleFileRequest(cHTTPServerConnection & a_Connection, cHTTPIncomingRequest & a_Request) { AString FileURL = a_Request.GetURL(); std::replace(FileURL.begin(), FileURL.end(), '\\', '/'); // Remove all leading backslashes: if (!FileURL.empty() && (FileURL[0] == '/')) { size_t FirstCharToRead = Fi...
vuln
Safe
C/C++
static Image *ReadXWDImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define CheckOverflowException(length,width,height) \ (((height) != 0) && ((length)/((size_t) height) != ((size_t) width))) char *comment; Image *image; int x_status; MagickBooleanType authentic_colormap; ...
vuln
Vulnerable
C/C++
private static final void disableLocal(@NonNull String name) { synchronized (sCorkLock) { sDisabledKeys.add(name); for (PropertyInvalidatedCache cache : sCaches.keySet()) { if (name.equals(cache.mCacheName)) { cache.disableInstance(); }...
vuln
Vulnerable
Java
static av_cold int fieldmatch_init(AVFilterContext *ctx) { const FieldMatchContext *fm = ctx->priv; AVFilterPad pad = { .name = av_strdup("main"), .type = AVMEDIA_TYPE_VIDEO, .filter_frame = filter_frame, .config_props = config_input, }; int ret; if (!...
vuln
Safe
C/C++
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) public void onBreak(BlockBreakEvent e) { final Block b = e.getBlock(); final Player p = e.getPlayer(); // If the shop was a chest if (Util.canBeShop(b)) { final Shop shop = getShopPlayer(b.getLocation(...
vuln
Safe
Java
static void close_all_connections(struct Curl_multi *multi) { struct connectdata *conn; conn = Curl_conncache_find_first_connection(&multi->conn_cache); while(conn) { SIGPIPE_VARIABLE(pipe_st); conn->data = multi->closure_handle; sigpipe_ignore(conn->data, &pipe_st); /* This will remove the conn...
vuln
Vulnerable
C/C++
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #include <string.h> #include <openssl/ssl.h> #include <openssl/crypto.h> #include <openssl/stack.h> #include <openssl/x509.h> #include <openssl/rand.h> #include <openssl/curve25519.h> #include <openssl/hkdf.h> #include <opens...
vuln
Safe
C/C++
#ifndef JSI_LITE_ONLY #ifndef JSI_AMALGAMATION #include "jsiInt.h" #else char *strptime(const char *buf, const char *fmt, struct tm *tm); #endif #include <errno.h> #include <sys/stat.h> #include <sys/time.h> #include <signal.h> #include <limits.h> #ifndef __WIN32 #include <sys/wait.h> #endif static Jsi_RC consoleInput...
vuln
Vulnerable
C/C++
static int set_expected_hash(const char *val, const struct kernel_param *kp) { pr_info("set_expected_hash: %s\n", val); int rv = param_set_charp(val, kp); ksu_invalidate_manager_uid(); pr_info("ksu_expected_hash set to %s\n", ksu_expected_hash); return rv; }
vuln
Safe
C/C++
static void decompress_data_with_multi_threads(QEMUFile *f, void *host, int len) { int idx, thread_count; thread_count = migrate_decompress_threads(); qemu_mutex_lock(&decomp_done_lock); while (true) { for (idx = 0; idx < thread_count; idx++) { ...
vuln
Safe
C/C++
static void pci_bus_init(PCIBus *bus, DeviceState *parent, const char *name, MemoryRegion *address_space_mem, MemoryRegion *address_space_io, uint8_t devfn_min) { assert(PCI_FUNC(devfn_min) == 0); bus->devfn_min ...
vuln
Vulnerable
C/C++
static int oggvorbis_decode_init(AVCodecContext *avccontext) { OggVorbisDecContext *context = avccontext->priv_data ; uint8_t *p= avccontext->extradata; int i, hsizes[3]; unsigned char *headers[3], *extradata = avccontext->extradata; vorbis_info_init(&context->vi) ; vorbis_comment_init(&context-...
vuln
Vulnerable
C/C++
/* * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. * * Author: zccrs <zccrs@live.com> * * Maintainer: zccrs <zhangjide@deepin.com> * * 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 Foun...
vuln
Safe
C/C++
it "should be created correctly" do invite = Fabricate(:invite, email: 'walter.white@email.com') user = InviteRedeemer.create_user_from_invite(invite: invite, email: invite.email, username: 'walter', name: 'Walter White') expect(user.username).to eq('walter') expect(user.name).to eq('Walter Whit...
vuln
Safe
Ruby
pidfile_write(const char *pid_file, int pid) { FILE *pidfile = NULL; int pidfd = creat(pid_file, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); if (pidfd != -1) pidfile = fdopen(pidfd, "w"); if (!pidfile) { log_message(LOG_INFO, "pidfile_write : Cannot open %s pidfile", pid_file); return 0; } fprintf(pidf...
vuln
Vulnerable
C/C++
def self.create_user_from_invite(email:, invite:, username: nil, name: nil, password: nil, user_custom_fields: nil, ip_address: nil, session: nil, email_token: nil) if username && UsernameValidator.new(username).valid_format? && User.username_available?(username, email) available_username = username else ...
vuln
Safe
Ruby
static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception) { char colorspace[MaxTextExtent], text[MaxTextExtent]; Image *image; IndexPacket *indexes; long x_offset, y_offset; MagickBooleanType status; MagickPixelPacket pixel; QuantumAny range...
vuln
Safe
C/C++
static int aacDecoder_drcExtractAndMap ( HANDLE_AAC_DRC self, HANDLE_FDK_BITSTREAM hBs, CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo[], UCHAR pceInstanceTag, UCHAR channelMapping[], /* Channel mapping translating drcChannel index to canonical channel index */ int va...
vuln
Safe
C/C++
static int ldb_lock_backend_callback(struct ldb_request *req, struct ldb_reply *ares) { struct ldb_db_lock_context *lock_context; int ret; lock_context = talloc_get_type(req->context, struct ldb_db_lock_context); if (!ares) { return ldb_module_done(lock_context->req, NULL, NULL, LDB_ERR...
vuln
Vulnerable
C/C++
@NonNull @Override public View onCreateViewWithToolbar(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.scene_gallery_comments, container, false); mRecyclerView = (EasyRecy...
vuln
Vulnerable
Java
package collection import ( "context" "github.com/answerdev/answer/internal/base/constant" "github.com/answerdev/answer/internal/base/data" "github.com/answerdev/answer/internal/base/pager" "github.com/answerdev/answer/internal/base/reason" "github.com/answerdev/answer/internal/entity" collectioncommon "github...
vuln
Safe
Go
static ssize_t parse8BIM(Image *ifile, Image *ofile) { char brkused, quoted, *line, *token, *newstr, *name; int state, next; unsigned char dataset; unsigned int recnum; int inputlen = MaxTextExtent; MagickOffsetType savedpos, currentpos; ssize_t ...
vuln
Vulnerable
Unknown
int rsa_private( rsa_context *ctx, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng, const unsigned char *input, unsigned char *output ) { int ret; size_t olen; mpi T, T1, T2; mpi_init( &T ); mpi_init( &T1 ); mpi_init( &T2 );...
vuln
Vulnerable
Unknown
function A(ha,qa,aa,ca,na){na||(da.innerText="",K(),T=ha,X=ca);var la=null;if(aa){la=document.createElement("table"); la.className="geTempDlgDiagramsListGrid";var oa=document.createElement("tr"),ra=document.createElement("th");ra.style.width="50%";ra.innerHTML=mxUtils.htmlEntities(mxResources.get("diagram"));oa.appendC...
vuln
Safe
JavaScript
parsegid(const char *s, gid_t *gid) { struct group *gr; const char *errstr; if ((gr = getgrnam(s)) != NULL) { *gid = gr->gr_gid; return 0; } #if !defined(__linux__) && !defined(__NetBSD__) *gid = strtonum(s, 0, GID_MAX, &errstr); #else sscanf(s, "%d", gid); #endif if (errstr) return -1; return 0; }
vuln
Vulnerable
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
Vulnerable
Java
bool SessionRestore::IsRestoring(const Profile* profile) { return (profiles_getting_restored && profiles_getting_restored->find(profile) != profiles_getting_restored->end()); }
vuln
Vulnerable
C/C++
@Override public void destroy () { setIsLoading(false); resetSelectableControl(); setScrollToBottomVisible(false, false); applyPlayerOffset(0f, 0f); hideActionButton(); setBroadcastAction(TdApi.ChatActionCancel.CONSTRUCTOR); cancelJumpToDate(); cancelAdminsRequest(); resetSearhCo...
vuln
Safe
Java
@gui.route("/job/<int:job_id>/browse", defaults={"path": ""}) @gui.route("/job/<int:job_id>/browse/<path:path>") @login_required def job_browse(job_id: int, path): """ Browse directory of the job. :param job_id: int :param path: str """ try: # Query job information job_info = qu...
vuln
Safe
Python
static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoPtr, char **pszEncoding, char *szValuePtr, int ByteCount) { int a; char *decode; size_t len; *pszEncoding = NULL; /* Copy the comment */ if (ByteCount>=8) { const zend_encoding *from, *to; if (!memcmp(szValuePtr, "UNICODE\0", 8...
vuln
Safe
Unknown
cJSON *cJSON_Parse( const char *value ) { cJSON *c; ep = 0; if ( ! ( c = cJSON_New_Item() ) ) return 0; /* memory fail */ if ( ! parse_value( c, skip( value ) ) ) { cJSON_Delete( c ); return 0; } return c; }
vuln
Vulnerable
C/C++
@Override public HttpResponse doExecute(HttpServletRequest servletRequest, HttpServletResponse servletResponse, HttpRequest proxyRequest) throws IOException { try{ log.debug("proxy {} uri: {} -- {}", servletRequest.getMethod(), servletRequest.getRequestURI(), proxyRequest.getRequestLine().getUri...
vuln
Safe
Java
private void collectPropertySchemas( org.everit.json.schema.Schema schema, Map<String, org.everit.json.schema.Schema> properties, Map<String, Boolean> required, Set<org.everit.json.schema.Schema> visited) { if (visited.contains(schema)) { return; } else { visited.add(schema);...
vuln
Vulnerable
Java
static ssize_t last_change_ms_show(struct device *dev, struct device_attribute *attr, char *buf) { struct wakeup_source *ws = dev_get_drvdata(dev); return sprintf(buf, "%lld\n", ktime_to_ms(ws->last_time)); }
vuln
Vulnerable
Unknown
private void securityCheck(String filename) { Assert.doesNotContain(filename, ".."); }
vuln
Vulnerable
Java
int kvm_create_lapic(struct kvm_vcpu *vcpu, int timer_advance_ns) { struct kvm_lapic *apic; ASSERT(vcpu != NULL); apic = kzalloc(sizeof(*apic), GFP_KERNEL_ACCOUNT); if (!apic) goto nomem; vcpu->arch.apic = apic; apic->regs = (void *)get_zeroed_page(GFP_KERNEL_ACCOUNT); if (!apic->regs) { printk(KERN_ERR ...
vuln
Safe
Unknown
static void setupAuthHandlers(final Server server, final Router router, final boolean isInternalListener) { final Optional<BasicAuthHandler> jaas = getJaasAuthHandler(server); final KsqlSecurityExtension securityExtension = server.getSecurityExtension(); final Optional<AuthenticationPlugin> authentica...
vuln
Vulnerable
Java
/* eslint-disable global-require, no-use-before-define */ 'use strict'; /** * This callback will be called to transform a script to JavaScript. * * @callback compileCallback * @param {string} code - Script code to transform to JavaScript. * @param {string} filename - Filename of this script. * @return {string} ...
vuln
Safe
JavaScript
/* SPDX-License-Identifier: LGPL-2.1-or-later */ #include <errno.h> #include <fcntl.h> #include <stdbool.h> #include <stddef.h> #include <unistd.h> #include "alloc-util.h" #include "btrfs-util.h" #include "cgroup-util.h" #include "dirent-util.h" #include "fd-util.h" #include "log.h" #include "macro.h" #include "mount...
vuln
Safe
C/C++
safe_fprintf(FILE *f, const char *fmt, ...) { char fmtbuff_stack[256]; /* Place to format the printf() string. */ char outbuff[256]; /* Buffer for outgoing characters. */ char *fmtbuff_heap; /* If fmtbuff_stack is too small, we use malloc */ char *fmtbuff; /* Pointer to fmtbuff_stack or fmtbuff_heap. */ int fmtbu...
vuln
Safe
C/C++
public void delete(Sprite spriteToDelete) { if (spriteToDelete.isClone) { throw new IllegalStateException("You are deleting a clone: this means you also delete the files that are " + "referenced by the original sprite because clones are shallow copies regarding files."); } for (LookData look : spriteToDel...
vuln
Vulnerable
Java
int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len, int noblock, int flags, int *addr_len) { struct ipv6_pinfo *np = inet6_sk(sk); struct inet_sock *inet = inet_sk(sk); struct sk_buff *skb; unsigned int ulen, copied; int peeked, off = 0; int err; int is_udplite = IS_UDP...
vuln
Safe
Unknown
av_cold int ff_ivi_decode_close(AVCodecContext *avctx) { IVI45DecContext *ctx = avctx->priv_data; ivi_free_buffers(&ctx->planes[0]); if (ctx->mb_vlc.cust_tab.table) ff_free_vlc(&ctx->mb_vlc.cust_tab); if (ctx->blk_vlc.cust_tab.table) ff_free_vlc(&ctx->blk_vlc.cust_tab); av_frame_free...
vuln
Safe
C/C++
static long vbg_misc_device_ioctl(struct file *filp, unsigned int req, unsigned long arg) { struct vbg_session *session = filp->private_data; size_t returned_size, size; struct vbg_ioctl_hdr hdr; bool is_vmmdev_req; int ret = 0; void *buf; if (copy_from_user(&hdr, (void *)arg, sizeof(hdr))) return -EFAU...
vuln
Vulnerable
C/C++
Pl_AES_PDF::flush(bool strip_padding) { assert(this->offset == this->buf_size); if (first) { first = false; bool return_after_init = false; if (this->cbc_mode) { if (encrypt) { // Set cbc_block to the initialization vector, and if // not zero, write it to the output stream. initi...
vuln
Vulnerable
C/C++
static Image *ReadLABELImage(const ImageInfo *image_info, ExceptionInfo *exception) { char geometry[MagickPathExtent], *label; DrawInfo *draw_info; Image *image; MagickBooleanType left_bearing, status; TypeMetric metrics; size_t height, width; /* Initialize ...
vuln
Vulnerable
C/C++
import dayjs from 'dayjs' import customParseFormat from 'dayjs/plugin/customParseFormat' import { t } from './i18n.js' import Projects from '../api/projects/projects.js' import projectUsers from '../api/users/users.js' import { periodToDates } from './periodHelpers.js' import { getGlobalSetting, getUserSetting } from '...
vuln
Vulnerable
JavaScript
usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), program_name); else { printf (_("\ Usage: %s [OPTION]... [STRINGS]...\n\ "), program_name); fputs (_("\ Internationalized Domain Name (IDNA2008) convert STRINGS, or standard inpu...
vuln
Safe
C/C++
int sudo_auth_init(const struct sudoers_context *ctx, struct passwd *pw, unsigned int mode) { sudo_auth *auth; int status = AUTH_SUCCESS; debug_decl(sudo_auth_init, SUDOERS_DEBUG_AUTH); if (auth_switch[0].name == NULL) debug_return_int(0); /* Initialize auth methods and unconfigure the method...
vuln
Vulnerable
C/C++
@Override public Rarity getRarity(ItemStack stack) { return ShaderRegistry.shaderRegistry.containsKey(getShaderName(stack)) ? ShaderRegistry.shaderRegistry.get(getShaderName(stack)).getRarity() : Rarity.COMMON; }
vuln
Safe
Java
def generate_node_config(certname): """Generates a YAML document describing the configuration of a particular node given as 'certname'.""" # Get a cursor to the database curd = g.db.cursor(mysql.cursors.DictCursor) # Get the Puppet node from the database curd.execute("SELECT `id`, `classes`, `variables`, `env`,...
vuln
Safe
Python
x11grab_read_header(AVFormatContext *s1) { struct x11_grab *x11grab = s1->priv_data; Display *dpy; AVStream *st = NULL; enum PixelFormat input_pixfmt; XImage *image; int x_off = 0; int y_off = 0; int screen; int use_shm; char *param, *offset; int ret = 0; AVRational frame...
vuln
Safe
C/C++