code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
/* * . .o8 oooo * .o8 "888 `888 * .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo * 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P' * 888 888 888 888 8...
vuln
Vulnerable
JavaScript
private int mget(struct magic_set *ms, const unsigned char *s, struct magic *m, size_t nbytes, size_t o, unsigned int cont_level, int mode, int text, int flip, int recursion_level, int *printed_something, int *need_separator, int *returnval) { uint32_t soffset, offset = ms->offset; uint32_t count = m->str...
vuln
Vulnerable
Unknown
// Copyright Project Contour 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...
vuln
Vulnerable
Go
char* problem_data_save(problem_data_t *pd) { load_abrt_conf(); struct dump_dir *dd = NULL; if (g_settings_privatereports) dd = create_dump_dir_from_problem_data_ext(pd, g_settings_dump_location, 0); else dd = create_dump_dir_from_problem_data(pd, g_settings_dump_location); c...
vuln
Safe
C/C++
xmlBufferCreateSize(size_t size) { xmlBufferPtr ret; if (size >= UINT_MAX) return(NULL); ret = (xmlBufferPtr) xmlMalloc(sizeof(xmlBuffer)); if (ret == NULL) { xmlTreeErrMemory("creating buffer"); return(NULL); } ret->use = 0; ret->alloc = xmlBufferAllocScheme; ret->size...
vuln
Safe
Unknown
sg_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos) { Sg_device *sdp; Sg_fd *sfp; Sg_request *srp; int req_pack_id = -1; sg_io_hdr_t *hp; struct sg_header *old_hdr = NULL; int retval = 0; if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))) return -ENXIO; SCSI_LOG_T...
vuln
Vulnerable
Unknown
xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem, const xmlChar *name, const xmlChar *value) { xmlChar *ret; xmlAttributePtr attrDecl = NULL; int extsubset = 0; if (doc == NULL) return(NULL); if (elem == NULL) return(NULL); if (name == NULL) return(...
vuln
Safe
Unknown
@Override public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) { //Vampire Finisher skill if(attacker instanceof PlayerEntity&& !Helper.isVampire(target)){ double relTh = VampirismConfig.BALANCE.vsSwordFinisherMaxHealth.get() * VampirePlayer.getOpt((Playe...
vuln
Vulnerable
Java
package com.salesmanager.shop.admin.controller.content; import java.io.ByteArrayInputStream; import java.net.URLConnection; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.htt...
vuln
Safe
Java
void *kqemu_vmalloc(size_t size) { static int phys_ram_fd = -1; static int phys_ram_size = 0; const char *tmpdir; char phys_ram_file[1024]; void *ptr; struct statfs stfs; if (phys_ram_fd < 0) { tmpdir = getenv("QEMU_TMPDIR"); if (!tmpdir) tmpdir = "/dev/shm"; ...
vuln
Vulnerable
C/C++
ResolveStateAndPredicate(ExprDef *expr, enum xkb_match_operation *pred_rtrn, xkb_mod_mask_t *mods_rtrn, CompatInfo *info) { if (expr == NULL) { *pred_rtrn = MATCH_ANY_OR_NONE; *mods_rtrn = MOD_REAL_MASK_ALL; return true; } *pred_rtrn = MATCH_EXACTLY; i...
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
Vulnerable
Python
# -*- 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
#!/usr/bin/env python # -*- coding: utf-8 -*- # # webgateway/views.py - django application view handling functions # # Copyright (c) 2007-2020 Glencoe Software, Inc. All rights reserved. # # This software is distributed under the terms described by the LICENCE file # you can find at the root of the distribution bundle,...
vuln
Safe
Python
private boolean setDataSourceImpl(MediaPlayer player, String path) { MusicPlaybackService musicService = mService.get(); if (musicService != null) { try { player.reset(); player.setOnPreparedListener(null); if (path.star...
vuln
Safe
Java
void bm_putpixel(Bitmap *b, int x, int y) { assert(b); if(x < b->clip.x0 || x >= b->clip.x1 || y < b->clip.y0 || y >= b->clip.y1) return; BM_SET(b, x, y, b->color); }
vuln
Safe
C/C++
int ff_audio_rechunk_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush, int (*get_packet)(AVFormatContext *, AVPacket *, AVPacket *, int), int (*compare_ts)(AVFormatContext *, AVPacket *, AVPacket *)) { int i; if (pkt) { AVStream *st =...
vuln
Safe
C/C++
''' SPDX-License-Identifier: Apache-2.0 Copyright 2017 Massachusetts Institute of Technology. ''' from multiprocessing import Process import threading import functools import time import os import sys import requests import zmq from keylime import config from keylime import crypto from keylime import json from keyli...
vuln
Vulnerable
Python
enable_xterm_mouse(SCREEN *sp, int enable) { #if USE_EMX_MOUSE sp->_emxmouse_activated = enable; #else NCURSES_PUTP2("xterm-mouse", TIPARM_1(sp->_mouse_xtermcap, enable)); #endif sp->_mouse_active = enable; }
vuln
Safe
Unknown
static Image *ReadMATImageV4(const ImageInfo *image_info,Image *image, ExceptionInfo *exception) { typedef struct { unsigned char Type[4]; unsigned int nRows; unsigned int nCols; unsigned int imagf; unsigned int nameLen; } MAT4_HDR; long ldblk; EndianType endian; Image *ro...
vuln
Safe
C/C++
private void setSlide (float x, float y, float sourceX, boolean noRotation, boolean byTouch) { lastSlideX = x; lastSlideY = y; lastSlideSourceX = sourceX; float dismissFactor = Math.abs(Math.min(1f, y / (float) Screen.dp(125f))); if (Float.isNaN(dismissFactor)) // TODO: find out why it could become...
vuln
Safe
Java
static int xfs_iget_cache_hit( struct xfs_perag *pag, struct xfs_inode *ip, xfs_ino_t ino, int flags, int lock_flags) __releases(RCU) { struct inode *inode = VFS_I(ip); struct xfs_mount *mp = ip->i_mount; int error; /* * check for re-use of an inode within an RCU grace period due to the * radix tr...
vuln
Vulnerable
C/C++
static int strncat_from_utf8_libarchive2(struct archive_string *as, const void *_p, size_t len, struct archive_string_conv *sc) { const char *s; int n; char *p; char *end; uint32_t unicode; #if HAVE_WCRTOMB mbstate_t shift_state; memset(&shift_state, 0, sizeof(shift_state)); #else /* Clear the shift state ...
vuln
Vulnerable
C/C++
def parse_yaml_query(yaml_content): """Parses the given YAML string to attempt to extract a query. Args: yaml_content: A string containing YAML content. Returns: On success, the processed MLQuery object. """ logger.debug("Attempting to parse YAML content:\n%s" % yaml_content) r...
vuln
Vulnerable
Python
base_sock_create(struct net *net, struct socket *sock, int protocol, int kern) { struct sock *sk; if (sock->type != SOCK_RAW) return -ESOCKTNOSUPPORT; sk = sk_alloc(net, PF_ISDN, GFP_KERNEL, &mISDN_proto, kern); if (!sk) return -ENOMEM; sock_init_data(sock, sk); sock->ops = &base_sock_ops; sock->state = S...
vuln
Vulnerable
Unknown
xsltNumberFormatGetMultipleLevel(xsltTransformContextPtr context, xmlNodePtr node, xsltCompMatchPtr countPat, xsltCompMatchPtr fromPat, double *array, int max) { int amount = 0; int cnt; xmlNodePtr ancestor; xmlNodePtr preceding; xmlXPathParserContextPtr parser; context...
vuln
Safe
Unknown
static int msrle_decode_pal4(AVCodecContext *avctx, AVPicture *pic, const uint8_t *data, int data_size) { int stream_ptr = 0; unsigned char rle_code; unsigned char extra_byte, odd_pixel; unsigned char stream_byte; int pixel_ptr = 0; int row_dec = pic->linesize[0]; ...
vuln
Vulnerable
C/C++
static int msmpeg4v12_decode_mb(MpegEncContext *s, int16_t block[6][64]) { int cbp, code, i; uint32_t * const mb_type_ptr = &s->current_picture.mb_type[s->mb_x + s->mb_y*s->mb_stride]; if (s->pict_type == AV_PICTURE_TYPE_P) { if (s->use_skip_mb_code) { if (get_bits1(&s->gb)) { ...
vuln
Safe
C/C++
static GF_Err gf_isom_parse_movie_boxes_internal(GF_ISOFile *mov, u32 *boxType, u64 *bytesMissing, Bool progressive_mode) { GF_Box *a; u64 totSize, mdat_end=0; GF_Err e = GF_OK; #ifndef GPAC_DISABLE_ISOM_FRAGMENTS if (mov->single_moof_mode && mov->single_moof_state == 2) { return e; } /*restart from where we ...
vuln
Safe
C/C++
@Override public AuthenticatorFlowStatus process(HttpServletRequest request, HttpServletResponse response, AuthenticationContext context) throws AuthenticationFailedException, LogoutFailedException { // if an authentication flow if (!context.is...
vuln
Vulnerable
Java
function doSubs($s) { global $ptrow, $hisrow, $enrow, $nextLocation, $keyLocation, $keyLength; global $groupLevel, $groupCount, $itemSeparator, $pid, $encounter; global $tcnt, $grcnt, $ckcnt; global $html_flag; $nextLocation = 0; $groupLevel = 0; $groupCount = 0; while (($keyLocation = ...
vuln
Safe
PHP
static void *circular_buffer_task( void *_URLContext) { URLContext *h = _URLContext; UDPContext *s = h->priv_data; fd_set rfds; struct timeval tv; while(!s->exit_thread) { int left; int ret; int len; if (ff_check_interrupt(&h->interrupt_callback)) { s->cir...
vuln
Vulnerable
C/C++
GF_Err gf_isom_set_extraction_slc(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex, const GF_SLConfig *slConfig) { GF_TrackBox *trak; GF_SampleEntryBox *entry; GF_Err e; GF_SLConfig **slc; GF_ESDBox *esds; trak = gf_isom_get_track_from_file(the_file, trackNumber); if (!trak) return GF_BAD_PARAM...
vuln
Safe
C/C++
static CharDriverState *qmp_chardev_open_serial(ChardevHostdev *serial, Error **errp) { #ifdef HAVE_CHARDEV_TTY int fd; fd = qmp_chardev_open_file_source(serial->device, O_RDWR, errp); if (error_is_set(errp)) { return NULL; } qemu_set_nonblock(...
vuln
Vulnerable
C/C++
public static boolean shouldShow(@NonNull OsmandSettings settings, @NonNull MapActivity activity) { OsmandApplication app = activity.getMyApplication(); if (app.getAppCustomization().isFeatureEnabled(FRAGMENT_RENDER_INIT_ERROR_ID)) { File file = app.getAppPath(EXCEPTION_PATH); return settings.OPENGL_RENDER_FA...
vuln
Safe
Java
void Compute(OpKernelContext* context) override { // Input tensor is of the following dimensions: // [ batch, in_rows, in_cols, in_depth ] const Tensor& input = context->input(0); // Input filter is of the following dimensions: // [ filter_rows, filter_cols, in_depth, out_depth] const Tensor& f...
vuln
Safe
Unknown
bool numeric(char c) { return c >= '0' && c <= '9'; }
vuln
Vulnerable
C/C++
date_s__parse_internal(int argc, VALUE *argv, VALUE klass) { VALUE vstr, vcomp, hash; rb_scan_args(argc, argv, "11", &vstr, &vcomp); StringValue(vstr); if (!rb_enc_str_asciicompat_p(vstr)) rb_raise(rb_eArgError, "string should have ASCII compatible encoding"); if (argc < 2) vcomp = Qtrue; ...
vuln
Vulnerable
Unknown
function tt(t){var e=t.length;while(--e>=0){t[e]=0}}
vuln
Safe
JavaScript
void createDirectory(const string &path) const { // We do not use makeDirTree() here. If an attacker creates a directory // just before we do, then we want to abort because we want the directory // to have specific permissions. if (mkdir(path.c_str(), parseModeString("u=rwx,g=rx,o=rx")) == -1) { int e = errn...
vuln
Safe
Unknown
package bootstrap import ( "context" "crypto/sha256" "encoding/base64" "errors" rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" "github.com/rancher/rancher/pkg/controllers/provisioningv2/rke2" capicontrollers "github.com/rancher/rancher/pkg/generated/controllers/cluster.x-k8s.io/v1beta1" rkecontr...
vuln
Vulnerable
Go
doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end, int tok, const char *next, const char **nextPtr, XML_Bool haveMore) { #ifdef XML_DTD static const XML_Char externalSubsetName[] = {ASCII_HASH, '\0'}; #endif /* XML_DTD */ static const XML_Char atypeCDATA[] = {ASCII_C, AS...
vuln
Vulnerable
Unknown
int url_is_local_not_ssh(const char *url) { const char *colon = strchr(url, ':'); const char *slash = strchr(url, '/'); return !colon || (slash && slash < colon) || has_dos_drive_prefix(url); }
vuln
Vulnerable
C/C++
static int _gdImageWebpCtx (gdImagePtr im, gdIOCtx * outfile, int quality) { uint8_t *argb; int x, y; uint8_t *p; uint8_t *out; size_t out_size; int ret = 0; if (im == NULL) { return 1; } if (!gdImageTrueColor(im)) { gd_error("Palette image not supported by webp"); return 1; } if (quality == -1) ...
vuln
Safe
C/C++
static void glfs_clear_preopened(glfs_t *fs) { ListElement *entry = NULL; if (fs == NULL) { return; } QLIST_FOREACH(entry, &glfs_list, list) { if (entry->saved.fs == fs) { if (--entry->saved.ref) { return; } QLIST_REMOVE(entry, list); ...
vuln
Vulnerable
C/C++
// list of available flags module.exports = { // allow (original) unsafe behavior of merge all properties, including ones like `__proto__` allowDangerousObjectKeys: 'deeply:allowDangerousObjectKeys:' + Math.random(), // to prevent (reduce chance of) accidental leaking of the global variables into runtime flags ...
vuln
Safe
JavaScript
void HTMLLinkElement::attach() { if (m_shouldProcessAfterAttach) { m_shouldProcessAfterAttach = false; queuePostAttachCallback(&HTMLLinkElement::processCallback, this); } HTMLElement::attach(); }
vuln
Vulnerable
C/C++
DwaCompressor::uncompress (const char *inPtr, int inSize, IMATH_NAMESPACE::Box2i range, const char *&outPtr) { int minX = range.min.x; int maxX = std::min (range.max.x, _max[0]); int minY = range.min.y; int maxY = std::min (range.max.y, _max[1]); Int64 iSize = static_cast<Int64>(...
vuln
Safe
C/C++
static int dxv_decompress_raw(AVCodecContext *avctx) { DXVContext *ctx = avctx->priv_data; GetByteContext *gbc = &ctx->gbc; if (bytestream2_get_bytes_left(gbc) < ctx->tex_size) return AVERROR_INVALIDDATA; bytestream2_get_buffer(gbc, ctx->tex_data, ctx->tex_size); return 0; }
vuln
Safe
C/C++
function access_get_project_level( $p_project_id = null, $p_user_id = null ) { if( null === $p_user_id ) { $p_user_id = auth_get_current_user_id(); } # Deal with not logged in silently in this case /** @todo we may be able to remove this and just error and once we default to anon login, we can remove it for sure...
vuln
Vulnerable
PHP
static int cirrus_bitblt_solidfill(CirrusVGAState *s, int blt_rop) { cirrus_fill_t rop_func; if (blit_is_unsafe(s, true)) { return 0; } rop_func = cirrus_fill[rop_to_index[blt_rop]][s->cirrus_blt_pixelwidth - 1]; rop_func(s, s->vga.vram_ptr + s->cirrus_blt_dstaddr, s->cirrus_bl...
vuln
Vulnerable
Unknown
static int kmvc_decode_intra_8x8(KmvcContext * ctx, const uint8_t * src, int src_size, int w, int h) { BitBuf bb; int res, val; int i, j; int bx, by; int l0x, l1x, l0y, l1y; int mx, my; const uint8_t *src_end = src + src_size; kmvc_init_getbits(bb, src); for (by = 0; by < h; by += 8)...
vuln
Safe
C/C++
static int xemaclite_of_probe(struct platform_device *ofdev) { struct resource *res; struct net_device *ndev = NULL; struct net_local *lp = NULL; struct device *dev = &ofdev->dev; int rc = 0; dev_info(dev, "Device Tree Probing\n"); /* Create an ethernet device instance */ ndev = alloc_etherdev(sizeof(struct ...
vuln
Safe
C/C++
("/"==R.charAt(0)?"":u)+R);D.push('url("'+R+'"'+K[Q].substring(T))}else D.push(K[Q])}else D=[u]}return null!=D?D.join(""):null};Editor.prototype.mapFontUrl=function(u,D,K){/^https?:\/\//.test(D)&&!this.isCorsEnabledForUrl(D)&&(D=PROXY_URL+"?url="+encodeURIComponent(D));K(u,D)};Editor.prototype.embedCssFonts=function(u,...
vuln
Safe
JavaScript
'use strict'; /** * Representation a of zip file in js * @constructor */ function JSZip() { // if this constructor is used without `new`, it adds `new` before itself: if(!(this instanceof JSZip)) { return new JSZip(); } if(arguments.length) { throw new Error("The constructor with pa...
vuln
Vulnerable
JavaScript
packet2tree(const u_char * data, const int len, int datalink) { uint32_t _U_ vlan_offset; ssize_t pkt_len = len; tcpr_tree_t *node = NULL; ipv4_hdr_t ip_hdr; ipv6_hdr_t ip6_hdr; tcp_hdr_t tcp_hdr; udp_hdr_t udp_hdr; icmpv4_hdr_t icmp_hdr; dnsv4_hdr_t dnsv4_hdr; u_int16_t ether_ty...
vuln
Safe
Unknown
static void lm32_uclinux_init(QEMUMachineInitArgs *args) { const char *cpu_model = args->cpu_model; const char *kernel_filename = args->kernel_filename; const char *kernel_cmdline = args->kernel_cmdline; const char *initrd_filename = args->initrd_filename; LM32CPU *cpu; CPULM32State *env; Dr...
vuln
Safe
C/C++
static void gen_mul(DisasContext *dc, TCGv dest, TCGv srca, TCGv srcb) { TCGv t0 = tcg_temp_new(); tcg_gen_muls2_tl(dest, cpu_sr_ov, srca, srcb); tcg_gen_sari_tl(t0, dest, TARGET_LONG_BITS - 1); tcg_gen_setcond_tl(TCG_COND_NE, cpu_sr_ov, cpu_sr_ov, t0); tcg_temp_free(t0); tcg_gen_neg_tl(cpu_sr_o...
vuln
Safe
C/C++
@Override protected void configure(HttpSecurity http) throws Exception { http.servletApi() .and() .exceptionHandling() .and() .anonymous() .and() .addFilterBefore( new FiatAuthenticationFilter(fiatStatus), AnonymousAuthenticationFilter....
vuln
Vulnerable
Java
static int udp_socket_create(UDPContext *s, struct sockaddr_storage *addr, socklen_t *addr_len, const char *localaddr) { int udp_fd = -1; struct addrinfo *res0 = NULL, *res = NULL; int family = AF_UNSPEC; if (((struct sockaddr *) &s->dest_addr)->sa_family) family = (...
vuln
Safe
C/C++
RestQuery.prototype.runFind = function (options = {}) { if (this.findOptions.limit === 0) { this.response = { results: [] }; return Promise.resolve(); } const findOptions = Object.assign({}, this.findOptions); if (this.keys) { findOptions.keys = this.keys.map(key => { return key.split('.')[0];...
vuln
Vulnerable
JavaScript
void ExtensionOptionsGuest::DidNavigateMainFrame( const content::LoadCommittedDetails& details, const content::FrameNavigateParams& params) { if (attached()) { auto guest_zoom_controller = ui_zoom::ZoomController::FromWebContents(web_contents()); guest_zoom_controller->SetZoomMode( ui...
vuln
Vulnerable
C/C++
static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define RMT_EQUAL_RGB 1 #define RMT_NONE 0 #define RMT_RAW 2 #define RT_STANDARD 1 #define RT_ENCODED 2 #define RT_FORMAT_RGB 3 typedef struct _SUNInfo { unsigned int magic, width, height, depth, ...
vuln
Safe
Unknown
def terminate_broken(self, cause): # Terminate the executor because it is in a broken state. The cause # argument can be used to display more information on the error that # lead the executor into becoming broken. # Mark the process pool broken so that submits fail right now. ex...
vuln
Vulnerable
Python
int caf_parse(caf_reader_t *reader, int64_t *data_length) { uint32_t fcc; int64_t chunk_size; *data_length = 0; /* CAFFileHeader */ TRY_IO(pcm_read32be(&reader->io, &fcc)); ENSURE(fcc == M4AF_FOURCC('c','a','f','f')); TRY_IO(pcm_skip(&reader->io, 4)); /* mFileVersion, mFileFlags */ wh...
vuln
Vulnerable
Unknown
@Override public void tick(int ticksActive) { switch (activeSubPage) { case CHILDREN: childrenBreeding.get(activePage).tick(ticksActive); break; case ENTITY_MUTATIONS: entityMutationBreeding.get(activePage).tick(ticksActive); ...
vuln
Vulnerable
Java
package install import ( "fmt" "net/url" "strings" "github.com/answerdev/answer/internal/base/reason" "github.com/answerdev/answer/internal/base/validator" "github.com/answerdev/answer/pkg/checker" "github.com/segmentfault/pacman/errors" "xorm.io/xorm/schemas" ) // CheckConfigFileResp check config file if ex...
vuln
Safe
Go
static void Sp_split_regexp(js_State *J) { js_Regexp *re; const char *text; int limit, len, k; const char *p, *a, *b, *c, *e; Resub m; text = checkstring(J, 0); re = js_toregexp(J, 1); limit = js_isdefined(J, 2) ? js_tointeger(J, 2) : 1 << 30; js_newarray(J); len = 0; e = text + strlen(text); /* splitti...
vuln
Safe
Unknown
static void pp_mil_k8(fp8_t r, ep2_t *t, ep2_t *q, ep_t *p, int m, bn_t a) { fp8_t l; ep_t *_p = RLC_ALLOCA(ep_t, m); ep2_t *_q = RLC_ALLOCA(ep2_t, m); int i, j, len = bn_bits(a) + 1; int8_t s[RLC_FP_BITS + 1]; if (m == 0) { return; } fp8_null(l); RLC_TRY { fp8_new(l); if (_p == NULL || _q == NULL) { ...
vuln
Vulnerable
C/C++
static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception) { DIBInfo dib_info; Image *image; MagickBooleanType status; MemoryInfo *pixel_info; Quantum index; register ssize_t x; register Quantum *q; register ssize_t i; register unsigned cha...
vuln
Vulnerable
C/C++
evbuffer_ptr_set(struct evbuffer *buf, struct evbuffer_ptr *pos, size_t position, enum evbuffer_ptr_how how) { size_t left = position; struct evbuffer_chain *chain = NULL; EVBUFFER_LOCK(buf); switch (how) { case EVBUFFER_PTR_SET: chain = buf->first; pos->pos = position; position = 0; break; case EVB...
vuln
Vulnerable
Unknown
def _hkey(s): return s.title().replace('_', '-')
vuln
Vulnerable
Python
/* ** $Id: lparser.c $ ** Lua Parser ** See Copyright Notice in lua.h */ #define lparser_c #define LUA_CORE #include "lprefix.h" #include <limits.h> #include <string.h> #include "lua.h" #include "lcode.h" #include "ldebug.h" #include "ldo.h" #include "lfunc.h" #include "llex.h" #include "lmem.h" #include "lobject...
vuln
Safe
C/C++
var readline = require('readline'); var JSON5 = require('json5'); var rl = readline.createInterface({ input: process.stdin, output: process.stdout }); module.exports = cliMain; var instance = require('../lib/index.js'); var commands = { 'get': cmdGet, 'set': cmdSet, 'remove': cmdRemove, ...
vuln
Safe
JavaScript
return buffer.join(''); }; var FilesView = React.createClass({ onLoadMore: function(event) { Model.LoadMore(this.props.repo); }, render: function() { var rev = this.props.rev, repo = this.props.repo, regexp = this.props.regexp, matches = this.props.matches, totalMatches =...
vuln
Vulnerable
JavaScript
public void markMessagesReadAfter(long timestamp) { cleanUpReadMap(timestamp); final Iterator<Map.Entry<String, Long>> iterator = unreadMessagesSentAt.entrySet().iterator(); while (iterator.hasNext()) { final Map.Entry<String, Long> entry = iterator.next(); if (entry.get...
vuln
Safe
Java
/* * Driver for IMS Passenger Control Unit Devices * * Copyright (C) 2013 The IMS Company * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. */ #include <linux/completion.h> #i...
vuln
Vulnerable
C/C++
void TightDecoder::decodeRect(const Rect& r, const void* buffer, size_t buflen, const ServerParams& server, ModifiablePixelBuffer* pb) { const rdr::U8* bufptr; const PixelFormat& pf = server.pf(); rdr::U8 comp_ctl; bufptr = (const rdr::U8*)buffer; ...
vuln
Safe
C/C++
def text(self): components = ( ical.Timezone, ical.Event, ical.Todo, ical.Journal, ical.Card) items = set() try: filenames = os.listdir(self._filesystem_path) except (OSError, IOError) as e: log.LOGGER.info('Error while reading collection %r: %r' ...
vuln
Safe
Python
/* * OpenVPN -- An application to securely tunnel IP networks * over a single TCP/UDP port, with support for SSL/TLS-based * session authentication and key exchange, * packet encryption, packet authentication, and * packet compression. * * Copyright (C) 2002-2018...
vuln
Safe
C/C++
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
Safe
C/C++
ast_for_arguments(struct compiling *c, const node *n) { /* This function handles both typedargslist (function definition) and varargslist (lambda definition). parameters: '(' [typedargslist] ')' typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' [ '*' [tfpdef] (',' ...
vuln
Vulnerable
C/C++
function A(t){var e=t._readableState;for(h("flow",e.flowing);e.flowing&&null!==t.read(););}
vuln
Vulnerable
JavaScript
/** * Created by SpeedProg on 05.04.2015. */ /* global Bloodhound, language, Modernizr, tinymce, getPath */ if ($("#description").length) { tinymce.init({ selector: "#description", plugins: 'code', branding: false, menubar: "edit view format", language: language }); } ...
vuln
Vulnerable
Python
public static ForeignException forThrowable(Throwable exception, BinaryMarshaller<? super Throwable> marshaller) { try { ByteArrayBinaryOutput out = ByteArrayBinaryOutput.create(marshaller.inferSize(exception)); marshaller.write(out, exception); return new ForeignException(ou...
vuln
Safe
Java
inline bool loadModule(const char* filename, IR::Module& outModule) { // Read the specified file into an array. std::vector<U8> fileBytes; if(!loadFile(filename, fileBytes)) { return false; } // If the file starts with the WASM binary magic number, load it as a binary irModule. if(*(U32*)fileBytes.data() == 0x6d7...
vuln
Vulnerable
C/C++
void WebGLRenderingContextBase::TexImageHelperDOMArrayBufferView( TexImageFunctionID function_id, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLint xoffset, GLint yoffset, GL...
vuln
Vulnerable
C/C++
void SendToHost(v8::Isolate* isolate, gin_helper::ErrorThrower thrower, const std::string& channel, v8::Local<v8::Value> arguments) { if (!electron_ipc_remote_) { thrower.ThrowError(kIPCMethodCalledAfterContextReleasedError); return; } blink:...
vuln
Safe
Unknown
# Performs extraction of data that matches extraction rules. # This is automatically invoked by core.module code if extraction has been # enabled by the user; other modules need not reference this module directly. import os import re import pwd import stat import shlex import tempfile import subprocess import binwalk....
vuln
Safe
Python
static int read_data(void *opaque, uint8_t *buf, int buf_size) { struct playlist *v = opaque; HLSContext *c = v->parent->priv_data; int ret, i; int just_opened = 0; restart: if (!v->needed) return AVERROR_EOF; if (!v->input) { int64_t reload_interval; struct segme...
vuln
Vulnerable
C/C++
/* * Swagger Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator p...
vuln
Safe
Java
protected boolean exec(String sql) throws SQLException { if (sql == null) throw new SQLException("SQLiteJDBC internal error: sql==null"); if (rs.isOpen()) throw new SQLException("SQLite JDBC internal error: rs.isOpen() on exec."); boolean rc = false; boolean success = false; try...
vuln
Safe
Java
bool WideToCharMap(const wchar *Src,char *Dest,size_t DestSize,bool &Success) { // String with inconvertible characters mapped to private use Unicode area // must have the mark code somewhere. if (wcschr(Src,(wchar)MappedStringMark)==NULL) return false; Success=true; uint SrcPos=0,DestPos=0; while (Src...
vuln
Vulnerable
C/C++
handle_keywordonly_args(struct compiling *c, const node *n, int start, asdl_seq *kwonlyargs, asdl_seq *kwdefaults) { PyObject *argname; node *ch; expr_ty expression, annotation; arg_ty arg; int i = start; int j = 0; /* index for kwdefaults and kwonlyargs */ if (kwonl...
vuln
Safe
C/C++
static int decode_hq_slice_row(AVCodecContext *avctx, void *arg, int jobnr, int threadnr) { int i; DiracContext *s = avctx->priv_data; DiracSlice *slices = ((DiracSlice *)arg) + s->num_x*jobnr; for (i = 0; i < s->num_x; i++) decode_hq_slice(avctx, &slices[i]); return 0; }
vuln
Vulnerable
C/C++
/* 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
C/C++
rsvg_new_line (void) { RsvgNodeLine *line; line = g_new (RsvgNodeLine, 1); _rsvg_node_init (&line->super, RSVG_NODE_TYPE_LINE); line->super.draw = _rsvg_node_line_draw; line->super.set_atts = _rsvg_node_line_set_atts; line->x1 = line->x2 = line->y1 = line->y2 = _rsvg_css_parse_length ("0"); ...
vuln
Safe
Unknown
@Override public void handleNotification(INotification notification) { switch (notification.getName()) { case MsgAPI.SHOW_ADD_LIBRARY_DIALOG: Sandbox sandbox = Sandbox.getInstance(); int item = notification.getBody(); Dialogs.showInputDialog(sand...
vuln
Vulnerable
Java
void do_subfe (void) { T0 = T1 + ~T0 + xer_ca; if (likely(T0 >= T1 && (xer_ca == 0 || T0 != T1))) { xer_ca = 0; } else { xer_ca = 1; } }
vuln
Vulnerable
C/C++
import json from tornado import web from ...base.handlers import IPythonHandler, json_errors class NbconvertRootHandler(IPythonHandler): SUPPORTED_METHODS = ('GET',) @web.authenticated @json_errors def get(self): try: from IPython.nbconvert.exporters.export import exporter_map ...
vuln
Vulnerable
Python