code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
BlockDriverState *bdrv_find_backing_image(BlockDriverState *bs,
const char *backing_file)
{
char *filename_full = NULL;
char *backing_file_full = NULL;
char *filename_tmp = NULL;
int is_protocol = 0;
BlockDriverState *curr_bs = NULL;
BlockDriverState *retval = NULL;
if (!bs || !bs->d... | vuln | Vulnerable | C/C++ |
public boolean transfer(Unit origin, Unit destination) {
boolean transferred;
// Check the origin is a person
if (origin instanceof EquipmentOwner) {
transferred = ((EquipmentOwner)origin).removeEquipment((Equipment)this);
}
else {
transferred = origin.getInventory().retrieveUnit(this, false);
}
... | vuln | Safe | Java |
/* radare2 - LGPL - Copyright 2021-2022 - condret */
#include <r_io.h>
R_API RIOBank *r_io_bank_new(const char *name) {
r_return_val_if_fail (name, NULL);
RIOBank *bank = R_NEW0 (RIOBank);
if (!bank) {
return NULL;
}
bank->name = strdup (name);
bank->submaps = r_crbtree_new (free);
if (!bank->submaps) {
fr... | vuln | Safe | C/C++ |
status_t OMXNodeInstance::allocateBufferWithBackup(
OMX_U32 portIndex, const sp<IMemory> ¶ms,
OMX::buffer_id *buffer, OMX_U32 allottedSize) {
if (params == NULL || buffer == NULL) {
ALOGE("b/25884056");
return BAD_VALUE;
}
Mutex::Autolock autoLock(mLock);
if (allottedSize ... | vuln | Safe | C/C++ |
void innerExecute(int currentProcessor, IngestDocument ingestDocument, BiConsumer<IngestDocument, Exception> handler) {
if (currentProcessor == processorsWithMetrics.size()) {
handler.accept(ingestDocument, null);
return;
}
Tuple<Processor, IngestMetric> processorWithMet... | vuln | Vulnerable | Java |
bool object_property_get_bool(Object *obj, const char *name,
Error **errp)
{
QObject *ret = object_property_get_qobject(obj, name, errp);
QBool *qbool;
bool retval;
if (!ret) {
return false;
}
qbool = qobject_to_qbool(ret);
if (!qbool) {
error_se... | vuln | Safe | C/C++ |
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved
*
* $Header$
*/
#include "k5-int.h"
#include <sys/time.h>
#include <kadm5/admin.h>
#include <kdb.h>
#include "server_internal.h"
#ifdef USE_PASSWORD_SERV... | vuln | Safe | C/C++ |
f_assert_fails(typval_T *argvars, typval_T *rettv)
{
char_u *cmd;
garray_T ga;
int save_trylevel = trylevel;
int called_emsg_before = called_emsg;
char *wrong_arg_msg = NULL;
char_u *tofree = NULL;
if (check_for_string_or_number_arg(argvars, 0) == FAIL
|| check_for_opt_string_or_list... | vuln | Safe | C/C++ |
public int getTier(ItemStack testItem, List<String> list) {
if (testItem.getItem() instanceof IRadiationSuit)
return ((IRadiationSuit) testItem.getItem()).getArmorTier();
for (String line : list) {
if(line.length() == 0 || !line.contains(":"))
continue;
if (line.substring(0, line.lastIndexOf(':')).equa... | vuln | Safe | Java |
@SubscribeEvent
public void onSound(PlaySoundEvent event) {
if (ToggleCommand.dungeonBossMusic && Utils.inDungeons && inDungeonBossRoom) {
if (event.isCancelable() && event.name.startsWith("note.")) event.setCanceled(true);
}
} | vuln | Safe | Java |
Http::FilterMetadataStatus Context::onResponseMetadata() {
if (!in_vm_context_created_ || !wasm_->onResponseMetadata_) {
return Http::FilterMetadataStatus::Continue;
}
if (wasm_->onResponseMetadata_(this, id_).u64_ == 0) {
return Http::FilterMetadataStatus::Continue;
}
return Http::FilterMetadataStatu... | vuln | Safe | C/C++ |
/* globals
ClipboardJS,
inventreeFormDataUpload,
inventreeGet,
launchModalForm,
user_settings,
*/
/* exported
attachClipboard,
enableDragAndDrop,
exportFormatOptions,
inventreeDocReady,
inventreeLoad,
inventreeSave,
*/
function attachClipboard(selector, containerselector, t... | vuln | Vulnerable | Python |
int av_write_frame(AVFormatContext *s, AVPacket *pkt)
{
int ret;
compute_pkt_fields2(s->streams[pkt->stream_index], pkt);
truncate_ts(s->streams[pkt->stream_index], pkt);
ret= s->oformat->write_packet(s, pkt);
if(!ret)
ret= url_ferror(&s->pb);
return ret;
} | vuln | Vulnerable | C/C++ |
/*
* Functions to sequence FLUSH and FUA writes.
*
* Copyright (C) 2011 Max Planck Institute for Gravitational Physics
* Copyright (C) 2011 Tejun Heo <tj@kernel.org>
*
* This file is released under the GPLv2.
*
* REQ_{FLUSH|FUA} requests are decomposed to sequences consisted of three
* optional steps - PREFL... | vuln | Vulnerable | C/C++ |
static Image *ReadCAPTIONImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
char
*caption,
geometry[MagickPathExtent],
*property,
*text;
const char
*gravity,
*option;
DrawInfo
*draw_info;
Image
*image;
MagickBooleanType
split,
status;
register ssize... | vuln | Safe | C/C++ |
static int ReadHuffmanCodeLengths(
VP8LDecoder* const dec, const int* const code_length_code_lengths,
int num_symbols, int* const code_lengths) {
int ok = 0;
VP8LBitReader* const br = &dec->br_;
int symbol;
int max_symbol;
int prev_code_len = DEFAULT_CODE_LENGTH;
HuffmanCode table[1 << LENGTHS_TABLE... | vuln | Vulnerable | C/C++ |
static int asn1_d2i_ex_primitive(ASN1_VALUE **pval,
static int asn1_template_ex_d2i(ASN1_VALUE **pval,
const unsigned char **in, long len,
const ASN1_TEMPLATE *tt, char opt,
ASN1_TLC *ctx);
static int asn1_template_noexp... | vuln | Vulnerable | Unknown |
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* 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.apach... | vuln | Vulnerable | Java |
cJSON *cJSON_CreateFloat( double num )
{
cJSON *item = cJSON_New_Item();
if ( item ) {
item->type = cJSON_Number;
item->valuefloat = num;
item->valueint = num;
}
return item;
} | vuln | Vulnerable | C/C++ |
/* Mach-O support for BFD.
Copyright (C) 1999-2020 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
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 Fou... | vuln | Vulnerable | C/C++ |
int qemu_savevm_state_complete(Monitor *mon, QEMUFile *f)
{
SaveStateEntry *se;
cpu_synchronize_all_states();
QTAILQ_FOREACH(se, &savevm_handlers, entry) {
if (se->save_live_state == NULL)
continue;
qemu_put_byte(f, QEMU_VM_SECTION_END);
qemu_put_be32(f, se->sect... | vuln | Safe | C/C++ |
static bool cgm_bind_dir(const char *root, const char *dirname)
{
nih_local char *cgpath = NULL;
/* /sys should have been mounted by now */
cgpath = NIH_MUST( nih_strdup(NULL, root) );
NIH_MUST( nih_strcat(&cgpath, NULL, "/sys/fs/cgroup") );
if (!dir_exists(cgpath)) {
ERROR("%s does not exist", cgpath);
retu... | vuln | Safe | C/C++ |
boolean containsKey(Context context, String key) {
SharedPreferences sharedPreferences = getSharedPreferences(context);
if (sharedPreferences != null) {
try {
return sharedPreferences.contains(key);
} catch (SecurityException ignored) {
// defensiv... | vuln | Safe | Java |
@SuppressWarnings("unchecked")
public T value() {
try {
if (!constant) {
return (T) getter.invoke(null);
}
if (cachedValue == NO_VALUE) {
cachedValue = (T) getter.invoke(null);
}
return cachedValue;
} catch (... | vuln | Vulnerable | Java |
'use strict';
var required = require('requires-port')
, qs = require('querystringify')
, CRHTLF = /[\n\r\t]/g
, slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//
, protocolre = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i
, windowsDriveLetter = /^[a-zA-Z]:/
, whitespace = /^[ \f\n\r\t\v\u00a0\u1680\u2000-\u2... | vuln | Vulnerable | JavaScript |
int SpdyProxyClientSocket::DoReadReplyComplete(int result) {
if (result < 0)
return result;
if (response_.headers->GetParsedHttpVersion() < HttpVersion(1, 0))
return ERR_TUNNEL_CONNECTION_FAILED;
net_log_.AddEvent(
NetLog::TYPE_HTTP_TRANSACTION_READ_TUNNEL_RESPONSE_HEADERS,
base::Bind(&Http... | vuln | Vulnerable | C/C++ |
void postBroadcastInfoRequest(final BroadcastInfoRequest request) {
mHandler.post(new Runnable() {
@Override
public void run() {
if (mSession.getInputSession() != null) {
mSession.getInputSession().requestBroadcastInfo(request);
... | vuln | Safe | Java |
async start() {
if (this.server) {
return
}
this.app = await this.createApp()
if (this.port) {
this.server = this.app.listen(this.port)
} else {
do {
try {
this.port = await getPort({ port: defaultWatchServerPort })
this.server = this.app.listen(this.p... | vuln | Vulnerable | JavaScript |
bool parse( char* ptr )
{
if (!ptr)
CV_PARSE_ERROR_CPP("Invalid input");
bool first = true;
bool ok = true;
FileNode root_collection(fs->getFS(), 0, 0);
for(;;)
{
// 0. skip leading comments and directives and ...
// 1. reach the... | vuln | Safe | C/C++ |
static int multiwrite_f(int argc, char **argv)
{
struct timeval t1, t2;
int Cflag = 0, qflag = 0;
int c, cnt;
char **buf;
int64_t offset, first_offset = 0;
int total = 0;
int nr_iov;
int nr_reqs;
int pattern = 0xcd;
QEMUIOVector *qiovs;
int i;
BlockRequest *reqs;
... | vuln | Vulnerable | C/C++ |
static int
dissect_spoolss_keybuffer(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, dcerpc_info *di, guint8 *drep)
{
guint32 size;
int end_offset;
if (di->conformant_run)
return offset;
/* Dissect size and data */
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep,
h... | vuln | Vulnerable | C/C++ |
static int db__message_reconnect_reset_incoming(struct mosquitto *context)
{
struct mosquitto_client_msg *msg, *tmp;
context->msgs_in.inflight_bytes = 0;
context->msgs_in.inflight_bytes12 = 0;
context->msgs_in.inflight_count = 0;
context->msgs_in.inflight_count12 = 0;
context->msgs_in.queued_bytes = 0;
context-... | vuln | Safe | C/C++ |
def parse_line(s):
s = s.rstrip()
r = re.sub(REG_LINE_GPERF, '', s)
if r != s: return r
r = re.sub(REG_HASH_FUNC, 'hash(OnigCodePoint codes[])', s)
if r != s: return r
r = re.sub(REG_STR_AT, 'onig_codes_byte_at(codes, \\1)', s)
if r != s: return r
r = re.sub(REG_UNFOLD_KEY, 'unicode_unf... | vuln | Vulnerable | C/C++ |
pseudo_ulog( ClassAd *ad )
{
ULogEvent *event = instantiateEvent(ad);
int result = 0;
char const *critical_error = NULL;
MyString CriticalErrorBuf;
bool event_already_logged = false;
bool put_job_on_hold = false;
char const *hold_reason = NULL;
char *hold_reason_buf = NULL;
int hold_reason_code = 0;
int hold_... | vuln | Vulnerable | C/C++ |
@Inject(method = "updatePlayerPose", at = @At(value = "TAIL"))
private void updatePlayerPoseEvent(CallbackInfo ci) {
if(!this.level.isClientSide() || this.getPose() == Pose.CROUCHING || getPose() == Pose.DYING || getPose() == Pose.SWIMMING || getPose() == Pose.FALL_FLYING || getPose() == Pose.SLEEPING) {
... | vuln | Vulnerable | Java |
static int hda_codec_dev_init(DeviceState *qdev, DeviceInfo *base)
{
HDACodecBus *bus = DO_UPCAST(HDACodecBus, qbus, qdev->parent_bus);
HDACodecDevice *dev = DO_UPCAST(HDACodecDevice, qdev, qdev);
HDACodecDeviceInfo *info = DO_UPCAST(HDACodecDeviceInfo, qdev, base);
dev->info = info;
if (dev->cad ==... | vuln | Safe | C/C++ |
void caps_print_filter(pid_t pid) {
EUID_ASSERT();
ProcessHandle sandbox = pin_sandbox_process(pid);
uint64_t caps = extract_caps(sandbox);
unpin_process(sandbox);
int i;
uint64_t mask;
int elems = sizeof(capslist) / sizeof(capslist[0]);
for (i = 0, mask = 1; i < elems; i++, mask <<= 1) {
printf("%-18.18s ... | vuln | Safe | Unknown |
static int af9005_identify_state(struct usb_device *udev,
struct dvb_usb_device_properties *props,
struct dvb_usb_device_description **desc,
int *cold)
{
int ret;
u8 reply, *buf;
buf = kmalloc(FW_BULKOUT_SIZE + 2, GFP_KERNEL);
if (!buf)
return -ENOMEM;
ret = af9005_boot_packet(udev, FW_CONFIG, &... | vuln | Vulnerable | C/C++ |
EditorUi.prototype.updateCssForMarker = function(markerDiv, prefix, shape, marker, fill)
{
markerDiv.style.verticalAlign = 'top';
markerDiv.style.height = '21px';
markerDiv.style.width = '21px';
markerDiv.innerText = '';
if (shape == 'flexArrow')
{
markerDiv.className = (marker != null && marker != mxConstants... | vuln | Safe | JavaScript |
void timer_del(QEMUTimer *ts)
{
QEMUTimerList *timer_list = ts->timer_list;
qemu_mutex_lock(&timer_list->active_timers_lock);
timer_del_locked(timer_list, ts);
qemu_mutex_unlock(&timer_list->active_timers_lock);
} | vuln | Vulnerable | C/C++ |
package profile
import (
"bufio"
"bytes"
"context"
"crypto"
"crypto/hmac"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"crypto/sha512"
"crypto/subtle"
"crypto/tls"
"crypto/x509"
"encoding/base64"
"encoding/json"
"encoding/pem"
"fmt"
"io"
"io/ioutil"
mathrand "math/rand"
"net"
"net/http"
"net/url"
... | vuln | Safe | Go |
GetStartupData(HANDLE pipe, STARTUP_DATA *sud)
{
size_t size, len;
BOOL ret = FALSE;
WCHAR *data = NULL;
DWORD bytes, read;
bytes = PeekNamedPipeAsync(pipe, 1, &exit_event);
if (bytes == 0)
{
MsgToEventLog(M_SYSERR, TEXT("PeekNamedPipeAsync failed"));
ReturnLastError... | vuln | Vulnerable | C/C++ |
private MatchingDocument extractMetadataFromJson(MatchingDocument outputData) {
JsonElement jelement = new JsonParser().parse(outputData.getJsonObject());
JsonObject jobject = jelement.getAsJsonObject();
final JsonArray titlesFromJson = jobject.get("title").getAsJsonArray();
if (titlesF... | vuln | Vulnerable | Java |
async function validateSPLTokenTransfer(
message: Message,
meta: ConfirmedTransactionMeta,
recipient: Recipient,
splToken: SPLToken
): Promise<[BigNumber, BigNumber]> {
const recipientATA = await getAssociatedTokenAddress(splToken, recipient);
const accountIndex = message.accountKeys.findIndex((... | vuln | Vulnerable | JavaScript |
static void delete_file(e2fsck_t ctx, ext2_ino_t ino,
struct dup_inode *dp, char* block_buf)
{
ext2_filsys fs = ctx->fs;
struct process_block_struct pb;
struct problem_context pctx;
unsigned int count;
clear_problem_context(&pctx);
pctx.ino = pb.ino = ino;
pb.dup_blocks = 0;
pb.ctx = ctx;
pctx.str = "dele... | vuln | Safe | Unknown |
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2000-2005 Silicon Graphics, Inc.
* Copyright (c) 2013 Red Hat, Inc.
* All Rights Reserved.
*/
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_shared.h"
#include "xfs_format.h"
#include "xfs_log_format.h"
#include "xfs_trans_resv.h"
#include "xfs_bit.h"
#incl... | vuln | Safe | C/C++ |
static void virtio_scsi_bad_req(void)
{
error_report("wrong size for virtio-scsi headers");
exit(1);
} | vuln | Vulnerable | C/C++ |
@Override
public RssGetShuffleResultResponse getShuffleResult(RssGetShuffleResultRequest request) {
GetShuffleResultRequest rpcRequest = GetShuffleResultRequest
.newBuilder()
.setAppId(request.getAppId())
.setShuffleId(request.getShuffleId())
.setPartitionId(request.getPartitionId(... | vuln | Safe | Java |
/* Copyright 2017 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++ |
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: https://www.espocrm.com
*
* EspoCRM is free software: you can redistribute i... | vuln | Vulnerable | JavaScript |
private void handleSandman(int groupId) { // runs on handler thread
// Handle preconditions.
final boolean startDreaming;
final int wakefulness;
synchronized (mLock) {
mSandmanScheduled = false;
final int[] ids = mDisplayGroupPowerStateMapper.getDisplayGroupIdsLoc... | vuln | Safe | Java |
void impeg2d_flush_ext_and_user_data(dec_state_t *ps_dec)
{
UWORD32 u4_start_code;
stream_t *ps_stream;
ps_stream = &ps_dec->s_bit_stream;
u4_start_code = impeg2d_bit_stream_nxt(ps_stream,START_CODE_LEN);
while((u4_start_code == EXTENSION_START_CODE || u4_start_code == USER_DATA_START_CODE) &&... | vuln | Safe | C/C++ |
static int
check_compat_entry_size_and_hooks(struct compat_ipt_entry *e,
struct xt_table_info *newinfo,
unsigned int *size,
const unsigned char *base,
const unsigned char *limit,
const unsigned int *hook_entries,
const unsigned int *underflows,
const char *name)
{
struct xt_en... | vuln | Vulnerable | C/C++ |
static void ep_mul_glv_imp(ep_t r, const ep_t p, const bn_t k) {
int l, l0, l1, i, n0, n1, s0, s1;
int8_t naf0[RLC_FP_BITS + 1], naf1[RLC_FP_BITS + 1], *t0, *t1;
bn_t n, _k, k0, k1, v1[3], v2[3];
ep_t q, t[1 << (EP_WIDTH - 2)];
bn_null(n);
bn_null(_k);
bn_null(k0);
bn_null(k1);
ep_null(q);
RLC_TRY {
bn_ne... | vuln | Vulnerable | C/C++ |
//
// DNP3 was initially used over serial links; it defined its own application
// layer, transport layer, and data link layer. This hierarchy cannot be
// mapped to the TCP/IP stack directly. As a result, all three DNP3 layers
// are packed together as a single application layer payload over the TCP
// layer. Each DNP... | vuln | Safe | C/C++ |
static int scsi_req_length(SCSICommand *cmd, SCSIDevice *dev, uint8_t *buf)
{
cmd->xfer = scsi_cdb_length(buf);
switch (buf[0]) {
case TEST_UNIT_READY:
case REWIND:
case START_STOP:
case SET_CAPACITY:
case WRITE_FILEMARKS:
case WRITE_FILEMARKS_16:
case SPACE:
case RESERVE:
ca... | vuln | Safe | C/C++ |
public static function wpSetUpBeforeClass( $factory ) {
self::$user_ids = array(
'administrator' => self::make_user_by_role( 'administrator' ),
'contributor' => self::make_user_by_role( 'contributor' ),
);
self::$posts['publish'] = $factory->post->create_and_get();
self::... | vuln | Safe | PHP |
@Override
public void load(CompoundTag compoundTag) {
super.load(compoundTag);
this.color = compoundTag.contains(COLOR_TAG) ? compoundTag.getInt(COLOR_TAG) : DEFAULT_COLOR;
if (compoundTag.contains(STATUS_EFFECT_TAG) && !compoundTag.getString(STATUS_EFFECT_TAG).trim().equals("")) {
... | vuln | Safe | Java |
def init_user(username, chat_id):
conn = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + "\\users\\" + username + '.db')
conn2 = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + '\\cf.db')
cursor = conn.cursor()
cursor2 = conn2.cursor()
cursor.execute("CREATE TABLE result (p... | vuln | Safe | Python |
int fuse_open_common(struct inode *inode, struct file *file, bool isdir)
{
struct fuse_mount *fm = get_fuse_mount(inode);
struct fuse_conn *fc = fm->fc;
int err;
bool is_wb_truncate = (file->f_flags & O_TRUNC) &&
fc->atomic_o_trunc &&
fc->writeback_cache;
bool dax_truncate = (file->f_flags & O_TRUNC) &&
... | vuln | Safe | Unknown |
function peg$parseraw() {
var s0, s1, s2, s3, s4, s5;
peg$silentFails++;
s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c98) {
s1 = peg$c98;
peg$currPos += 2;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c99); }
}
... | vuln | Vulnerable | JavaScript |
void mca_ccb_hdl_req(tMCA_CCB* p_ccb, tMCA_CCB_EVT* p_data) {
BT_HDR* p_pkt = &p_data->hdr;
uint8_t *p, *p_start;
tMCA_DCB* p_dcb;
tMCA_CTRL evt_data;
tMCA_CCB_MSG* p_rx_msg = NULL;
uint8_t reject_code = MCA_RSP_NO_RESOURCE;
bool send_rsp = false;
bool check_req = false;
uint8_t reject_opcode;
MCA_TRACE... | vuln | Vulnerable | C/C++ |
/* Copyright 2017 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 | Python |
/* Copyright 2018 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 |
void dtls1_free(SSL *s)
{
DTLS_RECORD_LAYER_free(&s->rlayer);
{
pqueue *buffered_messages;
pqueue *sent_messages;
unsigned int mtu;
unsigned int link_mtu;
DTLS_RECORD_LAYER_clear(&s->rlayer);
if (s->d1) {
buffered_messages = s->d1->buffered_messages;
sent_messages = s->d1... | vuln | Safe | C/C++ |
public static void initialize(Context context) {
if (true) return;
try {
Unseal.unseal();
Log.i(TAG, "Unseal success!");
} catch (Exception e) {
Log.e(TAG, "Unseal fail!");
e.printStackTrace();
}
PreferenceManager.getInstance(contex... | vuln | Safe | Java |
# -*- 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 | Vulnerable | Python |
static const uint8_t *get_signature(const uint8_t *asn1_sig, int *len) | vuln | Safe | C/C++ |
def unfold(string)
string.gsub(/[\r\n \t]+/m, ' ')
end | vuln | Safe | Ruby |
// Copyright (C) 2004-2021 Artifex Software, Inc.
//
// This file is part of MuPDF.
//
// MuPDF is free software: you can redistribute it and/or modify it under the
// terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option)
// ... | vuln | Safe | C/C++ |
package com.salesmanager.shop.admin.model.permission;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPrope... | vuln | Vulnerable | Java |
/* jshint strict: false */
// //////////////////////////////////////////////////////////////////////////////
// / @brief Foxx administration actions
// /
// / @file
// /
// / DISCLAIMER
// /
// / Copyright 2016 ArangoDB GmbH, Cologne, Germany
// /
// / Licensed under the Apache License, Version 2.0 (the "License")
// ... | vuln | Safe | C/C++ |
static inline short adpcm_ms_expand_nibble(ADPCMChannelStatus *c, int nibble)
{
int predictor;
predictor = (((c->sample1) * (c->coeff1)) + ((c->sample2) * (c->coeff2))) / 64;
predictor += ((nibble & 0x08)?(nibble - 0x10):(nibble)) * c->idelta;
c->sample2 = c->sample1;
c->sample1 = av_clip_int16(pred... | vuln | Vulnerable | C/C++ |
static void build_l4proto_tcp(const struct nf_conntrack *ct, struct nethdr *n)
{
if (!nfct_attr_is_set(ct, ATTR_TCP_STATE))
return;
ct_build_group(ct, ATTR_GRP_ORIG_PORT, n, NTA_PORT,
sizeof(struct nfct_attr_grp_port));
ct_build_u8(ct, ATTR_TCP_STATE, n, NTA_TCP_STATE);
if (CONFIG(sync).tcp_window_... | vuln | Safe | C/C++ |
#include "webcc/utility.h"
#include <algorithm>
#include <ctime>
#include <fstream>
#include <iomanip> // for put_time
#include <iostream>
#include <sstream>
#include "webcc/string.h"
#include "webcc/version.h"
using boost::asio::ip::tcp;
namespace webcc {
namespace utility {
const std::string& UserAgent() {
st... | vuln | Vulnerable | C/C++ |
static int http_prepare_data(HTTPContext *c)
{
int i;
switch(c->state) {
case HTTPSTATE_SEND_DATA_HEADER:
memset(&c->fmt_ctx, 0, sizeof(c->fmt_ctx));
pstrcpy(c->fmt_ctx.author, sizeof(c->fmt_ctx.author), c->stream->author);
pstrcpy(c->fmt_ctx.comment, sizeof(c->fmt_ctx.comment), c->s... | vuln | Safe | C/C++ |
long vorbis_book_decodevs_add(codebook *book,float *a,oggpack_buffer *b,int n){
if(book->used_entries>0){
int step=n/book->dim;
long *entry = alloca(sizeof(*entry)*step);
float **t = alloca(sizeof(*t)*step);
int i,j,o;
for (i = 0; i < step; i++) {
entry[i]=decode_packed_entry_number(book,b)... | vuln | Safe | Unknown |
int encode_msg(struct sip_msg *msg,char *payload,int len)
{
int i,j,k,u,request;
unsigned short int h;
struct hdr_field* hf;
struct msg_start* ms;
struct sip_uri miuri;
char *myerror=NULL;
ptrdiff_t diff;
if(len < MAX_ENCODED_MSG + MAX_MESSAGE_LEN)
return -1;
if(parse_headers(msg,... | 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(), "s", &fname, &fname_len) == FAILURE) {
return;
}
if (zend_hash_str_exists(&phar_obj->archive->manifest, fname, (uint) fname_len)) {
if (NULL != (entry =... | vuln | Vulnerable | Unknown |
def mkdir(self, data, path):
credentials = self._formatCredentials(data, name='current')
command = (
'{credentials} '
'rclone touch current:{path}/.keep'
).format(
credentials=credentials,
path=path,
)
try:
result = se... | vuln | Vulnerable | Python |
static int usb_host_handle_control(USBHostDevice *s, USBPacket *p)
{
struct usbdevfs_urb *urb;
AsyncURB *aurb;
int ret, value, index;
/*
* Process certain standard device requests.
* These are infrequent and are processed synchronously.
*/
value = le16_to_cpu(s->ctrl.req.wValue);
... | vuln | Vulnerable | C/C++ |
/*
* Dragonfly - Runtime dependency management library
* Copyright (c) 2021 Joshua Sing <joshua@hypera.dev>
*
* 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, in... | vuln | Vulnerable | Java |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from collections import OrderedDict
import re
import yaml
from io import StringIO
from configparser import ConfigParser, NoOptionError
from .regex import HASH_REGEX
from .dependencies import DependencyFile, Dependency
from packaging.r... | vuln | Safe | Python |
return ka}function B(){function fa(ta,ka){var Ja=mxResources.get(ta);null==Ja&&(Ja=ta.substring(0,1).toUpperCase()+ta.substring(1));18<Ja.length&&(Ja=Ja.substring(0,18)+"…");return Ja+" ("+ka.length+")"}function sa(ta,ka,Ja){mxEvent.addListener(ka,"click",function(){Ha!=ka&&(Ha.style.backgroundColor="",Ha=ka,Ha.... | vuln | Vulnerable | JavaScript |
function(c){if(null!=c[EditorUi.DIFF_INSERT])for(var e=0;e<c[EditorUi.DIFF_INSERT].length;e++)try{var g=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][e].data).documentElement.cloneNode(!1);null!=g.getAttribute("name")&&g.setAttribute("name",this.anonymizeString(g.getAttribute("name")));c[EditorUi.DIFF_INSERT][e].data=mxUtil... | vuln | Vulnerable | JavaScript |
package server
import (
"fmt"
"time"
"github.com/usememos/memos/server/profile"
"github.com/usememos/memos/store"
"github.com/gorilla/securecookie"
"github.com/gorilla/sessions"
"github.com/labstack/echo-contrib/session"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
)
type Server s... | vuln | Safe | Go |
void hexdump(msg_info msg_info, const char *mem, unsigned int len)
{
unsigned int i, j;
char str[10 + HEXDUMP_COLS * 4 + 2];
int c = 0; /* index in str */
for(i = 0; i < len + ((len % HEXDUMP_COLS) ? (HEXDUMP_COLS - len % HEXDUMP_COLS) : 0); i++)
{
/* print offset */
if(i % HEXDUMP_... | vuln | Vulnerable | C/C++ |
static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
{
struct net *net = sock_net(skb->sk);
rtnl_doit_func doit;
int sz_idx, kind;
int family;
int type;
int err;
type = nlh->nlmsg_type;
if (type > RTM_MAX)
return -EOPNOTSUPP;
type -= RTM_BASE;
/* All the messages must have at least 1 b... | vuln | Vulnerable | Unknown |
int snd_card_disconnect(struct snd_card *card)
{
struct snd_monitor_file *mfile;
if (!card)
return -EINVAL;
spin_lock(&card->files_lock);
if (card->shutdown) {
spin_unlock(&card->files_lock);
return 0;
}
card->shutdown = 1;
spin_unlock(&card->files_lock);
/* phase 1: disable fops (user space) operation... | vuln | Vulnerable | C/C++ |
if(!self.define){const e=e=>{"require"!==e&&(e+=".js");let i=Promise.resolve();return r[e]||(i=new Promise((async i=>{if("document"in self){const r=document.createElement("script");r.src=e,document.head.appendChild(r),r.onload=i}else importScripts(e),i()}))),i.then((()=>{if(!r[e])throw new Error(`Module ${e} didn’t reg... | vuln | Vulnerable | JavaScript |
BGD_DECLARE(void) gdImagePngCtxEx (gdImagePtr im, gdIOCtx * outfile, int level)
{
int i, j, bit_depth = 0, interlace_type;
int width = im->sx;
int height = im->sy;
int colors = im->colorsTotal;
int *open = im->open;
int mapping[gdMaxColors]; /* mapping[gd_index] == png_index */
png_byte trans_values[256];
png_c... | vuln | Vulnerable | Unknown |
/*!
Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
package com.rebuild.web.general;
import cn.devezhao.bizz.security.member.T... | vuln | Safe | Java |
@contextmanager
def run_interactive_shell_command(command, **kwargs):
"""
Runs a single command in shell and provides stdout, stderr and stdin
streams.
This function creates a context manager that sets up the process (using
`subprocess.Popen()`), returns to caller, closes streams and waits for
... | vuln | Safe | Python |
static int fsl_lpspi_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
struct fsl_lpspi_data *fsl_lpspi;
struct spi_controller *controller;
struct spi_imx_master *lpspi_platform_info =
dev_get_platdata(&pdev->dev);
struct resource *res;
int i, ret, irq;
u32 temp;
bool is_slave;... | vuln | Safe | C/C++ |
private void addRevision (Revision r) {
String auth = r.getAuthor() != null ? r.getAuthor().getName() : "author-unknown";
Label author = new Label("<strong>" + auth + "</strong>", ContentMode.HTML);
Label date = new Label(r.getDate().toString());
Label info = new Label(r.getInfo(), Conte... | vuln | Safe | Java |
def render_description(self, record):
if record.description:
return render_markdown(record.description)
return self.default | vuln | Safe | Python |
parser_tagged_template_literal_append_strings (parser_context_t *context_p, /**< parser context */
ecma_object_t *template_obj_p, /**< template object */
ecma_object_t *raw_strings_p, /**< raw strings object */
... | vuln | Vulnerable | Unknown |
TEE_Result crypto_acipher_alloc_dsa_public_key(struct dsa_public_key *s,
size_t key_size_bits __unused)
{
memset(s, 0, sizeof(*s));
if (!bn_alloc_max(&s->g))
return TEE_ERROR_OUT_OF_MEMORY;
if (!bn_alloc_max(&s->p))
goto err;
if (!bn_alloc_max(&s->q))
goto err;
if (!bn_alloc_max(&s->y))
goto e... | vuln | Safe | C/C++ |
copy_ciphersuites(gnutls_session_t session,
gnutls_buffer_st * cdata, int add_scsv)
{
int ret;
uint8_t cipher_suites[MAX_CIPHERSUITE_SIZE + 4]; /* allow space for SCSV */
int cipher_suites_size;
size_t init_length = cdata->length;
ret =
_gnutls_supported_ciphersuites(session, cipher_suites,
sizeo... | vuln | Safe | C/C++ |
int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb)
{
MpegEncContext *s = &ctx->m;
unsigned startcode, v;
int ret;
int vol = 0;
/* search next start code */
align_get_bits(gb);
if (!s->studio_profile && s->avctx->bits_per_raw_sample != 8)
s->avctx->bits_per_... | vuln | Safe | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.