code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
destroyPresentationContextList(LST_HEAD ** lst) { DUL_PRESENTATIONCONTEXT *pc; DUL_TRANSFERSYNTAX *ts; if ((lst == NULL) || (*lst == NULL)) return; while ((pc = (DUL_PRESENTATIONCONTEXT*) LST_Dequeue(lst)) != NULL) { if (pc->proposedTransferSyntax != NULL) { while ((ts = (DU...
vuln
Vulnerable
C/C++
int sctp_verify_asconf(const struct sctp_association *asoc, struct sctp_paramhdr *param_hdr, void *chunk_end, struct sctp_paramhdr **errp) { sctp_addip_param_t *asconf_param; union sctp_params param; int length, plen; param.v = (sctp_paramhdr_t *) param_hdr; while (param.v <= chunk_end - sizeof(...
vuln
Vulnerable
C/C++
@Override public boolean shouldOverrideUrlLoading( final WebView view, final String url) { if(url == null) { return false; } if(url.startsWith("data:")) { // Prevent imgur bug where we're directed to some random data URI return true; } // Go back if loading same page t...
vuln
Vulnerable
Java
func (c *Client) Update() (data.TargetFiles, error) { if err := c.UpdateRoots(); err != nil { if _, ok := err.(verify.ErrExpired); ok { // For backward compatibility, we wrap the ErrExpired inside // ErrDecodeFailed. return nil, ErrDecodeFailed{"root.json", err} } return nil, err } // Load trusted me...
vuln
Safe
Go
validate_exec_list(struct drm_i915_gem_exec_object2 *exec, int count) { int i; for (i = 0; i < count; i++) { char __user *ptr = (char __user *)(uintptr_t)exec[i].relocs_ptr; int length; /* limited by fault_in_pages_readable() */ if (exec[i].flags & __EXEC_OBJECT_UNKNOWN_FLAGS) return -EINVAL; /* Fi...
vuln
Vulnerable
Unknown
static void gt64120_pci_mapping(GT64120State *s) { if ((s->regs[GT_PCI0IOLD] & 0x7f) <= s->regs[GT_PCI0IOHD]) { if (s->PCI0IO_length) { memory_region_del_subregion(get_system_memory(), &s->PCI0IO_mem); memory_region_destroy(&s->PCI0IO_mem); } s->PCI...
vuln
Vulnerable
C/C++
int av_base64_decode(uint8_t *out, const char *in, int out_size) { int i; unsigned v = 0; uint8_t *dst = out; for (i = 0; in[i] && in[i] != '='; i++) { unsigned int index= in[i]-43; if (index>=FF_ARRAY_ELEMS(map2) || map2[index] == 0xff) return -1; v = (v << 6) + map2...
vuln
Safe
C/C++
public function createBranch($name, $checkout = FALSE) { // git branch $name $this->run('branch', '--end-of-options', $name); if ($checkout) { $this->checkout($name); } return $this; }
vuln
Safe
PHP
@Override public long readLong() { return activeRegion.readInt32(); }
vuln
Vulnerable
Java
@Override public void channelInactive(ChannelHandlerContext ctx) throws Exception { super.channelInactive(ctx); connectionController.decreaseConnection(ctx.channel().remoteAddress()); isActive = false; log.info("Closed connection from {}", remoteAddress); if (brokerIntercepto...
vuln
Vulnerable
Java
int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) { AVFrame *extended_frame = NULL; AVFrame *pa...
vuln
Safe
C/C++
TfLiteStatus SigmoidPrepare(TfLiteContext* context, TfLiteNode* node) { OpData* data = reinterpret_cast<OpData*>(node->user_data); TF_LITE_ENSURE_EQ(context, NumInputs(node), 1); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* input = GetInput(context, node, 0); TfLiteTensor* output = Ge...
vuln
Vulnerable
C/C++
@NotNull @Override public InteractionResult useOn(UseOnContext ctx) { ItemStack stack = ctx.getItemInHand(); Level world = ctx.getLevel(); Player player = ctx.getPlayer(); BlockPos pos = ctx.getClickedPos(); BlockState state = world.getBlockState(pos); Block block = state.getBlock(); Direction side = ct...
vuln
Safe
Java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may n...
vuln
Vulnerable
Java
var A=g.addClickHandler;g.addClickHandler=function(E,G,P){var J=G;G=function(F,H){if(null==H){var S=mxEvent.getSource(F);"a"==S.nodeName.toLowerCase()&&(H=S.getAttribute("href"))}null!=H&&g.isCustomLink(H)&&(mxEvent.isTouchEvent(F)||!mxEvent.isPopupTrigger(F))&&g.customLinkClicked(H)&&mxEvent.consume(F);null!=J&&J(F,H)...
vuln
Safe
JavaScript
private void addDocuments(boolean importZip, String charset, boolean immediateIndexing, final GUIDocument metadata, final Session session, List<GUIDocument> createdDocs) throws PersistenceException, ServerException, ParseException, IOException { checkWritePermission(metadata, session); Map<String, File> upl...
vuln
Safe
Java
static struct dentry *nfs_readdir_lookup(nfs_readdir_descriptor_t *desc) { struct dentry *parent = desc->file->f_path.dentry; struct inode *dir = parent->d_inode; struct nfs_entry *entry = desc->entry; struct dentry *dentry, *alias; struct qstr name = { .name = entry->name, .len = entry->len, }; struct inode...
vuln
Vulnerable
Unknown
/* * Copyright (C) Igor Sysoev * Copyright (C) NGINX, Inc. */ #include <njs_main.h> static njs_int_t njs_vm_init(njs_vm_t *vm); static njs_int_t njs_vm_handle_events(njs_vm_t *vm); const njs_str_t njs_entry_main = njs_str("main"); const njs_str_t njs_entry_module = njs_str("module"); const...
vuln
Vulnerable
C/C++
public static void loadAddons(PlayerEntity player) { if (EntityHelper.INSTANCE.isNPC(player)) return; String s = player.getGameProfile().getId().toString().replace("-", ""); loadAddons(s); }
vuln
Safe
Java
OMX_ERRORTYPE omx_vdec::update_portdef(OMX_PARAM_PORTDEFINITIONTYPE *portDefn) { OMX_ERRORTYPE eRet = OMX_ErrorNone; struct v4l2_format fmt; if (!portDefn) { return OMX_ErrorBadParameter; } DEBUG_PRINT_LOW("omx_vdec::update_portdef"); portDefn->nVersion.nVersion = OMX_SPEC_VERSION; portDefn->...
vuln
Safe
C/C++
void Filter::onDownstreamEvent(Network::ConnectionEvent event) { if (event == Network::ConnectionEvent::LocalClose || event == Network::ConnectionEvent::RemoteClose) { downstream_closed_ = true; } ENVOY_CONN_LOG(trace, "on downstream event {}, has upstream = {}", read_callbacks_->connection(), ...
vuln
Safe
Unknown
static void dp8393x_do_transmit_packets(dp8393xState *s) { NetClientState *nc = qemu_get_queue(s->nic); int width, size; int tx_len, len; uint16_t i; width = (s->regs[SONIC_DCR] & SONIC_DCR_DW) ? 2 : 1; while (1) { /* Read memory */ size = sizeof(uint16_t) * 6 * width; ...
vuln
Vulnerable
C/C++
void delegpt_add_neg_msg(struct delegpt* dp, struct msgreply_entry* msg) { struct reply_info* rep = (struct reply_info*)msg->entry.data; if(!rep) return; /* if error or no answers */ if(FLAGS_GET_RCODE(rep->flags) != 0 || rep->an_numrrsets == 0) { struct delegpt_ns* ns = delegpt_find_ns(dp, msg->key.qname, m...
vuln
Safe
Unknown
@Override public boolean invoke(MessageContext messageContext) { buildMessage(messageContext); org.apache.axis2.context.MessageContext axis2MessageContext = ((Axis2MessageContext) messageContext).getAxis2MessageContext(); String httpMethod = axis2MessageContext.getProperty...
vuln
Vulnerable
Java
# cython: language_level=3str """A cleanup tool for HTML. Removes unwanted tags and content. See the `Cleaner` class for details. """ from __future__ import absolute_import import copy import re import sys try: from urlparse import urlsplit from urllib import unquote_plus except ImportError: # Python 3...
vuln
Vulnerable
Python
// Copyright 2012-2018 (c) Peter Širka <petersirka@gmail.com> // // 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, cop...
vuln
Vulnerable
JavaScript
int gnutls_pcert_import_openpgp (gnutls_pcert_st* pcert, gnutls_openpgp_crt_t crt, unsigned int flags) { int ret; size_t sz; memset(pcert, 0, sizeof(*pcert)); pcert->type = GNUTLS_CRT_OPENPGP; pcert->cert.data = NULL; sz = 0; ret = gnutls_openpgp_crt_export(crt, GNUTLS_OPENPGP_FMT_RAW, NULL, &sz); if (r...
vuln
Safe
Unknown
static void IBusBusConnectedCallback(IBusBus* bus, gpointer user_data) { void IBusBusConnected(IBusBus* bus) { LOG(WARNING) << "IBus connection is recovered."; MaybeRestoreConnections(); }
vuln
Safe
C/C++
public static String getWebHost() { if (BuildConfig.DEBUG) { return "http://localhost:3000"; } else { return getAPIHost(); } }
vuln
Vulnerable
Java
/* * 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
/* NetHack 3.6 topten.c $NHDT-Date: 1450451497 2015/12/18 15:11:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.44 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ #inclu...
vuln
Vulnerable
C/C++
void SkippedMBMotionComp( VideoDecData *video ) { Vop *prev = video->prevVop; Vop *comp; int ypos, xpos; PIXEL *c_comp, *c_prev; PIXEL *cu_comp, *cu_prev; PIXEL *cv_comp, *cv_prev; int width, width_uv; int32 offset; #ifdef PV_POSTPROC_ON // 2/14/2001 int imv; int32 size = (int32) video->nTotal...
vuln
Vulnerable
C/C++
package teler import ( "bytes" "errors" "fmt" "io" "regexp" "strings" "net/http" "net/url" "path/filepath" "github.com/kitabisa/teler-waf/request" "github.com/kitabisa/teler-waf/threat" "github.com/scorpionknifes/go-pcre" "golang.org/x/net/publicsuffix" ) // Analyze runs the actual checks. func (t *Tel...
vuln
Vulnerable
Go
def _clean_data(data): """ Remove html tags and extra white spaces e.g newline, tabs etc from provided data """ cleaner = Cleaner(tags=[], strip=True) cleaned_text = " ".join(re.split(r"\s+", cleaner.clean(data), flags=re.UNICODE)).strip() return cleaned_text
vuln
Vulnerable
Python
static int stub_probe(struct usb_device *udev) { struct stub_device *sdev = NULL; const char *udev_busid = dev_name(&udev->dev); struct bus_id_priv *busid_priv; int rc; dev_dbg(&udev->dev, "Enter probe\n"); /* check we should claim or not by busid_table */ busid_priv = get_busid_priv(udev_busid); if (!busid_p...
vuln
Vulnerable
Unknown
int crypto_authenticate_and_decrypt (struct crypto_instance *instance, unsigned char *buf, int *buf_len) { struct crypto_config_header *cch = (struct crypto_config_header *)buf; const char *guessed_str; if (cch->crypto_cipher_type != CRYPTO_CIPHER_TYPE_2_3) { guessed_str = NULL; if ((cch->crypto_cipher_type ...
vuln
Vulnerable
Unknown
void nfc_unregister_device(struct nfc_dev *dev) { int rc; pr_debug("dev_name=%s\n", dev_name(&dev->dev)); rc = nfc_genl_device_removed(dev); if (rc) pr_debug("The userspace won't be notified that the device %s " "was removed\n", dev_name(&dev->dev)); device_lock(&dev->dev); if (dev->rfkill) { rfkill_un...
vuln
Vulnerable
Unknown
@Override public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) { VoxelShape shape = state.get(OPEN) ? SHAPE_OPEN : SHAPE; if (state.get(OPEN) && state.get(PART).isRight()) { shape = VoxelShapeHelper.add(-12.0D, 0.0D, 0.0D, -12.0D, 0.0D...
vuln
Vulnerable
Java
static int lua_websocket_read(lua_State *L) { apr_socket_t *sock; apr_status_t rv; int do_read = 1; int n = 0; apr_size_t len = 1; apr_size_t plen = 0; unsigned short payload_short = 0; apr_uint64_t payload_long = 0; unsigned char *mask_bytes; char byte; int plaintext; ...
vuln
Safe
C/C++
def exec_command(self, cmd, in_data=None, sudoable=True): super(Connection, self).exec_command(cmd, in_data=in_data, sudoable=sudoable) if cmd == "-" and not in_data.startswith(b"#!"): # The powershell plugin sets cmd to '-' when we are executing...
vuln
Vulnerable
Python
public static HttpClientInterface makeHttpClient(boolean usePool) { return new HttpClientInterface() { private CloseableHttpClient httpClient = null; private synchronized CloseableHttpClient getHttpClient4() { if (httpClient == null) { HttpClientBuilder httpClientBuilder = HttpClients.custom(); ...
vuln
Vulnerable
Java
finish_process_as_req(struct as_req_state *state, krb5_error_code errcode) { krb5_key_data *server_key; krb5_keyblock *as_encrypting_key = NULL; krb5_data *response = NULL; const char *emsg = 0; int did_log = 0; loop_respond_fn oldrespond; void *oldarg; kdc_realm_t *kdc_active_realm = st...
vuln
Safe
C/C++
function VirtualBackground({ _jitsiTrack, _selectedThumbnail, _virtualSource, dispatch, t }: Props) { const [ options, setOptions ] = useState({}); const localImages = jitsiLocalStorage.getItem('virtualBackgrounds'); const [ storedImages, setStoredImages ] = useState((localImages && Bourne.parse(localImages...
vuln
Safe
JavaScript
null,this.container)}));q.appendChild(u);u.className="geBtn gePrimaryBtn";b.editor.cancelFirst||q.appendChild(e);if(null!=k)for(c=0;c<k.length;c++)(function(v,x,A){v=mxUtils.button(v,function(z){x(z)});null!=A&&v.setAttribute("title",A);v.className="geBtn";q.appendChild(v)})(k[c][0],k[c][1],k[c][2]);m.appendChild(q);th...
vuln
Vulnerable
JavaScript
#!/usr/bin/python -u # # p7zr library # # Copyright (c) 2019-2021 Hiroshi Miura <miurahr@linux.com> # Copyright (c) 2004-2015 by Joachim Bauch, mail@joachim-bauch.de # 7-Zip Copyright (C) 1999-2010 Igor Pavlov # LZMA SDK Copyright (C) 1999-2010 Igor Pavlov # # This library is free software; you can redistribute it and/...
vuln
Vulnerable
Python
static int em_jmp_far(struct x86_emulate_ctxt *ctxt) { int rc; unsigned short sel; memcpy(&sel, ctxt->src.valptr + ctxt->op_bytes, 2); rc = load_segment_descriptor(ctxt, sel, VCPU_SREG_CS); if (rc != X86EMUL_CONTINUE) return rc; ctxt->_eip = 0; memcpy(&ctxt->_eip, ctxt->src.valptr, ctxt->op_bytes); return ...
vuln
Vulnerable
C/C++
private int getCurrentListSize() { if (activeSubPage == null) return 0; switch (activeSubPage) { case ENTITY_MUTATIONS: return entityMutationBreeding.size(); case ITEM_MUTATIONS: return itemMutationBreeding.size(); case CHILDREN: ...
vuln
Safe
Java
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * md5_client.c -- This client sends one or more files to MD5 QUIC server * for MD5 sum calculation. */ #include <assert.h> #include <errno.h> #include <inttypes.h> #include <stdio.h> #include <stdlib.h> #include <string.h> ...
vuln
Vulnerable
C/C++
@Override protected HashFunction getHMac(final byte[] key) { return Hashing.hmacSha512(key); }
vuln
Vulnerable
Java
public void requestSettingsRefresh() { Intent intent = new Intent(); intent.setAction(ACTION.SETTINGS_CHANGED); sendBroadcast(intent); }
vuln
Vulnerable
Java
void jsP_dumpsyntax(js_State *J, js_Ast *prog, int dominify) { minify = dominify; if (prog) { if (prog->type == AST_LIST) pstmlist(-1, prog); else { pstm(0, prog); nl(); } } if (minify > 1) putchar('\n'); }
vuln
Safe
C/C++
e1000e_io_read(void *opaque, hwaddr addr, unsigned size) { E1000EState *s = opaque; uint32_t idx; uint64_t val; switch (addr) { case E1000_IOADDR: trace_e1000e_io_read_addr(s->ioaddr); return s->ioaddr; case E1000_IODATA: if (e1000e_io_get_reg_index(s, &idx)) { ...
vuln
Vulnerable
C/C++
package context import ( "bytes" stdContext "context" "encoding/json" "encoding/xml" "errors" "fmt" "io" "io/ioutil" "mime/multipart" "net" "net/http" "net/url" "os" "path" "path/filepath" "reflect" "regexp" "sort" "strconv" "strings" "sync/atomic" "time" "unsafe" "github.com/kataras/iris/v12/...
vuln
Safe
Go
def karma_ask(name): db = db_connect() cursor = db.cursor() try: cursor.execute( ''' SELECT karma FROM people WHERE name='{}' '''.format(name)) karma = cursor.fetchone() if karma is None: logger.debug('No karma found for name {}'.format(name)) db.c...
vuln
Vulnerable
Python
def form( self, *, max_files: typing.Union[int, float] = 1000, max_fields: typing.Union[int, float] = 1000, ) -> AwaitableOrContextManager[FormData]: return AwaitableOrContextManagerWrapper( self._get_form(max_files=max_files, max_fields=max_fields) )
vuln
Safe
Python
static av_cold int ape_decode_init(AVCodecContext * avctx) { APEContext *s = avctx->priv_data; int i; if (avctx->extradata_size != 6) { av_log(avctx, AV_LOG_ERROR, "Incorrect extradata\n"); return -1; } if (avctx->bits_per_coded_sample != 16) { av_log(avctx, AV_LOG_ERROR, "On...
vuln
Vulnerable
C/C++
static int channel_setenv(LIBSSH2_CHANNEL *channel, const char *varname, unsigned int varname_len, const char *value, unsigned int value_len) { LIBSSH2_SESSION *session = channel->session; unsigned char *s, *data; static const unsigned char reply_codes[3] ...
vuln
Vulnerable
Unknown
file_asynch_read (struct rw *rw, struct command *command, nbd_completion_callback cb) { int dummy = 0; file_synch_read (rw, slice_ptr (command->slice), command->slice.len, command->offset); if (cb.callback (cb.user_data, &dummy) == -1) { perror (rw->name...
vuln
Vulnerable
Unknown
bool Capability::ChangeUnixUser(uid_t uid) { if (setInitialCapabilities()) { struct passwd *pw; if ((pw = getpwuid(uid)) == nullptr) { Logger::Error("unable to getpwuid(%d): %s", uid, folly::errnoStr(errno).c_str()); return false; } if (initgroups(pw->pw_name, pw->pw_...
vuln
Safe
C/C++
def prepare_plugin_docs_command(self, plugin_names, plugin_type=None, response_format=None, snippet=False, playbook_dir=None, module_path=None): if response_format and response_format not in DocConfig._supported_response_formats: raise ConfigurationError("Invalid...
vuln
Vulnerable
Python
int DSA_verify(int type, const unsigned char *dgst, int dgst_len, const unsigned char *sigbuf, int siglen, DSA *dsa) { DSA_SIG *s; const unsigned char *p = sigbuf; unsigned char *der = NULL; int derlen = -1; int ret=-1; s = DSA_SIG_new(); if (s == NULL) return(ret); if (d2i_DSA_SIG(&s,&p,siglen) == NULL...
vuln
Safe
C/C++
int rsa_rsassa_pss_sign( rsa_context *ctx, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, int hash_id, unsigned int hashlen, const unsigned char *h...
vuln
Safe
Unknown
public void processRequest() throws Exception { String dir = SQLInitServlet.getField("filePath") + "crf" + File.separator + "new" + File.separator; // YW 09-10-2007 << Now CRF_Design_Template_v2.xls is located at // $CATALINA_HOME/webapps/OpenClinica-instanceName/properties FormProcessor...
vuln
Safe
Java
static void qemu_tcg_init_vcpu(CPUState *cpu) { char thread_name[VCPU_THREAD_NAME_SIZE]; static QemuCond *single_tcg_halt_cond; static QemuThread *single_tcg_cpu_thread; if (qemu_tcg_mttcg_enabled() || !single_tcg_cpu_thread) { cpu->thread = g_malloc0(sizeof(QemuThread)); cpu->halt_cond ...
vuln
Safe
C/C++
pcl_status_read(byte * data, uint max_data, pcl_state_t * pcs) { uint count = min(max_data, pcs->status.write_pos - pcs->status.read_pos); if (count) memcpy(data, pcs->status.buffer + pcs->status.read_pos, count); pcs->status.read_pos += count; if (pcs->status.read_pos == p...
vuln
Vulnerable
Unknown
static int decode_init_thread_copy(AVCodecContext *avctx) { H264Context *h = avctx->priv_data; if (!avctx->internal->is_copy) return 0; memset(h->sps_buffers, 0, sizeof(h->sps_buffers)); memset(h->pps_buffers, 0, sizeof(h->pps_buffers)); h->rbsp_buffer[0] = NULL; h->rbsp_buffer[1] ...
vuln
Vulnerable
C/C++
@Override public boolean matches(@Nonnull CraftingInventory inv, World world) { ItemStack[] components = getComponents(inv); if(!components[jerrycanIndex].isEmpty()&&!components[containerIndex].isEmpty()&&countOccupiedSlots(inv)==2) { return FluidUtil.getFluidContained(components[jerrycanIndex]).map(fs -> { ...
vuln
Safe
Java
static int execute_decode_slices(H264Context *h, int context_count) { MpegEncContext *const s = &h->s; AVCodecContext *const avctx = s->avctx; H264Context *hx; int i; if (s->avctx->hwaccel || s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) return 0; if (context_count...
vuln
Safe
C/C++
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); selectedMeasurementUnit = Unit.getSelectedMeasurementUnit(getActivity()); selectedDeliveryUnit = Unit.getSelectedDeliveryUnit(getActivity()); selectedTemperatureUnit = TempUnit.getSelectedTemperat...
vuln
Vulnerable
Java
@Override public void init() { setPackage(oidcPackage); setLabel("OIDC client"); setDescription("OpenID Connect client registration"); addAttribute(REGISTRATION_ID, ROLE_ID) .setLabel("Registration ID") .setDescription("Registration identifier"); addAttribute(CLIENT_ID) ....
vuln
Vulnerable
Java
@Redirect(method = "drop", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;dropInventory()V")) private void generateGrave(LivingEntity livingEntity, DamageSource source) { if (!(livingEntity instanceof PlayerEntity player) || livingEntity.world.getGameRules().getBoolean(GameRules.KEE...
vuln
Vulnerable
Java
'use strict'; var tag = require('./tag'); var wrapWith = function (tagName) { return function (name, field, options) { var opt = options || {}; var wrappedContent = []; var errorHTML = opt.hideError ? '' : field.errorHTML(); if (field.widget.type === 'multipleCheckbox' || field.widg...
vuln
Vulnerable
JavaScript
static enum count_type __read_io_type(struct page *page) { struct address_space *mapping = page->mapping; if (mapping) { struct inode *inode = mapping->host; struct f2fs_sb_info *sbi = F2FS_I_SB(inode); if (inode->i_ino == F2FS_META_INO(sbi)) return F2FS_RD_META; if (inode->i_ino == F2FS_NODE_INO(sbi)) ...
vuln
Vulnerable
Unknown
public @Nullable UUID getOwnerID() { return this.getEntityData().get(OWNER_UUID).orElse(null); }
vuln
Safe
Java
def build_query(path, details) query = @pattern.dup prefix = path.prefix.empty? ? "" : "#{escape_entry(path.prefix)}\\1" query.gsub!(/\:prefix(\/)?/, prefix) partial = escape_entry(path.partial? ? "_#{path.name}" : path.name) query.gsub!(/\:action/, partial) details.each do |ext, ...
vuln
Safe
Ruby
void Logger::addPeer(const QString &ip, bool blocked, const QString &reason) { QWriteLocker locker(&lock); Log::Peer temp = { peerCounter++, QDateTime::currentMSecsSinceEpoch(), Utils::String::toHtmlEscaped(ip), blocked, Utils::String::toHtmlEscaped(reason) }; m_peers.push_back(temp); if (m_peers.size...
vuln
Safe
Unknown
int net_handle_fd_param(Monitor *mon, const char *param) { if (!qemu_isdigit(param[0])) { int fd; fd = monitor_get_fd(mon, param); if (fd == -1) { error_report("No file descriptor named %s found", param); return -1; } return fd; } else { re...
vuln
Vulnerable
C/C++
_addFiles: function(files) { var self = this, file_html, html = ''; file_html = '<li class="plupload_file ui-state-default plupload_delete" id="{id}" style="width:{thumb_width}px;">' + '<div class="plupload_file_thumb plupload_thumb_toload" style="width: {thumb_width}px; height: {thumb_height}px;">' + '<div...
vuln
Vulnerable
JavaScript
proc_file_lseek(struct file *file, loff_t offset, int orig) { lock_kernel(); switch (orig) { case 0: if (offset < 0) goto out; file->f_pos = offset; unlock_kernel(); return(file->f_pos); case 1: if (offset + file->f_pos < 0) goto out; file->f_pos += offset; unlock_kernel(); return(fil...
vuln
Vulnerable
Unknown
void Compute(OpKernelContext* const context) override { // node_id_range const Tensor* node_id_range_t; OP_REQUIRES_OK(context, context->input("node_id_range", &node_id_range_t)); const auto node_id_range = node_id_range_t->vec<int32>(); OP_REQUIRES( context, node_id_range_t->dims() == 1, ...
vuln
Safe
C/C++
@Override protected Map<String, String> getInternalConnectionProperties(DBRProgressMonitor monitor, DBPDriver driver, JDBCExecutionContext context, String purpose, DBPConnectionConfiguration connectionInfo) throws DBCException { Map<String, String> props = new HashMap<>(); if (driver.getId().equals(...
vuln
Safe
Java
static int esp_input(struct xfrm_state *x, struct sk_buff *skb) { struct ip_esp_hdr *esph; struct esp_data *esp = x->data; struct crypto_aead *aead = esp->aead; struct aead_request *req; struct sk_buff *trailer; int elen = skb->len - sizeof(*esph) - crypto_aead_ivsize(aead); int nfrags; void *tmp; u8 *iv; str...
vuln
Vulnerable
Unknown
static public File allocateFile(File dir, String name) { int q = name.indexOf('?'); if (q > 0) { name = name.substring(0, q); } File file = new File(dir, name); Path normalizedFile = file.toPath().normalize(); // For CVE-2018-19859, issue #1840 ...
vuln
Safe
Java
Win32StackFrameUnwinder::Win32StackFrameUnwinder( UnwindFunctions* unwind_functions) : at_top_frame_(true), unwind_info_present_for_all_frames_(true), pending_blacklisted_module_(nullptr), unwind_functions_(unwind_functions) { }
vuln
Vulnerable
C/C++
ServiceWorkerNetworkProvider::CreateForNavigation( int route_id, const RequestNavigationParams& request_params, blink::WebLocalFrame* frame, bool content_initiated) { bool browser_side_navigation = IsBrowserSideNavigationEnabled(); bool should_create_provider_for_window = false; int service_worker...
vuln
Safe
C/C++
/************************************************************************* This project implements a complete(!) JPEG (Recommendation ITU-T T.81 | ISO/IEC 10918-1) codec, plus a library that can be used to encode and decode JPEG streams. It also implements ISO/IEC 18477 aka JPEG XT which is an extensi...
vuln
Vulnerable
C/C++
sshkey_load_file(int fd, struct sshbuf *blob) { u_char buf[1024]; size_t len; struct stat st; int r, dontmax = 0; if (fstat(fd, &st) < 0) return SSH_ERR_SYSTEM_ERROR; if ((st.st_mode & (S_IFSOCK|S_IFCHR|S_IFIFO)) == 0 && st.st_size > MAX_KEY_FILE_SIZE) return SSH_ERR_INVALID_FORMAT; /* * Pre-allocate...
vuln
Safe
C/C++
exports.verifyCertificate = function verifyCertificate(cert, caDir, caFile, cb) { var command = 'openssl verify -purpose sslclient'; if (caDir) { command += ' -CApath ' + caDir; } if (caFile) { command += ' -CAfile ' + caFile; } var openssl = exec(command, function(err, stdout, stderr) { var validationResu...
vuln
Vulnerable
JavaScript
void rose_stop_heartbeat(struct sock *sk) { sk_stop_timer(sk, &sk->sk_timer); }
vuln
Safe
Unknown
int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh) { transaction_t *transaction = handle->h_transaction; journal_t *journal; struct journal_head *jh; int ret = 0; if (is_handle_aborted(handle)) return -EROFS; if (!buffer_jbd(bh)) { ret = -EUCLEAN; goto out; } /* * We don't grab j...
vuln
Vulnerable
C/C++
void helper_wrpil(CPUSPARCState *env, target_ulong new_pil) { #if !defined(CONFIG_USER_ONLY) trace_win_helper_wrpil(env->psrpil, (uint32_t)new_pil); env->psrpil = new_pil; if (cpu_interrupts_enabled(env)) { cpu_check_irqs(env); } #endif }
vuln
Vulnerable
C/C++
handle_client_accesses(CMD_Request *rx_message, CMD_Reply *tx_message) { CLG_Status result; RPT_ClientAccess_Report report; unsigned long nc; IPAddr ip; int i; struct timeval now; LCL_ReadCookedTime(&now, NULL); nc = ntohl(rx_message->data.client_accesses.n_clients); tx_message->status = htons(STT_S...
vuln
Safe
Unknown
inline Status SparseTensor::Split(const SparseTensor& input_tensor, const int split_dim, const int num_split, std::vector<SparseTensor>* result) { std::vector<Tensor> output_indices; std::vector<Tensor> output_values; std::vector<TensorShape> out...
vuln
Vulnerable
C/C++
void eb_mul_halve(eb_t r, const eb_t p, const bn_t k) { int i, j, trc, cof; int8_t naf[RLC_FB_BITS + 1], *_k; eb_t q, s, t[1 << (EB_WIDTH - 2)]; bn_t n, m; fb_t u, v, w, z; size_t l; if (bn_is_zero(k) || eb_is_infty(p)) { eb_set_infty(r); return; } bn_null(m); bn_null(n); eb_null(q); eb_null(s); for ...
vuln
Safe
C/C++
plan_a (char const *filename) { char const *s; char const *lim; char const **ptr; char *buffer; lin iline; size_t size = instat.st_size; /* Fail if the file size doesn't fit in a size_t, or if storage isn't available. */ if (! (size == instat.st_size && (buffer = malloc (size ? size : (size_t) ...
vuln
Safe
Unknown
function onContentLoad(){ if($('.autocomplete-clear').length == 0){ $('.autocomplete-input').scopedSearch({'delay': 250}); $('.ui-helper-hidden-accessible').remove(); } $('.flash.error').each(function(index, item) { if ($('.alert.alert-danger.base').length == 0) { if ($('#host-conflicts-modal...
vuln
Safe
JavaScript
static Image *ReadPCLImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define CropBox "CropBox" #define DeviceCMYK "DeviceCMYK" #define MediaBox "MediaBox" #define RenderPCLText " Rendering PCL... " char command[MaxTextExtent], *density, filename[MaxTextExtent], geometry[MaxTextExt...
vuln
Vulnerable
C/C++
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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 # (at your option) an...
vuln
Vulnerable
Python
static int remove_mapping(BDRVVVFATState* s, int mapping_index) { mapping_t* mapping = array_get(&(s->mapping), mapping_index); mapping_t* first_mapping = array_get(&(s->mapping), 0); if (mapping->first_mapping_index < 0) free(mapping->path); array_remove(&(s->mapping), mapping_index); ...
vuln
Vulnerable
C/C++
int sas_smp_get_phy_events(struct sas_phy *phy) { int res; u8 *req; u8 *resp; struct sas_rphy *rphy = dev_to_rphy(phy->dev.parent); struct domain_device *dev = sas_find_dev_by_rphy(rphy); req = alloc_smp_req(RPEL_REQ_SIZE); if (!req) return -ENOMEM; resp = alloc_smp_resp(RPEL_RESP_SIZE); if (!resp) { kfr...
vuln
Safe
C/C++