code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, struct mm_walk *walk) { struct vm_area_struct *vma; struct pagemapread *pm = walk->private; pte_t *pte; int err = 0; split_huge_page_pmd(walk->mm, pmd); if (pmd_trans_unstable(pmd)) return 0; /* find the first VMA at...
vuln
Safe
C/C++
// Copyright (c) 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/ui/webui/browser_switch/browser_switch_ui.h" #include <memory> #include "base/bind.h" #include "base/metrics/histogram_macr...
vuln
Safe
C/C++
static int eightsvx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { EightSvxContext *esc = avctx->priv_data; int n, out_data_size, ret; uint8_t *src, *dst; if (!esc->samples && avpkt) { uint8_t *deinterleaved_samples, *...
vuln
Safe
C/C++
protected void internalClose() throws SQLException { if (this.pointer != null && !this.pointer.isClosed()) { if (conn.isClosed()) throw DB.newSQLException(SQLITE_ERROR, "Connection is closed"); rs.close(); batch = null; batchPos = 0; int resp = this....
vuln
Safe
Java
@Override public void callSessionInitiating(ImsCallProfile profile) { if (mListener != null) { TelephonyUtils.runWithCleanCallingIdentity(()-> mListener.callSessionInitiating( ImsCallSession.this, profile), mListenerExecutor); } }
vuln
Vulnerable
Java
/** * Copyright (c) 2006-2012, JGraph Ltd */ /** * Construcs a new toolbar for the given editor. */ function Toolbar(editorUi, container) { this.editorUi = editorUi; this.container = container; this.staticElements = []; this.init(); // Global handler to hide the current menu this.gestureHandler = mxUtils.bin...
vuln
Safe
JavaScript
static int jpeg2000_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { Jpeg2000DecoderContext *s = avctx->priv_data; ThreadFrame frame = { .f = data }; AVFrame *picture = data; int tileno, ret; s->avctx = avctx; s->buf = ...
vuln
Vulnerable
C/C++
App.Actions.WEB.update_ftp_username_hint = function(elm, hint) { if (hint.trim() == '') { $(elm).parent().find('.hint').html(''); } hint = hint.replace(/[^\w\d]/gi, ''); $(elm).parent().find('.v-ftp-user').val(hint); $(elm).parent().find('.hint').text(GLOBAL.FTP_USER_PREFIX + hint); }
vuln
Vulnerable
JavaScript
static int filter_frame(AVFilterLink *inlink, AVFrame *in) { AVFilterContext *ctx = inlink->dst; BoxBlurContext *s = ctx->priv; AVFilterLink *outlink = inlink->dst->outputs[0]; AVFrame *out; int plane; int cw = FF_CEIL_RSHIFT(inlink->w, s->hsub), ch = FF_CEIL_RSHIFT(in->height, s->vsub); int...
vuln
Safe
C/C++
static int uvc_scan_chain_backward(struct uvc_video_chain *chain, struct uvc_entity **_entity) { struct uvc_entity *entity = *_entity; struct uvc_entity *term; int id = -EINVAL, i; switch (UVC_ENTITY_TYPE(entity)) { case UVC_VC_EXTENSION_UNIT: case UVC_VC_PROCESSING_UNIT: id = entity->baSourceID[0]; break; ...
vuln
Vulnerable
Unknown
/* * umoci: Umoci Modifies Open Containers' Images * Copyright (C) 2016-2020 SUSE LLC * * 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...
vuln
Vulnerable
Go
public MetaData parseMetaData(String metaDataXML) throws SAMLException { Document document = parseFromBytes(metaDataXML.getBytes(StandardCharsets.UTF_8)); EntityDescriptorType root = unmarshallFromDocument(document, EntityDescriptorType.class); MetaData metaData = new MetaData(); metaData.id = root.getI...
vuln
Vulnerable
Java
png_text_compress(png_structp png_ptr, png_charp text, png_size_t text_len, int compression, compression_state *comp) { int ret; comp->num_output_ptr = 0; comp->max_output_ptr = 0; comp->output_ptr = NULL; comp->input = NULL; comp->input_len = 0; /* We may just want to pass the te...
vuln
Vulnerable
C/C++
package config import ( "bytes" "fmt" "io/ioutil" "os" "path/filepath" "runtime" "strings" "time" exec "golang.org/x/sys/execabs" "github.com/BurntSushi/toml" "github.com/mitchellh/go-homedir" log "github.com/sirupsen/logrus" "github.com/spf13/viper" prefixed "github.com/x-cray/logrus-prefixed-formatte...
vuln
Safe
Go
igraph_error_t igraph_read_graph_graphml(igraph_t *graph, FILE *instream, igraph_integer_t index) { #if HAVE_LIBXML == 1 xmlParserCtxtPtr ctxt; xmlGenericErrorFunc libxml_old_generic_error_handler; void* libxml_old_generic_error_context; xmlStructuredErrorFunc libxml_old_structured_error_handler; v...
vuln
Safe
C/C++
/* * Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com> * 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 co...
vuln
Safe
C/C++
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #define DEBUG_TYPE "vm" #include "JSLib/JSLibInternal.h" #include "hermes/VM/Casting.h" #include "hermes/VM/Interpreter.h" #include...
vuln
Vulnerable
JavaScript
int TabStrip::OnPerformDrop(const DropTargetEvent& event) { if (!drop_info_.get()) return ui::DragDropTypes::DRAG_NONE; const int drop_index = drop_info_->drop_index; const bool drop_before = drop_info_->drop_before; const bool file_supported = drop_info_->file_supported; SetDropIndex(-1, false); GU...
vuln
Vulnerable
C/C++
static Image *ReadPDBImage(const ImageInfo *image_info,ExceptionInfo *exception) { unsigned char attributes, tag[3]; Image *image; IndexPacket index; MagickBooleanType status; PDBImage pdb_image; PDBInfo pdb_info; register IndexPacket *indexes; register ssize_t ...
vuln
Safe
C/C++
static int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it, int tag, int aclass, char opt, ASN1_TLC *ctx, int depth) { const ASN1_TEMPLATE *tt, *errtt = NULL; const ASN1_EX...
vuln
Safe
Unknown
package com.salesmanager.shop.mapper.catalog; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.co...
vuln
Vulnerable
Java
private Result<Object> verifyFile(String name, ResourceType type, MultipartFile file) { Result<Object> result = new Result<>(); putMsg(result, Status.SUCCESS); if (FileUtils.directoryTraversal(name)) { logger.error("file alias name {} verify failed", name); putMsg(result...
vuln
Safe
Java
// Same as url, but TLD is optional $.validator.addMethod( "url2", function( value, element ) { return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})+(?::(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!...
vuln
Safe
JavaScript
void bm_fillpoly(Bitmap *b, BmPoint points[], unsigned int n) { /* http://alienryderflex.com/polygon_fill/ https://hackernoon.com/computer-graphics-scan-line-polygon-fill-algorithm-3cb47283df6 You might also be interested in this article: http://nothings.org/gamedev/rasterize/ */ unsigned int i...
vuln
Vulnerable
C/C++
/**************************************************************************** * * Copyright (C) 2006,2007 A.Kleine * * 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 2 of...
vuln
Vulnerable
C/C++
HttpStateData::continueAfterParsingHeader() { if (flags.handling1xx) { debugs(11, 5, HERE << "wait for 1xx handling"); Must(!flags.headers_parsed); return false; } if (!flags.headers_parsed && !eof) { debugs(11, 9, "needs more at " << inBuf.length()); flags.do_next_r...
vuln
Safe
Unknown
@Override protected void onStop() { super.onStop(); MusicUtils.notifyForegroundStateChanged(this, false); }
vuln
Vulnerable
Java
static identifier new_identifier(const char *n, struct compiling *c) { PyObject *id = PyUnicode_DecodeUTF8(n, strlen(n), NULL); if (!id) return NULL; /* PyUnicode_DecodeUTF8 should always return a ready string. */ assert(PyUnicode_IS_READY(id)); /* Check whether there are non-ASCII character...
vuln
Vulnerable
C/C++
static int i2c_slave_post_load(void *opaque, int version_id) { I2CSlave *dev = opaque; I2CBus *bus; I2CNode *node; bus = I2C_BUS(qdev_get_parent_bus(DEVICE(dev))); if ((bus->saved_address == dev->address) || (bus->saved_address == I2C_BROADCAST)) { node = g_malloc(sizeof(struct I2CNo...
vuln
Safe
C/C++
static int dx2_decode_slice_420(GetBitContext *gb, AVFrame *frame, int line, int left, uint8_t lru[3][8]) { int x, y; int width = frame->width; int ystride = frame->linesize[0]; int ustride = frame->linesize[1]; int vstride = frame->...
vuln
Safe
C/C++
void gps_tracker( void ) { ssize_t unused; int gpsd_sock; char line[256], *temp; struct sockaddr_in gpsd_addr; int ret, is_json, pos; fd_set read_fd; struct timeval timeout; /* attempt to connect to localhost, port 2947 */ pos = 0; gpsd_sock = socket( AF_INET, SOCK_STREAM, 0 ); ...
vuln
Safe
C/C++
import './allprojectschart.html' import { FlowRouter } from 'meteor/ostrio:flow-router-extra' import { getUserSetting, getUserTimeUnitVerbose } from '../../utils/frontend_helpers' Template.allprojectschart.onCreated(function allprojectschartCreated() { this.topTasks = new ReactiveVar() this.projectStats = new Reac...
vuln
Safe
JavaScript
static bool tight_can_send_png_rect(VncState *vs, int w, int h) { if (vs->tight.type != VNC_ENCODING_TIGHT_PNG) { return false; } if (ds_get_bytes_per_pixel(vs->ds) == 1 || vs->client_pf.bytes_per_pixel == 1) { return false; } return true; }
vuln
Safe
C/C++
@SuppressWarnings("ConstantConditions") // Clarity @Override public Map<Integer, ChunkFactory.Stats> export(File baseDir, String name, File backupDir, ProgressReceiver progressReceiver) throws IOException, ProgressReceiver.OperationCancelled { // Sanity checks final Set<Point> selectedTiles = wo...
vuln
Safe
Java
Http::FilterMetadataStatus Context::onResponseMetadata() { if (!wasm_->onResponseMetadata_) { return Http::FilterMetadataStatus::Continue; } if (wasm_->onResponseMetadata_(this, id_).u64_ == 0) { return Http::FilterMetadataStatus::Continue; } return Http::FilterMetadataStatus::Continue; // This is cur...
vuln
Vulnerable
C/C++
@EventHandler(priority = EventPriority.LOW) public static void onPreSellTransaction(PreTransactionEvent event) { if (event.isCancelled() || event.getTransactionType() != SELL) { return; } Player client = event.getClient(); UUID owner = event.getOwnerAccount().getUuid(); ...
vuln
Vulnerable
Java
############################################################################# # # Copyright (c) 2002 Zope Foundation and Contributors. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS...
vuln
Safe
Python
static inline signed int ReadPropertySignedLong(const EndianType endian, const unsigned char *buffer) { union { unsigned int unsigned_value; signed int signed_value; } quantum; unsigned int value; if (endian == LSBEndian) { value=(unsigned int) ((buffer[3] << 24) | (buff...
vuln
Vulnerable
Unknown
public InputStream setBlob(@NotNull final PersistentStoreTransaction txn, @NotNull final PersistentEntity entity, @NotNull final String blobName, @NotNull final InputStream stream) throws IOException { InputStream buffe...
vuln
Vulnerable
Java
public ResponseEntity<Void> addPetWithHttpInfo(Pet body) throws RestClientException { Object postBody = body; // verify the required parameter 'body' is set if (body == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' ...
vuln
Vulnerable
Java
R_API RBinJavaVerificationObj *r_bin_java_read_from_buffer_verification_info_new(ut8 *buffer, ut64 sz, ut64 buf_offset) { if (sz < 8) { return NULL; } ut64 offset = 0; RBinJavaVerificationObj *se = R_NEW0 (RBinJavaVerificationObj); if (!se) { return NULL; } se->file_offset = buf_offset; se->tag = buffer[off...
vuln
Safe
Unknown
/* 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
Safe
Python
/* globals ClipboardJS, inventreeFormDataUpload, inventreeGet, launchModalForm, user_settings, */ /* exported attachClipboard, enableDragAndDrop, exportFormatOptions, inventreeDocReady, inventreeLoad, inventreeSave, sanitizeData, */ function attachClipboard(selector, co...
vuln
Safe
Python
public void setListenIfResumed(boolean listenIfResumed) { if (listenIfResumed == ((mFlags & FLAG_LISTEN_IF_RESUMED) != 0)) { return; } if (listenIfResumed) { mFlags |= FLAG_LISTEN_IF_RESUMED; if ((mFlags & FLAG_RESUMED) != 0) { // If we are res...
vuln
Safe
Java
static int ipmi_register_netfn(IPMIBmcSim *s, unsigned int netfn, const IPMINetfn *netfnd) { if ((netfn & 1) || (netfn >= MAX_NETFNS) || (s->netfns[netfn / 2])) { return -1; } s->netfns[netfn / 2] = netfnd; return 0; }
vuln
Safe
C/C++
public static void save() { try (final BufferedWriter writer = Files.newBufferedWriter(configPath)) { JsonObject jsonSeeds = new JsonObject(); seeds.forEach(jsonSeeds::addProperty); root.add("seeds", jsonSeeds); JsonArray jsonIgnoredBlocks = new JsonArray(); ...
vuln
Safe
Java
static void hci_disconn_loglink_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) { struct hci_ev_disconn_logical_link_complete *ev = (void *) skb->data; struct hci_chan *hchan; BT_DBG("%s log handle 0x%4.4x status 0x%2.2x", hdev->name, le16_to_cpu(ev->handle), ev->status); if (ev->status)...
vuln
Safe
Unknown
public boolean importMedia(){ if(!LoginManager.isLoggedIn(context)) { return false; } if(!SyncManager.isImportEnabled(context)){ return false; } Log.e("EnteredImportMedia", "1"); boolean isSomethingImported = false; long lastImportedFileDate = Helpers.getPreference(context, SyncManager.LAST_IMPORTE...
vuln
Safe
Java
private void sendSharedPasswordAuthType() throws NoSuchPaddingException, IllegalBlockSizeException, NoSuchAlgorithmException, BadPaddingException, InvalidKeyException, InvalidAlgorithmParameterException { byte[] playerPasswordSalt = playerDatabase.getPlayerPasswordSalt(player.getName()); Secure...
vuln
Safe
Java
static int cgw_remove_job(struct sk_buff *skb, struct nlmsghdr *nlh) { struct cgw_job *gwj = NULL; struct hlist_node *nx; struct rtcanmsg *r; struct cf_mod mod; struct can_can_gw ccgw; u8 limhops = 0; int err = 0; if (!capable(CAP_NET_ADMIN)) return -EPERM; if (nlmsg_len(nlh) < sizeof(*r)) return -EINVAL...
vuln
Vulnerable
Unknown
TPM_RC TPML_TAGGED_POLICY_Unmarshal(TPML_TAGGED_POLICY *target, BYTE **buffer, INT32 *size) { TPM_RC rc = TPM_RC_SUCCESS; UINT32 i; if (rc == TPM_RC_SUCCESS) { rc = UINT32_Unmarshal(&target->count, buffer, size); } if (rc == TPM_RC_SUCCESS) { if (target->count > MAX_TAGGED_POLICIES) { rc = T...
vuln
Safe
C/C++
pixBlockconvGray(PIX *pixs, PIX *pixacc, l_int32 wc, l_int32 hc) { l_int32 w, h, d, wpl, wpla; l_uint32 *datad, *dataa; PIX *pixd, *pixt; PROCNAME("pixBlockconvGray"); if (!pixs) return (PIX *)ERROR_PTR("pixs not defined", procName...
vuln
Safe
Unknown
DeviceState *qdev_device_add(QemuOpts *opts, Error **errp) { DeviceClass *dc; const char *driver, *path; DeviceState *dev; BusState *bus = NULL; Error *err = NULL; driver = qemu_opt_get(opts, "driver"); if (!driver) { error_setg(errp, QERR_MISSING_PARAMETER, "driver"); return...
vuln
Vulnerable
C/C++
/* * PKCS15 emulation layer for TCOS based preformatted cards * * Copyright (C) 2011, Peter Koch <pk@opensc-project.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either *...
vuln
Safe
C/C++
static uint32_t get_cmd(ESPState *s, uint32_t maxlen) { uint8_t buf[ESP_CMDFIFO_SZ]; uint32_t dmalen, n; int target; target = s->wregs[ESP_WBUSID] & BUSID_DID; if (s->dma) { dmalen = MIN(esp_get_tc(s), maxlen); if (dmalen == 0) { return 0; } if (s->dma_me...
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
Vulnerable
Java
confirm = function(ndx) { var i = existed[ndx], file = files[i], last = ndx == existed.length-1; if (!file) { return; } fm.confirm({ title : fm.i18n(cut ? 'moveFiles' : 'copyFiles'), text : ['errExists', file.name, 'confirmRepl'], all : !la...
vuln
Vulnerable
JavaScript
static int intel_vgpu_mmap(struct mdev_device *mdev, struct vm_area_struct *vma) { unsigned int index; u64 virtaddr; unsigned long req_size, pgoff = 0; pgprot_t pg_prot; struct intel_vgpu *vgpu = mdev_get_drvdata(mdev); index = vma->vm_pgoff >> (VFIO_PCI_OFFSET_SHIFT - PAGE_SHIFT); if (index >= VFIO_PCI_ROM_REG...
vuln
Vulnerable
C/C++
@Override public void reset() { if (this.wearer != null && !this.wearer.getCommandSenderWorld().isClientSide()) { this.curios.clear(); this.invalidStacks.clear(); SortedSet<ISlotType> sorted = new TreeSet<>(CuriosApi.getSlotHelper().getSlotTypes(this.wearer)); for...
vuln
Vulnerable
Java
public static String getRelativePath(File rootDir, String absolutePath) { String rootDirPath = rootDir.getAbsolutePath().replace('\\', '/'); String objectPath = absolutePath.replace('\\', '/'); if (objectPath.startsWith(rootDirPath)) objectPath = objectPath.substring(rootDirPath.length()); if (obj...
vuln
Vulnerable
Java
static int read_shape_from_file(int *cols, int *rows, int **values, const char *filename, void *log_ctx) { uint8_t *buf, *p, *pend; size_t size; int ret, i, j, w; if ((ret = av_file_map(filename, &buf, &size, 0, log_ctx)) < 0) return ret; w = 0; for (...
vuln
Safe
C/C++
/* * Copyright 2014-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
vuln
Safe
Java
static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags) { BDRVRBDState *s = bs->opaque; char pool[RBD_MAX_POOL_NAME_SIZE]; char snap_buf[RBD_MAX_SNAP_NAME_SIZE]; char conf[RBD_MAX_CONF_SIZE]; char clientname_buf[RBD_MAX_CONF_SIZE]; char *clientname; QemuOpts *opts; Erro...
vuln
Safe
C/C++
function turn_textarea_switch(checkbox) { var target, session; var id = checkbox.id.replace(/hidden_value$/, "value"); var source = document.getElementById(id); var $editorContainer = $('.editor-container'); if (checkbox.checked) { target = '<input class="form-control" type="password" id="' + id + '" nam...
vuln
Vulnerable
JavaScript
static int get_cox(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c) { uint8_t byte; if (bytestream2_get_bytes_left(&s->g) < 5) return AVERROR_INVALIDDATA; /* nreslevels = number of resolution levels = number of decomposition level +1 */ c->nreslevels = bytestream2_get_byt...
vuln
Safe
C/C++
compile_def_function( ufunc_T *ufunc, int check_return_type, compiletype_T compile_type, cctx_T *outer_cctx) { char_u *line = NULL; char_u *line_to_free = NULL; char_u *p; char *errormsg = NULL; // error message cctx_T cctx; garray_T *instr; int did_emsg_before = did_emsg; int ...
vuln
Vulnerable
Unknown
@Override public void onResolve(HitResult rayTraceResult, Level world, @Nullable LivingEntity shooter, SpellStats spellStats, SpellContext spellContext, SpellResolver resolver) { if (!canSummon(shooter)) return; Vec3 vector3d = safelyGetHitPos(rayTraceResult); int ticks = (int) ...
vuln
Vulnerable
Java
// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/ui/webui/nearby_share/nearby_share_dialog_ui.h" #include <string> #include "base/strings/string_split.h" #include "chrome/brows...
vuln
Safe
C/C++
static void gen_tlbsx_440(DisasContext *ctx) { #if defined(CONFIG_USER_ONLY) GEN_PRIV; #else TCGv t0; CHK_SV; t0 = tcg_temp_new(); gen_addr_reg_index(ctx, t0); gen_helper_440_tlbsx(cpu_gpr[rD(ctx->opcode)], cpu_env, t0); tcg_temp_free(t0); if (Rc(ctx->opcode)) { TCGLabel *l1 = ge...
vuln
Safe
C/C++
/* * AirSpy SDR driver * * Copyright (C) 2014 Antti Palosaari <crope@iki.fi> * * 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 2 of the License, or * (at your ...
vuln
Vulnerable
C/C++
/* * utils for libavcodec * Copyright (c) 2001 Fabrice Bellard * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the...
vuln
Vulnerable
C/C++
vhost_user_get_vring_base(struct virtio_net **pdev, struct VhostUserMsg *msg, int main_fd __rte_unused) { struct virtio_net *dev = *pdev; struct vhost_virtqueue *vq = dev->virtqueue[msg->payload.state.index]; uint64_t val; /* We have to stop the queue (virtio) if it is running. */ vhost_destroy_device_notif...
vuln
Vulnerable
Unknown
MagickExport MemoryInfo *AcquireVirtualMemory(const size_t count, const size_t quantum) { MemoryInfo *memory_info; size_t length; length=count*quantum; if ((count == 0) || (quantum != (length/count))) { errno=ENOMEM; return((MemoryInfo *) NULL); } memory_info=(MemoryInfo *) Mag...
vuln
Vulnerable
Unknown
null;u=null!=u?u.getElementsByTagName("parsererror"):null;null!=u&&0<u.length&&(J=E||mxResources.get("invalidChars"),E=u[0].getElementsByTagName("div"),0<E.length&&(J=mxUtils.getTextContent(E[0])));return null!=J?mxUtils.trim(J):J};Editor.addRetryToError=function(u,E){null!=u&&(u=null!=u.error?u.error:u,null==u.retry&&...
vuln
Vulnerable
JavaScript
process_tgs_req(krb5_kdc_req *request, krb5_data *pkt, const krb5_fulladdr *from, kdc_realm_t *kdc_active_realm, krb5_data **response) { krb5_keyblock * subkey = 0; krb5_keyblock *header_key = NULL; krb5_keyblock *stkt_server_key = NULL; krb5_keyblock *subject_key; kr...
vuln
Vulnerable
C/C++
static ssize_t available_instances_show(struct mdev_type *mtype, struct mdev_type_attribute *attr, char *buf) { const struct mbochs_type *type = &mbochs_types[mtype_get_type_group_id(mtype)]; int count = atomic_read(&mbochs_avail_mbytes) / type->mbytes; return sprintf(buf, "%d\n", count); }
vuln
Safe
Unknown
static void lm32_cpu_class_init(ObjectClass *oc, void *data) { LM32CPUClass *lcc = LM32_CPU_CLASS(oc); CPUClass *cc = CPU_CLASS(oc); DeviceClass *dc = DEVICE_CLASS(oc); lcc->parent_realize = dc->realize; dc->realize = lm32_cpu_realizefn; lcc->parent_reset = cc->reset; cc->reset = lm32_cpu_re...
vuln
Safe
C/C++
/* * 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") + yo...
vuln
Safe
Java
def get_path Log.add_info(request, params.inspect) if params[:thetisBoxSelKeeper].blank? @folder_path = '/' + t('paren.unknown') render(:partial => 'ajax_folder_path', :layout => false) return end @selected_id = params[:thetisBoxSelKeeper].split(':').last SqlHelper.validate_token...
vuln
Safe
Ruby
GF_Err import_file(GF_ISOFile *dest, char *inName, u32 import_flags, GF_Fraction force_fps, u32 frames_per_sample, GF_FilterSession *fsess, char **mux_args_if_first_pass, u32 tk_idx) { u32 track_id, i, j, timescale, track, stype, profile, compat, level, new_timescale, rescale_num, rescale_den, svc_mode, txt_flags, spl...
vuln
Safe
Unknown
protected function _draft_or_post_title( $post = 0 ) { $title = get_the_title( $post ); if ( empty( $title ) ) $title = __( '(no title)', 'aryo-activity-log' ); return $title; }
vuln
Vulnerable
PHP
function onRequest (req, res) { // If a 'hostname' string is specified, deny requests with a 'Host' // header that does not match the origin of the torrent server to prevent // DNS rebinding attacks. if (opts.hostname && req.headers.host !== `${opts.hostname}:${server.address().port}`) { return re...
vuln
Vulnerable
JavaScript
package server import ( "github.com/labstack/echo/v4" "github.com/usememos/memos/api" "github.com/usememos/memos/common" ) type response struct { Data interface{} `json:"data"` } func composeResponse(data interface{}) response { return response{ Data: data, } } func (server *Server) DefaultAuthSkipper(c ech...
vuln
Vulnerable
Go
@JsonIgnore public void delete() throws IOException { FileUtils.deleteDirectory(getAppSource()); FileUtils.deleteDirectory(getDistHome()); }
vuln
Safe
Java
void net_slirp_redir(const char *redir_str) { struct slirp_config_str *config; if (QTAILQ_EMPTY(&slirp_stacks)) { config = qemu_malloc(sizeof(*config)); pstrcpy(config->str, sizeof(config->str), redir_str); config->flags = SLIRP_CFG_HOSTFWD | SLIRP_CFG_LEGACY; config->next = slir...
vuln
Vulnerable
C/C++
# -*- coding: utf-8 -*- # rdiffweb, A web interface to rdiff-backup repositories # Copyright (C) 2012-2021 rdiffweb contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version ...
vuln
Safe
Python
private void insertAvailableSubInfoToEntity(List<SubscriptionInfo> availableInfoList) { if ((availableInfoList == null || availableInfoList.size() == 0) && mAvailableSubInfoEntityList.size() != 0) { if (DEBUG) { Log.d(TAG, "availableSudInfoList from framework is empty...
vuln
Vulnerable
Java
static void apply_tns(float coef[1024], TemporalNoiseShaping *tns, IndividualChannelStream *ics, int decode) { const int mmm = FFMIN(ics->tns_max_bands, ics->max_sfb); int w, filt, m, i; int bottom, top, order, start, end, size, inc; float lpc[TNS_MAX_ORDER]; float tmp[TNS_MAX_...
vuln
Safe
C/C++
@Override protected void onHandleWork(@NonNull Intent intent) { String action = intent.getAction(); WRuntime.CrashReportIntent crash = EngineProvider.INSTANCE.getOrCreateRuntime(getBaseContext()).getCrashReportIntent(); if (crash.action_crashed.equals(action)) { final int activit...
vuln
Safe
Java
void Compute(OpKernelContext* ctx) override { const Tensor& input = ctx->input(0); const Tensor& input_min_tensor = ctx->input(1); const Tensor& input_max_tensor = ctx->input(2); int num_slices = 1; if (axis_ > -1) { num_slices = input.dim_size(axis_); } OP_REQUIRES(ctx, input_min_ten...
vuln
Vulnerable
C/C++
static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define ThrowDCMException(exception,message) \ { \ if (info.scale != (Quantum *) NULL) \ info.scale=(Quantum *) RelinquishMagickMemory(info.scale); \ if (data != (unsigned char *) NULL) \ data=(unsigned char *) RelinquishMagi...
vuln
Vulnerable
C/C++
// Sandstorm - Personal Cloud Sandbox // Copyright (c) 2014 Sandstorm Development Group, Inc. and contributors // 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 // /...
vuln
Vulnerable
JavaScript
void SFS_ObjectMemberAccess(ScriptParser *parser) { if (parser->codec->LastError) return; SFS_Expression(parser); SFS_AddString(parser, "."); SFS_Identifier(parser); }
vuln
Vulnerable
Unknown
public synchronized TriggerSmartContract rlpParseToTriggerSmartContract() { if (!parsed) rlpParse(); TriggerSmartContract.Builder build = TriggerSmartContract.newBuilder(); build.setOwnerAddress(ByteString.copyFrom(ByteArray.fromHexString(ByteArray.toHexString(this.getSender()).replace(Constan...
vuln
Safe
Java
void isis_notif_lsp_error(const struct isis_circuit *circuit, const uint8_t *lsp_id, const char *raw_pdu, size_t raw_pdu_len, __attribute__((unused)) uint32_t offset, __attribute__((unused)) uint8_t tlv_type) { const char *xpath = "/frr-isisd:lsp-error-detected"; struct list *arguments = yang_data...
vuln
Safe
Unknown
static int mov_write_mdia_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track) { int64_t pos = avio_tell(pb); int ret; avio_wb32(pb, 0); ffio_wfourcc(pb, "mdia"); mov_write_mdhd_tag(pb, mov, track); mov_write_hdlr_tag(pb, track); if ((ret = mov_write_minf_...
vuln
Safe
C/C++
import datetime import hashlib import itertools import logging import os import time from collections import defaultdict from dataclasses import asdict, dataclass, field from operator import itemgetter from typing import ( IO, AbstractSet, Any, Callable, Collection, Dict, Iterable, List,...
vuln
Vulnerable
Python
public static function loadFromPath(string $path) { $instance = new self(); $instance->name = trim(\App\Purifier::purify(basename($path))); $instance->path = $path; return $instance; }
vuln
Safe
PHP
function editInPlace(element) { closeEditInPlaceForms(); // create edit form var tag_id = $(this).attr('id').substr(5); var tag_name = $(this).html(); var tag_width = $(this).width(); $(this).parent().data("revert", $(this).parent().html()); var form = '<form id="gRenameTagForm" method="post" class="ui-h...
vuln
Safe
JavaScript
/* * Copyright (c) 2011-2015 The original author or authors * ------------------------------------------------------ * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * and Apache License v2.0 which accompanies this distr...
vuln
Vulnerable
Java