code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
@Override
public void dispose() {
performLocked(() -> {
WLToolkit.unregisterWLSurface(getWLSurface(nativePtr));
nativeDisposeFrame(nativePtr);
nativePtr = 0;
});
} | vuln | Safe | Java |
_hb_ot_layout_init (hb_face_t *face)
{
hb_ot_layout_t *layout = &face->ot_layout;
layout->gdef_blob = Sanitizer<GDEF>::sanitize (hb_face_get_table (face, HB_OT_TAG_GDEF));
layout->gdef = &Sanitizer<GDEF>::lock_instance (layout->gdef_blob);
layout->gsub_blob = Sanitizer<GSUB>::sanitize (hb_face_get_table (face... | vuln | Vulnerable | Unknown |
archive_read_format_rar_read_data(struct archive_read *a, const void **buff,
size_t *size, int64_t *offset)
{
struct rar *rar = (struct rar *)(a->format->data);
int ret;
if (rar->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
rar->has_encrypted_entries =... | vuln | Safe | Unknown |
@Override
public @NonNull Set<AuthenticationHandler> getAuthenticationHandlers(final AuthenticationTransaction transaction) {
val handlers = getAuthenticationHandlers();
LOGGER.debug("Candidate/Registered authentication handlers for this transaction are [{}]", handlers);
val handlerResolvers... | vuln | Vulnerable | Java |
void RegisterSwReporterComponent(ComponentUpdateService* cus) {
if (!ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled() &&
!safe_browsing::IsInSRTPromptFieldTrialGroups()) {
return;
}
base::string16 cleaner_key_name(kSoftwareRemovalToolRegistryKey);
cleaner_key_name.append(1, L'\\')... | vuln | Vulnerable | C/C++ |
bool PrintRenderFrameHelper::PrintPagesNative(blink::WebLocalFrame* frame,
int page_count) {
const PrintMsg_PrintPages_Params& params = *print_pages_params_;
const PrintMsg_Print_Params& print_params = params.params;
std::vector<int> printed_pages = GetPrintedPages(p... | vuln | Vulnerable | C/C++ |
private void markDirtyClient() {
markDirty();
if (getWorld() != null) {
BlockState state = getWorld().getBlockState(getPos());
getWorld().updateListeners(getPos(), state, state, 3);
if(!world.isClient) {
ServerWorld world = (ServerWorld) getWorld();
world.getChunkManager().threadedAnvilChunkStorag... | vuln | Vulnerable | Java |
// Package impersonation sets up service accounts that are permitted to act on behalf of a Rancher user on a cluster.
package impersonation
import (
"context"
"fmt"
"reflect"
"sort"
"time"
authcommon "github.com/rancher/rancher/pkg/auth/providers/common"
v3 "github.com/rancher/rancher/pkg/generated/norman/mana... | vuln | Safe | Go |
public Optional<InputStream> getResourceAsStream(String path) {
Path filePath = getFilePath(normalize(path));
try {
return Optional.of(Files.newInputStream(filePath));
} catch (IOException e) {
return Optional.empty();
}
} | vuln | Vulnerable | Java |
/*
* Copyright (c) 2004-2005 Sergey Lyubka <valenok@gmail.com>
* All rights reserved
*
* "THE BEER-WARE LICENSE" (Revision 42):
* Sergey Lyubka wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can ... | vuln | Safe | C/C++ |
import os
import os.path
import shutil
from babel.messages.frontend import CommandLineInterface
from translate.convert.po2csv import main as po2csv
from translate.convert.csv2po import main as csv2po
ROOT_DIR = 'i18n'
TRANSLATIONS = os.path.join(ROOT_DIR, 'translations')
MESSAGES = os.path.join(ROOT_DIR, 'message... | vuln | Safe | Python |
static void f_parser (lua_State *L, void *ud) {
int i;
Proto *tf;
Closure *cl;
struct SParser *p = cast(struct SParser *, ud);
int c = luaZ_lookahead(p->z);
luaC_checkGC(L);
tf = (luaY_parser)(L, p->z,
&p->buff, p->name);
cl = luaF_newLclosure... | vuln | Safe | C/C++ |
@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
EObject context = selections.iterator().next();
String windowTitle = Optional.ofNullable((String) parameters.get(PARAMETER_WINDOW_TITLE)).orElse("");
ImageDescriptor image = Opt... | vuln | Safe | Java |
static int ldb_kv_handle_request(struct ldb_module *module,
struct ldb_request *req)
{
struct ldb_control *control_permissive;
struct ldb_context *ldb;
struct tevent_context *ev;
struct ldb_kv_context *ac;
struct tevent_timer *te;
struct timeval tv;
unsigned int i;
ldb = ldb_module_get_ctx(module);
cont... | vuln | Safe | Unknown |
static void
gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length)
{
u_int len = length;
uint16_t flags, prot;
/* 16 bits ND_TCHECKed in gre_print() */
flags = EXTRACT_16BITS(bp);
if (ndo->ndo_vflag)
ND_PRINT((ndo, ", Flags [%s]",
bittok2str(gre_flag_values,"non... | vuln | Vulnerable | C/C++ |
static int sdp_read_header(AVFormatContext *s)
{
RTSPState *rt = s->priv_data;
RTSPStream *rtsp_st;
int size, i, err;
char *content;
char url[1024];
if (!ff_network_init())
return AVERROR(EIO);
if (s->max_delay < 0)
s->max_delay = DEFAULT_REORDERING_DELAY;
if (rt->rtsp_f... | vuln | Safe | C/C++ |
/*
* Copyright (c) 2007-2017, Cameron Rich
*
* 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... | vuln | Safe | C/C++ |
function parseLinks(text,nav)
{
text = text.replace(/(\x01)/g,"");
if (!text || text === null || text === undefined){
return;
}
text = text.replace(/http:\/\/img.codewalr\.us\//g,"\x01img.codewalr.us/");
text = text.replace(/http:\/\/codewalr\.us\//g,"\x01codewalr.us/");
text = text.replace(RegExp("(^|.... | vuln | Safe | JavaScript |
private Slice handleBindSlice(Uri sliceUri, List<SliceSpec> supportedSpecs,
String callingPkg, int callingUid, int callingPid) {
// This can be removed once Slice#bindSlice is removed and everyone is using
// SliceManager#bindSlice.
String pkg = callingPkg != null ? callingPkg
... | vuln | Vulnerable | Java |
static int rsd_read_header(AVFormatContext *s)
{
AVIOContext *pb = s->pb;
int i, ret, version, start = 0x800;
AVCodecParameters *par;
AVStream *st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
avio_skip(pb, 3);
version = avio_r8(pb) - '0';
par = st->codecpar;
... | vuln | Safe | C/C++ |
/*
* 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 Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed... | vuln | Vulnerable | C/C++ |
def set_cluster_conf(params, request, auth_user)
if not allowed_for_local_cluster(auth_user, Permissions::FULL)
return 403, 'Permission denied'
end
if params[:cluster_conf] != nil and params[:cluster_conf].strip != ""
Cfgsync::ClusterConf.backup()
Cfgsync::ClusterConf.from_text(params[:cluster_conf]).... | vuln | Safe | Ruby |
public void setCustomProperty(final String propertyName, final String propertyValue) {
try {
ConfigurationFilesManager.getInstance().setCustomProperty(propertiesFilename, tenantId, propertyName,
propertyValue);
} catch (IOException e) {
throw new RuntimeExcept... | vuln | Vulnerable | Java |
static inline VALUE fiobj_mustache_find_obj_absolute(VALUE udata,
const char *name,
uint32_t name_len) {
VALUE tmp;
if (!RB_TYPE_P(udata, T_HASH)) {
if (name_len == 1 && name[0] == '.')
return udata;
... | vuln | Safe | C/C++ |
static int vp8_lossy_decode_frame(AVCodecContext *avctx, AVFrame *p,
int *got_frame, uint8_t *data_start,
unsigned int data_size)
{
WebPContext *s = avctx->priv_data;
AVPacket pkt;
int ret;
if (!s->initialized) {
ff_vp8_decode_i... | vuln | Safe | C/C++ |
function validateLink(url) {
var BAD_PROTOCOLS = [ 'vbscript', 'javascript', 'file', 'data' ];
var str = url.trim().toLowerCase();
// Care about digital entities "javascript:alert(1)"
str = utils.replaceEntities(str);
if (str.indexOf(':') !== -1 && BAD_PROTOCOLS.indexOf(str.split(':')[0]) !== -1) {
r... | vuln | Safe | JavaScript |
/* radare - LGPL - Copyright 2012-2017 - pancake, Fedor Sakharov */
#define D0 if(1)
#define D1 if(1)
#include <errno.h>
#define DWARF_DUMP 0
#if DWARF_DUMP
#define DBGFD stdout
#else
#define DBGFD NULL
#endif
#include <r_bin.h>
#include <r_bin_dwarf.h>
#include <r_core.h>
#define STANDARD_OPERAND_COUNT_DWARF2 9
... | vuln | Vulnerable | C/C++ |
void simplestring_addn(simplestring* target, const char* source, int add_len) {
if(target && source) {
if(!target->str) {
simplestring_init_str(target);
}
if(target->len + add_len + 1 > target->size) {
/* newsize is current length + new length */
int newsize = target->len... | vuln | Vulnerable | C/C++ |
/* 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 | Python |
evdev_log_msg(struct evdev_device *device,
enum libinput_log_priority priority,
const char *format,
...)
{
va_list args;
char buf[1024];
if (!is_logged(evdev_libinput_context(device), priority))
return;
/* Anything info and above is user-visible, use the device name */
snprintf(buf,
siz... | vuln | Safe | Unknown |
static int doBundleInstance(struct nc_state_t *nc, ncMetadata * pMeta, char *instanceId, char *bucketName, char *filePrefix, char *walrusURL,
char *userPublicKey, char *S3Policy, char *S3PolicySig)
{
// sanity checking
if (instanceId == NULL || bucketName == NULL || filePrefix == NUL... | vuln | Vulnerable | Unknown |
function EventSource (url, eventSourceInitDict) {
var readyState = EventSource.CONNECTING
Object.defineProperty(this, 'readyState', {
get: function () {
return readyState
}
})
Object.defineProperty(this, 'url', {
get: function () {
return url
}
})
var self = this
self.reconne... | vuln | Vulnerable | JavaScript |
QString IRCView::openTags(TextHtmlData* data, int from)
{
QString ret, tag;
int i = from > -1 ? from : 0;
for ( ; i < data->openHtmlTags.count(); ++i)
{
tag = data->openHtmlTags.at(i);
if (data->reverse)
{
ret += fontColorOpenTag(Preferences::self()... | vuln | Safe | C/C++ |
static int
search_impl(i_ctx_t *i_ctx_p, bool forward)
{
os_ptr op = osp;
os_ptr op1 = op - 1;
uint size = r_size(op);
uint count;
byte *pat;
byte *ptr;
byte ch;
int incr = forward ? 1 : -1;
check_read_type(*op1, t_string);
check_read_type(*op, t_string);
if (size > r_size(o... | vuln | Safe | C/C++ |
@Override
public void handle(final RoutingContext routingContext) {
final String path = routingContext.normalisedPath();
if (KSQL_AUTHENTICATION_SKIP_PATHS.contains(path)) {
routingContext.next();
return;
}
if (SystemAuthenticationHandler.isAuthenticatedAsSystemUser(routingContext)) {
... | vuln | Vulnerable | Java |
public static void extractZip(File zip, File toDir) throws IOException {
try (ZipInputStream zis = new ZipInputStream(new FileInputStream(zip))) {
ZipEntry entry;
while ((entry = zis.getNextEntry()) != null) {
if (!entry.isDirectory()) {
File file = ne... | vuln | Vulnerable | Java |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
// Retrieve tensors (All should be allocated by now)
const TfLiteTensor* output_shape;
TF_LITE_ENSURE_OK(
context, GetInputSafe(context, node, kOutputShapeTensor, &output_shape));
const TfLiteTensor* weights;
TF_LITE_ENSURE_OK(context,
... | 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 | Safe | Java |
static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, int linesize, DCTELEM *block)
{
int i;
int dc = block[0];
const uint8_t *cm;
dc = (17 * dc + 4) >> 3;
dc = (12 * dc + 64) >> 7;
cm = ff_cropTbl + MAX_NEG_CROP + dc;
for(i = 0; i < 8; i++){
dest[0] = cm[dest[0]];
dest[1] = cm[... | vuln | Vulnerable | C/C++ |
gss_get_mic_iov(OM_uint32 *minor_status, gss_ctx_id_t context_handle,
gss_qop_t qop_req, gss_iov_buffer_desc *iov, int iov_count)
{
OM_uint32 status;
gss_union_ctx_id_t ctx;
gss_mechanism mech;
status = val_wrap_iov_args(minor_status, context_handle, 0, qop_req, NULL,
iov, iov_count);
i... | vuln | Safe | C/C++ |
async function getStreamingFile(req, res) {
try {
const filePath = path.join(gladys.config.tempFolder, req.params.folder, req.params.file);
const filestream = fs.createReadStream(filePath);
filestream.on('error', (err) => {
res.status(404).end();
});
filestream.pipe(res);
}... | vuln | Vulnerable | JavaScript |
QemuOpts *qemu_opts_from_qdict(QemuOptsList *list, const QDict *qdict)
{
QemuOpts *opts;
opts = qemu_opts_create(list, qdict_get_try_str(qdict, "id"), 1);
if (opts == NULL)
return NULL;
qdict_iter(qdict, qemu_opts_from_qdict_1, opts);
return opts;
} | vuln | Vulnerable | C/C++ |
coolkey_get_public_key_from_certificate(sc_pkcs15_card_t *p15card, sc_cardctl_coolkey_object_t *obj)
{
sc_pkcs15_cert_info_t cert_info;
sc_pkcs15_cert_t *cert_out = NULL;
sc_pkcs15_pubkey_t *key = NULL;
int r;
cert_info.value.value = NULL;
r = coolkey_get_certificate(p15card->card, obj, &cert_info.value);
if (r... | vuln | Vulnerable | Unknown |
def async_call(self, function):
try:
kwargs = self.request.arguments
for arg, value in six.iteritems(kwargs):
if len(value) == 1:
kwargs[arg] = xhtml_escape(value[0])
else:
kwargs[arg] = xhtml_escape(value)
... | vuln | Safe | Python |
static void v9fs_link(void *opaque)
{
V9fsPDU *pdu = opaque;
int32_t dfid, oldfid;
V9fsFidState *dfidp, *oldfidp;
V9fsString name;
size_t offset = 7;
int err = 0;
v9fs_string_init(&name);
err = pdu_unmarshal(pdu, offset, "dds", &dfid, &oldfid, &name);
if (err < 0) {
trace_v9fs_li... | vuln | Vulnerable | C/C++ |
private void launchEditUrlDialog(Context ctx, SearchEngineInfo info) {
new EditTextDialog.Builder(ctx)
.setTitle(R.string.title_edit_url_search_engine)
.setHint(info.name)
.setInitialText(info.url)
.setConfirmListener(R.string.confirm_edit_url_search_engine, (newN... | vuln | Safe | Java |
FloydSteinbergDitheringC(gx_device_bjc_printer *dev,
byte *row, byte *dithered, uint width,
uint raster, bool limit_extr, bool composeK)
{ byte byteC=0, byteM=0, byteY=0, byteK=0, bitmask = 0x80; /* first bit */
int i;
int errorC = 0, errorM = 0, errorY = 0, d... | vuln | Vulnerable | Unknown |
may_get_cmd_block(exarg_T *eap, char_u *p, char_u **tofree, int *flags)
{
char_u *retp = p;
if (*p == '{' && ends_excmd2(eap->arg, skipwhite(p + 1))
&& eap->getline != NULL)
{
garray_T ga;
char_u *line = NULL;
ga_init2(&ga, sizeof(char_u *), 10);
if (ga_copy_string(&ga, p) == FAIL)... | vuln | Safe | C/C++ |
/*
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/lice... | vuln | Safe | C/C++ |
Network::FilterStatus Context::onDownstreamData(int data_length, bool end_of_stream) {
if (!wasm_->onDownstreamData_) {
return Network::FilterStatus::Continue;
}
auto result = wasm_->onDownstreamData_(this, id_, static_cast<uint32_t>(data_length),
static_cast<uint32_t>... | vuln | Vulnerable | C/C++ |
package com.salesmanager.shop.admin.controller.customers;
import com.salesmanager.core.business.services.customer.attribute.CustomerOptionValueService;
import com.salesmanager.core.business.services.reference.language.LanguageService;
import com.salesmanager.core.business.utils.ajax.AjaxResponse;
import com.salesmanag... | vuln | Vulnerable | Java |
protected int ensureInitialized(Frame frameNext)
{
return frameNext.f_function.ensureInitialized(this, frameNext);
} | vuln | Vulnerable | Java |
OMX_ERRORTYPE SoftAAC2::internalGetParameter(
OMX_INDEXTYPE index, OMX_PTR params) {
switch (index) {
case OMX_IndexParamAudioAac:
{
OMX_AUDIO_PARAM_AACPROFILETYPE *aacParams =
(OMX_AUDIO_PARAM_AACPROFILETYPE *)params;
if (!isValidOMXParam(aacParams)) {
... | vuln | Safe | C/C++ |
def cookies(self):
# type: () -> Dict[str, Union[str, AnnotatedValue]]
privacy_cookies = [
django_settings.CSRF_COOKIE_NAME,
django_settings.SESSION_COOKIE_NAME,
]
clean_cookies = {} # type: Dict[str, Union[str, AnnotatedValue]]
for (key, val) in self.re... | vuln | Safe | Python |
@Override
@Transactional(rollbackFor = Exception.class)
public Result<Object> createDirectory(User loginUser,
String name,
String description,
ResourceType type,
... | vuln | Safe | Java |
static ssize_t runtime_active_time_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
int ret;
u64 tmp = pm_runtime_active_time(dev);
do_div(tmp, NSEC_PER_MSEC);
ret = sysfs_emit(buf, "%llu\n", tmp);
return ret;
} | vuln | Safe | Unknown |
def get_safe_post_login_redirect():
allow_list = [
url_for('browser.index')
]
url = get_post_login_redirect()
if url in allow_list:
return url
return "/" | vuln | Vulnerable | Python |
public boolean isValid(String value, ConstraintValidatorContext context) {
long longValue = 0;
boolean failed = false;
String errorMessage = "";
try {
longValue = Long.parseLong(value);
} catch (NumberFormatException ex) {
failed = true;
errorMessage = String.format... | vuln | Vulnerable | Java |
/*
Copyright 2016 GitHub Inc.
See https://github.com/github/gh-ost/blob/master/LICENSE
*/
package main
import (
"flag"
"fmt"
"os"
"os/signal"
"syscall"
"github.com/github/gh-ost/go/base"
"github.com/github/gh-ost/go/logic"
"github.com/github/gh-ost/go/sql"
_ "github.com/go-sql-driver/mysql"
"github.co... | vuln | Vulnerable | Go |
/*
* linux/fs/lockd/svc.c
*
* This is the central lockd service.
*
* FIXME: Separate the lockd NFS server functionality from the lockd NFS
* client functionality. Oh why didn't Sun create two separate
* services in the first place?
*
* Authors: Olaf Kirch (okir@monad.swb.de)
*
* Copyright (C) 1995, 1996... | vuln | Safe | C/C++ |
static int sdl_write_trailer(AVFormatContext *s)
{
SDLContext *sdl = s->priv_data;
sdl->quit = 1;
if (sdl->overlay)
SDL_FreeYUVOverlay(sdl->overlay);
if (sdl->event_thread)
SDL_WaitThread(sdl->event_thread, NULL);
if (sdl->mutex)
SDL_DestroyMutex(sdl->mutex);
if (sdl->ini... | vuln | Vulnerable | C/C++ |
async def wrapped_send(message):
nonlocal accumulated_body, size_limit_exceeded, response_headers
if message["type"] == "http.response.start":
response_headers = message["headers"]
await send(message)
return
if message["type"] != "http... | vuln | Safe | Python |
void smp_proc_master_id(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
uint8_t* p = p_data->p_data;
tBTM_LE_PENC_KEYS le_key;
SMP_TRACE_DEBUG("%s", __func__);
if (p_cb->rcvd_cmd_len < 11) { // 1(Code) + 2(EDIV) + 8(Rand)
android_errorWriteLog(0x534e4554, "111937027");
SMP_TRACE_ERROR("%s: Invalid command... | vuln | Safe | C/C++ |
void RenderFrameImpl::OnSelectPopupMenuItem(int selected_index) {
if (external_popup_menu_ == NULL)
return;
blink::WebScopedUserGesture gesture(frame_);
// We need to reset |external_popup_menu_| before calling DidSelectItem(),
// which might delete |this|.
// See ExternalPopupMenuRemoveTest.RemoveFra... | vuln | Safe | C/C++ |
static int read_header(FFV1Context *f)
{
uint8_t state[CONTEXT_SIZE];
int i, j, context_count = -1; //-1 to avoid warning
RangeCoder *const c = &f->slice_context[0]->c;
memset(state, 128, sizeof(state));
if (f->version < 2) {
int chroma_planes, chroma_h_shift, chroma_v_shift, transparency,... | vuln | Safe | Unknown |
package com.salesmanager.shop.admin.controller.content;
import com.salesmanager.core.business.services.content.ContentService;
import com.salesmanager.core.business.services.reference.language.LanguageService;
import com.salesmanager.core.model.content.Content;
import com.salesmanager.core.model.content.ContentDescrip... | vuln | Vulnerable | Java |
ProcPanoramiXShmCreatePixmap(
register ClientPtr client)
{
ScreenPtr pScreen = NULL;
PixmapPtr pMap = NULL;
DrawablePtr pDraw;
DepthPtr pDepth;
int i, j, result, rc;
ShmDescPtr shmdesc;
REQUEST(xShmCreatePixmapReq);
unsigned int width, height, depth;
unsigned long size;
Panor... | vuln | Safe | Unknown |
@Override
public void putObject(String objectName, String contentType, Map<String, String> metadata, byte[] objectData)
throws IOException {
// TODO: do something with metadata
if (objectName.endsWith("/")) {
Path path = root.resolve(objectName);
if (!Files.exist... | vuln | Vulnerable | Java |
private void schedule(ObservationRequest observation) {
Satellite satellite = satelliteDao.findById(observation.getSatelliteId());
LOG.info("scheduled next pass for {}. start: {} end: {}", satellite, new Date(observation.getStartTimeMillis()), new Date(observation.getEndTimeMillis()));
IQReader reader = createRea... | vuln | Vulnerable | Java |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2021
* All rights reserved
*
* This file is part of GPAC / ISO Media File Format sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU L... | vuln | Vulnerable | C/C++ |
fn calculate_gas_cost(
base_length: u64,
exp_length: u64,
mod_length: u64,
exponent: &BigUint,
) -> u64 {
fn calculate_multiplication_complexity(base_length: u64, mod_length: u64) -> u64 {
let max_length = max(base_length, mod_length);
let mut words = max_length / 8;
if max_length % 8 > 0 {
words += 1;
... | vuln | Safe | Rust |
static ssize_t handle_aiocb_rw(RawPosixAIOData *aiocb)
{
ssize_t nbytes;
char *buf;
if (!(aiocb->aio_type & QEMU_AIO_MISALIGNED)) {
if (aiocb->aio_niov == 1) {
return handle_aiocb_rw_linear(aiocb, aiocb->aio_iov->iov_base);
}
if (preadv_present) {
... | vuln | Safe | C/C++ |
static int decode_blocks_ind(ALSDecContext *ctx, unsigned int ra_frame,
unsigned int c, const unsigned int *div_blocks,
unsigned int *js_blocks)
{
int ret;
unsigned int b;
ALSBlockData bd = { 0 };
bd.ra_block = ra_frame;
bd.const_bloc... | vuln | Safe | C/C++ |
def validate_url(url):
if os.path.exists(url):
with open(url, 'r') as opener:
content = opener.read()
else:
content = url
urls = []
for _url in content.splitlines():
if not _url:
continue
urls.append((_validate(_url), _url))
return urls | vuln | Vulnerable | Python |
@SuppressLint("WrongConstant")
@Deprecated
@CheckResult
@NonNull
private char[] getAliasPassword(@NonNull String alias) throws KeyStoreException {
char[] password;
String prefAlias = getPrefAlias(alias);
if (sharedPreferences.contains(prefAlias)) {
String encryptedPas... | vuln | Safe | Java |
public function checkRolesRight($right = null)
{
if ((int) $this->getValue('usr_id') === 0) {
return false;
}
if (count($this->rolesRights) === 0) {
$this->assignRoles = false;
$tmpRolesRights = array(
'rol_all_lists_view' => false,
... | vuln | Vulnerable | PHP |
TaskFragmentContainer newContainer(@Nullable Activity activity, int taskId) {
final TaskFragmentContainer container = new TaskFragmentContainer(activity, taskId);
if (!mTaskContainers.contains(taskId)) {
mTaskContainers.put(taskId, new TaskContainer(taskId));
}
final TaskCont... | vuln | Vulnerable | Java |
void hfi1_mmu_rb_unregister(struct mmu_rb_handler *handler)
{
struct mmu_rb_node *rbnode;
struct rb_node *node;
unsigned long flags;
struct list_head del_list;
/* Unregister first so we don't get any more notifications. */
mmu_notifier_unregister(&handler->mn, handler->mn.mm);
/*
* Make sure the wq delete ha... | vuln | Safe | Unknown |
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
| Copyrigh... | vuln | Safe | C/C++ |
CommandBufferProxyImpl::AllocateAndMapSharedMemory(size_t size) {
mojo::ScopedSharedBufferHandle handle =
mojo::SharedBufferHandle::Create(size);
if (!handle.is_valid()) {
DLOG(ERROR) << "AllocateAndMapSharedMemory: Create failed";
return nullptr;
}
base::SharedMemoryHandle platform_handle;
... | vuln | Vulnerable | C/C++ |
n_start_visual_mode(int c)
{
#ifdef FEAT_CONCEAL
int cursor_line_was_concealed = curwin->w_p_cole > 0
&& conceal_cursor_line(curwin);
#endif
VIsual_mode = c;
VIsual_active = TRUE;
VIsual_reselect = TRUE;
// Corner case: the 0 position in a tab may change when going into
// virtualedit. ... | vuln | Safe | Unknown |
/*
* Copyright (c) 2001 The Regents of the University of Michigan.
* All rights reserved.
*
* Kendrick Smith <kmsmith@umich.edu>
* Andy Adamson <kandros@umich.edu>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met... | vuln | Vulnerable | C/C++ |
/*
* Video capture interface for Linux version 2
*
* A generic framework to process V4L2 ioctl commands.
*
* 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 Licen... | vuln | Vulnerable | C/C++ |
package command
import (
"time"
"github.com/zitadel/zitadel/internal/eventstore"
"github.com/zitadel/zitadel/internal/domain"
"github.com/zitadel/zitadel/internal/repository/user"
)
type HumanRefreshTokenWriteModel struct {
eventstore.WriteModel
TokenID string
RefreshToken string
UserState domai... | vuln | Safe | Go |
static int build_huff(const uint8_t *src, VLC *vlc, int *fsym)
{
int i;
HuffEntry he[256];
int last;
uint32_t codes[256];
uint8_t bits[256];
uint8_t syms[256];
uint32_t code;
*fsym = -1;
for (i = 0; i < 256; i++) {
he[i].sym = i;
he[i].len = *src++;
}
qsort(he... | vuln | Vulnerable | C/C++ |
void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_colorspace *is, fz_colorspace *ds, fz_colorspace *ss, const fz_color_params *params)
{
int n = ss->n;
fz_cached_color_converter *cached = fz_malloc_struct(ctx, fz_cached_color_converter);
cc->opaque = cached;
cc->convert = fz_cached_co... | vuln | Vulnerable | C/C++ |
Py_NO_INLINE static void
child_exec(char *const exec_array[],
char *const argv[],
char *const envp[],
const char *cwd,
int p2cread, int p2cwrite,
int c2pread, int c2pwrite,
int errread, int errwrite,
int errpipe_read, int errpipe_write,
... | vuln | Safe | C/C++ |
public static Long getLong(Context context, SharedPrefNames prefName, String key, Long _default) {
SharedPreferences sharedPreferences = getPreferences(context, prefName);
try {
return Long.valueOf(sharedPreferences.getString(key, _default + ""));
} catch (ClassCastException ex) {
... | vuln | Safe | Java |
static int inet6_create(struct net *net, struct socket *sock, int protocol)
{
struct inet_sock *inet;
struct ipv6_pinfo *np;
struct sock *sk;
struct list_head *p;
struct inet_protosw *answer;
struct proto *answer_prot;
unsigned char answer_flags;
char answer_no_check;
int try_loading_module = 0;
int err;
if... | vuln | Vulnerable | Unknown |
static int buffered_rate_limit(void *opaque)
{
MigrationState *s = opaque;
int ret;
ret = qemu_file_get_error(s->file);
if (ret) {
return ret;
}
if (s->bytes_xfer > s->xfer_limit) {
return 1;
}
return 0;
} | vuln | Vulnerable | C/C++ |
def clean(self):
super().clean()
# If editing an existing DeviceType to have a larger u_height, first validate that *all* instances of it have
# room to expand within their racks. This validation will impose a very high performance penalty when there are
# many instances to check, but i... | vuln | Safe | Python |
static int ipddp_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct ipddp_route __user *rt = ifr->ifr_data;
struct ipddp_route rcp, rcp2, *rp;
if(!capable(CAP_NET_ADMIN))
return -EPERM;
if(copy_from_user(&rcp, rt, sizeof(rcp)))
return -EFAULT;
switch... | vuln | Vulnerable | C/C++ |
@Override
public void run() {
while (observer.isReady()) {
try {
if (cancelled) { //Exit if cancelled
observer.onError(new StatusException(io.grpc.Status.CANCELLED));
is.close();
... | vuln | Vulnerable | Java |
int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt)
{
int ret, size;
size = RAW_PACKET_SIZE;
if (av_new_packet(pkt, size) < 0)
return AVERROR(ENOMEM);
pkt->pos= avio_tell(s->pb);
pkt->stream_index = 0;
ret = ffio_read_partial(s->pb, pkt->data, size);
if (ret < 0) {
... | vuln | Vulnerable | C/C++ |
def process_file():
content = request.json
target_filename = os.path.normpath(content.get('filename')).lstrip(os.pardir + os.sep)
print(f"Processing {target_filename}")
success, reason = process_single(WATCH_DIRECTORY, target_filename)
return json.dumps({'filename': target_filename, 'success': success, 'reaso... | vuln | Safe | Python |
static int decode_slice_header(H264Context *h){
MpegEncContext * const s = &h->s;
int first_mb_in_slice;
unsigned int pps_id;
int num_ref_idx_active_override_flag;
static const uint8_t slice_type_map[5]= {P_TYPE, B_TYPE, I_TYPE, SP_TYPE, SI_TYPE};
int slice_type;
int default_ref_list_done = ... | vuln | Safe | C/C++ |
static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int depth, AVFormatContext *s)
{
AVIOContext *pb;
WtvFile *wf;
uint8_t *buffer;
if (avio_seek(s->pb, (int64_t)first_sector << WTV_SECTOR_BITS, SEEK_SET) < 0)
return NULL;
wf = av_mallocz(sizeof(WtvFile));
if (!wf... | vuln | Vulnerable | C/C++ |
require('../services/Requisitions');
import Util from 'lib/util';
const QuickNode = require('../model/QuickNode');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(function() {
'use strict';
const quickAddPanelBasicView = require('../../views/quick-add-panel-basi... | vuln | Vulnerable | Java |
@Override
public void stop() {
if (!isOpen()) {
return;
}
if (!started) {
return;
}
ALC11.alcCaptureStop(device);
SoundManager.checkAlError();
started = false;
int available = available();
short[] data = new short[avail... | vuln | Vulnerable | Java |
void FUNCC(ff_h264_chroma_dc_dequant_idct)(int16_t *_block, int qmul){
const int stride= 16*2;
const int xStride= 16;
int a,b,c,d,e;
dctcoef *block = (dctcoef*)_block;
a= block[stride*0 + xStride*0];
b= block[stride*0 + xStride*1];
c= block[stride*1 + xStride*0];
d= block[stride*1 + xStr... | vuln | Vulnerable | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.