code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
/* 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
/* FTP engine * * Copyright (c) 2014-2019 Joachim Nilsson <troglobit@gmail.com> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTW...
vuln
Safe
C/C++
sds sdsMakeRoomFor(sds s, size_t addlen) { void *sh, *newsh; size_t avail = sdsavail(s); size_t len, newlen; char type, oldtype = s[-1] & SDS_TYPE_MASK; int hdrlen; size_t usable; /* Return ASAP if there is enough space left. */ if (avail >= addlen) return s; len = sdslen(s); s...
vuln
Safe
Unknown
/* * libEtPan! -- a mail stuff library * * Copyright (C) 2001, 2005 - DINH Viet Hoa * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the a...
vuln
Safe
C/C++
void impeg2d_dec_hdr(void *pv_dec,impeg2d_video_decode_ip_t *ps_ip, impeg2d_video_decode_op_t *ps_op) { UWORD32 u4_bits_read; dec_state_t *ps_dec; ps_dec = (dec_state_t *)pv_dec; ps_op->s_ivd_video_decode_op_t.u4_error_code = 0; impeg2d_bit_stream_init(&(ps_dec->s_bit_stream),ps_ip->s_ivd_video_dec...
vuln
Vulnerable
C/C++
def listAllUsers(usernamePrefix: St): Action[U] = GetActionRateLimited( RateLimits.ReadsFromDb, MinAuthnStrength.EmbeddingStorageSid12) { request =>
vuln
Safe
Scala
void end_read_record(READ_RECORD *info) { /* free cache if used */ free_cache(info); if (info->table) { if (info->table->db_stat) // if opened (void) info->table->file->extra(HA_EXTRA_NO_CACHE); if (info->read_record != rr_quick) // otherwise quick_range does it (void) info->table->file->ha_...
vuln
Safe
Unknown
static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, u64 param3, u64 param4) { int rc; u64 base_addr, size; /* If user manually set "flags", make sure it is legal */ if (flags && (flags & ~(SETWA_FLAGS_APICID|SETWA_FLAGS_MEM|SETWA_FLAGS_PCIE_SBDF))) return -EINVAL; /* * W...
vuln
Vulnerable
C/C++
static int sol_read_packet(AVFormatContext *s, AVPacket *pkt) { int ret; if (s->pb->eof_reached) return AVERROR(EIO); ret= av_get_packet(s->pb, pkt, MAX_SIZE); pkt->stream_index = 0; pkt->size = ret; return 0; }
vuln
Vulnerable
C/C++
BGD_DECLARE(gdImagePtr) gdImageClone (gdImagePtr src) { gdImagePtr dst; register int i, x; if (src->trueColor) { dst = gdImageCreateTrueColor(src->sx , src->sy); } else { dst = gdImageCreate(src->sx , src->sy); } if (dst == NULL) { return NULL; } if (src->trueColor == 0) { dst->colorsTotal = src->col...
vuln
Safe
Unknown
static unsigned decode_digit(int cp) { return (unsigned) (cp - 48 < 10 ? cp - 22 : cp - 65 < 26 ? cp - 65 : cp - 97 < 26 ? cp - 97 : base); }
vuln
Safe
C/C++
PHP_FUNCTION(imagepsloadfont) { char *file; int file_len, f_ind, *font; #ifdef PHP_WIN32 struct stat st; #endif if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &file, &file_len) == FAILURE) { return; } #ifdef PHP_WIN32 if (VCWD_STAT(file, &st) < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fo...
vuln
Safe
Unknown
static int mpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; Mpeg1Context *s = avctx->priv_data; AVFrame *picture = data; MpegEncContext *s2 =...
vuln
Vulnerable
C/C++
_rsvg_node_poly_draw (RsvgNode * self, RsvgDrawingCtx * ctx, int dominate) { RsvgNodePoly *poly = (RsvgNodePoly *) self; gsize i; GString *d; char buf[G_ASCII_DTOSTR_BUF_SIZE]; /* represent as a "moveto, lineto*, close" path */ if (poly->pointlist_len < 2) return; d = g_string_new ...
vuln
Vulnerable
Unknown
#include "extensions/filters/http/jwt_authn/verifier.h" #include "envoy/extensions/filters/http/jwt_authn/v3/config.pb.h" #include "jwt_verify_lib/check_audience.h" using envoy::extensions::filters::http::jwt_authn::v3::JwtProvider; using envoy::extensions::filters::http::jwt_authn::v3::JwtRequirement; using envoy::...
vuln
Vulnerable
C/C++
@EventHandler public void grappler(PlayerFishEvent event) { if (blockDisabled(Ability.GRAPPLER)) return; if (event.getCaught() != null) { if (!(event.getCaught() instanceof Item)) { PlayerData playerData = plugin.getPlayerManager().getPlayerData(event.getPlayer()); if (playerData != null) { Player ...
vuln
Vulnerable
Java
/******************************************************************************* * This file is part of OpenNMS(R). * * Copyright (C) 2002-2014 The OpenNMS Group, Inc. * OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc. * * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. * * OpenNMS(...
vuln
Vulnerable
Java
static int parse_vtrk(AVFormatContext *s, FourxmDemuxContext *fourxm, uint8_t *buf, int size, int left) { AVStream *st; if (size != vtrk_SIZE || left < size + 8) { return AVERROR_INVALIDDATA; } st = avformat_new_stream(s, NULL); if (!st) ...
vuln
Safe
C/C++
static void do_flush_queued_data(VirtIOSerialPort *port, VirtQueue *vq, VirtIODevice *vdev) { VirtIOSerialPortClass *vsc; assert(port); assert(virtio_queue_ready(vq)); vsc = VIRTIO_SERIAL_PORT_GET_CLASS(port); while (!port->throttled) { unsigned int i; ...
vuln
Safe
C/C++
def _cleanup_sessions(self): for session, user in list(self._session_users_by_session.items()): if not isinstance(user, SessionUser): continue if user.touched + (15 * 60) < time.monotonic(): self._logger.info( f"Cleaning up user session...
vuln
Safe
Python
static bool parseOperands(char* str, ArmOp *op) { char *t = strdup (str); int operand = 0; char *token = t; char *x; int imm_count = 0; int mem_opt = 0; if (!token) { return false; } while (token) { char *next = strchr (token, ','); if (next) { *next++ = 0; } while (token[0] == ' ') { token++;...
vuln
Vulnerable
C/C++
xsltLoadDocument(xsltTransformContextPtr ctxt, const xmlChar *URI) { xsltDocumentPtr ret; xmlDocPtr doc; if ((ctxt == NULL) || (URI == NULL)) return(NULL); /* * Security framework check */ if (ctxt->sec != NULL) { int res; res = xsltCheckRead(ctxt->sec, ctxt, URI); if (res <= 0) { ...
vuln
Safe
Unknown
default boolean isItemValid(int slot, ItemStack bullet) { if (!isSocketSlotAvailable(slot)) { return false; } if (!ISpellAcceptor.isContainer(bullet)) { return false; } ISpellAcceptor container = ISpellAcceptor.acceptor(bullet); return this instanceof ICADData || !container.isCADOnlyContainer(); }
vuln
Safe
Java
static BROTLI_INLINE uint32_t GetCopyExtra(uint16_t copycode) { return kBrotliCopyExtra[copycode]; }
vuln
Safe
Unknown
bool WebGLImageConversion::ExtractTextureData(unsigned width, bool WebGLImageConversion::ExtractTextureData( unsigned width, unsigned height, GLenum format, GLenum type, const PixelStoreParams& unpack_params, bool flip_y, bool premultiply_alpha, const void* pixels, Vector<uint8_t>& d...
vuln
Safe
C/C++
function validateChanges(changes, source, callback) { if (!changes.length) { return; } const activeEditor = instance.getActiveEditor(); const beforeChangeResult = instance.runHooks('beforeChange', changes, source || 'edit'); let shouldBeCanceled = true; if (beforeChangeResult === false) ...
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. */ // 字段类型 // eslint-disable-next-line no-unused-vars const FIELD_TYPES = { ...
vuln
Vulnerable
Java
static void put_pixels_clamped4_c(const DCTELEM *block, uint8_t *restrict pixels, int line_size) { int i; uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; for(i=0;i<4;i++) { pixels[0] = cm[block[0]]; pixels[1] = cm[block[1]]; pixels[2] = cm[block[2]]; ...
vuln
Vulnerable
C/C++
function msgpack (options) { var encodingTypes = [] var decodingTypes = new Map() options = options || { forceFloat64: false, compatibilityMode: false, // if true, skips encoding Dates using the msgpack // timestamp ext format (-1) disableTimestampEncoding: false, preferMap: false, //...
vuln
Safe
JavaScript
static int unimac_mdio_probe(struct platform_device *pdev) { struct unimac_mdio_pdata *pdata = pdev->dev.platform_data; struct unimac_mdio_priv *priv; struct device_node *np; struct mii_bus *bus; struct resource *r; int ret; np = pdev->dev.of_node; priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); ...
vuln
Safe
C/C++
static int pci_qdev_init(DeviceState *qdev) { PCIDevice *pci_dev = (PCIDevice *)qdev; PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(pci_dev); PCIBus *bus; int rc; bool is_default_rom; if (pc->is_express) { pci_dev->cap_present |= QEMU_PCI_CAP_EXPRESS; } bus = PCI_BUS(qdev_get_pa...
vuln
Vulnerable
C/C++
int main(int argc, char **argv) { FILE *infile = NULL; VpxVideoWriter *writer = NULL; vpx_codec_ctx_t codec; vpx_codec_enc_cfg_t cfg; vpx_image_t raw; vpx_codec_err_t res; vpx_fixed_buf_t stats = {0}; VpxVideoInfo info = {0}; const VpxInterface *encoder = NULL; int pass; const int fps = 30;...
vuln
Vulnerable
C/C++
/* * Minio Cloud Storage, (C) 2017 Minio, Inc. * * 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
Vulnerable
Go
int ssh_scp_write(ssh_scp scp, const void *buffer, size_t len) { int w; int rc; uint8_t code; if (scp == NULL) { return SSH_ERROR; } if (scp->state != SSH_SCP_WRITE_WRITING) { ssh_set_error(scp->session, SSH_FATAL, "ssh_scp_write called under invalid state...
vuln
Vulnerable
Unknown
RawTile OpenJPEGImage::getRegion( int ha, int va, unsigned int res, int layers, int x, int y, unsigned int w, unsigned int h ){ // Scale up our output bit depth to the nearest factor of 8 unsigned int obpc = bpc; if( bpc <= 16 && bpc > 8 ) obpc = 16; else if( bpc <= 8 ) obpc = 8; #ifdef DEBUG Timer timer;...
vuln
Safe
C/C++
private byte[] inflate(final byte[] bytes) throws DataFormatException { try (final ByteArrayOutputStream baos = new ByteArrayOutputStream()) { // Git objects are compressed with ZLib. // We need to decompress it using Inflater. final Inflater ifr = new Inflater(); ifr.setInput(bytes); ...
vuln
Vulnerable
Java
public static boolean addExchangedLocators(Map<Integer, Set<DistributionLocatorId>> locators, LocatorMembershipListener locatorListener) { ConcurrentHashMap<Integer, Set<DistributionLocatorId>> allLocators = (ConcurrentHashMap<Integer, Set<DistributionLocatorId>>) locatorListener .getAllL...
vuln
Vulnerable
Java
static int read_file_dentry_set(struct exfat_de_iter *iter, struct exfat_inode **new_node, int *skip_dentries) { struct exfat_dentry *file_de, *stream_de, *dentry; struct exfat_inode *node = NULL; int i, ret; ret = exfat_de_iter_get(iter, 0, &file_de); if (ret || file_de->type != EXFAT_FILE) { exfat_debug("...
vuln
Vulnerable
C/C++
void Compute(OpKernelContext* ctx) override { const Tensor& input = ctx->input(0); OP_REQUIRES( ctx, (axis_ == -1 || axis_ < input.shape().dims()), errors::InvalidArgument("Shape must be at least rank ", axis_ + 1, " but is rank ", input.shape().dims())); cons...
vuln
Vulnerable
C/C++
public static String checkIfTermuxTaskerAllowExternalAppsPolicyIsViolated(final Context context, final String executable) { if (executable == null || executable.isEmpty()) return context.getString(R.string.error_null_or_empty_executable); String errmsg = null; if (!FileUtils.isPathInDirPath(ex...
vuln
Safe
Java
static Image *ReadPWPImage(const ImageInfo *image_info,ExceptionInfo *exception) { FILE *file; Image *image, *next_image, *pwp_image; ImageInfo *read_info; int c, unique_file; MagickBooleanType status; register Image *p; register ssize_t i; size_t files...
vuln
Vulnerable
Unknown
func (p *Parser) parseSome() *Expr { decl := &SomeDecl{} decl.SetLoc(p.s.Loc()) // Attempt to parse "some x in xs", which will end up in // SomeDecl{Symbols: ["member(x, xs)"]} s := p.save() p.scan() if term := p.parseTermInfixCall(); term != nil { if call, ok := term.Value.(Call); ok { switch call[0].S...
vuln
Vulnerable
Go
static int dn_nl_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh) { struct net *net = sock_net(skb->sk); struct nlattr *tb[IFA_MAX+1]; struct dn_dev *dn_db; struct ifaddrmsg *ifm; struct dn_ifaddr *ifa; struct dn_ifaddr __rcu **ifap; int err = -EINVAL; if (!capable(CAP_NET_ADMIN)) return -EPERM; if (!net...
vuln
Vulnerable
Unknown
static av_cold int truemotion1_decode_init(AVCodecContext *avctx) { TrueMotion1Context *s = avctx->priv_data; s->avctx = avctx; s->frame = av_frame_alloc(); if (!s->frame) return AVERROR(ENOMEM); av_fast_malloc(&s->vert_pred, &s->vert_pred_size, s->avctx->width * sizeof(unsigned in...
vuln
Vulnerable
C/C++
FFAMediaCodec* ff_AMediaCodec_createEncoderByType(const char *mime) { JNIEnv *env = NULL; FFAMediaCodec *codec = NULL; jstring mime_type = NULL; codec = av_mallocz(sizeof(FFAMediaCodec)); if (!codec) { return NULL; } codec->class = &amediacodec_class; env = ff_jni_get_env(codec);...
vuln
Vulnerable
C/C++
/* * OpenEXR (.exr) image decoder * Copyright (c) 2006 Industrial Light & Magic, a division of Lucas Digital Ltd. LLC * Copyright (c) 2009 Jimmy Christensen * * B44/B44A, Tile, UINT32 added by Jokyo Images support by CNC - French National Center for Cinema * * This file is part of FFmpeg. * * FFmpeg is free so...
vuln
Vulnerable
C/C++
static void usb_msd_send_status(MSDState *s, USBPacket *p) { struct usb_msd_csw csw; int len; csw.sig = cpu_to_le32(0x53425355); csw.tag = cpu_to_le32(s->tag); csw.residue = s->residue; csw.status = s->result; len = MIN(sizeof(csw), p->iov.size); usb_packet_copy(p, &csw, len); p->res...
vuln
Safe
C/C++
TPMI_ALG_HASH_Unmarshal(TPMI_ALG_HASH *target, BYTE **buffer, INT32 *size, BOOL allowNull) { TPM_RC rc = TPM_RC_SUCCESS; if (rc == TPM_RC_SUCCESS) { rc = TPM_ALG_ID_Unmarshal(target, buffer, size); } if (rc == TPM_RC_SUCCESS) { switch (*target) { #if ALG_SHA1 case TPM_ALG_SHA1: #endif #if ALG_SH...
vuln
Vulnerable
Unknown
/* 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++
static int swf_write_video(AVFormatContext *s, AVCodecContext *enc, const uint8_t *buf, int size) { ByteIOContext *pb = &s->pb; static int tag_id = 0; if (enc->frame_number > 1) { put_swf_tag(s, TAG_REMOVEOBJECT); put_le16(pb, SHAPE_ID); put_le16...
vuln
Vulnerable
C/C++
function renderSimpleTemplateWithValidators(formElement, template) { var validators, validatorsCountWithoutRequired, validatorsTemplateContent; assert('object' === $.type(formElement), 'Invalid parameter "formElement"', 1479035674); renderSimpleTemplate(formElement, template); validatorsTempla...
vuln
Safe
JavaScript
public static void updateActivity(Predator predator) { Brain<Predator> brain = predator.getBrain(); Optional<Activity> current = brain.getActiveNonCoreActivity(); if (current.isPresent() && current.get() == BrainObjects.HUNT) { brain.getMemory(MemoryModuleType.ATTACK_TARG...
vuln
Vulnerable
Java
base::ProcessHandle StartProcessWithAccess(CommandLine* cmd_line, const FilePath& exposed_dir) { const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); content::ProcessType type; std::string type_str = cmd_line->GetSwitchValueASCII(switches::kProces...
vuln
Safe
C/C++
private void readKeys( ) throws GeneralSecurityException { if ( DatastoreService.existsKey( DATASTORE_PUBLIC_KEY ) && DatastoreService.existsKey( DATASTORE_PRIVATE_KEY ) ) { X509EncodedKeySpec keySpecPublic = new X509EncodedKeySpec(Base64.getDecoder().decode(DatastoreService.getDataValue( DA...
vuln
Safe
Java
asmlinkage long sys_oabi_epoll_wait(int epfd, struct oabi_epoll_event __user *events, int maxevents, int timeout) { struct epoll_event *kbuf; mm_segment_t fs; long ret, err, i; if (maxevents <= 0 || maxevents > (INT_MAX/sizeof(struct epoll_event))) return -EINVAL; kbuf = kmalloc(sizeof(*kbuf) * ...
vuln
Vulnerable
Unknown
/* * Copyright (c) 2006, 2019 Oracle and/or its affiliates. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main director...
vuln
Safe
C/C++
@Override public void clicked(int slot, int dragType, ClickType clickType, Player player) { // We can't move if: // the slot is the item index, and it's an illegal action (like, swapping the items) // the hotbar item is being swapped out // the action is "pickup all" (this ignore...
vuln
Vulnerable
Java
static void mptsas_free_request(MPTSASRequest *req) { MPTSASState *s = req->dev; if (req->sreq != NULL) { req->sreq->hba_private = NULL; scsi_req_unref(req->sreq); req->sreq = NULL; QTAILQ_REMOVE(&s->pending, req, next); } qemu_sglist_destroy(&req->qsg); g_free(req);...
vuln
Vulnerable
Unknown
package validation import ( "fmt" "math" "reflect" "strconv" "strings" "text/scanner" "github.com/graph-gophers/graphql-go/errors" "github.com/graph-gophers/graphql-go/internal/common" "github.com/graph-gophers/graphql-go/internal/query" "github.com/graph-gophers/graphql-go/types" ) type varSet map[*types....
vuln
Vulnerable
Go
public static void handle(SPacketHighlightRecipe pPacket, Supplier<NetworkEvent.Context> pContext) { pContext.get().enqueueWork(() -> { ClientPlayerEntity clientPlayerEntity = Minecraft.getInstance().player; if (clientPlayerEntity != null) { RecipesWidget.get().ifPre...
vuln
Vulnerable
Java
irc_server_gnutls_callback (void *data, gnutls_session_t tls_session, const gnutls_datum_t *req_ca, int nreq, const gnutls_pk_algorithm_t *pk_algos, int pk_algos_len, gnutls_retr_st *answer, int action) { ...
vuln
Safe
C/C++
@Inject(method = "push(DDD)V", at = @At(value = "HEAD"), cancellable = true) public void ignorePushingWhileInactive(double x, double y, double z, CallbackInfo ci) { if (this.isInactive) { ci.cancel(); } }
vuln
Vulnerable
Java
static int llcp_sock_bind(struct socket *sock, struct sockaddr *addr, int alen) { struct sock *sk = sock->sk; struct nfc_llcp_sock *llcp_sock = nfc_llcp_sock(sk); struct nfc_llcp_local *local; struct nfc_dev *dev; struct sockaddr_nfc_llcp llcp_addr; int len, ret = 0; if (!addr || alen < offsetofend(struct socka...
vuln
Vulnerable
C/C++
@Override public void onVisibilityChanged(boolean visible) { if (visible) { // If the button will actually become visible and the navbar is about // to hide, tell the statusbar to keep it around for longer mAutoH...
vuln
Vulnerable
Java
static int io_sq_offload_start(struct io_ring_ctx *ctx, struct io_uring_params *p) { struct io_wq_data data; unsigned concurrency; int ret; init_waitqueue_head(&ctx->sqo_wait); mmgrab(current->mm); ctx->sqo_mm = current->mm; if (ctx->flags & IORING_SETUP_SQPOLL) { ret = -EPERM; if (!capable(CAP_S...
vuln
Vulnerable
Unknown
public static List<Dependency> parseGradle(PomRepository repository, File file, ILogger logger) throws IOException { String readString = FileUtils.readFileToString(file, Charset.defaultCharset()); // remove all comments readString = readString.replaceAll("\\s*//.*", ""); Matcher matcher ...
vuln
Safe
Java
int __cil_build_ast_node_helper(struct cil_tree_node *parse_current, uint32_t *finished, void *extra_args) { struct cil_args_build *args = extra_args; struct cil_db *db = args->db; struct cil_tree_node *ast_current = args->ast; struct cil_tree_node *tunif = args->tunif; struct cil_tree_node *in = args->in; struct...
vuln
Safe
Unknown
decode_sequence(const uint8_t *asn1, size_t len, const struct seq_info *seq, void *val) { krb5_error_code ret; const uint8_t *contents; size_t i, j, clen; taginfo t; assert(seq->n_fields > 0); for (i = 0; i < seq->n_fields; i++) { if (len == 0) break; ...
vuln
Vulnerable
Unknown
'use strict' var join = require('path').join var EventEmitter = require('events') var pull = require('pull-stream') var ref = require('ssb-ref') var ssbKeys = require('ssb-keys') var createDB = require('./db') var extras = require('./extras') var u = require('./util') function isString (s) { return typeof s === 's...
vuln
Vulnerable
JavaScript
def main(): global logger result = 0 parser = argparse.ArgumentParser(description='Keycloak REST client', prog=prog_name, epilog=verbose_help.format(prog_name=prog_name), formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argume...
vuln
Vulnerable
Python
function delete_organization(id, organization_name) { const delAPI = "../delete/organization/"+id; swal.queue([{ title: 'Are you sure you want to delete '+ organization_name +'?', text: "You won't be able to revert this!", type: 'warning', showCancelButton: true, confirmB...
vuln
Vulnerable
JavaScript
def install(filename, target): '''Run a package's installer script against the given target directory.''' print(' Unpacking %s...' % filename) subprocess.check_call(['tar', 'xf', filename]) basename = filename.split('.tar')[0] print(' Installing %s...' % basename) install_cmd = [os.path.join(basename, 'inst...
vuln
Safe
Python
static int a64_write_trailer(struct AVFormatContext *s) { A64MuxerContext *c = s->priv_data; AVPacket pkt; if(c->interleaved) a64_write_packet(s, &pkt); return 0; }
vuln
Vulnerable
C/C++
static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception) { char filename[MaxTextExtent]; FILE *file; Image *image; int status, unique_file; ssize_t n; SVGInfo *svg_info; unsigned char message[MaxTextExtent]; xmlSAXHandler sax_modules; ...
vuln
Vulnerable
C/C++
vhost_user_set_protocol_features(struct virtio_net **pdev, struct VhostUserMsg *msg, int main_fd __rte_unused) { struct virtio_net *dev = *pdev; uint64_t protocol_features = msg->payload.u64; uint64_t slave_protocol_features = 0; rte_vhost_driver_get_protocol_features(dev->ifname, &slave_protocol_features...
vuln
Vulnerable
Unknown
set_acl(struct archive *a, int fd, const char *name, struct archive_acl *abstract_acl, __LA_MODE_T mode, int ae_requested_type, const char *tname) { aclent_t *aclent; #if ARCHIVE_ACL_SUNOS_NFS4 ace_t *ace; #endif int cmd, e, r; void *aclp; int ret; int ae_type, ae_permset, ae_tag, ae_id; int ...
vuln
Safe
C/C++
protocol_handshake_oldstyle (struct connection *conn) { struct old_handshake handshake; uint64_t exportsize; uint16_t gflags, eflags; /* In --tls=require / FORCEDTLS mode, old style handshakes are * rejected because they cannot support TLS. */ if (tls == 2) { nbdkit_error ("non-TLS client tried to ...
vuln
Safe
Unknown
ins_compl_get_exp(pos_T *ini) { static ins_compl_next_state_T st; static int st_cleared = FALSE; int i; int found_new_match; int type = ctrl_x_mode; if (!compl_started) { buf_T *buf; FOR_ALL_BUFFERS(buf) buf->b_scanned = 0; if (!st_cleared) { CLEAR_FIELD(st); ...
vuln
Safe
Unknown
BlockInterfaceErrorAction drive_get_onerror(BlockDriverState *bdrv) { int index; for (index = 0; index < nb_drives; index++) if (drives_table[index].bdrv == bdrv) return drives_table[index].onerror; return BLOCK_ERR_STOP_ENOSPC; }
vuln
Safe
C/C++
public String updateImpl() { boolean valid = true; if (captchaEnable()) { valid = recaptchaService.verifyRecaptchaResponse(); } if (this.password != null && this.confirm != null) { if (!this.password.equalsIgnoreCase(this.confirm)) { facesMessages.add(FacesMessage.SEVERITY_ERROR, "Password mismatch.")...
vuln
Vulnerable
Java
int main(int argc, char **argv) { FILE *infile = NULL; vpx_codec_ctx_t codec = {0}; vpx_codec_enc_cfg_t cfg = {0}; int frame_count = 0; vpx_image_t raw = {0}; vpx_codec_err_t res; VpxVideoInfo info = {0}; VpxVideoWriter *writer = NULL; const VpxInterface *encoder = NULL; const int fps = 2; ...
vuln
Vulnerable
C/C++
sixel_allocator_realloc( sixel_allocator_t /* in */ *allocator, /* allocator object */ void /* in */ *p, /* existing buffer to be re-allocated */ size_t /* in */ n) /* re-allocation size */ { /* precondition */ assert(allocator); assert(allocator...
vuln
Vulnerable
Unknown
static int ismt_access(struct i2c_adapter *adap, u16 addr, unsigned short flags, char read_write, u8 command, int size, union i2c_smbus_data *data) { int ret; unsigned long time_left; dma_addr_t dma_addr = 0; /* address of the data buffer */ u8 dma_size = 0; enum dma_data_direction dma_direction ...
vuln
Safe
C/C++
public function save() { $project = $this->getProject(); $values = $this->request->getValues(); $values['project_id'] = $project['id']; list($valid, $errors) = $this->taskValidator->validateCreation($values); if (! $valid) { $this->flash->failure(t('Unable to cr...
vuln
Safe
PHP
void CLASS nikon_coolscan_load_raw() { int bufsize = width*3*tiff_bps/8; if(tiff_bps <= 8) gamma_curve(1.0/imgdata.params.coolscan_nef_gamma,0.,1,255); else gamma_curve(1.0/imgdata.params.coolscan_nef_gamma,0.,1,65535); fseek (ifp, data_offset, SEEK_SET); unsigned char *buf = (unsigned char*)malloc(bu...
vuln
Vulnerable
Unknown
def _download_file(bucket, filename, local_dir): key = bucket.get_key(filename) local_filename = os.path.join(local_dir, filename) key.get_contents_to_filename(local_filename) return local_filename
vuln
Vulnerable
Python
parse_suse_release (guestfs_h *g, struct inspect_fs *fs, const char *filename) { int64_t size; char *major, *minor; CLEANUP_FREE_STRING_LIST char **lines = NULL; int r = -1; /* Don't trust guestfs_head_n not to break with very large files. * Check the file size is something reasonable first. */ size ...
vuln
Safe
Unknown
static int ahash_def_finup(struct ahash_request *req) { struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); int err; err = ahash_save_req(req, ahash_def_finup_done1); if (err) return err; err = tfm->update(req); if (err == -EINPROGRESS || (err == -EBUSY && (ahash_request_flags(req) & CRYPTO_TF...
vuln
Safe
Unknown
@Override public void apply(Item.Settings settings, Item item) { if (item.hasRecipeRemainder()) { throw new IllegalArgumentException("Item cannot have a standard recipe remainder and a custom recipe remainder"); } super.apply(settings, item); }
vuln
Safe
Java
dns_init() { ip_addr_t dnsserver; LWIP_ASSERT("sanity check SIZEOF_DNS_QUERY", sizeof(struct dns_query) == SIZEOF_DNS_QUERY); LWIP_ASSERT("sanity check SIZEOF_DNS_ANSWER", sizeof(struct dns_answer) <= SIZEOF_DNS_ANSWER_ASSERT); dns_payload = (u8_t *)LWIP_MEM_ALIGN(dns_payload_buffer); /* initialize...
vuln
Safe
Unknown
public void setDimension(final Dimension dimension) { Configuration config = Configuration.getInstance(); if (this.dimension != null) { this.dimension.removePropertyChangeListener(this); this.dimension.removeDimensionListener(this); for (Tile tile: this.dimension.getT...
vuln
Vulnerable
Java
/** * Copyright (c) 2008, SnakeYAML * * 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...
vuln
Safe
Java
int CServer::SendMsg(CMsgPacker *pMsg, int Flags, int ClientID) { CNetChunk Packet; if(!pMsg) return -1; // drop invalid packet if(ClientID != -1 && (ClientID < 0 || ClientID >= MAX_CLIENTS || m_aClients[ClientID].m_State == CClient::STATE_EMPTY || m_aClients[ClientID].m_Quitting)) return 0; mem_zero(&Packet...
vuln
Safe
C/C++
BOOL security_decrypt(BYTE* data, int length, rdpRdp* rdp) { if (rdp->decrypt_use_count >= 4096) { security_key_update(rdp->decrypt_key, rdp->decrypt_update_key, rdp->rc4_key_len); crypto_rc4_free(rdp->rc4_decrypt_key); rdp->rc4_decrypt_key = crypto_rc4_init(rdp->decrypt_key, rdp->rc4_key_len); rdp->decrypt_u...
vuln
Vulnerable
C/C++
static int store_xauthority(void) { // put a copy of .Xauthority in XAUTHORITY_FILE fs_build_mnt_dir(); char *src; char *dest = RUN_XAUTHORITY_FILE; // create an empty file as root, and change ownership to user FILE *fp = fopen(dest, "w"); if (fp) { fprintf(fp, "\n"); SET_PERMS_STREAM(fp, getuid(), getgid()...
vuln
Safe
C/C++
static int mimic_decode_update_thread_context(AVCodecContext *avctx, const AVCodecContext *avctx_from) { MimicContext *dst = avctx->priv_data, *src = avctx_from->priv_data; int i, ret; if (avctx == avctx_from) return 0; dst->cur_index = src->next_cur_index; dst->prev_index = src->next_prev_...
vuln
Vulnerable
C/C++
public function Load($tree) { if (!$tree) return; $contents = array(); $treePath = $tree->GetPath(); $args = array(); $args[] = '--full-name'; if ($this->exe->CanShowSizeInTree()) $args[] = '-l'; $args[] = '-t'; $args[] = escapeshellarg($tree->GetHash()); $lines = explode("\n", $this->exe...
vuln
Safe
PHP
static inline void write_IRQreg (openpic_t *opp, int n_IRQ, uint32_t reg, uint32_t val) { uint32_t tmp; switch (reg) { case IRQ_IPVP: opp->src[n_IRQ].ipvp = (opp->src[n_IRQ].ipvp & 0x40000000) | (val & 0x800F00FF); op...
vuln
Vulnerable
C/C++
static int pad_basic(bn_t m, int *p_len, int m_len, int k_len, int operation) { uint8_t pad = 0; int result = RLC_OK; bn_t t; RLC_TRY { bn_null(t); bn_new(t); switch (operation) { case RSA_ENC: case RSA_SIG: case RSA_SIG_HASH: /* EB = 00 | FF | D. */ bn_zero(m); bn_lsh(m, m, 8); bn_...
vuln
Vulnerable
C/C++
static void tcg_handle_interrupt(CPUState *cpu, int mask) { int old_mask; old_mask = cpu->interrupt_request; cpu->interrupt_request |= mask; if (!qemu_cpu_is_self(cpu)) { qemu_cpu_kick(cpu); return; } if (use_icount) { cpu->icount_decr.u16.high = 0xffff; if (...
vuln
Vulnerable
C/C++