code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
'use strict';
const { clone, cloneDeep } = require('./clone');
const SMALL_ARRAY_SIZE = 10;
function isEmpty(item) {
if (Array.isArray(item) || Buffer.isBuffer(item)) {
return item.length === 0;
} else if (isObject(item)) {
return Object.keys(item).length === 0;
} else {
return true;
}
}
function... | vuln | Vulnerable | JavaScript |
void PngImage::readMetadata()
{
#ifdef DEBUG
std::cerr << "Exiv2::PngImage::readMetadata: Reading PNG file " << io_->path() << std::endl;
#endif
if (io_->open() != 0) {
throw Error(kerDataSourceOpenFailed, io_->path(), strError());
}
IoCloser closer(*io_);
if (!is... | vuln | Safe | C/C++ |
void JBIG2Stream::readTextRegionSeg(unsigned int segNum, bool imm, bool lossless, unsigned int length, unsigned int *refSegs, unsigned int nRefSegs)
{
std::unique_ptr<JBIG2Bitmap> bitmap;
JBIG2HuffmanTable runLengthTab[36];
JBIG2HuffmanTable *symCodeTab = nullptr;
const JBIG2HuffmanTable *huffFSTable, *... | vuln | Safe | C/C++ |
accept_xsmp_connection (SmsConn sms_conn,
GsmXsmpServer *server,
unsigned long *mask_ret,
SmsCallbacks *callbacks_ret,
char **failure_reason_ret)
{
IceConn ice_conn;
GsmXSMPClient *clie... | vuln | Vulnerable | C/C++ |
int ossl_policy_cache_set_mapping(X509 *x, POLICY_MAPPINGS *maps)
{
POLICY_MAPPING *map;
X509_POLICY_DATA *data;
X509_POLICY_CACHE *cache = x->policy_cache;
int i;
int ret = 0;
if (sk_POLICY_MAPPING_num(maps) == 0) {
ret = -1;
goto bad_mapping;
}
for (i = 0; i < sk_POLICY... | vuln | Safe | C/C++ |
static int __jfs_set_acl(tid_t tid, struct inode *inode, int type,
struct posix_acl *acl)
{
char *ea_name;
int rc;
int size = 0;
char *value = NULL;
switch (type) {
case ACL_TYPE_ACCESS:
ea_name = XATTR_NAME_POSIX_ACL_ACCESS;
if (acl) {
rc = posix_acl_update_mode(inode, &inode->i_mode, &acl);
... | vuln | Safe | C/C++ |
void Server::msgQueryUsers(ServerUser *uSource, MumbleProto::QueryUsers &msg) {
MSG_SETUP(ServerUser::Authenticated);
MumbleProto::QueryUsers reply;
for (int i=0;i<msg.ids_size();++i) {
int id = msg.ids(i);
if (id >= 0) {
const QString &name = getUserName(id);
if (! name.isEmpty()) {
reply.add_ids(id... | vuln | Safe | Unknown |
cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
{
int rc = -ENOMEM, xid;
struct cifsSesInfo *ses;
xid = GetXid();
ses = cifs_find_smb_ses(server, volume_info->username);
if (ses) {
cFYI(1, "Existing smb sess found (status=%d)", ses->status);
/* existing SMB ses has a server ref... | vuln | Vulnerable | Unknown |
int ff_jpeg2000_init_component(Jpeg2000Component *comp,
Jpeg2000CodingStyle *codsty,
Jpeg2000QuantStyle *qntsty,
int cbps, int dx, int dy,
AVCodecContext *avctx)
{
uint8_t log2_band_prec_width... | vuln | Safe | C/C++ |
static void print_net_client(Monitor *mon, VLANClientState *vc)
{
monitor_printf(mon, "%s: type=%s,%s\n", vc->name,
NetClientOptionsKind_lookup[vc->info->type], vc->info_str);
} | vuln | Safe | C/C++ |
// Package decision implements the decision engine for the bitswap service.
package decision
import (
"context"
"fmt"
"math/bits"
"sync"
"time"
"github.com/google/uuid"
"github.com/ipfs/go-cid"
bstore "github.com/ipfs/go-ipfs-blockstore"
wl "github.com/ipfs/go-libipfs/bitswap/client/wantlist"
"github.com/i... | vuln | Vulnerable | Go |
public static void onClickSearchAction(Launcher launcher, SearchActionItemInfo itemInfo) {
if (itemInfo.getIntent() != null) {
if (itemInfo.hasFlags(SearchActionItemInfo.FLAG_SHOULD_START_FOR_RESULT)) {
launcher.startActivityForResult(itemInfo.getIntent(), 0);
} else {
... | vuln | Vulnerable | Java |
static void uhci_ioport_writew(void *opaque, uint32_t addr, uint32_t val)
{
UHCIState *s = opaque;
addr &= 0x1f;
trace_usb_uhci_mmio_writew(addr, val);
switch(addr) {
case 0x00:
if ((val & UHCI_CMD_RS) && !(s->cmd & UHCI_CMD_RS)) {
trace_usb_uhci_schedule_start();
... | vuln | Vulnerable | C/C++ |
private boolean clickAudio(Map<String, Object> data, Object params) {
if (data == null) {
return false;
}
try {
FullFormatter.AudioClickAction aca = (FullFormatter.AudioClickAction) params;
if (aca.action == FullFormatter.AudioClickAct... | vuln | Vulnerable | Java |
# (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 |
start_input_ppm(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
{
ppm_source_ptr source = (ppm_source_ptr)sinfo;
int c;
unsigned int w, h, maxval;
boolean need_iobuffer, use_raw_buffer, need_rescale;
if (getc(source->pub.input_file) != 'P')
ERREXIT(cinfo, JERR_PPM_NOT);
c = getc(source->pub.input_file);... | vuln | Safe | Unknown |
TPM2B_PRIVATE_KEY_RSA_Marshal(TPM2B_PRIVATE_KEY_RSA *source, BYTE **buffer, INT32 *size)
{
UINT16 written = 0;
written += TPM2B_Marshal(&source->b, sizeof(source->t.buffer), buffer, size); // libtpms changed
return written;
} | vuln | Safe | Unknown |
static void do_drive_backup(DriveBackup *backup, BlockJobTxn *txn, Error **errp)
{
BlockDriverState *bs;
BlockDriverState *target_bs;
BlockDriverState *source = NULL;
BdrvDirtyBitmap *bmap = NULL;
AioContext *aio_context;
QDict *options = NULL;
Error *local_err = NULL;
int flags;
int... | vuln | Vulnerable | C/C++ |
/* 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 | C/C++ |
static void pty_chr_close(struct CharDriverState *chr)
{
PtyCharDriver *s = chr->opaque;
int fd;
remove_fd_in_watch(chr);
fd = g_io_channel_unix_get_fd(s->fd);
g_io_channel_unref(s->fd);
close(fd);
if (s->timer_tag) {
g_source_remove(s->timer_tag);
s->timer_tag = 0;
}
... | vuln | Vulnerable | C/C++ |
xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
xmlXPathObjectPtr obj1, obj2;
if (nargs != 2) {
xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
"key() : expects two arguments\n");
ctxt->error = XPATH_INVALID_ARITY;
return;
}
/*
* Get the key's value.
*/
o... | vuln | Safe | C/C++ |
def _extract_record(
self,
topic: str,
topic_detail: Optional[TopicMetadata],
extra_topic_config: Optional[Dict[str, ConfigEntry]],
) -> Iterable[MetadataWorkUnit]:
logger.debug(f"topic = {topic}")
AVRO = "AVRO"
# 1. Create the default dataset snapshot for t... | vuln | Vulnerable | Python |
static int compat_do_replace(struct net *net, void __user *user,
unsigned int len)
{
int ret;
struct compat_arpt_replace tmp;
struct xt_table_info *newinfo;
void *loc_cpu_entry;
struct arpt_entry *iter;
if (copy_from_user(&tmp, user, sizeof(tmp)) != 0)
return -EFAULT;
/* overflow check */
if (tmp.si... | vuln | Vulnerable | Unknown |
int
notify(xlator_t *this, int32_t event, void *data, ...)
{
int i = 0;
int32_t ret = 0;
fuse_private_t *private = NULL;
gf_boolean_t start_thread = _gf_false;
glusterfs_graph_t *graph = NULL;
struct pollfd pfd = {0};
private = this->private;
graph = data;
gf_log("fuse", GF_LOG_DE... | vuln | Vulnerable | C/C++ |
static inline void tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
{
if (tlb->fullmm)
return;
/*
* VM_PFNMAP is more fragile because the core mm will not track the
* page mapcount -- there might not be page-frames for these PFNs after
* all. Force flush TLBs for such ranges to avoid munmap() ... | vuln | Safe | Unknown |
static int xhci_fire_ctl_transfer(XHCIState *xhci, XHCITransfer *xfer)
{
XHCITRB *trb_setup, *trb_status;
uint8_t bmRequestType;
uint16_t wLength;
XHCIPort *port;
USBDevice *dev;
int ret;
DPRINTF("xhci_fire_ctl_transfer(slot=%d)\n", xfer->slotid);
trb_setup = &xfer->trbs[0];
trb_stat... | vuln | Safe | C/C++ |
static void cirrus_invalidate_region(CirrusVGAState * s, int off_begin,
int off_pitch, int bytesperline,
int lines)
{
int y;
int off_cur;
int off_cur_end;
for (y = 0; y < lines; y++) {
off_cur = off_begin;
off_cur_end = (off_cur + bytesperline) & s->cirrus_addr_mask;
memory_... | vuln | Vulnerable | Unknown |
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* ... | vuln | Safe | Java |
/*
* qemu_process.c: QEMU process management
*
* Copyright (C) 2006-2016 Red Hat, Inc.
*
* 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
* version 2.1 of the License, or (a... | vuln | Safe | C/C++ |
public static void switchDimension(GeyserSession session, String javaDimension) {
int bedrockDimension = javaToBedrock(javaDimension);
int previousDimension = javaToBedrock(session.getDimension());
Entity player = session.getPlayerEntity();
session.getChunkCache().clear();
sess... | vuln | Vulnerable | Java |
Load_SBit_Png( FT_GlyphSlot slot,
FT_Int x_offset,
FT_Int y_offset,
FT_Int pix_bits,
TT_SBit_Metrics metrics,
FT_Memory memory,
FT_Byte* data,
FT_UInt ... | vuln | Safe | C/C++ |
static void gen_mfsri(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
GEN_PRIV;
#else
int ra = rA(ctx->opcode);
int rd = rD(ctx->opcode);
TCGv t0;
CHK_SV;
t0 = tcg_temp_new();
gen_addr_reg_index(ctx, t0);
tcg_gen_shri_tl(t0, t0, 28);
tcg_gen_andi_tl(t0, t0, 0xF);
gen_helper_lo... | vuln | Safe | C/C++ |
static void __udf_read_inode(struct inode *inode)
{
struct buffer_head *bh = NULL;
struct fileEntry *fe;
struct extendedFileEntry *efe;
uint16_t ident;
struct udf_inode_info *iinfo = UDF_I(inode);
struct udf_sb_info *sbi = UDF_SB(inode->i_sb);
unsigned int link_count;
unsigned int indirections = 0;
reread:
/*... | vuln | Safe | C/C++ |
rosbag::RecorderOptions parseOptions(int argc, char** argv) {
rosbag::RecorderOptions opts;
po::options_description desc("Allowed options");
desc.add_options()
("help,h", "produce help message")
("all,a", "record all topics")
("regex,e", "match topics using regular expressions")
("... | vuln | Vulnerable | C/C++ |
int main(int argc, char *argv[])
{
#ifdef HAVE_GUSI_H
GUSISetup(GUSIwithSIOUXSockets);
GUSISetup(GUSIwithInternetSockets);
#endif
#ifdef WITH_TCPWRAPPER
// this code makes sure that the linker cannot optimize away
// the DUL part of the network module where the external flags
// for libwrap are de... | vuln | Safe | C/C++ |
protected void failureHandler(HttpServletRequest request, HttpServletResponse response,
AuthenticationException ex) throws IOException {
String requestedUrl = request.getRequestURI();
if (requestedUrl.contains("api")) {
sendError(request,response, ex);
} else {
storeRequestedUrlAndRedirect... | vuln | Vulnerable | Java |
void qmp_block_set_io_throttle(const char *device, int64_t bps, int64_t bps_rd,
int64_t bps_wr, int64_t iops, int64_t iops_rd,
int64_t iops_wr, Error **errp)
{
ThrottleConfig cfg;
BlockDriverState *bs;
bs = bdrv_find(device);
if (!bs) {
... | vuln | Vulnerable | C/C++ |
/**
*
*/
package com.salesmanager.shop.store.controller.shoppingCart.facade;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import javax.inject.Inject;
import javax.persistence.NoResultException;
import org.apache.com... | vuln | Safe | Java |
public static NativeLong invoke(NativeLong id, String selector) {
return FOUNDATION.objc_msgSend(id, Foundation.INSTANCE.sel_registerName(selector));
} | vuln | Safe | Java |
static int parse_object_segment(AVCodecContext *avctx,
const uint8_t *buf, int buf_size)
{
PGSSubContext *ctx = avctx->priv_data;
PGSSubObject *object;
uint8_t sequence_desc;
unsigned int rle_bitmap_len, width, height;
int id;
if (buf_size <= 4)
buf_size -= ... | vuln | Vulnerable | C/C++ |
cmsBool OptimizeByResampling(cmsPipeline** Lut, cmsUInt32Number Intent, cmsUInt32Number* InputFormat, cmsUInt32Number* OutputFormat, cmsUInt32Number* dwFlags)
{
cmsPipeline* Src = NULL;
cmsPipeline* Dest = NULL;
cmsStage* mpe;
cmsStage* CLUT;
cmsStage *KeepPreLin = NULL, *KeepPostLin = NULL;
int... | vuln | Safe | Unknown |
krb5_init_creds_step(krb5_context context,
krb5_init_creds_context ctx,
krb5_data *in,
krb5_data *out,
krb5_krbhst_info *hostinfo,
unsigned int *flags)
{
krb5_error_code ret;
size_t len = 0;
size_t size;
AS_REQ req2;
krb5_data_zero(out);
if (ctx->as_req.req_b... | vuln | Safe | C/C++ |
private static Stream<AuthorizationDetails> getClientScopeModelStream(KeycloakSession session) {
AuthenticationSessionModel authSession = session.getContext().getAuthenticationSession();
//if Dynamic Scopes are enabled, get the scopes from the AuthorizationRequestContext, passing the session and scopes ... | vuln | Vulnerable | Java |
private static Stream<Recipe> createRecipes(CustomBeeData beeData){
List<Recipe> recipes = new ArrayList<>();
beeData.getHoneycombData().ifPresent(honeycombData -> {
for (int i = 0; i < 5; i++) recipes.add(new Recipe(honeycombData.getHiveOutput(i), NESTS.get(i), beeData.getEntityType(), fals... | vuln | Safe | Java |
bool PrintRenderFrameHelper::CopyMetafileDataToSharedMem(
bool PrintRenderFrameHelper::CopyMetafileDataToReadOnlySharedMem(
const PdfMetafileSkia& metafile,
base::SharedMemoryHandle* shared_mem_handle) {
uint32_t buf_size = metafile.GetDataSize();
if (buf_size == 0)
return false;
mojo::ScopedSh... | vuln | Safe | C/C++ |
//
// $Id$
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.css;
import org.w3c.css.atrules.css.AtRuleMedia;
import org.w3c.css.atrules.css.AtRulePage;
import org.w3c.... | vuln | Vulnerable | Java |
function addAttribute(mainTemplate, elName, source, chunk) {
const outputOptions = this.compilation.outputOptions || mainTemplate.outputOptions;
if (!outputOptions.crossOriginLoading) {
this.sriPlugin.errorOnce(
this.compilation,
'webpack option output.crossOriginLoading not set, code spli... | vuln | Vulnerable | JavaScript |
static void vfio_msi_enable(VFIOPCIDevice *vdev)
{
int ret, i;
vfio_disable_interrupts(vdev);
vdev->nr_vectors = msi_nr_vectors_allocated(&vdev->pdev);
retry:
vdev->msi_vectors = g_malloc0(vdev->nr_vectors * sizeof(VFIOMSIVector));
for (i = 0; i < vdev->nr_vectors; i++) {
VFIOMSIVector *vect... | vuln | Vulnerable | C/C++ |
(function()
{
// Adds electrical stencils
Sidebar.prototype.addElectricalPalette = function()
{
var s = mxConstants.STYLE_VERTICAL_LABEL_POSITION + '=bottom;shadow=0;dashed=0;align=center;html=1;' + mxConstants.STYLE_VERTICAL_ALIGN + '=top;' + mxConstants.STYLE_SHAPE;
var mea = s + '=mxgraph.electrical.abstract.... | vuln | Safe | Java |
bool Track::VetEntry(const BlockEntry* pBlockEntry) const
bool Track::VetEntry(const BlockEntry* pBlockEntry) const {
assert(pBlockEntry);
const Block* const pBlock = pBlockEntry->GetBlock();
assert(pBlock);
assert(pBlock->GetTrackNumber() == m_info.number);
if (!pBlock || pBlock->GetTrackNumber() != m_info.n... | vuln | Safe | C/C++ |
protected ContentHandle canonicalizeContent(ArtifactType artifactType, ContentHandle content) {
try {
ArtifactTypeUtilProvider provider = factory.getArtifactTypeProvider(artifactType);
ContentCanonicalizer canonicalizer = provider.getContentCanonicalizer();
ContentHandle cano... | vuln | Safe | Java |
def main():
global word
print("Starting script... press 'ctrl+c' in terminal to turn off")
while True:
if pyperclip.paste() != word and len(pyperclip.paste().split())<5:
word = pyperclip.paste()
wordChc=False
req = requests.get("https://api-portal.dictionary.com/d... | vuln | Vulnerable | Python |
static void sas_unregister_devs_sas_addr(struct domain_device *parent,
int phy_id, bool last)
{
struct expander_device *ex_dev = &parent->ex_dev;
struct ex_phy *phy = &ex_dev->ex_phy[phy_id];
struct domain_device *child, *n, *found = NULL;
if (last) {
list_for_each_entry_safe(child, n,
&ex_dev->children,... | vuln | Vulnerable | C/C++ |
def new_f(*args, **kwargs):
try:
return f(*args, **kwargs)
except InputParameterError as e:
msgStr = str(e)
log.warning('%s', msgStr)
return HttpResponseBadRequest(escape(msgStr)) | vuln | Vulnerable | Python |
public boolean isChannelUserPresent(Integer channelKey, String userId) {
SQLiteDatabase database = dbHelper.getReadableDatabase();
Cursor cursor = null;
boolean present = false;
try {
cursor = database.rawQuery(
"SELECT COUNT(*) FROM channel_User_X WHERE "... | vuln | Vulnerable | Java |
GF_Err url_box_read(GF_Box *s, GF_BitStream *bs)
{
GF_DataEntryURLBox *ptr = (GF_DataEntryURLBox *)s;
if (ptr->size) {
ptr->location = (char*)gf_malloc((u32) ptr->size);
if (! ptr->location) return GF_OUT_OF_MEM;
gf_bs_read_data(bs, ptr->location, (u32)ptr->size);
if (ptr->location[ptr->size-1]) {
GF_LOG(... | vuln | Safe | Unknown |
app.post("/db/:db/:name", function(req, res) {
var db = req.params.db;
var name = req.params.name;
var obj = req.body.obj;
var msg = "db:"+db+" name:"+name+"\n"+obj;
c.log(msg);
var filename = path.join(dbRoot, db, 'md', name);
if (filename.indexOf(dbRoot) !== 0) { // 檢查是否穿越dbRoot 參考:https://en.wikipedia.... | vuln | Safe | JavaScript |
// Copyright (c) 2004-2013 Sergey Lyubka
// Copyright (c) 2013-2021 Cesanta Software Limited
// All rights reserved
//
// This software is dual-licensed: you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation. For the terms... | vuln | Vulnerable | C/C++ |
jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
{
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
JDIMENSION i, x;
int y;
JDIMENSION lines_per_iMCU_row, lines_left_in_iMCU_row, lines_... | vuln | Vulnerable | Unknown |
static bool __oom_reap_task_mm(struct task_struct *tsk, struct mm_struct *mm)
{
struct mmu_gather tlb;
struct vm_area_struct *vma;
bool ret = true;
/*
* We have to make sure to not race with the victim exit path
* and cause premature new oom victim selection:
* __oom_reap_task_mm exit_mm
* mmget_not_zer... | vuln | Safe | C/C++ |
void DownloadRequestLimiter::TabDownloadState::DidFinishNavigation(
content::NavigationHandle* navigation_handle) {
if (!navigation_handle->IsInMainFrame())
return;
if (status_ == ALLOW_ONE_DOWNLOAD ||
(status_ == PROMPT_BEFORE_DOWNLOAD &&
!navigation_handle->IsRendererInitiated() &&
... | vuln | Safe | C/C++ |
import sqlite3
import re
import timeit
import sys
import os
pathlist = os.path.realpath(__file__).split(os.path.sep)
RTXindex = pathlist.index("RTX")
sys.path.append(os.path.sep.join([*pathlist[:(RTXindex + 1)], 'code']))
from RTXConfiguration import RTXConfiguration
RTXConfig = RTXConfiguration()
autocomplete_filepa... | vuln | Vulnerable | Python |
private static PendingIntent getPendingIntent(Context context, int appWidgetId) {
Intent intent = new Intent(context, RecordingWidgetProvider.class);
intent.setAction(RecordingWidgetProvider.ACTION_RECORD_OR_STOP);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
// got... | vuln | Vulnerable | Java |
static int shorten_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
AVFrame *frame = data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
ShortenContext *s = avctx->priv_data;
int i, input_buf_size = 0;
... | vuln | Safe | C/C++ |
import warnings
import six
from django.http import HttpResponse
from django.utils.crypto import constant_time_compare
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import View
from ..exceptions import AnymailInsecureWebhookWarning, ... | vuln | Vulnerable | Python |
int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
{
struct page *page = vmf->page;
loff_t size;
unsigned long len;
int ret;
struct file *file = vma->vm_file;
struct inode *inode = file_inode(file);
struct address_space *mapping = inode->i_mapping;
handle_t *handle;
get_block_t *get_block;... | vuln | Vulnerable | C/C++ |
ExtensionNavigationThrottle::WillStartOrRedirectRequest() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
content::WebContents* web_contents = navigation_handle()->GetWebContents();
ExtensionRegistry* registry =
ExtensionRegistry::Get(web_contents->GetBrowserContext());
const GURL& url = navigation_ha... | vuln | Vulnerable | C/C++ |
static void pc87312_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
dc->realize = pc87312_realize;
dc->reset = pc87312_reset;
dc->vmsd = &vmstate_pc87312;
dc->props = pc87312_properties;
} | vuln | Vulnerable | C/C++ |
h2v1_merged_upsample_565D_internal(j_decompress_ptr cinfo,
JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr,
JSAMPARRAY output_buf)
{
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
register int y,... | vuln | Vulnerable | Unknown |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyrigt: (c) 2017, Yanis Guenane <yanis+ansible@guenane.org>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module... | vuln | Vulnerable | C/C++ |
@Override
protected void onPrepareDialogBuilder(AlertDialog.Builder builder) {
super.onPrepareDialogBuilder(builder);
KeyboardDialogBuilder.setCustomTitle(builder, getPreference().getDialogTitle());
if (mEntryValues.length != mEntries.length)
throw new IllegalStateException("mEn... | vuln | Safe | Java |
static void net_tx_pkt_do_sw_csum(struct NetTxPkt *pkt)
{
struct iovec *iov = &pkt->vec[NET_TX_PKT_L2HDR_FRAG];
uint32_t csum_cntr;
uint16_t csum = 0;
uint32_t cso;
uint32_t iov_len = pkt->payload_frags + NET_TX_PKT_PL_START_FRAG - 1;
uint16_t csl;
struct ip_header *iphdr;
size_t cs... | vuln | Safe | C/C++ |
int ff_hevc_decode_extradata(const uint8_t *data, int size, HEVCParamSets *ps,
int *is_nalff, int *nal_length_size,
int err_recognition, void *logctx)
{
int ret = 0;
GetByteContext gb;
bytestream2_init(&gb, data, size);
if (size > 3 && (data[0] |... | vuln | Vulnerable | C/C++ |
vcard_emul_replay_insertion_events(void)
{
VReaderListEntry *current_entry;
VReaderListEntry *next_entry = NULL;
VReaderList *list = vreader_get_reader_list();
for (current_entry = vreader_list_get_first(list); current_entry;
current_entry = next_entry) {
VReader *vreader = vreader_l... | vuln | Safe | C/C++ |
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This 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 version 2.1 of
* th... | vuln | Vulnerable | Java |
_WM_ParseNewHmi(uint8_t *hmi_data, uint32_t hmi_size) {
uint32_t hmi_tmp = 0;
uint8_t *hmi_base = hmi_data;
uint16_t hmi_bpm = 0;
uint16_t hmi_division = 0;
// uint32_t hmi_duration_secs = 0;
uint32_t hmi_track_cnt = 0;
uint32_t *hmi_track_offset = NULL;
uint32_t i = 0;
uint32_t j = 0;... | vuln | Vulnerable | C/C++ |
PS_SERIALIZER_DECODE_FUNC(php_binary) /* {{{ */
{
const char *p;
char *name;
const char *endptr = val + vallen;
zval *current;
int namelen;
int has_value;
php_unserialize_data_t var_hash;
int skip = 0;
PHP_VAR_UNSERIALIZE_INIT(var_hash);
for (p = val; p < endptr; ) {
zval **tmp;
skip = 0;
namelen = ((... | vuln | Safe | Unknown |
int utf8s_to_utf16s(const u8 *s, int len, wchar_t *pwcs)
static inline void put_utf16(wchar_t *s, unsigned c, enum utf16_endian endian)
{
switch (endian) {
default:
*s = (wchar_t) c;
break;
case UTF16_LITTLE_ENDIAN:
*s = __cpu_to_le16(c);
break;
case UTF16_BIG_ENDIAN:
*s = __cpu_to_be16(c);
break;
}
}
... | vuln | Safe | C/C++ |
@Nullable
private ITaskFragmentOrganizer findTaskFragmentOrganizerForAllWindows() {
mTempTransitionWindows.clear();
mTempTransitionWindows.addAll(mDisplayContent.mClosingApps);
mTempTransitionWindows.addAll(mDisplayContent.mOpeningApps);
mTempTransitionWindows.addAll(mDisplayContent.... | vuln | Vulnerable | Java |
private boolean doFight()
{
if (target == null || !target.isAlive() || (actionTimeoutCounter -= COMBAT_UPDATE_RATE) <= 0)
{
target = null;
citizen.setLastHurtByMob(null);
citizen.setTarget(null);
return true;
}
if (citizen.isWorkerAtSi... | vuln | Safe | Java |
static void
add_action_env_vars(const svc_action_t *op)
{
if (safe_str_eq(op->standard, PCMK_RESOURCE_CLASS_OCF) == FALSE) {
return;
}
if (op->params) {
g_hash_table_foreach(op->params, set_ocf_env_with_prefix, NULL);
}
set_ocf_env("OCF_RA_VERSION_MAJOR", "1", NULL);
set_ocf_en... | vuln | Vulnerable | C/C++ |
static char* allocFromUTF16(const char16_t* in, size_t len)
{
if (len == 0) return getEmptyString();
// Allow for closing '\0'
const ssize_t resultStrLen = utf16_to_utf8_length(in, len) + 1;
if (resultStrLen < 1) {
return getEmptyString();
}
SharedBuffer* buf = SharedBuffer::al... | vuln | Safe | C/C++ |
PHP_METHOD(Phar, offsetExists)
{
char *fname;
size_t fname_len;
phar_entry_info *entry;
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &fname, &fname_len) == FAILURE) {
return;
}
if (zend_hash_str_exists(&phar_obj->archive->manifest, fname, (uint) fname_len)) {
if (NULL != (entry =... | vuln | Safe | Unknown |
/* nbdkit
* Copyright (C) 2013-2019 Red Hat Inc.
*
* 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 conditions and the f... | vuln | Safe | C/C++ |
static void io_rw_resubmit(struct callback_head *cb)
{
struct io_kiocb *req = container_of(cb, struct io_kiocb, task_work);
struct io_ring_ctx *ctx = req->ctx;
int err;
err = io_sq_thread_acquire_mm(ctx, req);
if (io_resubmit_prep(req, err)) {
refcount_inc(&req->refs);
io_queue_async_work(req);
}
} | vuln | Vulnerable | Unknown |
/*
* 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 |
def _generate_kwarg_handlers(context: Context, sig):
# generate kwarg handlers.
# since they might come in thru calldata or be default,
# allocate them in memory and then fill it in based on calldata or default,
# depending on the signature
ret = []
def handler_for(calldata_kwargs, default_kwa... | vuln | Safe | Python |
/* Copyright 2019 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 | C/C++ |
static int em_ret_far(struct x86_emulate_ctxt *ctxt)
{
int rc;
unsigned long eip, cs;
u16 old_cs;
int cpl = ctxt->ops->cpl(ctxt);
struct desc_struct old_desc, new_desc;
const struct x86_emulate_ops *ops = ctxt->ops;
if (ctxt->mode == X86EMUL_MODE_PROT64)
ops->get_segment(ctxt, &old_cs, &old_desc, NULL,
V... | vuln | Safe | C/C++ |
public CharSequence getTextRepresentation (Tdlib tdlib, boolean onlyPinned, boolean allowContent, @Nullable boolean[] hasCustomText) {
switch (notification.type.getConstructor()) {
case TdApi.NotificationTypeNewMessage.CONSTRUCTOR: {
TdApi.Message message = ((TdApi.NotificationTypeNewMessage) notifica... | vuln | Safe | Java |
static FlatView *address_space_get_flatview(AddressSpace *as)
{
FlatView *view;
rcu_read_lock();
view = atomic_rcu_read(&as->current_map);
flatview_ref(view);
rcu_read_unlock();
return view;
} | vuln | Vulnerable | C/C++ |
void ProcessStateChangesUnifiedPlan(
WebRtcSetDescriptionObserver::States states) {
DCHECK_EQ(sdp_semantics_, webrtc::SdpSemantics::kUnifiedPlan);
handler_->OnModifyTransceivers(
std::move(states.transceiver_states),
action_ == PeerConnectionTracker::ACTION_SET_REMOTE_DESCRIPTION);
} | 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 |
/* vi:set ts=8 sts=4 sw=4 noet:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
/*
* drawscreen.c: Code for updating all t... | vuln | Vulnerable | C/C++ |
/* $Id$ */
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
*
* 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; eit... | vuln | Vulnerable | C/C++ |
// 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 | Safe | JavaScript |
def __init__(
self,
*,
sqs_queue: str,
message_content: str,
message_attributes: dict | None = None,
delay_seconds: int = 0,
message_group_id: str | None = None,
aws_conn_id: str = "aws_default",
**kwargs,
):
super().__init__(**kwargs)
... | vuln | Vulnerable | Python |
vhost_user_check_and_alloc_queue_pair(struct virtio_net *dev,
struct vhu_msg_context *ctx)
{
uint32_t vring_idx;
switch (ctx->msg.request.master) {
case VHOST_USER_SET_VRING_KICK:
case VHOST_USER_SET_VRING_CALL:
case VHOST_USER_SET_VRING_ERR:
vring_idx = ctx->msg.payload.u64 & VHOST_USER_VRING_IDX_MASK;
br... | vuln | Vulnerable | C/C++ |
static int slirp_hostfwd(SlirpState *s, Monitor *mon, const char *redir_str,
int legacy_format)
{
struct in_addr host_addr = { .s_addr = INADDR_ANY };
struct in_addr guest_addr = { .s_addr = 0 };
int host_port, guest_port;
const char *p;
char buf[256];
int is_udp;
ch... | vuln | Safe | C/C++ |
static bool blit_is_unsafe(struct CirrusVGAState *s)
{
assert(s->cirrus_blt_width > 0);
assert(s->cirrus_blt_height > 0);
if (blit_region_is_unsafe(s, s->cirrus_blt_dstpitch,
s->cirrus_blt_dstaddr & s->cirrus_addr_mask)) {
if (blit_region_is_unsafe(s, s->cirrus_blt_src... | vuln | Vulnerable | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.