code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
define([ './summary-widget.html', '@braintree/sanitize-url' ], function ( summaryWidgetTemplate, urlSanitizeLib ) { const WIDGET_ICON_CLASS = 'c-sw__icon js-sw__icon'; function SummaryWidgetView(domainObject, openmct) { this.openmct = openmct; this.domainObject = domainObject; ...
vuln
Vulnerable
JavaScript
check_offset(char *memory, int total_size, char *name, void *offset, int size) { ptrdiff_t need_size = (char *) offset - memory + size; /*debug("check_offset: size=%x vs %x offset=%x size=%x\n", need_size, total_size, (char *) offset - memory, size);*/ if (need_size < 0 || need_size > total_size) { warn(_("%s:...
vuln
Vulnerable
Unknown
nm_wildcard_match_check(const char *str, const char *const *patterns, guint num_patterns) { gboolean has_optional = FALSE; gboolean has_any_optional = FALSE; guint i; for (i = 0; i < num_patterns; i++) { gboolean is_inverted; gboolean is_mandatory; gboolean match...
vuln
Vulnerable
C/C++
public Flags flagList() throws DecodingException { Flags flags = new Flags(); nextWordChar(); consumeChar('('); CharacterValidator validator = new NoopCharValidator(); String nextWord = consumeWord(validator); while (!nextWord.endsWith(")")) { DecoderUtils.set...
vuln
Vulnerable
Java
@Override public int getHeight(int x, int z, Heightmap.Type heightmap, HeightLimitView heightmapType) { TerraWorld world = TerraFabricPlugin.getInstance().getWorld(dimensionType); int height = world.getWorld().getMaxHeight(); while(height >= world.getWorld().getMinHeight() && !heightmap.getB...
vuln
Safe
Java
bool RendererPermissionsPolicyDelegate::IsRestrictedUrl( const GURL& document_url, std::string* error) { if (dispatcher_->IsExtensionActive(kWebStoreAppId)) { if (error) *error = errors::kCannotScriptGallery; return true; } if (SearchBouncer::GetInstance()->IsNewTabPage(document_url)) { ...
vuln
Vulnerable
Unknown
def CveMatch(cve, dep_metadata): '''Heuristically match dependency metadata against CVE. In general, we allow false positives but want to keep the noise low, to avoid the toil around having to populate IGNORES_CVES. Args: cve: Cve object to match against. dep_metadata: dependency metadata dictionary. ...
vuln
Safe
Python
@Override public void callSessionHoldReceived(ImsCallProfile profile) { TelephonyUtils.runWithCleanCallingIdentity(()-> { if (mListener != null) { mListener.callSessionHoldReceived(ImsCallSession.this, profile); } }, mListenerExecutor);...
vuln
Safe
Java
private static TokenCredential resolveTokenCredential(AzureProperties azureProperties) { if (azureProperties.getCredential() == null) { return null; } final TokenCredentialOptionsProvider.TokenCredentialOptions properties = azureProperties.getCredential(); final String tenan...
vuln
Vulnerable
Java
void Compute(OpKernelContext* ctx) override { const Tensor& input = ctx->input(0); const int depth = (axis_ == -1) ? 1 : input.dim_size(axis_); Tensor* output = nullptr; OP_REQUIRES_OK(ctx, ctx->allocate_output(0, input.shape(), &output)); Tensor num_bits_tensor; num_bits_tensor = ctx->input(3)...
vuln
Vulnerable
Unknown
SPL_METHOD(SplObjectStorage, unserialize) { spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); char *buf; int buf_len; const unsigned char *p, *s; php_unserialize_data_t var_hash; zval *pentry, *pmembers, *pcount = NULL, *pinf; long count; if (zend_parse_p...
vuln
Safe
Unknown
public void executeImpl() { try { logger.debug("Job Starting"); if (dispositionActions != null && !dispositionActions.isEmpty()) { boolean hasMore = true; int skipCount = 0; if (batchSize < 1) { ...
vuln
Safe
Java
GF_Err flac_dmx_process(GF_Filter *filter) { GF_FLACDmxCtx *ctx = gf_filter_get_udta(filter); GF_FilterPacket *pck, *dst_pck; u8 *output; u8 *start; Bool final_flush=GF_FALSE; u32 pck_size, remain, prev_pck_size; u64 cts = GF_FILTER_NO_TS; FLACHeader hdr; if (ctx->in_error) return GF_NON_COMPLIANT_BITSTREAM...
vuln
Safe
C/C++
public void setOverridenEntityName(final String name){ if (!getPDCLock()) return; try { livingEntity.getPersistentDataContainer().set(main.namespaced_keys.overridenEntityNameKey, PersistentDataType.STRING, name); } finally { releasePDCLock(); } }
vuln
Safe
Java
@Override public boolean mouseScrolled(double mouseX, double mouseY, double delta) { if (this.scalingChestScreen == null) { return false; } if (this.scalingChestScreen.handleMouseScrolled(mouseX, mouseY, delta)) { return false; } return super.mouseScrolled(mouseX, mouseY, delta); }
vuln
Safe
Java
static TCGv_i64 gen_muls_i64_i32(TCGv a, TCGv b) { TCGv_i64 tmp1 = tcg_temp_new_i64(); TCGv_i64 tmp2 = tcg_temp_new_i64(); tcg_gen_ext_i32_i64(tmp1, a); dead_tmp(a); tcg_gen_ext_i32_i64(tmp2, b); dead_tmp(b); tcg_gen_mul_i64(tmp1, tmp1, tmp2); tcg_temp_free_i64(tmp2); return tmp1; }
vuln
Vulnerable
C/C++
QPDFObjectHandle::parse(std::string const& object_str, std::string const& object_description) { PointerHolder<InputSource> input = new BufferInputSource("parsed object", object_str); QPDFTokenizer tokenizer; bool empty = false; QPDFObjectHandle result = parse(inpu...
vuln
Vulnerable
Unknown
void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) { const struct iphdr *iph = (const struct iphdr *)icmp_skb->data; struct tcphdr *th = (struct tcphdr *)(icmp_skb->data + (iph->ihl << 2)); struct inet_connection_sock *icsk; struct tcp_sock *tp; struct inet_sock *inet; const int type = icmp_hdr(icmp_skb)->type; ...
vuln
Safe
C/C++
static struct dir *squashfs_opendir(unsigned int block_start, unsigned int offset, struct inode **i) { squashfs_dir_header_3 dirh; char buffer[sizeof(squashfs_dir_entry_3) + SQUASHFS_NAME_LEN + 1] __attribute__((aligned)); squashfs_dir_entry_3 *dire = (squashfs_dir_entry_3 *) buffer; long long start; int bytes;...
vuln
Vulnerable
Unknown
public void recalculateValues(ACSettings settings, PlayerInfo self, float armourPercent, double enemyDistance) { this.settings = settings; // entity range is the range from each crystal // so adding these together should solve problem // and reduce searching time final double en...
vuln
Vulnerable
Java
int VP8LDecodeImage(VP8LDecoder* const dec) { VP8Io* io = NULL; WebPDecParams* params = NULL; if (dec == NULL) return 0; assert(dec->hdr_.huffman_tables_.root.start != NULL); assert(dec->hdr_.htree_groups_ != NULL); assert(dec->hdr_.num_htree_groups_ > 0); io = dec->io_; assert(io != NULL); params ...
vuln
Safe
C/C++
/* * Copyright (c) by Jaroslav Kysela <perex@perex.cz> * Copyright (c) 2009 by Krzysztof Helt * Routines for control of MPU-401 in UART mode * * MPU-401 supports UART mode which is not capable generate transmit * interrupts thus output is done via polling. Also, if irq < 0, then * input is done also via po...
vuln
Safe
C/C++
/* * Copyright (c) 2012-2019 Belledonne Communications SARL. * * This file is part of belle-sip. * * 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 3 of the License, or * (...
vuln
Vulnerable
C/C++
/** * @file * A Backbone Model for the state of an in-place editable entity in the DOM. */ (function (_, $, Backbone, Drupal) { Drupal.quickedit.EntityModel = Drupal.quickedit.BaseModel.extend( /** @lends Drupal.quickedit.EntityModel# */ { /** * @type {object} */ defaults: /** @lends...
vuln
Vulnerable
Python
// Package samlsp provides helpers that can be used to protect web services using SAML. package samlsp import ( "context" "crypto/rsa" "crypto/x509" "net/http" "net/url" "time" "github.com/crewjam/saml" "github.com/crewjam/saml/logger" ) // Options represents the parameters for creating a new middleware type...
vuln
Vulnerable
Go
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2012 * All rights reserved * * This file is part of GPAC / FFMPEG module * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public...
vuln
Safe
C/C++
getFile(path, destination, workingDir) { const fileName = path.replace(singleSlash, "\\"); const cmdArgs = util.format("%s %s", fileName, destination); return this.execute("get", cmdArgs, workingDir); }
vuln
Vulnerable
JavaScript
static Image *ReadTIFFImage(const ImageInfo *image_info, ExceptionInfo *exception) { #define ThrowTIFFException(severity,message) \ { \ if (tiff_pixels != (unsigned char *) NULL) \ tiff_pixels=(unsigned char *) RelinquishMagickMemory(tiff_pixels); \ if (quantum_info != (QuantumInfo *) NULL) \ quantum_info...
vuln
Vulnerable
C/C++
int x509_verify(const CA_CERT_CTX *ca_cert_ctx, const X509_CTX *cert, int *pathLenConstraint) { int ret = X509_OK, i = 0; bigint *cert_sig; X509_CTX *next_cert = NULL; BI_CTX *ctx = NULL; bigint *mod = NULL, *expn = NULL; int match_ca_cert = 0; struct timeval tv; uint8_t is_sel...
vuln
Vulnerable
Unknown
h2_rx_data(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2) { int w1 = 0, w2 = 0; char buf[4]; unsigned wi; ssize_t cl; CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); ASSERT_RXTHR(h2); CHECK_OBJ_ORNULL(r2, H2_REQ_MAGIC); if (r2 == NULL || !r2->scheduled) return (0); if (r2->state >= H2_S_CLOS_REM) { r2-...
vuln
Safe
Unknown
private static void generateValidApiaryTag() { //noinspection ConstantConditions TAGS.put(new ResourceLocation(ResourcefulBees.MOD_ID, "tags/items/valid_apiary.json"), ForgeRegistries.BLOCKS.getValues().stream() .filter(block -> ((BlockAccessor)block).getHasCollis...
vuln
Safe
Java
@Override public void login(String username, String password) throws ServletException { webApplication.getManager(SecurityManager.class).login(this, username, password); }
vuln
Vulnerable
Java
def aesDecrypt(data, key): cipher = AES.new(key, AES.MODE_CTR, counter=Counter.new(128, initial_value=0)) return cipher.decrypt(data)
vuln
Safe
Python
static int rfcomm_sock_getname(struct socket *sock, struct sockaddr *addr, int *len, int peer) { struct sockaddr_rc *sa = (struct sockaddr_rc *) addr; struct sock *sk = sock->sk; BT_DBG("sock %p, sk %p", sock, sk); sa->rc_family = AF_BLUETOOTH; sa->rc_channel = rfcomm_pi(sk)->channel; if (peer) bacpy(&...
vuln
Vulnerable
C/C++
private static void setNFC(Context context, boolean enable) { /* Not working in debug version of application !!!! Test with release version. */ Context appContext = context.getApplicationContext(); if (Permissions.hasPermission(appContext, Manifest.permission.WRITE_...
vuln
Vulnerable
Java
public static JsonObject initJsonObject(String file) throws IOException { if (!(new File(file).exists())) createNewJsonObject(file); try { return new JsonParser().parse(new FileReader(file)).getAsJsonObject(); } catch (IllegalStateException corrupted) { corrupted.printSta...
vuln
Vulnerable
Java
vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg, int main_fd __rte_unused) { struct virtio_net *dev = *pdev; int fd = msg->fds[0]; uint64_t size, off; void *addr; if (validate_msg_fds(msg, 1) != 0) return RTE_VHOST_MSG_RESULT_ERR; if (fd < 0) { VHOST_LOG_CONFIG(ERR, "invalid lo...
vuln
Safe
Unknown
void AudioRendererHost::OnCreateStream( int stream_id, const media::AudioParameters& params, int input_channels) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK(LookupById(stream_id) == NULL); media::AudioParameters audio_params(params); uint32 buffer_size = media::AudioBus::CalculateMe...
vuln
Vulnerable
C/C++
@Override public void setApplicationEnabledSetting( String pkg, int state, int flags, int userId, String callingPkg) throws HiddenAPIsException { try { // Throws IllegalArgumentException if pkg is unknown. mIPackageManager.setApplicationEnabledSetting(pkg, state, flags, userId, callingPkg); ...
vuln
Safe
Java
processCollectClass(struct module_qstate* qstate, int id) { struct iter_qstate* iq = (struct iter_qstate*)qstate->minfo[id]; struct module_qstate* subq; /* If qchase.qclass == 0 then send out queries for all classes. * Otherwise, do nothing (wait for all answers to arrive and the * processClassResponse to put th...
vuln
Vulnerable
Unknown
void *address_space_map(AddressSpace *as, hwaddr addr, hwaddr *plen, bool is_write) { hwaddr len = *plen; hwaddr done = 0; hwaddr l, xlat, base; MemoryRegion *mr, *this_mr; ram_addr_t raddr; if (len == 0) { return NU...
vuln
Vulnerable
C/C++
import { UITypes } from 'nocodb-sdk' import { uiTypes } from '@/components/project/spreadsheet/helpers/uiTypes' export default { props: { sqlUi: [Object, Function], column: Object }, computed: { uiDatatype() { return this.column && this.column.uidt }, uiDatatypeIcon() { const ui =...
vuln
Safe
JavaScript
def authenticate(self, handler, data): username = self.normalize_username(data['username']) if not self.create_users: if not self._user_exists(username): return None password = data['password'] # Don't enforce password length requirement on existing users, s...
vuln
Safe
Python
OME.WellBirdsEye = function(opts) { var $tree_details = $("#tree_details"); var $well_details = $("#well_details"); var $well_birds_eye = $("#well_birds_eye"); function selectionChanged() { var imageIds = []; $('.ui-selected', $well_birds_eye).each(function(ws){...
vuln
Vulnerable
JavaScript
parseAssociate(unsigned char *buf, unsigned long pduLength, PRV_ASSOCIATEPDU * assoc) { OFCondition cond = EC_Normal; unsigned char type; unsigned long itemLength; PRV_PRESENTATIONCONTEXTITEM * context; (void) memset(assoc, 0, sizeof(*assoc)); // Check if ...
vuln
Safe
C/C++
private PropertiesFile getCachedDataFile(String resolverName, ModuleRevisionId mRevId) { // we append ".${resolverName} onto the end of the regular ivydata location File file = new File(getRepositoryCacheRoot(), IvyPatternHelper.substitute(getDataFilePattern(), mRevId) + "." + resolverName);...
vuln
Safe
Java
private int mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir, const unsigned char *s, uint32_t offset, size_t nbytes, size_t linecnt) { /* * Note: FILE_SEARCH and FILE_REGEX do not actually copy * anything, but setup pointers into the source */ if (indir == 0) { switch (type) { case F...
vuln
Vulnerable
C/C++
// Copyright 2021 dudaodong@gmail.com. All rights reserved. // Use of this source code is governed by MIT license. // Package fileutil implements some basic functions for file operations package fileutil import ( "archive/zip" "bufio" "errors" "fmt" "io" "io/fs" "io/ioutil" "net/http" "os" "path" "path/fil...
vuln
Safe
Go
/* * Copyright (c) 2018 Fastly, Kazuho Oku * * 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, copy, modify, merge, ...
vuln
Vulnerable
C/C++
void WT_Interpolate (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pWTIntFrame) { EAS_PCM *pOutputBuffer; EAS_I32 phaseInc; EAS_I32 phaseFrac; EAS_I32 acc0; const EAS_SAMPLE *pSamples; const EAS_SAMPLE *loopEnd; EAS_I32 samp1; EAS_I32 samp2; EAS_I32 numSamples; /* initialize some local var...
vuln
Vulnerable
C/C++
int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to) { unsigned int tooff = 0, fromoff = 0; size_t size; if (to->start > from->start) fromoff = to->start - from->start; else tooff = from->start - to->start; if (fromoff >= from->len || tooff >= to->len) return -EINVAL; size = min_t(size...
vuln
Safe
Unknown
wolfssl_connect_step1(struct Curl_easy *data, struct connectdata *conn, int sockindex) { char *ciphers; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; struct ssl_backend_data *backend = connssl->backend; SSL_METHOD* req_method = NULL; curl_socket_t sockfd = conn->sock[sockindex...
vuln
Vulnerable
Unknown
package saml import ( "bytes" "compress/flate" "context" "crypto/rsa" "crypto/tls" "crypto/x509" "encoding/base64" "encoding/xml" "errors" "fmt" "html/template" "io/ioutil" "net/http" "net/url" "regexp" "time" "github.com/beevik/etree" xrv "github.com/mattermost/xml-roundtrip-validator" dsig "githu...
vuln
Vulnerable
Go
package com.zrlog.web.util; import com.zrlog.util.ZrLogUtil; import org.apache.http.conn.util.InetAddressUtils; import javax.servlet.http.HttpServletRequest; /** * 存放与Web相关的工具代码 */ public class WebTools { /** * 处理由于浏览器使用透明代理,或者是WebServer运行在诸如 nginx/apache 这类 HttpServer后面的情况,通过获取请求头真实IP地址 * * @p...
vuln
Safe
Java
static int vnc_refresh_server_surface(VncDisplay *vd) { int width = pixman_image_get_width(vd->guest.fb); int height = pixman_image_get_height(vd->guest.fb); int y; uint8_t *guest_row; uint8_t *server_row; int cmp_bytes; VncState *vs; int has_dirty = 0; pixman_image_t *tmpbuf = NULL;...
vuln
Safe
Unknown
public List<Hash> selectPeers(TunnelPoolSettings settings) { int length = getLength(settings); if (length < 0) { if (log.shouldLog(Log.DEBUG)) log.debug("Length requested is zero: " + settings); return null; } //if (false && shouldSelectE...
vuln
Vulnerable
Java
public void closeContext() { EXTThreadLocalContext.alcSetThreadContext(0L); checkAlError(); }
vuln
Vulnerable
Java
@Override public void onApplicationEvent(ApplicationStartedEvent applicationStartedEvent) { final StreamsBuilder builder = new StreamsBuilder(); KStream<String, Channel> channelStream = builder.<String, Channel>stream(applicationCommunicationChannels); final KStream<String, Metadata> metada...
vuln
Vulnerable
Java
MagickExport Image *ShadowImage(const Image *image,const double opacity, const double sigma,const ssize_t x_offset,const ssize_t y_offset, ExceptionInfo *exception) { #define ShadowImageTag "Shadow/Image" CacheView *image_view; Image *border_image, *clone_image, *shadow_image; MagickBoolea...
vuln
Vulnerable
C/C++
def html_message key = CGI.escape_html titleize(keys.last) path = CGI.escape_html keys.join('.') %(<span class="translation_missing" title="translation missing: #{path}">#{key}</span>) end def keys @keys ||= I18n.normalize_keys(locale, key, options[:scope]).tap do |keys| ...
vuln
Safe
Ruby
/* * Copyright 2014 Ted Dunning * * 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
Safe
Java
static void matroska_merge_packets(AVPacket *out, AVPacket *in) { out->data = av_realloc(out->data, out->size+in->size); memcpy(out->data+out->size, in->data, in->size); out->size += in->size; av_destruct_packet(in); av_free(in); }
vuln
Vulnerable
C/C++
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2020 * All rights reserved * * This file is part of GPAC / common tools sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser Gen...
vuln
Safe
C/C++
/************************************************************************ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. * Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko * Website: https://www.espocrm.com * * EspoCRM is free software: you can redistribute i...
vuln
Vulnerable
JavaScript
int net_init_socket(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan) { if (qemu_opt_get(opts, "fd")) { int fd; if (qemu_opt_get(opts, "listen") || qemu_opt_get(opts, "connect") || qemu_opt_get(opts, "...
vuln
Vulnerable
C/C++
def export_table( self, table: str, export_dir: str | None = None, input_null_string: str | None = None, input_null_non_string: str | None = None, staging_table: str | None = None, clear_staging_table: bool = False, enclosed_by: str | None = None, ...
vuln
Safe
Python
void Compute(OpKernelContext* context) override { core::RefCountPtr<BoostedTreesEnsembleResource> tree_ensemble_resource; OP_REQUIRES_OK(context, LookupResource(context, HandleFromInput(context, 0), &tree_ensemble_resource)); mutex_lock l(*tree_ensemble_resource->g...
vuln
Safe
Unknown
bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext) { struct f2fs_sb_info *sbi = F2FS_I_SB(inode); struct extent_tree *et; struct extent_node *en; struct extent_info ei; if (!f2fs_may_extent_tree(inode)) { /* drop largest extent */ if (i_ext && i_ext->len) { i_ext->len = 0; ret...
vuln
Vulnerable
C/C++
/* * This file Copyright (C) 2008-2014 Mnemosyne LLC * * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * */ #if defined(HAVE_USELOCALE) && (!defined(_XOPEN_SOURCE) || _XOPEN_SOURCE < 700) #undef _XOPEN_SOURCE #define _XOPEN_SOURCE 700 #endif #if defined(HAVE...
vuln
Vulnerable
C/C++
static void parse_input(h2o_http2_conn_t *conn) static int parse_input(h2o_http2_conn_t *conn) { size_t http2_max_concurrent_requests_per_connection = conn->super.ctx->globalconf->http2.max_concurrent_requests_per_connection; int perform_early_exit = 0; if (conn->num_streams.pull.half_closed + conn->num...
vuln
Safe
C/C++
polkit_backend_interactive_authority_check_authorization (PolkitBackendAuthority *authority, PolkitSubject *caller, PolkitSubject *subject, ...
vuln
Safe
Unknown
public function push($remote = NULL, array $params = NULL) { $this->run('push', $remote, $params); return $this; }
vuln
Vulnerable
PHP
my_object_process_variant_of_array_of_ints123 (MyObject *obj, GValue *variant, GError **error) { GArray *array; int i; int j; j = 0; array = (GArray *)g_value_get_boxed (variant); for (i = 0; i <= 2; i++) { j = g_array_index (array, int, i); if (j != i + 1) goto error; } return...
vuln
Vulnerable
C/C++
#define pr_fmt(fmt) "SVM: " fmt #include <linux/kvm_host.h> #include "irq.h" #include "mmu.h" #include "kvm_cache_regs.h" #include "x86.h" #include "cpuid.h" #include "pmu.h" #include <linux/module.h> #include <linux/mod_devicetable.h> #include <linux/kernel.h> #include <linux/vmalloc.h> #include <linux/highmem.h> #...
vuln
Safe
C/C++
static Image *ReadSIXELImage(const ImageInfo *image_info,ExceptionInfo *exception) { char *sixel_buffer; Image *image; MagickBooleanType status; register char *p; register ssize_t x; register Quantum *q; size_t length; ssize_t i, j, y; unsigned char ...
vuln
Vulnerable
Unknown
int main(int argc, char *argv[]) { struct mschm_decompressor *chmd; struct mschmd_header *chm; struct mschmd_file *file, **f; unsigned int numf, i; setbuf(stdout, NULL); setbuf(stderr, NULL); user_umask = umask(0); umask(user_umask); MSPACK_SYS_SELFTEST(i); if (i) return 0; if ((chmd = mspack_cre...
vuln
Safe
Unknown
async def massban( self, ctx: commands.Context, user_ids: commands.Greedy[RawUserIds], days: Optional[int] = None, *, reason: str = None, ): """Mass bans user(s) from the server. User IDs need to be provided in order to ban using this command....
vuln
Safe
Python
static void ehci_update_frindex(EHCIState *ehci, int uframes) { if (!ehci_enabled(ehci) && ehci->pstate == EST_INACTIVE) { return; } if ((ehci->frindex % 0x2000) + uframes >= 0x2000) { ehci_raise_irq(ehci, USBSTS_FLR); } int rollovers = (ehci->frindex + uframes) / 0x4000; ...
vuln
Safe
C/C++
def karma_rank(name): db = db_connect() cursor = db.cursor() try: cursor.execute(''' SELECT (SELECT COUNT(*) FROM people AS t2 WHERE t2.karma > t1.karma) AS row_Num FROM people AS t1 WHERE name='{}' '''.format(name)) rank = cursor.fetchone()[0] + 1 log...
vuln
Vulnerable
Python
void SendRendererReply(const std::vector<int>& fds, const Pickle& reply, int reply_fd) { struct msghdr msg; memset(&msg, 0, sizeof(msg)); struct iovec iov = {const_cast<void*>(reply.data()), reply.size()}; msg.msg_iov = &iov; msg.msg_iovlen = 1; char control_buffer[CMS...
vuln
Vulnerable
C/C++
bool Tensor::FromProto(Allocator* a, const TensorProto& proto) { CHECK_NOTNULL(a); TensorBuffer* p = nullptr; if (!TensorShape::IsValid(proto.tensor_shape())) return false; if (proto.dtype() == DT_INVALID) return false; TensorShape shape(proto.tensor_shape()); const int64_t N = shape.num_elements(); if (N...
vuln
Safe
C/C++
int avpriv_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header) { int sample_rate, frame_size, mpeg25, padding; int sample_rate_index, bitrate_index; if (header & (1<<20)) { s->lsf = (header & (1<<19)) ? 0 : 1; mpeg25 = 0; } else { s->lsf = 1; mpeg25 = 1; } ...
vuln
Safe
C/C++
/* * Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * * 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, copy,...
vuln
Vulnerable
Java
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
vuln
Safe
Python
/* 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
LoggerContext getLoggerContext(final ClassLoader classLoader) { LoggerContext ctx; try { final int key = computeKey(classLoader); // If possible, avoid using Guava cache since the callable puts unwanted pressure on the garbage collector. ctx = builtContexts.get(key); if (ctx == null) { ...
vuln
Vulnerable
Java
bool_t auth_gssapi_unwrap_data( OM_uint32 *major, OM_uint32 *minor, gss_ctx_id_t context, uint32_t seq_num, XDR *in_xdrs, bool_t (*xdr_func)(), caddr_t xdr_ptr) { gss_buffer_desc in_buf, out_buf; XDR temp_xdrs; uint32_t verf_seq_num; int conf, qop; unsigned in...
vuln
Safe
C/C++
int32_t HELPER(sdiv)(int32_t num, int32_t den) { if (den == 0) return 0; if (num == INT_MIN && den == -1) return INT_MIN; return num / den; }
vuln
Safe
C/C++
static UINT drdynvc_process_close_request(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) { int value; UINT error; UINT32 ChannelId; wStream* data_out; ChannelId = drdynvc_read_variable_uint(s, cbChId); WLog_Print(drdynvc->log, WLOG_DEBUG, "process_close_request: Sp=%d cbChId=%d, ChannelId=%"PRIu3...
vuln
Vulnerable
C/C++
int ff_lzw_decode(LZWState *p, uint8_t *buf, int len){ int l, c, code, oc, fc; uint8_t *sp; struct LZWState *s = (struct LZWState *)p; if (s->end_code < 0) return 0; l = len; sp = s->sp; oc = s->oc; fc = s->fc; for (;;) { while (sp > s->stack) { *buf++ = *...
vuln
Safe
C/C++
public void close() throws SQLException { cols = null; colsMeta = null; meta = null; limitRows = 0; row = 0; lastCol = -1; columnNameToIndex = null; if (!open) { return; } DB db = stmt.getDatbase(); synchronized (db) {...
vuln
Vulnerable
Java
function o(){var b,c,d,e;return b=sc,c=sc,58===a.charCodeAt(sc)?(d=ka,sc++):(d=X,0===xc&&g(la)),d!==X?(e=v(),e!==X?(tc=c,d=ma(e),c=d):(sc=c,c=X)):(sc=c,c=X),c===X&&(c=null),c!==X&&(tc=b,c=na(c)),b=c}
vuln
Safe
JavaScript
void setattr_copy(struct inode *inode, const struct iattr *attr) { unsigned int ia_valid = attr->ia_valid; if (ia_valid & ATTR_UID) inode->i_uid = attr->ia_uid; if (ia_valid & ATTR_GID) inode->i_gid = attr->ia_gid; if (ia_valid & ATTR_ATIME) inode->i_atime = timespec_trunc(attr->ia_atime, inode->i_sb->...
vuln
Safe
C/C++
static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy) { int i; dst->key_frame = src->key_frame; dst->pict_type = src->pict_type; dst->sample_aspect_ratio = src->sample_aspect_ratio; dst->pts = src->pts; dst->repeat_pict ...
vuln
Safe
C/C++
ImageReader getReader(File imageFile, ImageInputStream inputStream) { Set<ImageReader> readers = new LinkedHashSet<>(); ImageIO.getImageReaders(inputStream).forEachRemaining(readers::add); ImageIO.getImageReadersBySuffix(UtilMethods.getFileExtension(imageFile.getName())) ...
vuln
Safe
Java
gxps_images_create_from_png (GXPSArchive *zip, const gchar *image_uri, GError **error) { #ifdef HAVE_LIBPNG GInputStream *stream; GXPSImage *image = NULL; char *png_err_msg = NULL; png_struct *png; png_info *info; png_byte *data = NULL; png_byte **row_pointers =...
vuln
Vulnerable
Unknown
static int read_exceptions(struct pstore *ps, int (*callback)(void *callback_context, chunk_t old, chunk_t new), void *callback_context) { int r, full = 1; /* * Keeping reading chunks and inserting exceptions until * we find a partially full area. */ for (ps->current_area = 0; full; ps->cu...
vuln
Safe
Unknown
"/images/"+ma+".svg";return!0}function M(fa,ca,ba,ja){function ia(na,Ja){null==qa?(na=/^https?:\/\//.test(na)&&!b.editor.isCorsEnabledForUrl(na)?PROXY_URL+"?url="+encodeURIComponent(na):TEMPLATE_PATH+"/"+na,mxUtils.get(na,mxUtils.bind(this,function(Ga){200<=Ga.getStatus()&&299>=Ga.getStatus()&&(qa=Ga.getText());Ja(qa)}...
vuln
Vulnerable
JavaScript
dns_stricmp(const char* str1, const char* str2) { char c1, c2; *----------------------------------------------------------------------------*/ /* DNS variables */ static struct udp_pcb *dns_pcb; static u8_t dns_seqno; static struct dns_table_entry dns_table[DNS_TABLE_SIZE]; static str...
vuln
Vulnerable
C/C++
@Override public void onWalkingModeClicked(int id) { if (menuWalkingModes.containsKey(id)) { // update active walking mode WalkingMode walkingMode = menuWalkingModes.get(id); WalkingModePersistenceHelper.setActiveMode(walkingMode, getContext()); }else if(id == men...
vuln
Vulnerable
Java