code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static void php_wddx_pop_element(void *user_data, const XML_Char *name)
{
st_entry *ent1, *ent2;
wddx_stack *stack = (wddx_stack *)user_data;
HashTable *target_hash;
zend_class_entry *pce;
zval obj;
/* OBJECTS_FIXME */
if (stack->top == 0) {
return;
}
if (!strcmp((char *)name, EL_STRING) || !st... | vuln | Safe | Unknown |
static void
create_vterm(term_T *term, int rows, int cols)
{
VTerm *vterm;
VTermScreen *screen;
VTermState *state;
VTermValue value;
vterm = vterm_new_with_allocator(rows, cols, &vterm_allocator, NULL);
term->tl_vterm = vterm;
screen = vterm_obtain_screen(vterm);
vterm_s... | vuln | Vulnerable | C/C++ |
/***
x509 modules for lua-openssl binding
create and manage x509 certificate
@module x509
@usage
x509 = require'openssl'.x509
*/
#include "openssl.h"
#include "private.h"
#define CRYPTO_LOCK_REF
#include "sk.h"
#define MYNAME "x509"
#define MYVERSION MYNAME " library for " LUA_VERSION " / Nov 2014 / "\
"based ... | vuln | Vulnerable | C/C++ |
public static List<String> getAllMicrophones() {
if (!SoundManager.canEnumerate()) {
return Collections.emptyList();
}
List<String> devices = ALUtil.getStringList(0L, ALC11.ALC_CAPTURE_DEVICE_SPECIFIER);
SoundManager.checkAlcError(0L);
return devices == null ? Collect... | vuln | Safe | Java |
# encoding: utf-8
'''API functions for adding data to CKAN.'''
import logging
import random
import re
from socket import error as socket_error
import datetime
import six
import ckan.common
from sqlalchemy import func
import ckan.lib.plugins as lib_plugins
import ckan.logic as logic
import ckan.plugins as plugins
i... | vuln | Vulnerable | Python |
def _exec_cmd(self, cmd):
"""Executes adb commands in a new shell.
This is specific to executing adb binary because stderr is not a good
indicator of cmd execution status.
Args:
cmds: A string that is the adb command to execute.
Returns:
The output of t... | vuln | Vulnerable | Python |
mlx5_rx_burst_mprq(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
{
struct mlx5_rxq_data *rxq = dpdk_rxq;
const unsigned int strd_n = 1 << rxq->log_strd_num;
const unsigned int strd_sz = 1 << rxq->log_strd_sz;
const unsigned int strd_shift =
MLX5_MPRQ_STRIDE_SHIFT_BYTE * rxq->strd_shift_en;
const unsig... | vuln | Safe | Unknown |
AvahiSDNSServerBrowser *avahi_s_dns_server_browser_new(
AvahiServer *server,
AvahiIfIndex interface,
AvahiProtocol protocol,
const char *domain,
AvahiDNSServerType type,
AvahiProtocol aprotocol,
AvahiLookupFlags flags,
AvahiSDNSServerBrowserCallback callback,
void* userdata) {
... | vuln | Safe | Unknown |
/*
* algif_hash: User-space interface for hash algorithms
*
* This file provides the user-space API for hash algorithms.
*
* Copyright (c) 2010 Herbert Xu <herbert@gondor.apana.org.au>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License... | vuln | Safe | C/C++ |
def _prepare_cli_cmd(self) -> list[Any]:
"""This function creates the command list from available information."""
conn = self.conn
hive_bin = "hive"
cmd_extra = []
if self.use_beeline:
hive_bin = "beeline"
self._validate_beeline_parameters(conn)
... | vuln | Vulnerable | Python |
synchronized_authz_initialize(void *baton, apr_pool_t *pool)
{
#if APR_HAS_THREADS
svn_boolean_t multi_threaded = TRUE;
#else
svn_boolean_t multi_threaded = FALSE;
#endif
SVN_ERR(svn_object_pool__create(&authz_pool, multi_threaded, pool));
SVN_ERR(svn_object_pool__create(&filtered_pool, multi_threaded, pool));... | vuln | Vulnerable | Unknown |
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <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 the
* <a href="http://www.apache... | vuln | Safe | Java |
def __call__(self, value: Dict[str, Any]) -> Any:
if (
value.get("lc", None) == 1
and value.get("type", None) == "secret"
and value.get("id", None) is not None
):
[key] = value["id"]
if key in self.secrets_map:
return self.secre... | vuln | Safe | Python |
static int coroutine_fn v9fs_complete_renameat(V9fsPDU *pdu, int32_t olddirfid,
V9fsString *old_name,
int32_t newdirfid,
V9fsString *new_name)
{
int err = 0;
V9fsState *s ... | vuln | Safe | C/C++ |
/* radare - LGPL - Copyright 2011-2019 - earada, pancake */
#include <r_core.h>
#include <r_config.h>
#include "r_util.h"
#include "r_util/r_time.h"
#define is_in_range(at, from, sz) ((at) >= (from) && (at) < ((from) + (sz)))
#define VA_FALSE 0
#define VA_TRUE 1
#define VA_NOREBASE 2
#define LOAD_BSS_MALLOC ... | vuln | Vulnerable | C/C++ |
static int add_push_report_sideband_pkt(git_push *push, git_pkt_data *data_pkt, git_buf *data_pkt_buf)
{
git_pkt *pkt;
const char *line, *line_end;
size_t line_len;
int error;
int reading_from_buf = data_pkt_buf->size > 0;
if (reading_from_buf) {
/* We had an existing partial packet, so add the new
* packet... | vuln | Safe | C/C++ |
def add_node_attr_remote(params, request, session)
if not allowed_for_local_cluster(session, Permissions::WRITE)
return 403, 'Permission denied'
end
retval = add_node_attr(
session, params["node"], params["key"], params["value"]
)
# retval = 2 if removing attr which doesn't exist
if retval == 0 or r... | vuln | Vulnerable | Ruby |
extern "C" void *malloc_wrapper(size_t size, void *caller)
{
void *ptr = NULL;
#ifdef MBED_MEM_TRACING_ENABLED
mbed_mem_trace_lock();
#endif
#ifdef MBED_HEAP_STATS_ENABLED
malloc_stats_mutex->lock();
alloc_info_t *alloc_info = (alloc_info_t *)SUPER_MALLOC(size + sizeof(alloc_info_t));
if (alloc_info... | vuln | Vulnerable | Unknown |
static int mount_entry_on_relative_rootfs(struct mntent *mntent,
const char *rootfs)
{
char path[MAXPATHLEN];
int ret;
/* relative to root mount point */
ret = snprintf(path, sizeof(path), "%s/%s", rootfs, mntent->mnt_dir);
if (ret >= sizeof(path)) {
ERROR("path name too long");
return -1;
}
return ... | vuln | Safe | Unknown |
function updateLinkColor()
{
var div = document.createElement('div');
div.style.width = '100%';
div.style.height = '100%';
div.style.boxSizing = 'border-box';
if (linkColor != null && linkColor != mxConstants.NONE)
{
div.style.border = '1px solid black';
div.style.backgroundColor = linkColo... | vuln | Vulnerable | JavaScript |
void vlan_setup(struct net_device *dev)
{
ether_setup(dev);
dev->priv_flags |= IFF_802_1Q_VLAN;
dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
dev->tx_queue_len = 0;
dev->netdev_ops = &vlan_netdev_ops;
dev->destructor = free_netdev;
dev->ethtool_ops = &vlan_ethtool_ops;
memset(dev->broa... | vuln | Safe | Unknown |
void WebPageSerializerImpl::openTagToString(Element* element,
SerializeDomParam* param)
{
bool needSkip;
StringBuilder result;
result.append(preActionBeforeSerializeOpenTag(element, param, &needSkip));
if (needSkip)
return;
result.append('<');
... | vuln | Vulnerable | C/C++ |
static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, int linesize, DCTELEM *block)
{
int i;
int dc = block[0];
const uint8_t *cm;
dc = ( 3 * dc + 1) >> 1;
dc = (17 * dc + 64) >> 7;
cm = ff_cropTbl + MAX_NEG_CROP + dc;
for(i = 0; i < 4; i++){
dest[0] = cm[dest[0]];
dest[1] = cm[... | vuln | Vulnerable | C/C++ |
int main(int argc, char **argv)
{
int fmtid;
int id;
char *infile;
jas_stream_t *instream;
jas_image_t *image;
int width;
int height;
int depth;
int numcmpts;
int verbose;
char *fmtname;
int debug;
size_t max_mem;
if (jas_init()) {
abort();
}
cmdname = argv[0];
infile = 0;
verbose = 0;
debug = 0... | vuln | Vulnerable | C/C++ |
fn collect_conflicts_between_fragments(
&self,
conflicts: &mut Vec<Conflict>,
fragment_name1: &'a str,
fragment_name2: &'a str,
mutually_exclusive: bool,
ctx: &ValidatorContext<'a, S>,
) where
S: ScalarValue,
{
// Early return on fragment recursion... | vuln | Vulnerable | Rust |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_str.c
*
*/
#include <stdlib.h>
#include <string.h>
#include "lsquic_str.h"
lsquic_str_t *
lsquic_str_new (const char *str, size_t sz)
{
lsquic_str_t *lstr;
char *copy;
if (str && sz)
{
copy = malloc(sz ... | vuln | Vulnerable | C/C++ |
SPL_METHOD(DirectoryIterator, getFilename)
{
spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
RETURN_STRING(intern->u.dir.entry.d_name, 1);
} | vuln | Vulnerable | C/C++ |
errno_t sssctl_logs_fetch(struct sss_cmdline *cmdline,
struct sss_tool_ctx *tool_ctx,
void *pvt)
{
const char *file;
errno_t ret;
glob_t globbuf;
/* Parse command line. */
ret = sss_tool_popt_ex(cmdline, NULL, SSS_TOOL_OPT_OPTIONAL, NULL, NULL,
... | vuln | Safe | Unknown |
$tableBody[] = array(htmlentities($row['label']), $row['nb_visits'], $row['bounce_rate']);
if ($count == 10) break;
}
$this->table($tableHead, $tableBody, null);
} | vuln | Safe | PHP |
# -*- 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 |
my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
{
MYSQL *mysql= stmt->mysql;
int rc= 0;
DBUG_ENTER("mysql_stmt_close");
free_root(&stmt->result.alloc, MYF(0));
free_root(&stmt->mem_root, MYF(0));
free_root(&stmt->extension->fields_mem_root, MYF(0));
if (mysql)
{
mysql->stmts= list_delete(mysql-... | vuln | Safe | Unknown |
static ssize_t runtime_status_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
const char *p;
if (dev->power.runtime_error) {
p = "error\n";
} else if (dev->power.disable_depth) {
p = "unsupported\n";
} else {
switch (dev->power.runtime_status) {
case RPM_SUSPENDED:
p = "suspende... | vuln | Safe | Unknown |
private void logMetrics(int selectedPos) {
if (mRankerServiceName != null) {
MetricsLogger metricsLogger = new MetricsLogger();
LogMaker log = new LogMaker(MetricsEvent.ACTION_TARGET_SELECTED);
log.setComponentName(mRankerServiceName);
log.addT... | vuln | Safe | Java |
pkcs11rsa_verify(dst_context_t *dctx, const isc_region_t *sig) {
CK_RV rv;
pk11_context_t *pk11_ctx = dctx->ctxdata.pk11_ctx;
isc_result_t ret = ISC_R_SUCCESS;
PK11_CALL(pkcs_C_VerifyFinal,
(pk11_ctx->session,
(CK_BYTE_PTR) sig->base,
(CK_ULONG) sig->length),
DST_R_VERIFYFAILURE);
return (ret);
... | vuln | Vulnerable | Unknown |
private void sendPendingStreaming(@Nullable String cause) {
final IntentSender statusReceiver;
synchronized (mLock) {
statusReceiver = mRemoteStatusReceiver;
}
if (statusReceiver == null) {
Slog.e(TAG, "Missing receiver for pending streaming status.");
... | vuln | Safe | Java |
static int
fpDiff(TIFF* tif, uint8* cp0, tmsize_t cc)
{
tmsize_t stride = PredictorState(tif)->stride;
uint32 bps = tif->tif_dir.td_bitspersample / 8;
tmsize_t wc = cc / bps;
tmsize_t count;
uint8 *cp = (uint8 *) cp0;
uint8 *tmp;
if((cc%(bps*stride))!=0)
{
TIFFErrorExt(tif->tif_clientdata, "fpDif... | vuln | Safe | C/C++ |
generate: function (length, options) {
length = length || 10
const generateOptions = options || {}
generateOptions.digits = Object.prototype.hasOwnProperty.call(generateOptions, 'digits') ? options.digits : true
generateOptions.alphabets = Object.prototype.hasOwnProperty.call(generateOptions, 'alphabet... | vuln | Vulnerable | JavaScript |
iscsi_aio_read16_cb(struct iscsi_context *iscsi, int status,
void *command_data, void *opaque)
{
IscsiAIOCB *acb = opaque;
trace_iscsi_aio_read16_cb(iscsi, status, acb, acb->canceled);
if (acb->canceled) {
qemu_aio_release(acb);
return;
}
acb->status = 0;
if (... | vuln | Vulnerable | C/C++ |
bool Unpack::AddVMCode(uint FirstByte,byte *Code,int CodeSize)
{
VMCodeInp.InitBitInput();
memcpy(VMCodeInp.InBuf,Code,Min(BitInput::MAX_SIZE,CodeSize));
VM.Init();
uint FiltPos;
if ((FirstByte & 0x80)!=0)
{
FiltPos=RarVM::ReadData(VMCodeInp);
if (FiltPos==0)
InitFilters30(false);
else
... | vuln | Vulnerable | C/C++ |
public static String getAttachedFilePath(String inputStudyOid) {
// Using a standard library to validate/Sanitize user inputs which will be used in path expression to prevent from path traversal
String studyOid = FilenameUtils.getName(inputStudyOid);
String attachedFilePath = CoreResources.getField("... | vuln | Vulnerable | Java |
def create_ssh_cred() -> None:
from jinja2 import Environment, FileSystemLoader
user_group = roxywi_common.get_user_group()
name = common.checkAjaxInput(form.getvalue('new_ssh'))
name = f'{name}_{user_group}'
enable = common.checkAjaxInput(form.getvalue('ssh_enable'))
group = common.checkAjaxInput(form.getvalue(... | vuln | Vulnerable | Python |
MagickExport void XFileBrowserWidget(Display *display,XWindows *windows,
const char *action,char *reply)
{
#define CancelButtonText "Cancel"
#define DirectoryText "Directory:"
#define FilenameText "File name:"
#define GrabButtonText "Grab"
#define FormatButtonText "Format"
#define HomeButtonText "Home"
#define ... | vuln | Vulnerable | Unknown |
int kvm_irqchip_add_msi_route(KVMState *s, MSIMessage msg)
{
struct kvm_irq_routing_entry kroute;
int virq;
if (!kvm_gsi_routing_enabled()) {
return -ENOSYS;
}
virq = kvm_irqchip_get_virq(s);
if (virq < 0) {
return virq;
}
kroute.gsi = virq;
kroute.type = KVM_IRQ_ROUT... | vuln | Vulnerable | C/C++ |
public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset,
byte[] ciphertext, int ciphertextOffset, int length) throws ShortBufferException {
int space;
if (ciphertextOffset > ciphertext.length)
space = 0;
else
space = ciphertext.length - ciphertextOffset;
if (!haskey) {
// The key i... | vuln | Vulnerable | Java |
av_cold void ff_sws_init_input_funcs(SwsContext *c)
{
enum PixelFormat srcFormat = c->srcFormat;
c->chrToYV12 = NULL;
switch(srcFormat) {
case PIX_FMT_YUYV422 : c->chrToYV12 = yuy2ToUV_c; break;
case PIX_FMT_UYVY422 : c->chrToYV12 = uyvyToUV_c; break;
case PIX_FMT_NV12 : c->chr... | vuln | Vulnerable | C/C++ |
async function csrfPlugin (fastify, opts) {
const {
cookieKey,
cookieOpts,
sessionKey,
getToken,
getUserInfo,
sessionPlugin,
csrfOpts
} = Object.assign({}, defaultOptions, opts)
assert(typeof cookieKey === 'string', 'cookieKey should be a string')
assert(typeof sessionKey === 'strin... | vuln | Safe | JavaScript |
static UINT drive_process_irp_query_directory(DRIVE_DEVICE* drive, IRP* irp)
{
const WCHAR* path;
DRIVE_FILE* file;
BYTE InitialQuery;
UINT32 PathLength;
UINT32 FsInformationClass;
if (!drive || !irp || !irp->Complete)
return ERROR_INVALID_PARAMETER;
if (Stream_GetRemainingLength(irp->input) < 32)
return E... | vuln | Safe | C/C++ |
/* jshint unused: false */
// eslint-disable-next-line no-unused-vars
/* global window, $, Backbone, document, d3, ReactDOM, React */
/* global arangoHelper, btoa, atob, _, frontendConfig */
(function () {
'use strict';
let isCurrentCoordinator = false;
window.Router = Backbone.Router.extend({
toUpdate: [],... | vuln | Vulnerable | C/C++ |
#ifndef JSI_LITE_ONLY
#define __JSIINT_C__
#ifndef JSI_AMALGAMATION
#include "jsiInt.h"
#endif
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <assert.h>
#ifdef __WIN32
#include <windows.h>
#include <shlwapi.h>
#ifndef JSI_OMIT_THREADS
#include <process.h>
#endif
#else
#ifndef JSI_OMIT_THREADS
#inc... | vuln | Vulnerable | C/C++ |
bool RenderFrameDevToolsAgentHost::AttachSession(DevToolsSession* session) {
if (session->restricted() && !IsFrameHostAllowedForRestrictedSessions())
return false;
session->SetRenderer(frame_host_ ? frame_host_->GetProcess()->GetID()
: ChildProcessHost::kInvalidUniqueID,
... | vuln | Safe | C/C++ |
/*
* Copyright (C) 2016 Southern Storm Software, Pty Ltd.
*
* 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 | Safe | Java |
static void jsiLNGetMatches(const char *str, linenoiseCompletions *lc) {
char buf[JSI_BUFSIZ], pre[JSI_BUFSIZ], hpre[6] = {};
const char *cp, *fnam = "Info.completions";
int i = 0, len;
int rc, isfile = 0, start = 0, end = Jsi_Strlen(str);
Jsi_Interp* interp = jsi_interactiveInterp;
if (!Jsi_Str... | vuln | Safe | C/C++ |
//
// Copyright 2021 The Sigstore 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 applicable law or ... | vuln | Vulnerable | Go |
from typing import Union, Optional, Dict, Any, List
import ujson
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from django.shortcuts import redirect, render
from django.conf import settings
from zerver.decorator import require_realm_admin, require_member_or_admi... | vuln | Vulnerable | Python |
import codecs
import errno
import gzip
import os
import posixpath
import shutil
import sys
import tarfile
import tempfile
import stat
import urllib.parse
import urllib.request
from urllib.parse import unquote
from urllib.request import pathname2url
import yaml
try:
from yaml import CSafeLoader as YamlSafeLoader,... | vuln | Vulnerable | Python |
static struct page *alloc_huge_page(struct vm_area_struct *vma,
unsigned long addr, int avoid_reserve)
{
struct hugepage_subpool *spool = subpool_vma(vma);
struct hstate *h = hstate_vma(vma);
struct page *page;
long chg;
/*
* Processes that did not create the mapping will have no
* reserves and will n... | vuln | Safe | C/C++ |
static int FNAME(update_accessed_dirty_bits)(struct kvm_vcpu *vcpu,
struct kvm_mmu *mmu,
struct guest_walker *walker,
gpa_t addr, int write_fault)
{
unsigned level, index;
pt_element_t pte, orig_pte;
pt_element_t __user *ptep_user;
gfn_t table_gfn;
int ret;
/* dirty/accessed bits ar... | vuln | Safe | Unknown |
static int rock_continue(struct rock_state *rs)
{
int ret = 1;
int blocksize = 1 << rs->inode->i_blkbits;
const int min_de_size = offsetof(struct rock_ridge, u);
kfree(rs->buffer);
rs->buffer = NULL;
if ((unsigned)rs->cont_offset > blocksize - min_de_size ||
(unsigned)rs->cont_size > blocksize ||
(uns... | vuln | Safe | C/C++ |
bool ZipCommon::isValidPath(const std::string& path)
{
try
{
if (Path(path, Path::PATH_UNIX).isAbsolute() || Path(path, Path::PATH_WINDOWS).isAbsolute())
return false;
}
catch (...)
{
return false;
}
if (path == "..")
return false;
if ((path.size() >= 3) && path.compare(0, 3, "../") == 0)
return fal... | vuln | Safe | C/C++ |
/*
Copyright The Helm 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 applicable law or agreed to in writing, software
di... | vuln | Vulnerable | Go |
/* eslint-disable no-param-reassign */
/* eslint-disable no-restricted-syntax */
/* eslint-disable guard-for-in */
import assert from './assert';
import objectAssign from './object-assign';
function pick(object, keys) {
return keys.reduce(function(prev, key) {
if (object[key]) {
prev[key] = object[key];
... | vuln | Vulnerable | JavaScript |
void RenderWidgetHostImpl::DidNavigate(uint32_t next_source_id) {
current_content_source_id_ = next_source_id;
did_receive_first_frame_after_navigation_ = false;
if (enable_surface_synchronization_) {
visual_properties_ack_pending_ = false;
if (view_)
view_->DidNavigate();
} else {
if (la... | vuln | Safe | C/C++ |
private void createIssue(ScanRequest request, Scan scan)
throws IOException {
try {
final ScanVulnerabilities scanVulnerabilities =
iastServiceRequests.apiScanVulnerabilities(scan.getScanId());
List<VulnerabilityInfo> vulnerabilities = scanVulnerabilities.... | vuln | Vulnerable | Java |
'use strict';
module.exports = {
evaluatePath,
setPath
};
function evaluatePath(document, keyPath) {
if (!document) {
return null;
}
let {indexOfDot, currentKey, remainingKeyPath} = computeStateInformation(keyPath);
// If there is a '.' in the keyPath and keyPath doesn't appear in th... | vuln | Vulnerable | JavaScript |
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build ignore
/*
Input to cgo -godefs. See README.md
*/
// +godefs map struct_in_addr [4]byte /* in_addr */
// +godefs map struct_in6_addr [16]byte /* in6... | vuln | Safe | Go |
void do_brinc (void)
{
uint32_t a, b, d, mask;
mask = (uint32_t)(-1UL) >> MASKBITS;
b = T1_64 & mask;
a = T0_64 & mask;
d = word_reverse(1 + word_reverse(a | ~mask));
T0_64 = (T0_64 & ~mask) | (d & mask);
} | vuln | Vulnerable | C/C++ |
sfe_apply_metadata_changes (const char * filenames [2], const METADATA_INFO * info)
{ SNDFILE *infile = NULL, *outfile = NULL ;
SF_INFO sfinfo ;
METADATA_INFO tmpinfo ;
int error_code = 0 ;
memset (&sfinfo, 0, sizeof (sfinfo)) ;
memset (&tmpinfo, 0, sizeof (tmpinfo)) ;
if (filenames [1] == NULL)
infile = outf... | vuln | Safe | Unknown |
if(!self.define){const e=e=>{"require"!==e&&(e+=".js");let r=Promise.resolve();return i[e]||(r=new Promise((async r=>{if("document"in self){const i=document.createElement("script");i.src=e,document.head.appendChild(i),i.onload=r}else importScripts(e),r()}))),r.then((()=>{if(!i[e])throw new Error(`Module ${e} didn’t reg... | vuln | Safe | Java |
scroll_idl(NCURSES_SP_DCLx int n, int del, int ins, NCURSES_CH_T blank)
{
int i;
if (!((parm_delete_line || delete_line) && (parm_insert_line || insert_line)))
return ERR;
GoTo(NCURSES_SP_ARGx del, 0);
UpdateAttrs(SP_PARM, blank);
if (n == 1 && delete_line) {
NCURSES_PUTP2("delete_line", delete_... | vuln | Vulnerable | Unknown |
package com.salesmanager.shop.admin.controller.shipping;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.inject.Inject;
import org.apache.commons.lang3.String... | vuln | Vulnerable | Java |
int vt_ioctl(struct tty_struct *tty,
unsigned int cmd, unsigned long arg)
{
struct vc_data *vc = tty->driver_data;
struct console_font_op op; /* used in multiple places here */
unsigned int console;
unsigned char ucval;
unsigned int uival;
void __user *up = (void __user *)arg;
int i, perm;
int ret = 0;
... | vuln | Vulnerable | C/C++ |
{% autoescape true %}
function PackageUI (type){
var packages = [];
var thisObject;
this.initialize = function(type) {
this.type = type;
thisObject = this;
$("#del_finished").click(this.deleteFinished);
$("#restart_failed").click(this.restartFailed);
this.parsePacka... | vuln | Vulnerable | Python |
from pathlib import Path
from vantage6.common.globals import APPNAME
#
# NODE SETTINGS
#
DEFAULT_NODE_SYSTEM_FOLDERS = False
DEFAULT_NODE_ENVIRONMENT = "application"
#
# INSTALLATION SETTINGS
#
PACKAGE_FOLDER = Path(__file__).parent.parent.parent
NODE_PROXY_SERVER_HOSTNAME = "proxyserver"
DATA_FOLDER = PACKAG... | vuln | Vulnerable | Python |
STATIC void GC_init_size_map(void)
{
int i;
/* Map size 0 to something bigger. */
/* This avoids problems at lower levels. */
GC_size_map[0] = 1;
for (i = 1; i <= GRANULES_TO_BYTES(TINY_FREELISTS-1) - EXTRA_BYTES; i++) {
GC_size_map[i] = (unsigned)ROUNDED_UP_GR... | vuln | Vulnerable | Unknown |
static bool blit_is_unsafe(struct CirrusVGAState *s)
{
assert(s->cirrus_blt_width > 0);
assert(s->cirrus_blt_height > 0);
if (s->cirrus_blt_width > CIRRUS_BLTBUFSIZE) {
return true;
}
if (blit_region_is_unsafe(s, s->cirrus_blt_dstpitch,
s->cirrus_blt_dstadd... | vuln | Safe | C/C++ |
static u64 __skb_get_nlattr(u64 ctx, u64 A, u64 X, u64 r4, u64 r5)
{
struct sk_buff *skb = (struct sk_buff *)(long) ctx;
struct nlattr *nla;
if (skb_is_nonlinear(skb))
return 0;
if (A > skb->len - sizeof(struct nlattr))
return 0;
nla = nla_find((struct nlattr *) &skb->data[A], skb->len - A, X);
if (n... | vuln | Vulnerable | C/C++ |
func (voteSet *VoteSet) MakeCommit() *Commit {
if voteSet.signedMsgType != tmproto.PrecommitType {
panic("Cannot MakeCommit() unless VoteSet.Type is PrecommitType")
}
voteSet.mtx.Lock()
defer voteSet.mtx.Unlock()
// Make sure we have a 2/3 majority
if voteSet.maj23 == nil {
panic("Cannot MakeCommit() unless ... | vuln | Safe | Go |
'use strict';
/**
* Share application.
*/
angular.module('share',
// Dependencies
['ui.router', 'ui.bootstrap', 'restangular', 'ngSanitize', 'ngTouch', 'pascalprecht.translate', 'tmh.dynamicLocale']
)
/**
* Configuring modules.
*/
.config(function($locationProvider, $stateProvider, $httpProvider, Restan... | vuln | Vulnerable | Java |
def download(self, filename, info_dict, subtitle=False):
"""Download to a filename using the info from info_dict
Return True on success and False otherwise
"""
nooverwrites_and_exists = (
not self.params.get('overwrites', True)
and os.path.exists(encodeFilename(fi... | vuln | Safe | Python |
@Override
@SuppressWarnings("unchecked")
public final void addInformation(ItemStack aStack, EntityPlayer aPlayer, @SuppressWarnings("rawtypes") List aList, boolean aF3_H) {
try {
String tKey = getUnlocalizedName(aStack) + ".tooltip", tString = LanguageHandler.translate(tKey, tKey);
if (UT.Code.stringValid(tSt... | vuln | Vulnerable | Java |
BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
{
int i, j;
BIO *out = NULL, *btmp = NULL, *etmp = NULL, *bio = NULL;
unsigned char *tmp = NULL;
X509_ALGOR *xa;
ASN1_OCTET_STRING *data_body = NULL;
const EVP_MD *evp_md;
const EVP_CIPHER *evp_cipher = NULL;
EVP_... | vuln | Vulnerable | Unknown |
public void addContainerViewAt(View v, int index) {
Assert.isMainThread();
ensureRemovedFromTransientContainer(v);
addView(v, index);
if (v instanceof ExpandableNotificationRow && mController.isShowingEmptyShadeView()) {
mController.updateShowEmptyShadeView();
upd... | vuln | Safe | Java |
function apiWorkspaceEndpoints(app) {
if (!app) return;
app.post("/v1/workspace/new", [validApiKey], async (request, response) => {
/*
#swagger.tags = ['Workspaces']
#swagger.description = 'Create a new workspace'
#swagger.requestBody = {
description: 'JSON object containing new display na... | vuln | Vulnerable | JavaScript |
public void run()
{
if (_should_update_caps_mode && _ic != null)
{
_should_enable_shift = _enabled && (_ic.getCursorCapsMode(_caps_mode) != 0);
_should_update_caps_mode = false;
}
_callback.update_shift_state(_should_enable_shift, _should_disable_shift);
} | vuln | Safe | Java |
static int dxtory_decode_v1_rgb(AVCodecContext *avctx, AVFrame *pic,
const uint8_t *src, int src_size,
int id, int bpp)
{
int h;
uint8_t *dst;
int ret;
if (src_size < avctx->width * avctx->height * bpp) {
av_log(avctx, AV_LOG_ERROR,... | vuln | Vulnerable | C/C++ |
@Override
public void run() {
SecurityContext original = SecurityContextHolder.getContext();
SecurityContextHolder.setContext(this.delegateSecurityContext);
try {
item.execute();
} catch (Exception t) {
String message = "Error in wo... | vuln | Safe | Java |
int digest_password(THD *thd, LEX_USER *user_record)
{
/* Empty passwords stay empty */
if (user_record->password.length == 0)
return 0;
#if defined(HAVE_OPENSSL)
/*
Transform password into a password hash
*/
if (user_record->plugin.str == sha256_password_plugin_name.str)
{
if (user_record->pa... | vuln | Safe | Unknown |
tgetpass(const char *prompt, int timeout, int flags,
struct sudo_conv_callback *callback)
{
struct sigaction sa, savealrm, saveint, savehup, savequit, saveterm;
struct sigaction savetstp, savettin, savettou;
char *pass;
static const char *askpass;
static char buf[SUDO_CONV_REPL_MAX + 1];
int... | vuln | Vulnerable | Unknown |
static int encrypted_update(struct key *key, struct key_preparsed_payload *prep)
{
struct encrypted_key_payload *epayload = key->payload.data[0];
struct encrypted_key_payload *new_epayload;
char *buf;
char *new_master_desc = NULL;
const char *format = NULL;
size_t datalen = prep->datalen;
int ret = 0;
if (... | vuln | Vulnerable | C/C++ |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2012
* All rights reserved
*
* This file is part of GPAC / Media Tools sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser Gene... | vuln | Safe | C/C++ |
virDomainGetTime(virDomainPtr dom,
long long *seconds,
unsigned int *nseconds,
unsigned int flags)
{
VIR_DOMAIN_DEBUG(dom, "seconds=%p, nseconds=%p, flags=%x",
seconds, nseconds, flags);
virResetLastError();
virCheckDomainReturn(do... | vuln | Safe | C/C++ |
iperf_json_printf(const char *format, ...)
{
cJSON* o;
va_list argp;
const char *cp;
char name[100];
char* np;
cJSON* j;
o = cJSON_CreateObject();
if (o == NULL)
return NULL;
va_start(argp, format);
np = name;
for (cp = format; *cp != '\0'; ++cp) {
switch (*cp) {
... | vuln | Vulnerable | Unknown |
de_dotdot( char* file )
{
char* cp;
char* cp2;
int l;
/* Collapse any multiple / sequences. */
while ( ( cp = strstr( file, "//") ) != (char*) 0 )
{
for ( cp2 = cp + 2; *cp2 == '/'; ++cp2 )
continue;
(void) strcpy( cp + 1, cp2 );
}
/* Remove leading ./ and any /./ sequences. */
... | vuln | Safe | C/C++ |
function sendResponse(response1: Response) {
try {
assert(response1 instanceof ResponseClass || response1 instanceof ServiceFault);
if (message.session) {
const counterName = ResponseClass.name.replace("Response", "");
message.session.i... | vuln | Safe | JavaScript |
public static VoxelShape getCollisionShapeBelowEntity(World world, @Nullable Entity entity, Box entityBoundingBox) {
int x = MathHelper.floor(entityBoundingBox.minX + (entityBoundingBox.maxX - entityBoundingBox.minX) / 2);
int y = MathHelper.floor(entityBoundingBox.minY);
int z = MathHelper.floo... | vuln | Safe | Java |
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.content.service;
import java.io.IOException;
import java.io.InputStream;
import jav... | vuln | Vulnerable | Java |
static int map_update_elem(union bpf_attr *attr, bpfptr_t uattr)
{
bpfptr_t ukey = make_bpfptr(attr->key, uattr.is_kernel);
bpfptr_t uvalue = make_bpfptr(attr->value, uattr.is_kernel);
int ufd = attr->map_fd;
struct bpf_map *map;
void *key, *value;
u32 value_size;
struct fd f;
int err;
if (CHECK_ATTR(BPF_MAP_... | vuln | Safe | Unknown |
int propagate_mnt(struct mount *dest_mnt, struct dentry *dest_dentry,
struct mount *source_mnt, struct list_head *tree_list)
{
struct user_namespace *user_ns = current->nsproxy->mnt_ns->user_ns;
struct mount *m, *child;
int ret = 0;
struct mount *prev_dest_mnt = dest_mnt;
struct mount *prev_src_mnt = s... | vuln | Safe | C/C++ |
void* leak_memalign(size_t alignment, size_t bytes)
{
// we can just use malloc
if (alignment <= MALLOC_ALIGNMENT)
return leak_malloc(bytes);
// need to make sure it's a power of two
if (alignment & (alignment-1))
alignment = 1L << (31 - __builtin_clz(alignment));
// here, aligment... | vuln | Vulnerable | Unknown |
package api
// Visibility is the type of a visibility.
type Visibility string
const (
// Public is the PUBLIC visibility.
Public Visibility = "PUBLIC"
// Protected is the PROTECTED visibility.
Protected Visibility = "PROTECTED"
// Private is the PRIVATE visibility.
Private Visibility = "PRIVATE"
)
func (e Visi... | vuln | Safe | Go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.