code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
generate_mail_credentials = function() { var div = $('.mail-infoblock').clone(); div.find('#mail_configuration').remove(); var pass=div.find('#v_password').text(); if (pass=="") div.find('#v_password').html(' '); var output = div.text(); output=output.replace(/(?:\r\n|\r|\n|\t)/g, "|"); outp...
vuln
Vulnerable
JavaScript
void DataView::ClearLengthAndBufferOnDetach() { AssertMsg(this->GetArrayBuffer()->IsDetached(), "Array buffer should be detached if we're calling this method"); this->length = 0; this->buffer = nullptr; }
vuln
Safe
C/C++
static int key_verify(pam_handle_t *pamh, int flags, PKCS11_KEY *authkey) { int ok = 0; unsigned char challenge[30]; unsigned char *signature = NULL; unsigned int siglen; const EVP_MD *md = EVP_sha1(); EVP_MD_CTX *md_ctx = EVP_MD_CTX_new(); EVP_PKEY *privkey = PKCS11_get_private_key(authkey); EVP_PKEY *p...
vuln
Safe
Unknown
static int writev_f(int argc, char **argv) { struct timeval t1, t2; int Cflag = 0, qflag = 0; int c, cnt; char *buf; int64_t offset; int total = 0; int nr_iov; int pattern = 0xcd; QEMUIOVector qiov; while ((c = getopt(argc, argv, "CqP:")) != EOF) { switch (c) { ...
vuln
Safe
C/C++
png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) { png_uint_32 chunk_name; #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED int keep; /* unknown handling method */ #endif /* First we make sure we have enough data for the 4-byte chunk name * and the 4-byte chunk length before proceeding with decoding t...
vuln
Safe
Unknown
virSecuritySELinuxMCSFind(virSecurityManager *mgr, const char *sens, int catMin, int catMax) { virSecuritySELinuxData *data = virSecurityManagerGetPrivateData(mgr); int catRange; char *mcs = NULL; /* +1 since virRandomInt ran...
vuln
Safe
Unknown
def get_nodes_status() corosync_online = [] corosync_offline = [] pacemaker_online = [] pacemaker_offline = [] pacemaker_standby = [] in_pacemaker = false stdout, stderr, retval = run_cmd( PCSAuth.getSuperuserSession, PCS, "status", "nodes", "both" ) stdout.each {|l| l = l.chomp if l.start...
vuln
Vulnerable
Ruby
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
vuln
Safe
C/C++
package com.salesmanager.shop.admin.model.orders; import java.io.Serializable; public class Refund implements Serializable { /** * */ private static final long serialVersionUID = 2392736671094915447L; private Long orderId; private String amount; public Long getOrderId() { return orderId; } public void...
vuln
Safe
Java
static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer, const char *model, const char *name, const char *ifname, const char *script, const char *downscript, const char *vhostfdname, ...
vuln
Safe
C/C++
static uint dump_events_for_db(char *db) { char query_buff[QUERY_LENGTH]; char db_name_buff[NAME_LEN*2+3], name_buff[NAME_LEN*2+3]; char *event_name; char delimiter[QUERY_LENGTH]; FILE *sql_file= md_result_file; MYSQL_RES *event_res, *event_list_res; MYSQL_ROW row, event_li...
vuln
Safe
Unknown
xmlParseDocument(xmlParserCtxtPtr ctxt) { xmlChar start[4]; xmlCharEncoding enc; xmlInitParser(); if ((ctxt == NULL) || (ctxt->input == NULL)) return(-1); GROW; /* * SAX: detecting the level. */ xmlDetectSAX2(ctxt); /* * SAX: beginning of the document processi...
vuln
Safe
Unknown
function(A,z,L,M,n){q.apply(this,arguments);m()};t.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);m()};t.connectionHandler.addListener(mxEvent.CONNECT,function(){m()})}var v=mxUtils.button(mxResources.get("close"),function(){b.confirm(mxResources.get("areYouSure"),function(){null!=u.parentNode...
vuln
Vulnerable
JavaScript
w3m_exit(int i) { #ifdef USE_MIGEMO init_migemo(); /* close pipe to migemo */ #endif stopDownload(); deleteFiles(); #ifdef USE_SSL free_ssl_ctx(); #endif disconnectFTP(); #ifdef USE_NNTP disconnectNews(); #endif #ifdef __MINGW32_VERSION WSACleanup(); #endif exit(i); }
vuln
Vulnerable
Unknown
ip_init(argc, argv, self) int argc; VALUE *argv; VALUE self; { struct tcltkip *ptr; /* tcltkip data struct */ VALUE argv0, opts; int cnt; int st; int with_tk = 1; Tk_Window mainWin = (Tk_Window)NULL; /* create object */ TypedData_Get_Struct(self, struct tcltkip, &tc...
vuln
Vulnerable
Unknown
public static void extractZip(File zipFile, File destDir) throws IOException { byte[] buffer = new byte[1024]; if (!destDir.exists()) destDir.mkdirs(); ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFile)); ZipEntry ze = zis.getNextEntry(); try ...
vuln
Vulnerable
Java
xmlParseReference(xmlParserCtxtPtr ctxt) { xmlEntityPtr ent; xmlChar *val; int was_checked; xmlNodePtr list = NULL; xmlParserErrors ret = XML_ERR_OK; if (RAW != '&') return; /* * Simple case of a CharRef */ if (NXT(1) == '#') { int i = 0; xmlChar out[10]; int hex ...
vuln
Vulnerable
Unknown
MHD_destroy_post_processor (struct MHD_PostProcessor *pp) { enum MHD_Result ret; if (NULL == pp) return MHD_YES; if (PP_ProcessValue == pp->state) { /* key without terminated value left at the end of the buffer; fake receiving a termination character to ensure it is also processed */ ...
vuln
Vulnerable
Unknown
package keeper import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/authz" ) var _ authz.MsgServer = Keeper{} // GrantAuthorization implements the MsgServer.Grant method to create a new grant. func (k Keeper) Grant(goCt...
vuln
Safe
Go
/* * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and...
vuln
Vulnerable
C/C++
""" SVG colors. """ import re COLORS = { 'aliceblue': (240 / 255, 248 / 255, 255 / 255, 1), 'antiquewhite': (250 / 255, 235 / 255, 215 / 255, 1), 'aqua': (0 / 255, 255 / 255, 255 / 255, 1), 'aquamarine': (127 / 255, 255 / 255, 212 / 255, 1), 'azure': (240 / 255, 255 / 255, 255 / 255, 1), 'bei...
vuln
Vulnerable
Python
/* * apply.c * * Copyright (C) Linus Torvalds, 2005 * * This applies patches on top of some (arbitrary) version of the SCM. * */ #include "cache.h" #include "config.h" #include "object-store.h" #include "blob.h" #include "delta.h" #include "diff.h" #include "dir.h" #include "xdiff-interface.h" #include "ll-merg...
vuln
Safe
C/C++
private void updateWelcome() { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); boolean setup_welcome = prefs.getBoolean("setup_welcome", true); ibWelcome.setImageLevel(setup_welcome ? 0 /* less */ : 1 /* more */); grpWelcome.setVisibility(setup_welc...
vuln
Safe
Java
/* * 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
Vulnerable
Java
static float **alloc_audio_arrays(int channels, int frame_size) { float **audio = av_mallocz_array(channels, sizeof(float *)); if (!audio) return NULL; for (int ch = 0; ch < channels; ch++) { audio[ch] = av_mallocz_array(frame_size, sizeof(float)); if (!audio[ch]) { ...
vuln
Vulnerable
C/C++
/* * The contents of this file are subject to the OpenMRS Public License * Version 1.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://license.openmrs.org * * Software distributed under the License is distributed on an "AS IS" *...
vuln
Vulnerable
Java
static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info, int *need_next_header, int *new_frame_start) { GetBitContext bits; AACADTSHeaderInfo hdr; int size; union { uint64_t u64; uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE]; } tmp; tmp.u64 = av_be2ne64(st...
vuln
Safe
C/C++
static int op_open1(OggOpusFile *_of, void *_stream,const OpusFileCallbacks *_cb, const unsigned char *_initial_data,size_t _initial_bytes){ ogg_page og; ogg_page *pog; int seekable; int ret; memset(_of,0,sizeof(*_of)); if(OP_UNLIKELY(_initial_bytes>(size_t)LONG_MAX))return OP_EFAULT; _of->...
vuln
Safe
C/C++
def vault_encrypt(v_plaintexts, mp): aes = do_crypto_setup(mp) return aes.encrypt(vault_encode(v_plaintexts, mp))
vuln
Safe
Python
static struct kvm_vcpu_hv_synic *synic_get(struct kvm *kvm, u32 vpidx) { struct kvm_vcpu *vcpu; struct kvm_vcpu_hv_synic *synic; vcpu = get_vcpu_by_vpidx(kvm, vpidx); if (!vcpu) return NULL; synic = to_hv_synic(vcpu); return (synic->active) ? synic : NULL; }
vuln
Vulnerable
C/C++
static void virtio_rnd_deinit(struct vmctx *ctx, struct pci_vdev *dev, char *opts) { struct virtio_rnd *rnd; void *jval; rnd = dev->arg; if (rnd == NULL) { DPRINTF(("%s: rnd is NULL\n", __func__)); return; } pthread_cancel(rnd->rx_tid); pthread_join(rnd->rx_tid, &jval); if (rnd->vbs_k.status == VIRTIO_DE...
vuln
Vulnerable
C/C++
public void update() { if (blocks != null) { for (SBlock block : blocks.values()) block.update(); } }
vuln
Safe
Java
int evutil_parse_sockaddr_port(const char *ip_as_string, struct sockaddr *out, int *outlen) { int port; char buf[128]; const char *cp, *addr_part, *port_part; int is_ipv6; /* recognized formats are: * [ipv6]:port * ipv6 * [ipv6] * ipv4:port * ipv4 */ cp = strchr(ip_as_string, ':'); if (*ip_as_string...
vuln
Safe
C/C++
static void rv40_h_weak_loop_filter(uint8_t *src, const int stride, const int filter_p1, const int filter_q1, const int alpha, const int beta, const int lim_p0q0, const int lim_q1, ...
vuln
Vulnerable
C/C++
@Override public ItemModule[] getMinorModules(ItemStack itemStack) { ItemModule[] modules = new ItemModule[minorModuleKeys.length]; CompoundNBT stackTag = NBTHelper.getTag(itemStack); for (int i = 0; i < minorModuleKeys.length; i++) { String moduleName = stackTag.getString(minor...
vuln
Vulnerable
Java
parse (IOBUF inp, PACKET * pkt, int onlykeypkts, off_t * retpos, int *skip, IOBUF out, int do_skip #ifdef DEBUG_PARSE_PACKET , const char *dbg_w, const char *dbg_f, int dbg_l #endif ) { int rc = 0, c, ctb, pkttype, lenbytes; unsigned long pktlen; byte hdr[8]; int hdrlen; int new_ctb = 0, ...
vuln
Vulnerable
Unknown
/* nbdkit * Copyright (C) 2013-2019 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the f...
vuln
Safe
C/C++
static int nbd_send_negotiate(NBDClient *client) { int csock = client->sock; char buf[8 + 8 + 8 + 128]; int rc; const int myflags = (NBD_FLAG_HAS_FLAGS | NBD_FLAG_SEND_TRIM | NBD_FLAG_SEND_FLUSH | NBD_FLAG_SEND_FUA); socket_set_block(csock); rc = -EINVAL; TRACE(...
vuln
Safe
C/C++
@Override public boolean update(){ if(super.update()){ //Make sure player is still valid and haven't left the server. if(player != null && player.isValid()){ //Set our position to the player's position. We may update this later if we have a gun. position.setTo(player.getPosition()); motion.setTo(p...
vuln
Vulnerable
Java
/* NetHack 3.6 topten.c $NHDT-Date: 1450451497 2015/12/18 15:11:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.44 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ #inclu...
vuln
Vulnerable
C/C++
public Result createApplication(String appName) { if (isClusterMode()) { //If there is a record in database, just delete it in order to start from scratch IClusterNotifier clusterNotifier = getApplication().getClusterNotifier(); long deletedRecordCount = clusterNotifier.getClusterStore().deleteAppSettings...
vuln
Vulnerable
Java
static void jsiSqlFunc(sqlite3_context *context, int argc, sqlite3_value**argv) { SqlFunc *p = (SqlFunc*)sqlite3_user_data(context); int i; int rc; Jsi_Interp *interp = p->interp; Jsi_Value *vpargs, *itemsStatic[100], **items = itemsStatic, *ret; if (argc>100) items = (Jsi_Value**)Jsi_Ca...
vuln
Safe
C/C++
@Nullable SearchOwner getSearchOwner();
vuln
Safe
Java
private boolean isBluetoothOn() { try { BluetoothAdapter bluetoothAdapter = getBluetoothAdapter(); if (bluetoothAdapter != null) { return (bluetoothAdapter.getState() == BluetoothAdapter.STATE_ON); } LogManager.w(TAG, "Cannot get bluetooth adapter"...
vuln
Safe
Java
@Override public void step(boolean directionDown, boolean skipSubChannel) { synchronized (mLock) { checkNotClosedLocked(); if (!checkConfiguredLocked()) return; nativeStep(mNativeContext, directionDown, skipSubChannel); } }
vuln
Vulnerable
Java
valid_length(uint8_t option, int dl, int *type) { const struct dhcp_opt *opt; ssize_t sz; if (dl == 0) return -1; for (opt = dhcp_opts; opt->option; opt++) { if (opt->option != option) continue; if (type) *type = opt->type; /* The size of RFC3442 and RFC5969 options is checked at a later * stage...
vuln
Safe
C/C++
int tls1_process_ticket(SSL *s, unsigned char *session_id, int len, const unsigned char *limit, SSL_SESSION **ret) { /* Point after session ID in client hello */ const unsigned char *p = session_id + len; unsigned short i; *ret = NULL; s->tlsext_ticket_expected = 0; /* ...
vuln
Safe
C/C++
ex_finally(exarg_T *eap) { int idx; int skip = FALSE; int pending = CSTP_NONE; cstack_T *cstack = eap->cstack; if (cmdmod_error(FALSE)) return; if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0) eap->errmsg = _(e_finally_without_try); else { if (!(cstack->cs_flags[cstack->cs_idx...
vuln
Vulnerable
Unknown
package com.salesmanager.shop.admin.controller.customers; import com.fasterxml.jackson.databind.ObjectMapper; import com.salesmanager.core.business.services.customer.attribute.CustomerOptionService; import com.salesmanager.core.business.services.customer.attribute.CustomerOptionSetService; import com.salesmanager.core...
vuln
Safe
Java
@Override public void rememberDevice( @NonNull Action onSuccess, @NonNull Consumer<AuthException> onException ) { awsMobileClient.getDeviceOperations().updateStatus(true, new Callback<Void>() { @Override public void onResult(Void result) { ...
vuln
Safe
Java
xmlXPathCompOpEvalPositionalPredicate(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op, xmlNodeSetPtr set, int contextSize, int minPos, int maxPos, int hasNsNodes) { if (op->ch1 != -1) { xmlXPathCompExprPtr comp = ctxt->comp; if (comp->steps[op->ch1]....
vuln
Vulnerable
C/C++
def listUsernames(pageId: PageId, prefix: St): Action[U] = GetActionRateLimited( RateLimits.ReadsFromDb, MinAuthnStrength.EmbeddingStorageSid12) { request =>
vuln
Safe
Scala
command_process_create_cell(cell_t *cell, or_connection_t *conn) { or_circuit_t *circ; int id_is_high; if (we_are_hibernating()) { log_info(LD_OR, "Received create cell but we're shutting down. Sending back " "destroy."); connection_or_send_destroy(cell->circ_id, conn, ...
vuln
Vulnerable
C/C++
private static SSLContext createEasySSLContext() { try { SSLContext context = SSLContext.getInstance("TLS"); context.init(null, new TrustManager[] { new DefaultX509TrustManager(null) }, null); return context; } catch (Exception e) { logger.error(e.getMess...
vuln
Vulnerable
Java
static int send_reply(struct svcxprt_rdma *rdma, struct svc_rqst *rqstp, struct page *page, struct rpcrdma_msg *rdma_resp, struct svc_rdma_req_map *vec, int byte_count, u32 inv_rkey) { struct svc_rdma_op_ctxt *ctxt; struct ib_send_wr send_wr; u32 xdr_off; int sge_no...
vuln
Vulnerable
C/C++
static int decode_dc_progressive(MJpegDecodeContext *s, int16_t *block, int component, int dc_index, int16_t *quant_matrix, int Al) { int val; s->bdsp.clear_block(block); val = mjpeg_decode_dc(s, dc_index); if (val == 0xfffff) { a...
vuln
Vulnerable
C/C++
public void addBox(ProjectInfo info, Identifiable<?> parent, Project.Part.Box box, boolean isUserInput) { if(isUserInput && !getCanEdit()) { WindowPopup.popup(workspace, 0.4D, 140, w -> {}, I18n.format("system.notEditor", Minecraft.getInstance().getSession().getUsername())); ...
vuln
Safe
Java
int mutt_from_base64 (char *out, const char *in, size_t olen) { int len = 0; register unsigned char digit1, digit2, digit3, digit4; do { digit1 = in[0]; if (digit1 > 127 || base64val (digit1) == BAD) return -1; digit2 = in[1]; if (digit2 > 127 || base64val (digit2) == BAD) return -1...
vuln
Safe
C/C++
rsvg_state_clone (RsvgState * dst, const RsvgState * src) { gint i; RsvgState *parent = dst->parent; rsvg_state_finalize (dst); *dst = *src; dst->parent = parent; dst->font_family = g_strdup (src->font_family); dst->lang = g_strdup (src->lang); rsvg_paint_server_ref (dst->fill); rs...
vuln
Vulnerable
Unknown
function buildContentTypeParser (c) { const contentTypeParser = new ContentTypeParser() contentTypeParser[kDefaultJsonParse] = c[kDefaultJsonParse] Object.assign(contentTypeParser.customParsers, c.customParsers) contentTypeParser.parserList = c.parserList.slice() return contentTypeParser }
vuln
Vulnerable
JavaScript
static int avcodec_find_best_pix_fmt1(int64_t pix_fmt_mask, int src_pix_fmt, int has_alpha, int loss_mask) { int dist, i, loss, min_dist, dst_pix_fmt; dst_pix_fmt = -1; min_dist = 0x7ffffff...
vuln
Vulnerable
C/C++
/* * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at * http://www.eclipse.org/legal/epl-2.0. * * This Source Code may also be made available...
vuln
Safe
Java
tChecksumCheckResult ParaNdis_CheckRxChecksum( PARANDIS_ADAPTER *pContext, ULONG virtioFlags, tCompletePhysicalAddress *pPacketPages, ULONG ulPa...
vuln
Vulnerable
Unknown
PageInfoUI::IdentityInfo::IdentityInfo() : identity_status(PageInfo::SITE_IDENTITY_STATUS_UNKNOWN), connection_status(PageInfo::SITE_CONNECTION_STATUS_UNKNOWN), show_ssl_decision_revoke_button(false), show_change_password_buttons(false) {}
vuln
Safe
C/C++
boolean computeDynamicParameters( GrayF32 disparity ) { // Find the min and max values for scaling the baseline float dispMax = 0; for (int y = 0; y < disparity.height; y++) { int index = disparity.startIndex + y*disparity.stride; for (int x = 0; x < disparity.width; x++) { float d = disparity.data[inde...
vuln
Safe
Java
define([ '../res/widgetTemplate.html', './Rule', './ConditionManager', './TestDataManager', './WidgetDnD', './eventHelpers', 'objectUtils', 'lodash', 'zepto', '@braintree/sanitize-url' ], function ( widgetTemplate, Rule, ConditionManager, TestDataMa...
vuln
Safe
JavaScript
function wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) { global $wp_embed; $embed = $wp_embed->autoembed( sprintf( "https://youtube.com/watch?v=%s", urlencode( $matches[2] ) ) ); /** * Filters the YoutTube embed output. * * @since 4.0.0 * * @see wp_embed_handler_youtube() * * @param stri...
vuln
Safe
PHP
sldns_bget_token_par(sldns_buffer *b, char *token, const char *delim, size_t limit, int* par, const char* skipw) { int c, lc; int p; /* 0 -> no parentheses seen, >0 nr of ( seen */ int com, quoted; char *t; size_t i; const char *d; const char *del; /* standard delimiters */ if (!delim) { /* from isspace(3)...
vuln
Vulnerable
Unknown
def requires_access(permissions: Sequence[tuple[str, str]] | None = None) -> Callable[[T], T]: """Factory for decorator that checks current user's permissions against required permissions.""" appbuilder = get_airflow_app().appbuilder if appbuilder.update_perms: appbuilder.sm.sync_resource_permission...
vuln
Safe
Python
public static <T> InternalFuture<List<T>> sequence( final List<InternalFuture<T>> futures, Executor executor) { if (futures.isEmpty()) { return InternalFuture.completedInternalFuture(new LinkedList<>()); } final var promise = new CompletableFuture<List<T>>(); final var values = new ArrayLis...
vuln
Vulnerable
Java
int basic_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC) { zval **login, **password; if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_login", sizeof("_login"), (void **)&login) == SUCCESS && Z_TYPE_PP(login) == IS_STRING && !zend_hash_exists(Z_OBJPROP_P(this_ptr), "_digest", sizeof("_digest")...
vuln
Safe
Unknown
QPDF::calculateLinearizationData(std::map<int, int> const& object_stream_data) { // This function calculates the ordering of objects, divides them // into the appropriate parts, and computes some values for the // linearization parameter dictionary and hint tables. The file // must be optimized (via ca...
vuln
Safe
Unknown
function setStageHeadline(title) { if (getUtility().isUndefinedOrNull(title)) { title = buildTitleByFormElement(); } $(getHelper().getDomElementDataIdentifierSelector('stageHeadline')).html(title); };
vuln
Vulnerable
JavaScript
def save(self): # copy the user's input from plain text to description to be processed # uses bleach to remove potentially harmful HTML code self.description = bleach.clean(str(self.description_plain_text), tags=CE.settings.bleach_allowed, ...
vuln
Safe
Python
@EventHandler(ignoreCancelled = true) public void onPlayerTeleport(PlayerTeleportEvent event) { // Don't stop admins/ops. towny.admin.spawn is part of towny.admin. if (event.getPlayer().hasPermission("towny.admin.spawn") || event.getPlayer().isOp()) return; if (SiegeWarSettings.getWarSiegeEnabled() &...
vuln
Safe
Java
static int parse_token(char **name, char **value, char **cp) { char *end; if (!name || !value || !cp) return -BLKID_ERR_PARAM; if (!(*value = strchr(*cp, '='))) return 0; **value = '\0'; *name = strip_line(*cp); *value = skip_over_blank(*value + 1); if (**value == '"') { end = strchr(*value + 1, '"'); ...
vuln
Vulnerable
Unknown
static int ep_insert(struct eventpoll *ep, struct epoll_event *event, struct file *tfile, int fd) { int error, revents, pwake = 0; unsigned long flags; long user_watches; struct epitem *epi; struct ep_pqueue epq; user_watches = atomic_long_read(&ep->user->epoll_watches); if (unlikely(user_watches >= max_...
vuln
Vulnerable
Unknown
const exec = require('./exec'); const listProcessesOnPort = module.exports.listProcessesOnPort = async port => { try { const result = (await exec(`lsof -i :${port}`)).output.split('\n'); const headers = result.shift().split(' ').filter(item => !!item.trim() && item.trim() !== "").map(item => item.toLowerCase()); ...
vuln
Vulnerable
JavaScript
static void ok_png_decode2(ok_png_decoder *decoder) { ok_png *png = decoder->png; uint8_t png_header[8]; if (!ok_read(decoder, png_header, sizeof(png_header))) { return; } uint8_t png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10}; if (memcmp(png_header, png_signature, 8) != 0) { ...
vuln
Vulnerable
Unknown
std::set<std::string> GetDistinctHosts(const URLPatternSet& host_patterns, bool include_rcd, bool exclude_file_scheme) { typedef base::StringPairs HostVector; HostVector hosts_best_rcd; for (const URLPattern& pattern : host_patterns) { ...
vuln
Safe
C/C++
def _rule_args_to_dict(self, context, to_port=None, from_port=None, parent_group_id=None, ip_protocol=None, cidr=None, group_id=None): values = {} if group_id is not None: try: parent_group_id = int(parent_g...
vuln
Safe
Python
def main() -> None: try: run(sys.argv) except KeyboardInterrupt: pass except (OSError, TooManyNodesError, TypeError, ValueError) as e: print(f"Error: {e}", file=sys.stderr) # noqa: T201 sys.exit(1)
vuln
Safe
Python
@EventHandler private void onTick(TickEvent.Pre event) { // Finding target pos if (target == null) { if (mc.crosshairTarget.getType() != HitResult.Type.BLOCK) return; BlockPos pos = ((BlockHitResult) mc.crosshairTarget).getBlockPos().up(); BlockState state = mc.w...
vuln
Vulnerable
Java
exif_data_load_data_thumbnail (ExifData *data, const unsigned char *d, unsigned int ds, ExifLong o, ExifLong s) { /* Sanity checks */ if (o >= ds) { exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "Bogus thumbnail offset (%u).", o); return; } if (CHECKOVERFLOW(o,ds,s)) { exif_log (data->...
vuln
Safe
C/C++
huff_get_next_word(Jbig2HuffmanState *hs, int offset) huff_get_next_word(Jbig2HuffmanState *hs, uint32_t offset) { uint32_t word = 0; Jbig2WordStream *ws = hs->ws; if ((ws->get_next_word(ws, offset, &word)) && ((hs->offset_limit == 0) || (offset < hs->offset_limit))) hs->offset_limit = offset; ...
vuln
Safe
C/C++
void MakeDataset(OpKernelContext* ctx, DatasetBase** output) override { // Create a new SparseTensorSliceDatasetOp::Dataset, insert it in // the step container, and return it as the output. const Tensor* indices; OP_REQUIRES_OK(ctx, ctx->input("indices", &indices)); const Tensor* values; OP_REQU...
vuln
Vulnerable
C/C++
static void RENAME(mix6to2)(SAMPLE **out, const SAMPLE **in, COEFF *coeffp, integer len){ int i; for(i=0; i<len; i++) { INTER t = in[2][i]*coeffp[0*6+2] + in[3][i]*coeffp[0*6+3]; out[0][i] = R(t + in[0][i]*(INTER)coeffp[0*6+0] + in[4][i]*(INTER)coeffp[0*6+4]); out[1][i] = R(t + in[1][i]*...
vuln
Vulnerable
C/C++
function f(ja,U){U.innerHTML="";ja=new Date(ja.modifiedDate);var J=b.timeSince(ja);null==J&&(J=mxResources.get("lessThanAMinute")); mxUtils.write(U,mxResources.get("timeAgo",[J],"{1} ago"));U.setAttribute("title",ja.toLocaleDateString()+" "+ja.toLocaleTimeString())}
vuln
Vulnerable
JavaScript
void Jsi_ValueArrayShift(Jsi_Interp *interp, Jsi_Value *v) { if (v->vt != JSI_VT_OBJECT) { Jsi_LogBug("Jsi_ValueArrayShift, target is not object"); return; } Jsi_Obj *o = v->d.obj; if (o->isarrlist) { uint i; if (!o->arrCnt) return; if (o->arr[0]) ...
vuln
Safe
C/C++
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2019 * All rights reserved * * This file is part of GPAC / ISO Media File Format sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU L...
vuln
Safe
C/C++
POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc); CPUClass *cc = CPU_CLASS(oc); dc->fw_name = "PowerPC,POWER9"; dc->desc = "POWER9"; dc->props = powerpc_servercpu_properties; pcc->pvr_match = ppc_pvr_match_...
vuln
Vulnerable
C/C++
tt_cmap14_validate( FT_Byte* table, FT_Validator valid ) { FT_Byte* p; FT_ULong length; FT_ULong num_selectors; if ( table + 2 + 4 + 4 > valid->limit ) FT_INVALID_TOO_SHORT; p = table + 2; length = TT_NEXT_ULONG( p ); num_selectors...
vuln
Safe
Unknown
static int a64_write_packet(struct AVFormatContext *s, AVPacket *pkt) { AVCodecContext *avctx = s->streams[0]->codec; A64MuxerContext *c = s->priv_data; int i, j; int ch_chunksize; int lifetime; int frame_count; int charset_size; int frame_size; int num_frames; switch (avctx...
vuln
Safe
C/C++
static int vorbis_encode_frame(AVCodecContext *avccontext, unsigned char *packets, int buf_size, void *data) { vorbis_enc_context *venc = avccontext->priv_data; const signed short *audio = data; int samples = data ? avccontext->frame_size : 0; ...
vuln
Vulnerable
C/C++
package getter import "net/url" // RedactURL is a port of url.Redacted from the standard library, // which is like url.String but replaces any password with "xxxxx". // Only the password in u.URL is redacted. This allows the library // to maintain compatibility with go1.14. func RedactURL(u *url.URL) string { if u =...
vuln
Vulnerable
Go
typeof fa.getAttribute&&null!=fa.getAttribute("title")&&sa.push({img:fa.getAttribute("img"),libs:fa.getAttribute("libs"),clibs:fa.getAttribute("clibs"),title:fa.getAttribute("title")}),fa=fa.nextSibling;F(sa)}});var ra=function(fa,ca,ba){la.style.display="";Ea.stop();W=!1;if(V)V=!1;else if(ca)aa.innerHTML=ca;else{ba=ba...
vuln
Safe
JavaScript
@Override protected Void doInBackground(Void... params) { /* Download file. */ ReleaseDetails releaseDetails = mDownloader.getReleaseDetails(); Uri downloadUrl = releaseDetails.getDownloadUrl(); AppCenterLog.debug(LOG_TAG, "Start downloading new release from " + downloadUrl); ...
vuln
Safe
Java
private LocalVariableEntry getParameterEntry(MethodPrototype method, int parameterIndex, String name) { MethodEntry owner = getMethodEntry(method); // params may be not computed if cfr creates a lambda expression fallback, e.g. in PointOfInterestSet if (owner == null || !method.parametersCompute...
vuln
Safe
Java
int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size) { const CodecMime *mime = ff_id3v2_mime_tags; enum AVCodecID id = AV_CODEC_ID_NONE; AVBufferRef *data = NULL; uint8_t mimetype[64], *desc = NULL; AVIOContext *pb = NULL; AVStream *st; int type, width, height; int l...
vuln
Vulnerable
C/C++
"none"};var Fa=function(){pa.innerHTML="";if(null!=F.currentPage){mxUtils.write(pa,F.currentPage.getName());var aa=null!=F.pages?F.pages.length:1,ca=F.getPageIndex(F.currentPage);ca=null!=ca?ca+1:1;var na=F.currentPage.getId();pa.setAttribute("title",F.currentPage.getName()+" ("+ca+"/"+aa+")"+(null!=na?" ["+na+"]":""))...
vuln
Vulnerable
JavaScript