code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
@Override protected void onSlideChanged(@Nullable Fragment oldFragment, @Nullable Fragment newFragment) { super.onSlideChanged(oldFragment, newFragment); if (null == newFragment || null == newFragment.getTag() || null == newFragment.getView()) { return; } if (newFragment....
vuln
Vulnerable
Java
static int ioctl_send_fib(struct aac_dev * dev, void __user *arg) { struct hw_fib * kfib; struct fib *fibptr; struct hw_fib * hw_fib = (struct hw_fib *)0; dma_addr_t hw_fib_pa = (dma_addr_t)0LL; unsigned size; int retval; if (dev->in_reset) { return -EBUSY; } fibptr = aac_fib_alloc(dev); if(fibptr == NULL)...
vuln
Vulnerable
Unknown
static void migration_bitmap_sync(void) { RAMBlock *block; uint64_t num_dirty_pages_init = migration_dirty_pages; MigrationState *s = migrate_get_current(); int64_t end_time; int64_t bytes_xfer_now; bitmap_sync_count++; if (!bytes_xfer_prev) { bytes_xfer_prev = ram_bytes_transferred(...
vuln
Vulnerable
C/C++
static int rtp_write_header(AVFormatContext *s1) { RTPMuxContext *s = s1->priv_data; int max_packet_size, n; AVStream *st; if (s1->nb_streams != 1) return -1; st = s1->streams[0]; if (!is_supported(st->codec->codec_id)) { av_log(s1, AV_LOG_ERROR, "Unsupported codec %x\n", st->cod...
vuln
Vulnerable
C/C++
static int cx24116_send_diseqc_msg(struct dvb_frontend *fe, struct dvb_diseqc_master_cmd *d) { struct cx24116_state *state = fe->demodulator_priv; int i, ret; /* Validate length */ if (d->msg_len > sizeof(d->msg)) return -EINVAL; /* Dump DiSEqC message */ if (debug) { printk(KERN_INFO "...
vuln
Safe
C/C++
state_separate_contexts (position_set const *s) { int separate_contexts = 0; size_t j; for (j = 0; j < s->nelem; ++j) { if (PREV_NEWLINE_DEPENDENT (s->elems[j].constraint)) separate_contexts |= CTX_NEWLINE; if (PREV_LETTER_DEPENDENT (s->elems[j].constraint)) separate_contexts |= C...
vuln
Safe
Unknown
int rose_parse_facilities(unsigned char *p, struct rose_facilities_struct *facilities) { int facilities_len, len; facilities_len = *p++; if (facilities_len == 0) return 0; while (facilities_len > 0) { if (*p == 0x00) { facilities_len--; p++; switch (*p) { case FAC_NATIONAL: /* National */ ...
vuln
Vulnerable
C/C++
PassRefPtr<RTCSessionDescription> RTCPeerConnection::localDescription(ExceptionCode& ec) { if (m_readyState == ReadyStateClosing || m_readyState == ReadyStateClosed) { ec = INVALID_STATE_ERR; return 0; } RefPtr<RTCSessionDescriptionDescriptor> descriptor = m_peerHandler->localDescription(); ...
vuln
Vulnerable
C/C++
@web.authenticated def get(self, value): if not self.is_admin(): raise web.HTTPError(404) self.set_header('Content-Type', 'text/html') self.write("<pre>") try: server_log_path = os.path.join(options.contest_dir, "server_log.txt") with open(server_l...
vuln
Safe
Python
def is_submitted(self): """ Consider the form submitted if there is an active request and the method is ``POST``, ``PUT``, ``PATCH``, or ``DELETE``. """ return cherrypy.request.method in SUBMIT_METHODS
vuln
Vulnerable
Python
void LEX::start(THD *thd_arg) { DBUG_ENTER("LEX::start"); DBUG_PRINT("info", ("This: %p thd_arg->lex: %p", this, thd_arg->lex)); thd= unit.thd= thd_arg; stmt_lex= this; // default, should be rewritten for VIEWs And CTEs DBUG_ASSERT(!explain); builtin_select.lex_start(this); lex_options= 0; context_st...
vuln
Vulnerable
Unknown
/* * Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * * 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 co...
vuln
Vulnerable
C/C++
public static boolean attackEntity(IModifiableWeapon weapon, IModifierToolStack tool, LivingEntity attackerLiving, Hand hand, Entity targetEntity, boolean applyCoolDown, boolean isExtraAttack) { // TODO: general modifiable // broken? give to vanilla if (tool.isBroken()) ...
vuln
Safe
Java
int compile_lhs( char_u *var_start, lhs_T *lhs, cmdidx_T cmdidx, int heredoc, int has_cmd, // "var" before "var_start" int oplen, cctx_T *cctx) { char_u *var_end; int is_decl = is_decl_command(cmdidx); CLEAR_POINTER(lhs); lhs->lhs_dest = dest_local; lhs->lhs_v...
vuln
Vulnerable
C/C++
async def release(self): await self.transaction.connection.execute( f"RELEASE SAVEPOINT {self.name}" )
vuln
Vulnerable
Python
@Override public void run() { eliteEntity.getLivingEntity().setVelocity(new Vector(0, 1.5, 0)); cloudParticle(eliteEntity.getLivingEntity().getLocation()); }
vuln
Vulnerable
Java
static void get_sensor_evt_enable(IPMIBmcSim *ibs, uint8_t *cmd, unsigned int cmd_len, uint8_t *rsp, unsigned int *rsp_len, unsigned int max_rsp_len) { IPMISensor *sens; IPMI_CHECK_CMD_LEN(3); if ((cmd[2] >...
vuln
Vulnerable
C/C++
static int idprime_get_token_name(sc_card_t* card, char** tname) { idprime_private_data_t * priv = card->drv_data; sc_path_t tinfo_path = {"\x00\x00", 2, 0, 0, SC_PATH_TYPE_PATH, {"", 0}}; sc_file_t *file = NULL; u8 buf[2]; char *name; int r; LOG_FUNC_CALLED(card->ctx); if (tname == NULL) { LOG_FUNC_RETURN(...
vuln
Safe
C/C++
/* * FreeRTOS Kernel V10.4.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * 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, includ...
vuln
Vulnerable
C/C++
success: function (message) { input.replaceWith('<span data-tag-id="' + id + '">' + input.val().replace(/\//g, '&#x2F;') + '</span>'); $('span[data-tag-id="' + id + '"]'); $('#saving_data_indicator').html(message); }
vuln
Safe
JavaScript
public void setCdDtlExp(String[] cdDtlExp) { this.cdDtlExp = cdDtlExp != null ? cdDtlExp.clone() : null; }
vuln
Safe
Java
opj_pi_iterator_t *opj_pi_create_decode(opj_image_t *p_image, opj_cp_t *p_cp, OPJ_UINT32 p_tile_no) { /* loop */ OPJ_UINT32 pino; OPJ_UINT32 compno, resno; /* to store w, h, dx and dy fro all components and resolutions */ OPJ_UINT32 * l_tmp_data; OPJ_UINT32 ** l_tmp_ptr; /* encoding pramete...
vuln
Safe
C/C++
static void handle_windowevent(SDL_Event *ev) { struct sdl2_console *scon = get_scon_from_window(ev->window.windowID); switch (ev->window.event) { case SDL_WINDOWEVENT_RESIZED: { QemuUIInfo info; memset(&info, 0, sizeof(info)); info.width = ev->window.data1; ...
vuln
Vulnerable
C/C++
public void execute(String username, boolean async) { try { if (username.isEmpty()) { return; } Runnable fetchNames = () -> { name = username; uuid = null; try { uuid = MojangAPI.getUUID(user...
vuln
Safe
Java
static void add_errors_by_sqlerrcode(JsonbParseState *parse_state) { int res; StringInfo command; MemoryContext old_context = CurrentMemoryContext, spi_context; const char *command_string = "SELECT " "job_type, jsonb_object_agg(sqlerrcode, count) " "FROM" "(" " SELECT (" " CASE " " WHEN error_data...
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
Safe
Python
/* vi:set et sw=2 sts=2 cin cino=t0,f0,(0,{s,>2s,n-s,^-s,e-s: * Copyright © 2017 Red Hat, Inc * * This program 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 the License, ...
vuln
Safe
C/C++
static inline int16_t mipsdsp_sat_add_i16(int16_t a, int16_t b, CPUMIPSState *env) { int16_t tempS; tempS = a + b; if (MIPSDSP_OVERFLOW_ADD(a, b, tempS, 0x8000)) { if (a > 0) { tempS = 0x7FFF; } else { tempS = 0x8000; ...
vuln
Safe
C/C++
concat_opt_exact_str(OptStr* to, UChar* s, UChar* end, OnigEncoding enc) { int i, j, len; UChar *p; for (i = to->len, p = s; p < end && i < OPT_EXACT_MAXLEN; ) { len = enclen(enc, p); if (i + len >= OPT_EXACT_MAXLEN) break; for (j = 0; j < len && p < end; j++) to->s[i++] = *p++; } to->len ...
vuln
Safe
C/C++
public Boolean allowTopicPolicyOperation(TopicName topicName, PolicyName policy, PolicyOperation operation, String originalRole, String role...
vuln
Safe
Java
void ff_snow_pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride, int sx, int sy, int b_w, int b_h, BlockNode *block, int plane_index, int w, int h){ if(block->type & BLOCK_INTRA){ int x, y; const unsigned color = block->color[plane_index]; const unsigned color4 = color*0x0101...
vuln
Vulnerable
C/C++
/* * Copyright (C) 1995 Linus Torvalds * * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999 * * Memory region support * David Parsons <orc@pell.chi.il.us>, July-August 1999 * * Added E820 sanitization routine (removes overlapping memory regions); * Brian Moyle <bmoyle@mvista.com>, Februa...
vuln
Vulnerable
C/C++
static void qemu_laio_process_completion(struct qemu_laio_state *s, struct qemu_laiocb *laiocb) { int ret; s->count--; ret = laiocb->ret; if (ret != -ECANCELED) { if (ret == laiocb->nbytes) ret = 0; else if (ret >= 0) ret = -EINVAL; laiocb->common.cb(l...
vuln
Vulnerable
C/C++
void aio_set_fd_handler(AioContext *ctx, int fd, bool is_external, IOHandler *io_read, IOHandler *io_write, AioPollFn *io_poll, void *opaque) { AioHandler *node; bool i...
vuln
Vulnerable
C/C++
static int vqa_decode_init(AVCodecContext *avctx) { VqaContext *s = (VqaContext *)avctx->priv_data; unsigned char *vqa_header; int i, j, codebook_index;; s->avctx = avctx; avctx->pix_fmt = PIX_FMT_PAL8; avctx->has_b_frames = 0; dsputil_init(&s->dsp, avctx); if (s->avctx->extradata_s...
vuln
Safe
C/C++
static int fuse_rename2(struct inode *olddir, struct dentry *oldent, struct inode *newdir, struct dentry *newent, unsigned int flags) { struct fuse_conn *fc = get_fuse_conn(olddir); int err; if (flags & ~(RENAME_NOREPLACE | RENAME_EXCHANGE | RENAME_WHITEOUT)) return -EINVAL; if (flags) { if (fc->no_rena...
vuln
Vulnerable
Unknown
function c(B,G,M,H,F,J,R,W,O){try{if(b.spinner.stop(),null==G||"image/"==G.substring(0,6))if(null==B&&null!=R||null==z[B]){var V=function(){P.innerHTML="";P.style.cursor="pointer";P.style.whiteSpace="nowrap";P.style.textOverflow="ellipsis";mxUtils.write(P,null!=T.title&&0<T.title.length?T.title:mxResources.get("untitle...
vuln
Vulnerable
JavaScript
static int net_slirp_init(NetClientState *peer, const char *model, const char *name, int restricted, bool ipv4, const char *vnetwork, const char *vhost, bool ipv6, const char *vprefix6, int vprefix6_len, const char *...
vuln
Safe
C/C++
void DownloadManagerImpl::CreateNewDownloadItemToStart( std::unique_ptr<download::DownloadCreateInfo> info, const download::DownloadUrlParameters::OnStartedCallback& on_started, download::InProgressDownloadManager::StartDownloadItemCallback callback, uint32_t id) { DCHECK_CURRENTLY_ON(BrowserThread::U...
vuln
Vulnerable
C/C++
static void neon_store_scratch(int scratch, TCGv var) { tcg_gen_st_i32(var, cpu_env, offsetof(CPUARMState, vfp.scratch[scratch])); tcg_temp_free_i32(var); }
vuln
Safe
C/C++
FUNC_DECODER(dissector_postgresql) { DECLARE_DISP_PTR(ptr); struct ec_session *s = NULL; void *ident = NULL; char tmp[MAX_ASCII_ADDR_LEN]; struct postgresql_status *conn_status; /* don't complain about unused var */ (void) DECODE_DATA; (void) DECODE_DATALEN; (void) DECODED_LEN; if (F...
vuln
Vulnerable
C/C++
#include "source/extensions/transport_sockets/tls/cert_validator/default_validator.h" #include <array> #include <deque> #include <functional> #include <string> #include <vector> #include "envoy/network/transport_socket.h" #include "envoy/ssl/context.h" #include "envoy/ssl/context_config.h" #include "envoy/ssl/private...
vuln
Safe
C/C++
public static String getFilePath(Context context, Uri uri) { final String[] projection = { MediaStore.MediaColumns.DISPLAY_NAME }; try (Cursor cursor = context.getContentResolver().query(uri, projection, null, null, null)) { if (cursor != null && curs...
vuln
Safe
Java
void ssl3_cbc_digest_record( const EVP_MD *digest, unsigned char* md_out, size_t* md_out_size, const unsigned char header[13], const unsigned char *data, size_t data_plus_mac_size, size_t data_plus_mac_plus_padding_size, const unsigned char *mac_secret, unsigned mac_secret_length, char is_sslv3) { union { d...
vuln
Vulnerable
Unknown
static int svq1_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; SVQ1Context *s = avctx->priv_data; AVFrame *cur = data; uint8_t *current; int result, i, x...
vuln
Safe
C/C++
xps_true_callback_glyph_name(gs_font *pfont, gs_glyph glyph, gs_const_string *pstr) { /* This function is copied verbatim from plfont.c */ int table_length; int table_offset; ulong format; uint numGlyphs; uint glyph_name_index; const byte *postp; /* post table pointer */ /* gue...
vuln
Vulnerable
Unknown
package config import ( "fmt" "reflect" "github.com/libp2p/go-libp2p-core/connmgr" "github.com/libp2p/go-libp2p-core/crypto" "github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/peerstore" "github.com/libp...
vuln
Safe
Go
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
vuln
Vulnerable
Python
static MagickBooleanType ProcessMSLScript(const ImageInfo *image_info, Image **image,ExceptionInfo *exception) { char message[MagickPathExtent]; Image *msl_image; int status; ssize_t n; MSLInfo msl_info; xmlSAXHandler sax_modules; xmlSAXHandlerPtr sax_handler; /* ...
vuln
Vulnerable
C/C++
public String[] getWatcherUserId() { return watcherUserId; }
vuln
Vulnerable
Java
@Override public MineralMix readFromJson(ResourceLocation recipeId, JsonObject json, IContext context) { JsonArray array = json.getAsJsonArray("ores"); List<StackWithChance> temp = new ArrayList<>(); float totalChance = 0; for(int i = 0; i < array.size(); i++) { JsonObject element = array.get(i).getAsJso...
vuln
Vulnerable
Java
int usb_get_bos_descriptor(struct usb_device *dev) { struct device *ddev = &dev->dev; struct usb_bos_descriptor *bos; struct usb_dev_cap_header *cap; unsigned char *buffer; int length, total_len, num, i; int ret; bos = kzalloc(sizeof(struct usb_bos_descriptor), GFP_KERNEL); if (!bos) return -ENOMEM; /* Get...
vuln
Safe
C/C++
public static final String getPrettyHexDumpSlice(final IoBuffer buf, final int offset, final int length) { if (buf == null) { throw new IllegalArgumentException(); } if (length < 0 || offset < 0 || offset + length > buf.limit()) { throw new IndexOutOfBoundsException(); ...
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
Safe
C/C++
crypto_recv( struct peer *peer, /* peer structure pointer */ struct recvbuf *rbufp /* packet buffer pointer */ ) { const EVP_MD *dp; /* message digest algorithm */ u_int32 *pkt; /* receive packet pointer */ struct autokey *ap, *bp; /* autokey pointer */ struct exten *ep, *fp; /* extension pointers */ struct ce...
vuln
Vulnerable
C/C++
/* * Copyright (C) 2009 Voice Sistem SRL * Copyright (C) 2009 Andrei Dragus * * This file is part of opensips, a free SIP server. * * opensips 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 ver...
vuln
Vulnerable
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
public String findValue(List<String> list) { Element nextElement = ownerDoc.getDocumentElement(); boolean nextElementFound; for (int k=0; k<list.size(); k++) { nextElementFound = false; String nextElementName = list.get(k); if (!nextElementName.contains("~")){...
vuln
Vulnerable
Java
public void run() { LOG.debug("Starting to get data"); try { final ObjectInputStream ois = new ObjectInputStream(mClient.getInputStream()); while (true) { final LoggingEvent event = (LoggingEvent) ois.readObject(); ...
vuln
Vulnerable
Java
static void flush_dpb(AVCodecContext *avctx){ H264Context *h= avctx->priv_data; int i; for(i=0; i<16; i++) h->delayed_pic[i]= NULL; h->delayed_output_pic= NULL; idr(h); h->s.current_picture_ptr->reference= 0; }
vuln
Safe
C/C++
static void add_pixels_clamped2_c(const DCTELEM *block, uint8_t *restrict pixels, int line_size) { int i; for(i=0;i<2;i++) { pixels[0] = av_clip_uint8(pixels[0] + block[0]); pixels[1] = av_clip_uint8(pixels[1] + block[1]); pixels += line_size; block...
vuln
Safe
C/C++
from django.apps import AppConfig class AnymailBaseConfig(AppConfig): name = 'anymail' verbose_name = "Anymail" def ready(self): pass
vuln
Vulnerable
Python
static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t buflen) { struct page *pages[NFS4ACL_MAXPAGES] = {NULL, }; struct nfs_getaclargs args = { .fh = NFS_FH(inode), .acl_pages = pages, .acl_len = buflen, }; struct nfs_getaclres res = { .acl_len = buflen, }; struct rpc_message msg =...
vuln
Safe
C/C++
public void onSetMobileIcon(int viewIndex, MobileIconState state) { StatusBarMobileView sbView; View view = mGroup.getChildAt(viewIndex); sbView = null; if (view instanceof StatusBarMobileView) { sbView = (StatusBarMobileView) view; } ...
vuln
Vulnerable
Java
// Copyright 2008-present Contributors to the OpenImageIO project. // SPDX-License-Identifier: BSD-3-Clause // https://github.com/OpenImageIO/oiio #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #define AVOID_WIN32_FILEIO #include <tiffio.h> #include <zlib.h> #include <OpenImageIO/dassert...
vuln
Safe
C/C++
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
vuln
Safe
Java
static void extrapolate_isf(float isf[LP_ORDER_16k]) { float diff_isf[LP_ORDER - 2], diff_mean; float corr_lag[3]; float est, scale; int i, j, i_max_corr; isf[LP_ORDER_16k - 1] = isf[LP_ORDER - 1]; for (i = 0; i < LP_ORDER - 2; i++) diff_isf[i] = isf[i + 1] - isf[i]; diff_mean =...
vuln
Safe
C/C++
@Procedure @Description("apoc.load.csv('url',{config}) YIELD lineNo, list, map - load CSV from URL as stream of values,\n config contains any of: {skip:1,limit:5,header:false,sep:'TAB',ignore:['tmp'],nullValues:['na'],arraySep:';',mapping:{years:{type:'int',arraySep:'-',array:false,name:'age',ignore:false}}") p...
vuln
Safe
Java
private ByteBuffer encodeIntervals() { int encodedDataLimit = (maxDataSize * 3) / 4; // encoded data is in base64, growing by 4/3 in size int totalSequenceBufferSize = 0; long[] threadIds = shuffleArray(threadSequences.keySetLong()); for (LongSequence sequence : threadSequences.values()) { ...
vuln
Safe
Java
char* parseValue( char* ptr, FileNode& node ) { if (!ptr) CV_PARSE_ERROR_CPP("Invalid value input"); ptr = skipSpaces( ptr ); if( !ptr || !*ptr ) CV_PARSE_ERROR_CPP( "Unexpected End-Of-File" ); if( *ptr == '"' ) { /* must be string or Base64 string...
vuln
Vulnerable
Unknown
Object *object_dynamic_cast_assert(Object *obj, const char *typename) { Object *inst; inst = object_dynamic_cast(obj, typename); if (!inst) { fprintf(stderr, "Object %p is not an instance of type %s\n", obj, typename); abort(); } return inst; }
vuln
Vulnerable
C/C++
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { static const int kOutputUniqueTensor = 0; static const int kOutputIndexTensor = 1; TF_LITE_ENSURE_EQ(context, NumInputs(node), 1); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 2); const TfLiteTensor* input; TF_LITE_ENSURE_OK(context, GetInput...
vuln
Safe
C/C++
private Pair<Boolean, List<String>> killYarnJob(@NonNull Host host, String logPath, String executePath, String tenantCode) { if (logPath == null || executeP...
vuln
Safe
Java
// // PDF token parsing functions for PDFio. // // Copyright © 2021 by Michael R Sweet. // // Licensed under Apache License v2.0. See the file "LICENSE" for more // information. // // // Include necessary headers... // #include "pdfio-private.h" // // This file parses PDF language syntax: // // << dict >> ...
vuln
Vulnerable
C/C++
@Override public void onStop() { super.onStop(); handler.removeCallbacks(refresher); refresher = null; }
vuln
Safe
Java
# Natural Language Toolkit: Transformation-based learning # # Copyright (C) 2001-2013 NLTK Project # Author: Marcus Uneson <marcus.uneson@gmail.com> # based on previous (nltk2) version by # Christopher Maloof, Edward Loper, Steven Bird # URL: <https://www.nltk.org/> # For license information, see LICENSE.TXT impo...
vuln
Safe
Python
int qemu_find_nic_model(NICInfo *nd, const char * const *models, const char *default_model) { int i; if (!nd->model) nd->model = strdup(default_model); for (i = 0 ; models[i]; i++) { if (strcmp(nd->model, models[i]) == 0) return i; } qemu_error("qe...
vuln
Safe
C/C++
private def createSessionId(siteId: SiteId, userId: UserId): SidOk = { // For now, create a SID value and *parse* it to get a SidOk. // This is stupid and inefficient. val now = globals.now() val uid = "" // for now val useridDateRandom = userId +"."+ now.millis +"."+ (nex...
vuln
Vulnerable
Scala
isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup) { char *eaz; int si1; int si2; int ematch; int wret; int swapped; int sidx = 0; u_long flags; isdn_net_dev *p; isdn_net_phone *n; char nr[ISDN_MSNLEN]; char *my_eaz; /* Search name in netdev-chain */ if (!setup->phone[0]) { nr[0] = '0'; ...
vuln
Safe
Unknown
/* Copyright The Helm 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, software distrib...
vuln
Vulnerable
Go
void wb_print(netdissect_options *ndo, register const void *hdr, register u_int len) { register const struct pkt_hdr *ph; ph = (const struct pkt_hdr *)hdr; if (len < sizeof(*ph) || !ND_TTEST(*ph)) { ND_PRINT((ndo, "%s", tstr)); return; } len -= sizeof(*ph); if (ph->ph_flags) ND_PRINT((ndo, "*"));...
vuln
Safe
C/C++
public static float getRenderHeight(Player player) { CarryOnData carry = CarryOnDataManager.getCarryData(player); if(carry.isCarrying(CarryType.BLOCK)) { BlockState state = getRenderState(player); VoxelShape shape = state.getShape(player.level, player.blockPosition()); if(shape == null) return 1f; ...
vuln
Vulnerable
Java
static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid, int bitdepth) { int ret; if (cid != ctx->cid) { const CIDEntry *cid_table = ff_dnxhd_get_cid_table(cid); if (!cid_table) { av_log(ctx->avctx, AV_LOG_ERROR, "unsupported cid %"PRIu32"\n", cid); return AVERROR(ENOS...
vuln
Safe
C/C++
static void pmac_dma_write(BlockBackend *blk, int64_t offset, int bytes, void (*cb)(void *opaque, int ret), void *opaque) { DBDMA_io *io = opaque; MACIOIDEState *m = io->opaque; IDEState *s = idebus_active_if(&m->bus); dma_addr_t dma_addr, dma_len; v...
vuln
Safe
C/C++
void md_mgf(uint8_t *key, size_t key_len, const uint8_t *in, size_t in_len) { uint32_t i, j, d; uint8_t *buffer = RLC_ALLOCA(uint8_t, in_len + sizeof(uint32_t)); uint8_t *t = RLC_ALLOCA(uint8_t, key_len + RLC_MD_LEN); if (buffer == NULL || t == NULL) { RLC_FREE(buffer); RLC_FREE(t); RLC_THROW(ERR_NO_MEMORY);...
vuln
Safe
C/C++
void DestroySkImageOnOriginalThread( sk_sp<SkImage> image, base::WeakPtr<WebGraphicsContext3DProviderWrapper> context_provider_wrapper, std::unique_ptr<gpu::SyncToken> sync_token) { if (context_provider_wrapper && image->isValid( context_provider_wrapper->ContextProvider()->GetGrContext())...
vuln
Vulnerable
C/C++
static int nc_uri(ASN1_IA5STRING *uri, ASN1_IA5STRING *base) { const char *baseptr = (char *)base->data; const char *hostptr = (char *)uri->data; const char *p = strchr(hostptr, ':'); int hostlen; /* Check for foo:// and skip past it */ if (!p || (p[1] != '/') || (p[2] != '/')) return X5...
vuln
Vulnerable
Unknown
// Copyright (c) 2015-2021 MinIO, Inc. // // This file is part of MinIO Object Storage stack // // This program 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 // (...
vuln
Safe
Go
@Redirect( method = "Lnet/minecraft/world/entity/Entity;move(Lnet/minecraft/world/entity/MoverType;Lnet/minecraft/world/phys/Vec3;)V", at = @At( value = "INVOKE", target = "Lnet/minecraft/world/entity/Entity;collide(Lnet/minecraft/world/phys/Vec3;)Lnet/minecraft/world/phys/Vec3;"...
vuln
Safe
Java
isdn_net_setcfg(isdn_net_ioctl_cfg * cfg) { isdn_net_dev *p = isdn_net_findif(cfg->name); ulong features; int i; int drvidx; int chidx; char drvid[25]; if (p) { isdn_net_local *lp = p->local; /* See if any registered driver supports the features we want */ features = ((1 << cfg->l2_proto) << ISDN_FEATURE...
vuln
Vulnerable
Unknown
static int sami_paragraph_to_ass(AVCodecContext *avctx, const char *src) { SAMIContext *sami = avctx->priv_data; int ret = 0; char *tag = NULL; char *dupsrc = av_strdup(src); char *p = dupsrc; AVBPrint *dst_content = &sami->encoded_content; AVBPrint *dst_source = &sami->encoded_source; i...
vuln
Safe
C/C++
module.exports = function gopher_parsedir (dirent) { // eslint-disable-line camelcase // discuss at: https://locutus.io/php/gopher_parsedir/ // original by: Brett Zamir (https://brett-zamir.me) // example 1: var entry = gopher_parsedir('0All about my gopher site.\t/allabout.txt\tgopher.example.com\t70\u000d\u0...
vuln
Safe
JavaScript
int X509_check_trust(X509 *x, int id, int flags) { X509_TRUST *pt; int idx; if(id == -1) return 1; idx = X509_TRUST_get_by_id(id); if(idx == -1) return default_trust(id, x, flags); pt = X509_TRUST_get0(idx); return pt->check_trust(pt, x, flags); }
vuln
Vulnerable
Unknown
# -*- 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
def get_users if params[:action] == 'get_users' Log.add_info(request, params.inspect) end @group_id = params[:id] =begin # @users = Group.get_users(params[:id]) =end # FEATURE_PAGING_IN_TREE >>> con = ['User.id > 0'] unless @group_id.nil? if @group_id == '0' con << "((grou...
vuln
Safe
Ruby
def get_configuration_data(path) return "" if path.nil? # can be removedish... if is_path_url?(path) config_text = read_config_data_from_web(path) if !valid_yaml_string?(config_text) path = get_proper_raw_url_for_github_config_file(path) config_text = read_config...
vuln
Safe
Ruby
/* Copyright 2020 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
void setMinimumSizeTo(Dimension minSize) { performLocked(() -> nativeSetMinimumSize(nativePtr, minSize.width, minSize.height)); }
vuln
Safe
Java
@Override public void process(Session session, ByteBuf data, int offset, int length, boolean isLastPart) { assert isLastPart; // TODO: here we should normalize the URL, remove escapes etc... HttpRequest request = HttpRequest.ensure(session.currentRequest()); if (request == null) { r...
vuln
Safe
Java
@Override public void run() { if (timer > 20 * 7 || !event.getEliteMobEntity().isValid()) { if (event.getEliteMobEntity() != null) event.getEliteMobEntity().getLivingEntity().setAI(true); cancel(); } else if (...
vuln
Safe
Java