code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
/* 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
Vulnerable
Python
DECLAREContigPutFunc(putcontig8bitYCbCr21tile) { (void) y; fromskew = (fromskew * 4) / 2; do { x = w>>1; do { int32 Cb = pp[2]; int32 Cr = pp[3]; YCbCrtoRGB(cp[0], pp[0]); YCbCrtoRGB(cp[1], pp[1]); cp += 2; pp += 4; } while (--x); if( (w&1) != 0 ) { int32 Cb = pp[2]; int32 Cr = p...
vuln
Vulnerable
Unknown
GF_Descriptor *gf_isom_get_root_od(GF_ISOFile *movie) { GF_Descriptor *desc; GF_ObjectDescriptor *od; GF_InitialObjectDescriptor *iod; GF_IsomObjectDescriptor *isom_od; GF_IsomInitialObjectDescriptor *isom_iod; GF_ESD *esd; GF_ES_ID_Inc *inc; u32 i; u8 useIOD; if (!movie || !movie->moov) return NULL; if (!m...
vuln
Vulnerable
C/C++
static void nsc_rle_decompress_data(NSC_CONTEXT* context) { UINT16 i; BYTE* rle; UINT32 planeSize; UINT32 originalSize; rle = context->Planes; for (i = 0; i < 4; i++) { originalSize = context->OrgByteCount[i]; planeSize = context->PlaneByteCount[i]; if (planeSize == 0) FillMemory(context->...
vuln
Vulnerable
C/C++
static int read_filter_params(MLPDecodeContext *m, GetBitContext *gbp, unsigned int substr, unsigned int channel, unsigned int filter) { SubStream *s = &m->substream[substr]; FilterParams *fp = &s->channel_params[channel].filter_params[filter]; con...
vuln
Vulnerable
C/C++
static av_cold int hevc_sdp_parse_fmtp_config(AVFormatContext *s, AVStream *stream, PayloadContext *hevc_data, char *attr, char *value) { if (!strcmp(attr, "profile-id"...
vuln
Vulnerable
C/C++
static ssize_t qemu_fill_buffer(QEMUFile *f) { int len; int pending; assert(!qemu_file_is_writable(f)); pending = f->buf_size - f->buf_index; if (pending > 0) { memmove(f->buf, f->buf + f->buf_index, pending); } f->buf_index = 0; f->buf_size = pending; len = f->ops->get_buffe...
vuln
Safe
C/C++
static void pci_bridge_update_mappings(PCIBridge *br) { memory_region_transaction_begin(); pci_bridge_region_cleanup(br); pci_bridge_region_init(br); memory_region_transaction_commit(); }
vuln
Vulnerable
C/C++
int WebSocketHandshake::ReadServerHandshake(const char* data, size_t len) { mode_ = MODE_INCOMPLETE; if (len < kServerHandshakeHeaderLength) { return -1; } if (!memcmp(data, kServerHandshakeHeader, kServerHandshakeHeaderLength)) { mode_ = MODE_NORMAL; } else { int eoh = HttpUtil::LocateEndOfHeader...
vuln
Vulnerable
C/C++
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) /* Copyright (C) 2017-2018 Netronome Systems, Inc. */ #include <linux/etherdevice.h> #include <linux/lockdep.h> #include <linux/pci.h> #include <linux/skbuff.h> #include <linux/vmalloc.h> #include <net/devlink.h> #include <net/dst_metadata.h> #include "main.h...
vuln
Safe
C/C++
/* * Copyright (c) 2004-2021, University of Oslo * 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 copyright notice, this * list of cond...
vuln
Safe
Java
/* $Id$ */ /* tiffcrop.c -- a port of tiffcp.c extended to include manipulations of * the image data through additional options listed below * * Original code: * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * Additions (c) Richard Nolde 2006-2010 * * Permission to use, ...
vuln
Vulnerable
C/C++
#include "stdafx.h" #include "Helper.h" #include "Logger.h" #ifdef WIN32 #include "dirent_windows.h" #include <direct.h> #else #include <dirent.h> #include <unistd.h> #endif #if !defined(WIN32) #include <sys/ptrace.h> #endif #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <fstream> #include <ma...
vuln
Vulnerable
C/C++
LOCAL int find_address_in_search_tree(MMDB_s *mmdb, uint8_t *address, sa_family_t address_family, MMDB_lookup_result_s *result) { record_info_s record_info = record_info_for_database(mmdb); if (0 == record_info.right_record_offset) { ...
vuln
Vulnerable
Unknown
package fleet const ( // ActionRead refers to reading an entity. ActionRead = "read" // ActionList refers to listing an entity. ActionList = "list" // ActionWrite refers to writing (CRUD operations) an entity. ActionWrite = "write" // // User specific actions // // ActionWriteRole is a write to a user's gl...
vuln
Safe
Go
datum_to_json(Datum val, bool is_null, StringInfo result, JsonTypeCategory tcategory, Oid outfuncoid, bool key_scalar) { char *outputstr; text *jsontext; /* callers are expected to ensure that null keys are not passed in */ char *outputstr; text *jsontext; check_stack_depth(...
vuln
Safe
C/C++
static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_ptr) { WtvContext *wtv = s->priv_data; AVIOContext *pb = wtv->pb; while (!url_feof(pb)) { ff_asf_guid g; int len, sid, consumed; ff_get_guid(pb, &g); len = avio_rl32(pb); if (len < 32) ...
vuln
Safe
C/C++
juniper_ggsn_print(netdissect_options *ndo, const struct pcap_pkthdr *h, register const u_char *p) { struct juniper_l2info_t l2info; struct juniper_ggsn_header { uint8_t svc_id; uint8_t flags_len; uint8_t proto; uint8_t flags; ...
vuln
Safe
C/C++
OM_uint32 KRB5_CALLCONV gss_pseudo_random (OM_uint32 *minor_status, gss_ctx_id_t context_handle, int prf_key, const gss_buffer_t prf_in, ssize_t desired_output_len, gss_buffer_t prf_out) { OM_uint32 status; gss_union_ctx_id_t ctx; gss_mechanism me...
vuln
Vulnerable
C/C++
/* ** vm.c - virtual machine for mruby ** ** See Copyright Notice in mruby.h */ #include <mruby.h> #include <mruby/array.h> #include <mruby/class.h> #include <mruby/hash.h> #include <mruby/irep.h> #include <mruby/numeric.h> #include <mruby/proc.h> #include <mruby/range.h> #include <mruby/string.h> #include <mruby/vari...
vuln
Safe
C/C++
def reset_password @admin_user = Motor::AdminUser.find(params[:admin_user_id]) authorize!(:manage, @admin_user) Devise::Mailer.default_url_options = { host: request.host, protocol: request.protocol, port: request.port } @admin_user.send_reset_password_instructions head :ok end
vuln
Vulnerable
Ruby
def legal?(string) string.to_s =~ /^[0-9a-f]{24}$/i ? true : false end
vuln
Vulnerable
Ruby
def get_top_popular(top_num): """ query the top(top_num) popular articles top_num => list of [title, count] """ cmd = """SELECT title, views FROM articles INNER JOIN ( SELECT path, count(path) AS views FROM log GROUP BY log.path ) AS log ...
vuln
Safe
Python
CtPtr ProtocolV1::handle_connect_message_2() { ldout(cct, 20) << __func__ << dendl; ldout(cct, 20) << __func__ << " accept got peer connect_seq " << connect_msg.connect_seq << " global_seq " << connect_msg.global_seq << dendl; connection->set_peer_type(connect_msg.host_type); ...
vuln
Safe
C/C++
package api // Visibility is the type of a visibility. type Visibility string const ( // Public is the PUBLIC visibility. Public Visibility = "PUBLIC" // Protected is the PROTECTED visibility. Protected Visibility = "PROTECTED" // Private is the PRIVATE visibility. Private Visibility = "PRIVATE" ) func (e Visi...
vuln
Vulnerable
Go
__nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags) { struct nlmsghdr *nlh; int size = NLMSG_LENGTH(len); nlh = (struct nlmsghdr*)skb_put(skb, NLMSG_ALIGN(size)); nlh->nlmsg_type = type; nlh->nlmsg_len = size; nlh->nlmsg_flags = flags; nlh->nlmsg_pid = pid; nlh->nlmsg_seq = seq; r...
vuln
Vulnerable
Unknown
static int mpegvideo_probe(AVProbeData *p) { uint32_t code= -1; int pic=0, seq=0, slice=0, pspack=0, vpes=0, apes=0, res=0, sicle=0; int i, j; uint32_t last = 0; for(i=0; i<p->buf_size; i++){ code = (code<<8) + p->buf[i]; if ((code & 0xffffff00) == 0x100) { switch(code){ ...
vuln
Safe
C/C++
@NonNull @Override public ProteusView inflate(@NonNull Layout layout, @NonNull ObjectValue data, @Nullable ViewGroup parent, int dataIndex) { /* * Get the the view type parser for this layout type */ final ViewTypeParser parser = getParser(layout); if (parser == null) ...
vuln
Safe
Java
static int ivr_read_header(AVFormatContext *s) { unsigned tag, type, len, tlen, value; int i, j, n, count, nb_streams = 0, ret; uint8_t key[256], val[256]; AVIOContext *pb = s->pb; AVStream *st; int64_t pos, offset, temp; pos = avio_tell(pb); tag = avio_rl32(pb); if (tag == MKTAG('....
vuln
Safe
Unknown
/** * The contents of this file are subject to the license and copyright * detailed in the LICENSE and NOTICE files at the root of the source * tree and available online at * * http://www.dspace.org/license/ */ package org.dspace.app.webui.servlet; import java.io.BufferedInputStream; import java.io.File; import ...
vuln
Safe
Java
static int acpi_load_old(QEMUFile *f, void *opaque, int version_id) { PIIX4PMState *s = opaque; int ret, i; uint16_t temp; ret = pci_device_load(&s->dev, f); if (ret < 0) { return ret; } qemu_get_be16s(f, &s->ar.pm1.evt.sts); qemu_get_be16s(f, &s->ar.pm1.evt.en); qemu_get_be1...
vuln
Safe
C/C++
static const SSL_METHOD *ssl23_get_client_method(int ver) { #ifndef OPENSSL_NO_SSL2 if (ver == SSL2_VERSION) return(SSLv2_client_method()); #endif if (ver == SSL3_VERSION) return(SSLv3_client_method()); else if (ver == TLS1_VERSION) return(TLSv1_c...
vuln
Vulnerable
C/C++
private void setOptions() { if (getContext() == null) return; SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); swRestoreOnLaunch.setChecked(prefs.getBoolean("restore_on_launch", true)); swSyncOnlaunch.setChecked(prefs.getBoolean("sync_o...
vuln
Vulnerable
Java
void DISOpticalFlowImpl::calc(InputArray I0, InputArray I1, InputOutputArray flow) { CV_Assert(!I0.empty() && I0.depth() == CV_8U && I0.channels() == 1); CV_Assert(!I1.empty() && I1.depth() == CV_8U && I1.channels() == 1); CV_Assert(I0.sameSize(I1)); CV_Assert(I0.isContinuous()); CV_Assert(I1.isCont...
vuln
Vulnerable
C/C++
uint8_t ethereum_extractThorchainData(const EthereumSignTx *msg, char *buffer) { // Swap data begins 164 chars into data buffer: // offset = deposit function hash + address + address + uint256 uint16_t offset = 4 + (5 * 32); int16_t len = msg->data_length - offset; if...
vuln
Vulnerable
C/C++
OM_uint32 KRB5_CALLCONV gss_unwrap (minor_status, context_handle, input_message_buffer, output_message_buffer, conf_state, qop_state) OM_uint32 * minor_status; gss_ctx_id_t context_handle; gss_buffer_t input_message_buffer; gss_buffer_t output_message_buf...
vuln
Safe
C/C++
status_t OMXNodeInstance::allocateSecureBuffer( OMX_U32 portIndex, size_t size, OMX::buffer_id *buffer, void **buffer_data, sp<NativeHandle> *native_handle) { if (buffer == NULL || buffer_data == NULL || native_handle == NULL) { ALOGE("b/25884056"); return BAD_VALUE; } if (portInd...
vuln
Safe
C/C++
package com.salesmanager.shop.admin.controller.products; import com.salesmanager.core.business.services.catalog.category.CategoryService; import com.salesmanager.core.business.services.catalog.product.ProductService; import com.salesmanager.core.business.services.catalog.product.image.ProductImageService; import com.s...
vuln
Safe
Java
static int discovery_stop(struct discovery_client *client) { struct btd_adapter *adapter = client->adapter; struct mgmt_cp_stop_discovery cp; /* Check if there are more client discovering */ if (g_slist_next(adapter->discovery_list)) { discovery_remove(client); update_discovery_filter(adapter); return 0; } ...
vuln
Vulnerable
C/C++
static int pn533_usb_probe(struct usb_interface *interface, const struct usb_device_id *id) { struct pn533 *priv; struct pn533_usb_phy *phy; struct usb_host_interface *iface_desc; struct usb_endpoint_descriptor *endpoint; int in_endpoint = 0; int out_endpoint = 0; int rc = -ENOMEM; int i; u32 protocols; en...
vuln
Vulnerable
C/C++
function updateServiceDescription(serviceId) { const $serviceDescription = $('#service-description'); $serviceDescription.empty(); const service = vars('available_services').find( (availableService) => Number(availableService.id) === Number(serviceId) ); if (!servi...
vuln
Vulnerable
JavaScript
putsum(uint8_t *data, uint32_t n, uint32_t sloc, uint32_t css, uint32_t cse) { uint32_t sum; if (cse && cse < n) n = cse + 1; if (sloc < n-1) { sum = net_checksum_add(n-css, data+css); stw_be_p(data + sloc, net_checksum_finish(sum)); } }
vuln
Vulnerable
C/C++
/*****************************************************************************/ /* LibreDWG - free implementation of the DWG file format */ /* */ /* Copyright (C) 2009-2010,2018-2021 Free Software Foundation, Inc. */ ...
vuln
Safe
C/C++
static void disas_ldst_reg_imm9(DisasContext *s, uint32_t insn, int opc, int size, int rt, bool is_vector) { int rn = extract32(insn, 5, 5); int imm9 = sextract32(insn, 12, 9); int...
vuln
Vulnerable
C/C++
static int connect_namedsocket(const char *path) { int sockfd, size; struct sockaddr_un helper; sockfd = socket(AF_UNIX, SOCK_STREAM, 0); if (sockfd < 0) { fprintf(stderr, "socket %s\n", strerror(errno)); return -1; } strcpy(helper.sun_path, path); helper.sun_family = AF_UNIX...
vuln
Vulnerable
C/C++
def replace_flag_at_index(file_content): file_content = io.StringIO(file_content) content = list(csv.reader(file_content)) header = content[0] flag_col_index = header.index("flag") content[flag_index][flag_col_index] = flag_option output = io.Strin...
vuln
Vulnerable
Python
int bit_search_sentinel (Bit_Chain *dat, unsigned char sentinel[16]) { long unsigned int i, j; for (i = 0; i < dat->size; i++) { for (j = 0; j < 16; j++) { if (dat->chain[i + j] != sentinel[j]) break; } if (j == 16) { dat->byte = i + j; ...
vuln
Vulnerable
C/C++
public function renameTag($oldName, $newName) { // http://stackoverflow.com/a/1873932 // create new as alias to old (`git tag NEW OLD`) $this->run('tag', '--end-of-options', $newName, $oldName); // delete old (`git tag -d OLD`) $this->removeTag($oldName); return $this; }
vuln
Safe
PHP
package com.salesmanager.shop.admin.model.customer.attribute; import java.io.Serializable; import java.util.List; import com.salesmanager.shop.model.entity.ShopEntity; public class CustomerOption extends ShopEntity implements Serializable { /** * */ private static final long serialVersionUID = 1L; privat...
vuln
Safe
Java
static int pad_pkcs2(bn_t m, int *p_len, int m_len, int k_len, int operation) { uint8_t pad, h1[RLC_MD_LEN], h2[RLC_MD_LEN]; /* MSVC does not allow dynamic stack arrays */ uint8_t *mask = RLC_ALLOCA(uint8_t, k_len); int result = RLC_ERR; bn_t t; bn_null(t); RLC_TRY { bn_new(t); switch...
vuln
Safe
C/C++
static int do_format(int drive, struct format_descr *tmp_format_req) { int ret; if (lock_fdc(drive)) return -EINTR; set_floppy(drive); if (!_floppy || _floppy->track > drive_params[current_drive].tracks || tmp_format_req->track >= _floppy->track || tmp_format_req->head >= _floppy->head || (_...
vuln
Vulnerable
Unknown
static void copy_frame(J2kEncoderContext *s) { int tileno, compno, i, y, x; uint8_t *line; for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++){ J2kTile *tile = s->tile + tileno; if (s->planar){ for (compno = 0; compno < s->ncomponents; compno++){ J2kC...
vuln
Safe
C/C++
@Override public Void visitFieldCall(FieldCallExpression expr, Void params) { if (expr.getArgument() instanceof ReferenceExpression && ((ReferenceExpression) expr.getArgument()).getBinding() == myThisBinding && (myFields == null || myFields.contains(expr.getDefinition()))) { myResult.add(expr.getDefinition(...
vuln
Vulnerable
Java
xmlParse3986Port(xmlURIPtr uri, const char **str) { const char *cur = *str; unsigned port = 0; /* unsigned for defined overflow behavior */ if (ISA_DIGIT(cur)) { while (ISA_DIGIT(cur)) { port = port * 10 + (*cur - '0'); cur++; } if (uri != NULL) uri->port = port & USHRT_MAX; /* port value mod...
vuln
Safe
C/C++
AvahiDnsPacket *avahi_recv_dns_packet_ipv4( int fd, AvahiIPv4Address *ret_src_address, uint16_t *ret_src_port, AvahiIPv4Address *ret_dst_address, AvahiIfIndex *ret_iface, uint8_t *ret_ttl) { AvahiDnsPacket *p= NULL; struct msghdr msg; struct iovec io; siz...
vuln
Safe
Unknown
query(frame) { const options = { ...frame.options, mongoTransformer: rejectPrivateFieldsTransformer }; return models.Post.findOne(frame.data, options) .then((model) => { if (!model) { throw ne...
vuln
Safe
JavaScript
public String decodeJobId(String encodedJobId) { String tenantId = FHIRRequestContext.get().getTenantId(); SecretKeySpec key = KEY_MAP.computeIfAbsent(tenantId, k -> getJobIdEncryptionKey()); // Decrypt to get the batch job id. if (key == null) { return encodedJobId; ...
vuln
Vulnerable
Java
static int nbd_negotiate_drop_sync(QIOChannel *ioc, size_t size)
vuln
Safe
C/C++
int kex_input_kexinit(int type, u_int32_t seq, void *ctxt) { struct ssh *ssh = ctxt; struct kex *kex = ssh->kex; const u_char *ptr; u_int i; size_t dlen; int r; debug("SSH2_MSG_KEXINIT received"); if (kex == NULL) return SSH_ERR_INVALID_ARGUMENT; ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, NULL); ptr = sshpkt...
vuln
Safe
C/C++
void Transform::interpolate_bilinear( RawTile& in, unsigned int resampled_width, unsigned int resampled_height ){ // Pointer to input buffer unsigned char *input = (unsigned char*) in.data; int channels = in.channels; unsigned int width = in.width; unsigned int height = in.height; // Define a max index p...
vuln
Safe
C/C++
static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx) { VAAPIEncodeContext *ctx = avctx->priv_data; VAEncSequenceParameterBufferH264 *vseq = ctx->codec_sequence_params; VAEncPictureParameterBufferH264 *vpic = ctx->codec_picture_params; VAAPIEncodeH264Context ...
vuln
Safe
C/C++
static void dec_modu(DisasContext *dc) { int l1; LOG_DIS("modu r%d, r%d, %d\n", dc->r2, dc->r0, dc->r1); if (!(dc->env->features & LM32_FEATURE_DIVIDE)) { qemu_log_mask(LOG_GUEST_ERROR, "hardware divider is not available\n"); return; } l1 = gen_new_label(); tcg_gen_brcondi_tl(TCG...
vuln
Safe
C/C++
static char *ask_new_field(struct chfn_control *ctl, const char *question, char *def_val) { int len; char *buf = NULL; /* leave initialized to NULL or getline segfaults */ #ifndef HAVE_LIBREADLINE size_t dummy = 0; #endif if (!def_val) def_val = ""; while (true) { printf("%s [%s]:", question, def_val); ...
vuln
Vulnerable
Unknown
// Copyright (C) 2002 UltraVNC Team Members. All Rights Reserved. // Copyright (C) 2000-2002 Const Kaplinsky. All Rights Reserved. // Copyright (C) 2002 TightVNC. All Rights Reserved. // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. // ...
vuln
Vulnerable
C/C++
def _setup_app(self, app): global limiter from octoprint.server.util.flask import ( OctoPrintFlaskRequest, OctoPrintFlaskResponse, OctoPrintJsonEncoder, OctoPrintSessionInterface, PrefixAwareJinjaEnvironment, ReverseProxiedEnvironm...
vuln
Vulnerable
Python
@Override public EnumActionResult onItemUseFirst(@Nonnull EntityPlayer player, @Nonnull World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand) { ItemStack stack = player.getHeldItem(hand); NBTTagCompound compound = GTUtility.getOrCreateNbtCompound(stack); ...
vuln
Safe
Java
static int clone_submodule(const char *path, const char *gitdir, const char *url, const char *depth, struct string_list *reference, int quiet, int progress) { struct child_process cp = CHILD_PROCESS_INIT; argv_array_push(&cp.args, "clone"); argv_array_push(&cp.args, "--no-checkout"); if (quiet) argv_...
vuln
Safe
Unknown
/* * The MIT License * * Copyright (c) 2009 The Broad Institute * * 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, including without limitation the rights * to use...
vuln
Vulnerable
Java
# -*- 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
protected DataSource createDataSource() throws SQLException { InitialContext context = null; DataSource source = null; try { context = GeoTools.getInitialContext(); source = (DataSource) context.lookup(datasourceName); } catch (IllegalArgumentException | NoInitial...
vuln
Vulnerable
Java
static int ipvideo_decode_block_opcode_0xD(IpvideoContext *s, AVFrame *frame) { int y; unsigned char P[2]; for (y = 0; y < 8; y++) { if (!(y & 3)) { P[0] = bytestream2_get_byte(&s->stream_ptr); P[1] = bytestream2_get_byte(&s->stream_ptr); memset(s->pixel_ptr, ...
vuln
Vulnerable
C/C++
static decContext* tsd_dec_ctx_get(pthread_key_t *key) { #ifndef WIN32 pthread_once(&dec_ctx_once, jv_tsd_dec_ctx_init); // cannot fail #endif decContext *ctx = (decContext*)pthread_getspecific(*key); if (ctx) { return ctx; } decContext _ctx = { 0, DEC_MAX_EMAX, DEC_MIN_EMAX, DEC_...
vuln
Vulnerable
C/C++
void configure () { GTK.gtk_widget_realize (handle); /* * Feature in GTK: using gdk_screen_get_monitor_at_window() does not accurately get the correct monitor on the machine. * Using gdk_screen_get_monitor_at_point() returns it correctly. Using getLocation() on point will get * the coordinates for where the too...
vuln
Vulnerable
Java
static int ehci_state_fetchqtd(EHCIQueue *q) { EHCIqtd qtd; EHCIPacket *p; int again = 0; get_dwords(q->ehci, NLPTR_GET(q->qtdaddr), (uint32_t *) &qtd, sizeof(EHCIqtd) >> 2); ehci_trace_qtd(q, NLPTR_GET(q->qtdaddr), &qtd); p = QTAILQ_FIRST(&q->packets); if (p != NULL) { ...
vuln
Safe
C/C++
bool HpackDecoder::DecodeNextLiteralHeader(HpackInputStream* input_stream, bool should_index) { StringPiece name; if (!DecodeNextName(input_stream, &name)) return false; StringPiece value; if (!DecodeNextStringLiteral(input_stream, false, &value)) return fal...
vuln
Safe
C/C++
/* 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
@Override public @NotNull List<ITextComponent> getTooltipStrings(@NotNull CentrifugeRecipeAdapter recipe, double mouseX, double mouseY) { for (int i = 0; i < 3; i++) { Double itemWeight = recipe.getItemWeight(i+1); ItemStack item = recipe.items.get(i+1).getDisplayedIngredient(); ...
vuln
Vulnerable
Java
public boolean hasEscrowData(int userId) { return hasState(SP_E0_NAME, DEFAULT_HANDLE, userId) && hasState(SP_P1_NAME, DEFAULT_HANDLE, userId); }
vuln
Vulnerable
Java
protected function signDocument(\DOMDocument $document, $node) { $this->add509Cert($this->getCertificate()->getPublicKey()->getX509Certificate()); $this->setCanonicalMethod(XMLSecurityDSig::EXC_C14N); $this->addReference($document->documentElement, XMLSecurityDSig::SHA1, array('http://www.w3...
vuln
Vulnerable
PHP
@Nullable public static ItemModifier getModifier(ItemStack stack) { if (stack.isEmpty() || !stack.hasTag()) { return null; } if (ForbiddenArcanus.ITEM_MODIFIER_REGISTRY.get() == null) { return null; } return ForbiddenArcanus.ITEM_MODIFIER_REGISTRY.ge...
vuln
Safe
Java
rsvg_new_filter_primitive_erode (void) { RsvgFilterPrimitiveErode *filter; filter = g_new (RsvgFilterPrimitiveErode, 1); _rsvg_node_init (&filter->super.super, RSVG_NODE_TYPE_FILTER_PRIMITIVE_ERODE); filter->super.in = g_string_new ("none"); filter->super.result = g_string_new ("none"); filter->...
vuln
Safe
Unknown
static void cirrus_bitblt_fill_nop(CirrusVGAState *s, uint32_t dstaddr, int dstpitch, int bltwidth,int bltheight) { }
vuln
Safe
Unknown
void MediaStreamDispatcherHost::BindRequest( void MediaStreamDispatcherHost::Create( int render_process_id, int render_frame_id, MediaStreamManager* media_stream_manager, mojom::MediaStreamDispatcherHostRequest request) { DCHECK_CURRENTLY_ON(BrowserThread::IO); mojo::MakeStrongBinding( std::...
vuln
Safe
C/C++
BGD_DECLARE(gdImagePtr) gdImageCreateFromTgaCtx(gdIOCtx* ctx) { int bitmap_caret = 0; oTga *tga = NULL; /* int pixel_block_size = 0; int image_block_size = 0; */ volatile gdImagePtr image = NULL; int x = 0; int y = 0; tga = (oTga *) gdMalloc(sizeof(oTga)); if (!tga) { return NULL; } tga->bitmap = NULL; ...
vuln
Safe
C/C++
static void nick_hash_remove(CHANNEL_REC *channel, NICK_REC *nick) { NICK_REC *list, *newlist; list = g_hash_table_lookup(channel->nicks, nick->nick); if (list == NULL) return; if (list == nick) { newlist = nick->next; } else { newlist = list; while (list->next != nick) list = list->next; list->next...
vuln
Safe
C/C++
import { loginPage, projectsPage } from "../../support/page_objects/navigation"; import { mainPage } from "../../support/page_objects/mainPage"; import { isPostgres, isXcdb, roles, staticProjects, } from "../../support/page_objects/projectConstants"; import { isTestSuiteActive } from "../../support/page...
vuln
Safe
JavaScript
/* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) | | Copyrigh...
vuln
Vulnerable
C/C++
null!=na){ca=ia.getAttribute("section");aa=ia.getAttribute("subsection");if(null==ca&&(la=na.indexOf("/"),ca=na.substring(0,la),null==aa)){var qa=na.indexOf("/",la+1);-1<qa&&(aa=na.substring(la+1,qa))}la=ya[ca];null==la&&(xa++,la=[],ya[ca]=la);na=ia.getAttribute("clibs");null!=ra[na]&&(na=ra[na]);na={url:ia.getAttribut...
vuln
Safe
JavaScript
void bn_rsh(bn_t c, const bn_t a, unsigned int bits) { int digits = 0; bn_copy(c, a); RLC_RIP(bits, digits, bits); if (digits > 0) { dv_rshd(c->dp, a->dp, a->used, digits); } if (a->used > digits) { c->used = a->used - digits; } else { c->used = 0; } c->sign = a->sign; if (c->used > 0 && bits > 0) ...
vuln
Safe
C/C++
vips_tracked_malloc( size_t size ) { void *buf; vips_tracked_init(); /* Need an extra sizeof(size_t) bytes to track * size of this block. Ask for an extra 16 to make sure we don't break * alignment rules. */ size += 16; if( !(buf = g_try_malloc( size )) ) { #ifdef DEBUG g_assert_not_reac...
vuln
Vulnerable
C/C++
static int encode_block(SVQ1EncContext *s, uint8_t *src, uint8_t *ref, uint8_t *decoded, int stride, int level, int threshold, int lambda, int intra) { int count, y, x, i, j, split, best_mean, best_score, best_count; int best_vector[6]; int block_sum[7] = { 0,...
vuln
Vulnerable
C/C++
if(!self.define){const e=e=>{"require"!==e&&(e+=".js");let r=Promise.resolve();return i[e]||(r=new Promise((async r=>{if("document"in self){const i=document.createElement("script");i.src=e,document.head.appendChild(i),i.onload=r}else importScripts(e),r()}))),r.then((()=>{if(!i[e])throw new Error(`Module ${e} didn’t reg...
vuln
Safe
Java
// Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore // Parse the header files for OpenBSD and generate a Go usable sysctl MIB. // // Build a MIB with each entry being an array containing the lev...
vuln
Vulnerable
Go
static int em_syscall(struct x86_emulate_ctxt *ctxt) { struct x86_emulate_ops *ops = ctxt->ops; struct desc_struct cs, ss; u64 msr_data; u16 cs_sel, ss_sel; u64 efer = 0; /* syscall is not available in real mode */ if (ctxt->mode == X86EMUL_MODE_REAL || ctxt->mode == X86EMUL_MODE_VM86) return emulate_ud(...
vuln
Vulnerable
C/C++
static int next_string(lexer_t *lexer, const char *s) { char *end; size_t length; end = strchr(s, '\''); if(end == NULL) { return -1; } length = end - s; *lexer->token = STRING_VALUE; lexer->input = end + 1; /* Skip the closing delimiter. */ memcpy(lexer->value, s, length); (*lexer->value)[le...
vuln
Vulnerable
C/C++
/* Userspace key control operations * * Copyright (C) 2004-5 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) * * 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 Foun...
vuln
Vulnerable
C/C++
void mono_reflection_create_dynamic_method (MonoReflectionDynamicMethod *mb) { MonoReferenceQueue *queue; MonoMethod *handle; DynamicMethodReleaseData *release_data; ReflectionMethodBuilder rmb; MonoMethodSignature *sig; MonoClass *klass; GSList *l; int i; if (mono_runtime_is_shutting_down ()) mono_raise_e...
vuln
Safe
C/C++
(function (tree) { tree.Quoted = function (str, content, escaped, index, currentFileInfo) { this.escaped = escaped; this.value = content || ''; this.quote = str.charAt(0); this.index = index; this.currentFileInfo = currentFileInfo; }; tree.Quoted.prototype = { type: "Quoted", genCSS: functi...
vuln
Vulnerable
Java
static int64_t read_ts(const char *s) { int hh, mm, ss, ms; if (sscanf(s, "%u:%u:%u.%u", &hh, &mm, &ss, &ms) == 4) return (hh*3600LL + mm*60LL + ss) * 1000LL + ms; if (sscanf(s, "%u:%u.%u", &mm, &ss, &ms) == 3) return ( mm*60LL + ss) * 1000LL + ms; return AV_NOPTS_VALUE; }
vuln
Safe
C/C++
function handleMultipart (opts = {}) { if (!this.isMultipart()) { throw new InvalidMultipartContentTypeError() } this.log.debug('starting multipart parsing') let values = [] let pendingHandler = null // only one file / field can be processed at a time // "null" will close the consum...
vuln
Safe
JavaScript