code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
Bool GPAC_EventProc(void *ptr, GF_Event *evt) { if (!term) return 0; if (gui_mode==1) { if (evt->type==GF_EVENT_QUIT) { Run = 0; } else if (evt->type==GF_EVENT_KEYDOWN) { switch (evt->key.key_code) { case GF_KEY_C: if (evt->key.flags & (GF_KEY_MOD_CTRL|GF_KEY_MOD_ALT)) { hide_shell(shell_visibl...
vuln
Safe
C/C++
path_equal (const char *a, const char *b, gboolean relax) { gboolean res; size_t a_len, b_len; if (relax == FALSE) return str_equal (a, b, FALSE); if (a == NULL || b == NULL) return a == b; a_len = strlen (a); b_len = strlen (b); while (a_len > 0 && a[a_len - 1] == '/') a_len--; while...
vuln
Safe
Unknown
apprentice_load(struct magic_set *ms, const char *fn, int action) { int errs = 0; uint32_t i, j; size_t files = 0, maxfiles = 0; char **filearr = NULL; struct stat st; struct magic_map *map; struct magic_entry_set mset[MAGIC_SETS]; php_stream *dir; php_stream_dirent d; TSRMLS_FETCH(); memset(mset, 0, size...
vuln
Safe
C/C++
def _checknetloc(netloc): if not netloc or netloc.isascii(): return # looking for characters like \u2100 that expand to 'a/c' # IDNA uses NFKC equivalence, so normalize for this check import unicodedata n = netloc.replace('@', '') # ignore characters already included n = n.replace(':',...
vuln
Safe
Python
static void rtl_p2p_action_ie(struct ieee80211_hw *hw, void *data, unsigned int len) { struct rtl_priv *rtlpriv = rtl_priv(hw); struct ieee80211_mgmt *mgmt = data; struct rtl_p2p_ps_info *p2pinfo = &(rtlpriv->psc.p2p_ps_info); u8 noa_num, index , i , noa_index = 0; u8 *pos, *end, *ie; u16 noa_len; stati...
vuln
Safe
Unknown
static ssize_t proc_pid_cmdline_read(struct file *file, char __user *buf, size_t _count, loff_t *pos) { struct task_struct *tsk; struct mm_struct *mm; char *page; unsigned long count = _count; unsigned long arg_start, arg_end, env_start, env_end; unsigned long len1, len2, len; unsigned long p; char c; ...
vuln
Safe
Unknown
bool Cluster::EOS() const pEntry = NULL; if (index < 0) return -1; // generic error if (m_entries_count < 0) return E_BUFFER_NOT_FULL; assert(m_entries); assert(m_entries_size > 0); assert(m_entries_count <= m_entries_size); if (index < m_entries_count) { pEntry = m_entries[index]; as...
vuln
Safe
C/C++
public void updateTraitsList() { EntityType<?> value = ForgeRegistries.ENTITIES.getValue(new ResourceLocation(selectedMobData.forEntity)); String key = value != null ? value.getTranslationKey() : "morph.morph.type.unknown"; ((ElementTextWrapper)getById("textMorphId")).setTex...
vuln
Safe
Java
# coding:utf-8 """ Django settings for MrDoc project. Generated by 'django-admin startproject' using Django 2.1.3. For more information on this file, see https://docs.djangoproject.com/en/2.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.1/ref/settings/ """ ...
vuln
Vulnerable
Python
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * th...
vuln
Safe
Java
static int nlmsg_populate_mdb_fill(struct sk_buff *skb, struct net_device *dev, struct br_mdb_entry *entry, u32 pid, u32 seq, int type, unsigned int flags) { struct nlmsghdr *nlh; struct br_port_msg *bpm; struct nlattr *nest, *nest2; nlh = nlmsg_put(skb, pid, seq, type, sizeof(*bpm), NLM_F_MUL...
vuln
Safe
Unknown
function ToolbarLink(props) { return <a className={classnames('maputnik-toolbar-link', props.className)} href={props.href} target={"blank"} > {props.children} </a> }
vuln
Vulnerable
JavaScript
static inline bool rom_order_compare(Rom *rom, Rom *item) { return (rom->as > item->as) || (rom->as == item->as && rom->addr >= item->addr); }
vuln
Vulnerable
C/C++
public static HashMap<String, String> toMap(JsonElement element) { HashMap<String, String> map = new HashMap<>(); JsonObject object = safeObject(element); if (object == null) return map; for (String key : object.keySet()) map.put(key, safeString(object, key)); return map; }
vuln
Safe
Java
i915_gem_execbuffer2_ioctl(struct drm_device *dev, void *data, struct drm_file *file) { struct drm_i915_gem_execbuffer2 *args = data; struct drm_i915_gem_exec_object2 *exec2_list; struct drm_syncobj **fences = NULL; const size_t count = args->buffer_count; int err; if (!check_buffer_count(count)) { DRM_D...
vuln
Vulnerable
Unknown
static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int nb_components, int predictor, int point_transform) { int i, mb_x, mb_y; int bits= (s->bits+7)&~7; int resync_mb_y = 0; int resync_mb_x = 0; point_transform += bits - s->bits; av_assert0(nb_components>=1 ...
vuln
Safe
C/C++
public static Collection<File> createDirList(File rootDir, boolean includeSubdirs) throws IOException { ArrayList<File> listOfDirs = new ArrayList<File>(); File[] allDirFiles = rootDir.listFiles(); if (allDirFiles == null) throw new FileNotFoundException("invalid directory specified"); for (int i ...
vuln
Vulnerable
Java
static ssize_t virtio_net_receive_rcu(NetClientState *nc, const uint8_t *buf, size_t size, bool no_rss) { VirtIONet *n = qemu_get_nic_opaque(nc); VirtIONetQueue *q = virtio_net_get_subqueue(nc); VirtIODevice *vdev = VIRTIO_DEVICE(n); VirtQueueElement *elems[VIRTQUEU...
vuln
Safe
Unknown
static int smsusb_init_device(struct usb_interface *intf, int board_id) { struct smsdevice_params_t params; struct smsusb_device_t *dev; void *mdev; int i, rc; int in_maxp; /* create device object */ dev = kzalloc(sizeof(struct smsusb_device_t), GFP_KERNEL); if (!dev) return -ENOMEM; memset(&params, 0, siz...
vuln
Safe
C/C++
av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], int fullRange, int brightness, int contrast, int saturation) { const int isRgb = c->dstFormat == AV_PIX_FMT_RGB32 || c->dstFormat == AV_PIX_...
vuln
Safe
C/C++
static int fill_dir_block(ext2_filsys fs, blk64_t *block_nr, e2_blkcnt_t blockcnt, blk64_t ref_block EXT2FS_ATTR((unused)), int ref_offset EXT2FS_ATTR((unused)), void *priv_data) { struct fill_dir_struct *fd = (struct fill_dir_struct *) priv_data; struct hash_entry *new_array, *ent; struct ...
vuln
Vulnerable
Unknown
libxlDomainCleanup(libxlDriverPrivate *driver, virDomainObj *vm) { libxlDomainObjPrivate *priv = vm->privateData; g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver); int vnc_port; char *file; virHostdevManager *hostdev_mgr = driver->hostdevMgr; unsigned int hostde...
vuln
Safe
Unknown
fn parse_quoted_text(input: &str) -> Result<Cow<'_, str>, ParseErrorKind> { Ok(match input.as_bytes()[0] { b'"' => { let mut s = strip_first_last(input); let mut buf = String::new(); loop { let mut chars = s.chars(); match chars.next() { ...
vuln
Vulnerable
Rust
def readObject(stream, pdf): tok = stream.read(1) stream.seek(-1, 1) # reset to start idx = ObjectPrefix.find(tok) if idx == 0: # name object return NameObject.readFromStream(stream, pdf) elif idx == 1: # hexadecimal string OR dictionary peek = stream.read(2) ...
vuln
Safe
Python
static int _dns_encode_HTTPS(struct dns_context *context, struct dns_rrs *rrs) { int ret = 0; int qtype = 0; int qclass = 0; char domain[DNS_MAX_CNAME_LEN]; char target[DNS_MAX_CNAME_LEN] = {0}; unsigned char *rr_len_ptr = NULL; unsigned char *start = NULL; unsigned char *rr_start = NULL; int ttl = 0; int pri...
vuln
Safe
C/C++
$pos = strpos($line, $match); if ($pos !== false) { $var = getvarname(strtok($field, '#')); if ($var != '[]') { ${'r' . $var} = $block; } } } } return $r; }
vuln
Safe
PHP
function insertAdult(firstName, lastName, username, password, packNumber, leaderType, rankType, phoneNumber, connection) { var temp= selectAdult(username, connection); if(temp.databaseObject.adult_id<1) { return temp; } var strQuery = "INSERT INTO adult VALUES('"+ connection.escape(firstName) ...
vuln
Safe
JavaScript
Status BuildXlaCompilationCache(DeviceBase* device, FunctionLibraryRuntime* flr, const XlaPlatformInfo& platform_info, XlaCompilationCache** cache) { if (platform_info.xla_device_metadata()) { *cache = new XlaCompilationCache( platform_info.x...
vuln
Vulnerable
C/C++
/** * <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
config_monitor( config_tree *ptree ) { int_node *pfilegen_token; const char *filegen_string; const char *filegen_file; FILEGEN *filegen; filegen_node *my_node; attr_val *my_opts; int filegen_type; int filegen_flag; /* Set the statistics directory */ if (ptree->stats_dir) stats_config(STATS_STATSDIR, ptre...
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; /* * Figure out the actual inb/inw/inl/etc routine to use based * upon the register size. */ switch (io->regsize) { case 1: io->inputb = port_inb; io->outputb = port_ou...
vuln
Safe
C/C++
package org.jboss.resteasy.reactive.server.vertx; import io.netty.buffer.Unpooled; import io.netty.channel.EventLoop; import io.netty.handler.codec.http.HttpHeaderNames; import io.netty.util.concurrent.ScheduledFuture; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; import io.vertx.core.Vertx; import i...
vuln
Vulnerable
Java
y,mxUtils.bind(this,function(){var C=null;if(!n){C=parseInt(H.value);var I=parseInt(U.value);C=J.checked||C==G&&I==G?null:{from:Math.max(0,Math.min(F-1,C-1)),to:Math.max(0,Math.min(F-1,I-1))}}d.downloadFile("pdf",null,null,!Q.checked,n?!0:!J.checked&&null==C,!W.checked,null!=X&&X.checked,null,null,V.checked,null!=p&&p....
vuln
Vulnerable
JavaScript
static struct ion_handle *ion_handle_get_by_id(struct ion_client *client, int id) { struct ion_handle *handle; mutex_lock(&client->lock); handle = idr_find(&client->idr, id); if (handle) ion_handle_get(handle); mutex_unlock(&client->lock); return handle ? handle : ERR_PTR(-EINVAL); }
vuln
Vulnerable
C/C++
private void setDefaultTokenInternal(Context context, int displayId) { final WindowManagerImpl wm = (WindowManagerImpl) context.getSystemService(WINDOW_SERVICE); final IAccessibilityServiceConnection connection = AccessibilityInteractionClient.getInstance(this).getConnection(mConnectionI...
vuln
Vulnerable
Java
static int rose_parse_national(unsigned char *p, struct rose_facilities_struct *facilities, int len) { unsigned char *pt; unsigned char l, lg, n = 0; int fac_national_digis_received = 0; do { switch (*p & 0xC0) { case 0x00: if (len < 2) return -1; p += 2; n += 2; len -= 2; break; case...
vuln
Safe
Unknown
void TopSitesImpl::SetTopSites(const MostVisitedURLList& new_top_sites, const CallLocation location) { DCHECK(thread_checker_.CalledOnValidThread()); MostVisitedURLList top_sites(new_top_sites); size_t num_forced_urls = MergeCachedForcedURLs(&top_sites); AddPrepopulatedPages(&top...
vuln
Vulnerable
Unknown
static int qtrle_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; QtrleContext *s = avctx->priv_data; int header, start_line; int stream_ptr, he...
vuln
Vulnerable
C/C++
import loadScript from "discourse/lib/load-script"; import { apiInitializer } from "discourse/lib/api"; import discourseDebounce from "discourse-common/lib/debounce"; async function applyMermaid(element, key = "composer") { const mermaids = element.querySelectorAll("pre[data-code-wrap=mermaid]"); if (!mermaids.le...
vuln
Safe
JavaScript
void ManifestManager::FetchManifest() { manifest_url_ = render_frame()->GetWebFrame()->GetDocument().ManifestURL(); if (manifest_url_.is_empty()) { ManifestUmaUtil::FetchFailed(ManifestUmaUtil::FETCH_EMPTY_URL); ResolveCallbacks(ResolveStateFailure); return; } fetcher_.reset(new ManifestFetcher...
vuln
Vulnerable
C/C++
function template(state, options) { function tpl(expression, ...args) { let last; tpl.lines.push( expression .replace(/%i/g, () => 'i') .replace(/\$(\d)/g, (match, index) => `${sanitizeString(args[index - 1])}`) .replace(/(%[sd])/g, () => { if (args.length) { ...
vuln
Safe
JavaScript
'use strict'; const packageInfo = require('../../package.json'); const EventEmitter = require('events').EventEmitter; const net = require('net'); const tls = require('tls'); const os = require('os'); const crypto = require('crypto'); const DataStream = require('./data-stream'); const PassThrough = require('stream').Pa...
vuln
Vulnerable
Java
Status SpaceToBatchOpCompute(OpKernelContext* context, const Tensor& orig_input_tensor, const Tensor& orig_block_shape, const Tensor& orig_paddings) { const int input_dims = orig_input_tensor.dims(); if (!TensorShapeUtils::IsVect...
vuln
Vulnerable
C/C++
radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) { struct mm_struct *mm = current->mm; struct vm_area_struct *vma; struct hstate *h = hstate_file(file); struct vm_unmapped_area_info info; if (unlikely(addr > mm->context.ad...
vuln
Vulnerable
Unknown
function checkContainer() { var element = containers.pop(); debug( "Creating an instance: checkContainer", element && element.Names[0], technicalName ); if (element) { var splittedName = element.Names[0].split("/"); if (instancesArray.indexOf(splittedName[1]) === -1) { ...
vuln
Vulnerable
JavaScript
pa.innerHTML="...";pa.style.fontSize="32px";ma.appendChild(pa);pa=document.createElement("div");pa.className="geTempDlgNewDiagramCatItemLbl";pa.innerHTML=ra;ma.appendChild(pa);Ca.appendChild(ma);mxEvent.addListener(ma,"click",function(){function Ka(){var Ra=Ia.querySelector(".geTemplateDrawioCatLink");null!=Ra?Ra.click...
vuln
Safe
JavaScript
void show_ip(struct pt_regs *regs, const char *loglvl) { #ifdef CONFIG_X86_32 printk("%sEIP: %pS\n", loglvl, (void *)regs->ip); #else printk("%sRIP: %04x:%pS\n", loglvl, (int)regs->cs, (void *)regs->ip); #endif show_opcodes(regs, loglvl); }
vuln
Safe
Unknown
// Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: AuthorizeEndpointHandler) // Package internal is a generated GoMock package. package internal import ( context "context" reflect "reflect" gomock "github.com/golang/mock/gomock" fosite "github.com/ory/fosite" ) // MockAuth...
vuln
Safe
Go
/* 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 di...
vuln
Vulnerable
Go
sds _sdsnewlen(const void *init, size_t initlen, int trymalloc) { void *sh; sds s; char type = sdsReqType(initlen); /* Empty strings are usually created in order to append. Use type 8 * since type 5 is not good at this. */ if (type == SDS_TYPE_5 && initlen == 0) type = SDS_TYPE_8; int hdrle...
vuln
Vulnerable
Unknown
/** * OLAT - Online Learning and Training<br> * http://www.olat.org * <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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unl...
vuln
Vulnerable
Java
@OnlyIn(Dist.CLIENT) public EntityModel getModel() { return (EntityModel) this.model; }
vuln
Safe
Java
/* * Copyright (c) Facebook, Inc. and its affiliates. * * 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 applic...
vuln
Safe
C/C++
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
Vulnerable
C/C++
@SuppressLint("UnspecifiedImmutableFlag") public void init(ReactApplicationContext reactContext, Callback successCallback, Callback errorCallback) { this.mContext = reactContext; this.mUSBManager = (UsbManager) this.mContext.getSystemService(Context.USB_SERVICE); this.mPermissionIndent = Pen...
vuln
Vulnerable
Java
rb_dlhandle_initialize(int argc, VALUE argv[], VALUE self) { void *ptr; struct dl_handle *dlhandle; VALUE lib, flag; char *clib; int cflag; const char *err; switch( rb_scan_args(argc, argv, "02", &lib, &flag) ){ case 0: clib = NULL; cflag = RTLD_LAZY | RTLD_GLOBAL; break; case 1: c...
vuln
Vulnerable
Unknown
void fp_prime_set_pmers(const int *f, int len) { bn_t p, t; bn_null(p); bn_null(t); RLC_TRY { bn_new(p); bn_new(t); if (len >= RLC_TERMS) { RLC_THROW(ERR_NO_VALID); return; } bn_set_2b(p, f[len - 1]); for (int i = len - 2; i > 0; i--) { if (f[i] > 0) { bn_set_2b(t, f[i]); bn_add(p, ...
vuln
Vulnerable
C/C++
/* * Copyright (c) 1992, 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 this ...
vuln
Safe
C/C++
MediaStreamDispatcherHost::~MediaStreamDispatcherHost() { DCHECK_CURRENTLY_ON(BrowserThread::IO); bindings_.CloseAllBindings(); CancelAllRequests(); }
vuln
Vulnerable
C/C++
__ext4_xattr_check_block(struct inode *inode, struct buffer_head *bh, const char *function, unsigned int line) { int error = -EFSCORRUPTED; if (buffer_verified(bh)) return 0; if (BHDR(bh)->h_magic != cpu_to_le32(EXT4_XATTR_MAGIC) || BHDR(bh)->h_blocks != cpu_to_le32(1)) goto errout; error = -EFSBADCR...
vuln
Vulnerable
C/C++
gdm_user_render_icon (GdmUser *user, gint icon_size) { GdkPixbuf *pixbuf; GdkPixbuf *framed; char *path; char *tmp; gboolean res; g_return_val_if_fail (GDM_IS_USER (user), NULL); g_return_val_if_fail (icon_...
vuln
Safe
Unknown
private function __findObjectByUuid($object_uuid, &$type) { $this->loadModel('Event'); $object = $this->Event->find('first', array( 'conditions' => array( 'Event.uuid' => $object_uuid, ), 'fields' => array('Event.orgc_id', 'Event.id'), ...
vuln
Vulnerable
PHP
static struct bpf_verifier_state *push_stack(struct bpf_verifier_env *env, int insn_idx, int prev_insn_idx, bool speculative) { struct bpf_verifier_state *cur = env->cur_state; struct bpf_verifier_stack_elem *elem; int err; elem = kzalloc(sizeof(struct bpf_verifier_stack_elem), GFP_KERNEL); if...
vuln
Safe
Unknown
static int avi_sync(AVFormatContext *s, int exit_early) { AVIContext *avi = s->priv_data; AVIOContext *pb = s->pb; int n; unsigned int d[8]; unsigned int size; int64_t i, sync; start_sync: memset(d, -1, sizeof(d)); for(i=sync=avio_tell(pb); !url_feof(pb); i++) { int j; fo...
vuln
Safe
C/C++
int nfc_start_poll(struct nfc_dev *dev, u32 im_protocols, u32 tm_protocols) { int rc; pr_debug("dev_name %s initiator protocols 0x%x target protocols 0x%x\n", dev_name(&dev->dev), im_protocols, tm_protocols); if (!im_protocols && !tm_protocols) return -EINVAL; device_lock(&dev->dev); if (!device_is_regist...
vuln
Vulnerable
Unknown
int ReadExecConfig() { int i = 0, j = 0, dup_entry = 0; FILE *fp; FILE *process_file; char buffer[OS_MAXSTR + 1]; /* Clean up */ for (i = 0; i <= exec_size + 1; i++) { memset(exec_names[i], '\0', OS_FLSIZE + 1); memset(exec_cmd[i], '\0', OS_FLSIZE + 1); exec_timeout[i] =...
vuln
Safe
C/C++
/* * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song <songweijia@gmail.com> * Copyright (C) 2007, Sebastian Pipping <sebastian@pipping.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the...
vuln
Vulnerable
C/C++
str2special( char_u **sp, int from) // TRUE for lhs of mapping { int c; static char_u buf[7]; char_u *str = *sp; int modifiers = 0; int special = FALSE; if (has_mbyte) { char_u *p; // Try to un-escape a multi-byte character. Return the un-escaped // string if it is a mu...
vuln
Safe
C/C++
private List<Object[]> getUserListCore(String searchTerm, String sortKey, Integer resultLimit, Integer offset) { if (StringUtils.isNotBlank(sortKey) && acceptableSortKeys.contains(sor...
vuln
Safe
Java
@GET @Path(BUCKET_PARAM) public Response getBucket(@HeaderParam("Authorization") final String authorization, @PathParam("bucket") final String bucket, @QueryParam("marker") final String markerParam, @QueryParam("prefix") final Strin...
vuln
Safe
Java
/* Copyright 2017 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
C/C++
public NavigationBarTransitions getBarTransitions() { return mNavigationBarView.getBarTransitions(); }
vuln
Vulnerable
Java
addMessage(msg, increment, isHistoryAdd) { // correct the time msg.time += this._pad.clientTimeOffset; // create the time string let minutes = `${new Date(msg.time).getMinutes()}`; let hours = `${new Date(msg.time).getHours()}`; if (minutes.length === 1) minutes = `0${minutes}`; ...
vuln
Vulnerable
JavaScript
/*! 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.core.service.general; import cn.devezhao.commons.Calen...
vuln
Vulnerable
Java
/* Copyright 2018-2020 Accenture Technology 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 la...
vuln
Safe
Java
void send(List<SendItem> itemsToSend) throws IOException { byte[] datagramData = new byte[maxPacketSize]; ByteBuffer buffer = ByteBuffer.wrap(datagramData); itemsToSend.stream() .map(item -> item.getPacket()) .forEach(packet -> { Keys keys = co...
vuln
Vulnerable
Java
@expose('/variables/<form>', methods=["GET", "POST"]) @login_required @wwwutils.action_logging def variables(self, form): try: if request.method == 'POST': data = request.json if data: session = settings.Session() va...
vuln
Safe
Python
def get_requested_day(self, date): data = dict() day_start, day_end = self.get_epoch_day(date) data['interval'] = {'from': self.convert_local_ts_to_utc(day_start, self.local_timezone), 'to': self.convert_local_ts_to_utc(day_end, self.local_timezone)} query = ''' SELECT Tim...
vuln
Safe
Python
private static String substituteTokens(String pattern, Map<String, Object> tokens, boolean external) { Map<String, Object> tokensCopy = external ? tokens : new HashMap<>(tokens); if (tokensCopy.containsKey(ORGANISATION_KEY) && !tokensCopy.containsKey(ORGANISATION_KEY2)) { tokensCopy.put(ORGA...
vuln
Vulnerable
Java
file_softmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes, int mode, int text) { struct mlist *ml; int rv; for (ml = ms->mlist[0]->next; ml != ms->mlist[0]; ml = ml->next) if ((rv = match(ms, ml->magic, ml->nmagic, buf, nbytes, 0, mode, text, 0, 0, NULL)) != 0) return rv; return 0...
vuln
Safe
Unknown
static int decode_tsw1(GetByteContext *gb, uint8_t *frame, int width, int height) { const uint8_t *frame_start = frame; const uint8_t *frame_end = frame + width * height; int mask = 0x10000, bitbuf = 0; int v, count; unsigned segments; unsigned offset; segments = bytestream2_get_le32(gb); ...
vuln
Safe
C/C++
public List<Worker> findAvailableAgentByAccessNode(UserDetail userDetail, List<String> processIdList) { // 引擎定时任务是5秒 Query query = Query.query(Criteria.where("worker_type").is("connector") .and("ping_time").gte(System.currentTimeMillis() - 1000 * 5 * 2) .and("isDeleted")....
vuln
Vulnerable
Java
function escapeArgPowerShell(arg, interpolation, quoted) { let result = arg .replace(/\u0000/g, "") .replace(/`/g, "``") .replace(/\$/g, "`$"); if (interpolation) { result = result .replace(/\n|\r/g, " ") .replace(/(^|\s|\u0085)((?:\*|[1-6])?)(>)/g, "$1$2`$3") .replace(/(^|\s|\u00...
vuln
Vulnerable
JavaScript
do_replace(struct net *net, const void __user *user, unsigned int len) { int ret; struct ipt_replace tmp; struct xt_table_info *newinfo; void *loc_cpu_entry; struct ipt_entry *iter; if (copy_from_user(&tmp, user, sizeof(tmp)) != 0) return -EFAULT; /* overflow check */ if (tmp.num_counters >= INT_MAX / sizeo...
vuln
Vulnerable
Unknown
PHP_HASH_API void PHP_HAVAL160Final(unsigned char *digest, PHP_HAVAL_CTX * context) { unsigned char bits[10]; unsigned int index, padLen; /* Version, Passes, and Digest Length */ bits[0] = (PHP_HASH_HAVAL_VERSION & 0x07) | ((context->passes & 0x07) << 3) | ((context->output & 0x03) << 6); bits[1] = (conte...
vuln
Safe
Unknown
void zunionInterGenericCommand(client *c, robj *dstkey, int op) { int i, j; long setnum; int aggregate = REDIS_AGGR_SUM; zsetopsrc *src; zsetopval zval; sds tmp; size_t maxelelen = 0; robj *dstobj; zset *dstzset; zskiplistNode *znode; int touched = 0; /* expect setnum in...
vuln
Vulnerable
Unknown
static int omap_gpio_init(SysBusDevice *sbd) { DeviceState *dev = DEVICE(sbd); struct omap_gpif_s *s = OMAP1_GPIO(dev); if (!s->clk) { error_report("omap-gpio: clk not connected"); return -1; } qdev_init_gpio_in(dev, omap_gpio_set, 16); qdev_init_gpio_out(dev, s->omap1.handler, 1...
vuln
Safe
C/C++
def _from_data(self, data: InteractionPayload): self.id: int = int(data["id"]) self.type: InteractionType = try_enum(InteractionType, data["type"]) self.data: Optional[InteractionData] = data.get("data") self.token: str = data["token"] self.version: int = data["version"] ...
vuln
Safe
Python
@POST @ManagedAsync @ApiOperation( value = "Create a new document", notes = "Auto-generates an ID for the newly created document", code = 201) @ApiResponses( value = { @ApiResponse( code = 201, message = "Created", responseHeaders = @ResponseHead...
vuln
Vulnerable
Java
@Override public void binderDied(IBinder who) { Slog.e(TAG, "Callback binder died: " + who); final Iterator<ClientCallback> iterator = mClientCallbacks.iterator(); while (iterator.hasNext()) { final ClientCallback callback = iterator.next(); if (callback.mCallback.asB...
vuln
Safe
Java
struct sk_buff *skb_segment(struct sk_buff *head_skb, netdev_features_t features) { struct sk_buff *segs = NULL; struct sk_buff *tail = NULL; struct sk_buff *list_skb = skb_shinfo(head_skb)->frag_list; skb_frag_t *frag = skb_shinfo(head_skb)->frags; unsigned int mss = skb_shinfo(head_skb)->gso_size; uns...
vuln
Safe
C/C++
static void store_slice_mmx(uint8_t *dst, const uint16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale, const uint8_t dither[8][8]) { int y; for (y = 0; y < height; y++) { uint8_t *dst1 = ds...
vuln
Vulnerable
C/C++
static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb, struct sk_buff_head *xmitq) { struct tipc_msg *hdr = buf_msg(skb); struct tipc_gap_ack_blks *ga = NULL; bool reply = msg_probe(hdr), retransmitted = false; u16 dlen = msg_data_sz(hdr), glen = 0; u16 peers_snd_nxt = msg_next_sent(hd...
vuln
Vulnerable
Unknown
@Override public void freeStorage(final String volumeUuid, final long freeStorageSize, final @StorageManager.AllocateFlags int flags, final IntentSender pi) { mContext.enforceCallingOrSelfPermission( android.Manifest.permission.CLEAR_APP_CACHE, TAG); m...
vuln
Safe
Java
def git_hook(strict=False, modify=False): """ Git pre-commit hook to check staged files for isort errors :param bool strict - if True, return number of errors on exit, causing the hook to fail. If False, return zero so it will just act as a warning. :param bool modify - if True, fix the...
vuln
Safe
Python
def get_output(command: str) -> bytes: """ Run a command and return raw output :param str command: the command to run :returns: the stdout output of the command """ return subprocess.check_output(command.split())
vuln
Vulnerable
Python
function serializeAndUploadFiles(s, obj, files) { for(var i = 0; i < files.length; i++) { if(!isFileTypeAllowed(obj, s, files[i].name)) { if(s.showError) $("<div class='" + s.errorClass + "'><b>" + files[i].name + "</b> " + s.extErrorStr + s.allowedTypes + "</div>").appen...
vuln
Vulnerable
JavaScript
public KeyNamePair[] getClients(String app_user, String app_pwd, String roleTypes) { if (log.isLoggable(Level.INFO)) log.info("User=" + app_user); if (Util.isEmpty(app_user)) { log.warning("No Apps User"); return null; } // Authentication boolean authenticated = false; MSystem system = MSystem.get...
vuln
Safe
Java
void CConfig::Write(CFile& File, unsigned int iIndentation) { CString sIndentation = CString(iIndentation, '\t'); auto SingleLine = [](const CString& s) { return s.Replace_n("\r", "").Replace_n("\n", ""); }; for (const auto& it : m_ConfigEntries) { for (const CString& sValue : it.secon...
vuln
Safe
C/C++
@Inject(method = "renderStatusEffectOverlay", at = @At("HEAD")) private void preRenderStatusEffectOverlay(final MatrixStack matrices, final CallbackInfo ci) { if (!VSOptions.INSTANCE.getRenderDebugText()) { return; } RenderSystem.pushMatrix(); final TextRenderer fontRen...
vuln
Vulnerable
Java