code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static int vqf_read_header(AVFormatContext *s)
{
VqfContext *c = s->priv_data;
AVStream *st = avformat_new_stream(s, NULL);
int chunk_tag;
int rate_flag = -1;
int header_size;
int read_bitrate = 0;
int size;
uint8_t comm_chunk[12];
if (!st)
return AVERROR(ENOMEM);
avio_s... | vuln | Safe | C/C++ |
int tm_adopt(
char *id,
int adoptCmd,
pid_t pid)
{
int rc = TM_SUCCESS;
int status, ret;
pid_t sid;
char *env;
struct tcp_chan *chan = NULL;
sid = getsid(pid);
/* do not adopt a sid not owned by caller */
if (!ispidowner(sid))
return(TM_EPERM);
/* Must be the only call to cal... | vuln | Safe | Unknown |
void Compute(OpKernelContext* context) override {
// Here's the basic idea:
// Batch and depth dimension are independent from row and col dimension. And
// because FractionalAvgPool currently only support pooling along row and
// col, we can basically think of this 4D tensor backpropagation as
// op... | vuln | Safe | C/C++ |
/* Copyright 2016 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 |
synchronized void sendResponse(Object object) {
if (mStdOutStream == null) {
return;
}
try {
mStdOutStream.writeUnshared(object);
mStdOutStream.flush();
} catch (IOException e) {
System.err.println("sendResponse: write error, shutting down");
e.printStackTrace();
Syst... | vuln | Safe | Java |
safe_fprintf(FILE *f, const char *fmt, ...)
{
char fmtbuff_stack[256]; /* Place to format the printf() string. */
char outbuff[256]; /* Buffer for outgoing characters. */
char *fmtbuff_heap; /* If fmtbuff_stack is too small, we use malloc */
char *fmtbuff; /* Pointer to fmtbuff_stack or fmtbuff_heap. */
int fmtbu... | vuln | Vulnerable | C/C++ |
static void opl3_setup_voice(int dev, int voice, int chn)
{
struct channel_info *info;
if (voice < 0 || voice >= devc->nr_voice)
return;
if (chn < 0 || chn > 15)
return;
info = &synth_devs[dev]->chn_info[chn];
opl3_set_instr(dev, voice, info->pgm_num);
devc->voc[voice].bender = 0;
devc->voc[voice].bende... | vuln | Safe | C/C++ |
void dd_sanitize_mode_and_owner(struct dump_dir *dd)
{
/* Don't sanitize if we aren't run under root:
* we assume that during file creation (by whatever means,
* even by "hostname >file" in abrt_event.conf)
* normal umask-based mode setting takes care of correct mode,
* and uid:gid is, of course... | vuln | Vulnerable | Unknown |
void DevToolsDownloadManagerDelegate::OnDownloadPathGenerated(
uint32_t download_id,
const content::DownloadTargetCallback& callback,
const base::FilePath& suggested_path) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
callback.Run(suggested_path,
content::DownloadItem::TARGET_DIS... | vuln | Safe | C/C++ |
static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags,
struct in6_addr *addr, uint32_t *ifindex)
{
struct sockaddr_in6 sin6;
unsigned char cbuf[CMSG_SPACE(sizeof(struct in6_pktinfo))];
struct iovec iovec;
struct msghdr msghdr;
struct cmsghdr *cmsghdr;
ssize_t len;
iovec.iov_len = *buf... | vuln | Vulnerable | Unknown |
var mxClient={VERSION:"18.0.4",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==docum... | vuln | Safe | JavaScript |
cmsPipeline* BuildRGBInputMatrixShaper(cmsHPROFILE hProfile)
{
cmsPipeline* Lut;
cmsMAT3 Mat;
cmsToneCurve *Shapes[3];
cmsContext ContextID = cmsGetProfileContextID(hProfile);
int i, j;
if (!ReadICCMatrixRGB2XYZ(&Mat, hProfile)) return NULL;
// XYZ PCS in encoded in 1.15 format, and the ma... | vuln | Safe | Unknown |
static void
vm_super_call (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
{
JERRY_ASSERT (frame_ctx_p->call_operation == VM_EXEC_SUPER_CALL);
JERRY_ASSERT (frame_ctx_p->byte_code_p[0] == CBC_EXT_OPCODE);
const uint8_t *byte_code_p = frame_ctx_p->byte_code_p + 3;
uint8_t opcode = byte_code_p[-2];
uint32_t... | vuln | Safe | C/C++ |
CodingReturnValue VP8ComponentDecoder::decode_chunk(UncompressedComponents * const colldata)
{
mux_splicer.init(spin_workers_);
/* cmpc is a global variable with the component count */
/* construct 4x4 VP8 blocks to hold 8x8 JPEG blocks */
if ( thread_state_[0] == nullptr || thread_state_[0]->context_... | vuln | Safe | C/C++ |
my_object_increment (MyObject *obj, gint32 x, gint32 *ret, GError **error)
{
*ret = x +1;
return TRUE;
} | vuln | Vulnerable | C/C++ |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
OpContext op_context(context, node);
TF_LITE_ENSURE_OK(context, InitializeTemporaries(context, node, &op_context));
OpData* op_data = reinterpret_c... | vuln | Safe | Unknown |
status_t OMXNodeInstance::emptyBuffer(
OMX::buffer_id buffer,
OMX_U32 rangeOffset, OMX_U32 rangeLength,
OMX_U32 flags, OMX_TICKS timestamp, int fenceFd) {
Mutex::Autolock autoLock(mLock);
// no emptybuffer if using input surface
if (getGraphicBufferSource() != NULL) {
an... | vuln | Safe | C/C++ |
private void handlePeerHandshakeFailed(PeerHandshakeFailed peerHandshakeFailed) {
peerHandshakeFailed.getChannel().getUri().ifPresent(this.addressBook.get()::blacklist);
} | vuln | Safe | Java |
esis_print(netdissect_options *ndo,
const uint8_t *pptr, u_int length)
{
const uint8_t *optr;
u_int li,esis_pdu_type,source_address_length, source_address_number;
const struct esis_header_t *esis_header;
if (!ndo->ndo_eflag)
ND_PRINT((ndo, "ES-IS"));
if (length <= 2) {
ND_PRINT((ndo, ndo->ndo_qfla... | vuln | Vulnerable | Unknown |
bool // O - `true` on success, `false` on failure
_pdfioDictSetValue(
pdfio_dict_t *dict, // I - Dictionary
const char *key, // I - Key
_pdfio_value_t *value) // I - Value
{
_pdfio_pair_t *pair; // Current pair
PDFIO_DEBUG("_pdfioDictSetValue(dict=%p, key=\"%s\", value=%p)\n", dict, key... | vuln | Vulnerable | C/C++ |
private void writeStderrToScreen() {
int bytesAvailable = mStderrBuffer.getBytesAvailable();
int bytesToRead = Math.min(bytesAvailable, mReceiveBuffer.length);
try {
int bytesRead = mStderrBuffer.read(mReceiveBuffer, 0, bytesToRead);
String out = new String(mReceiveBuffe... | vuln | Safe | Java |
int l2tp_packet_send(int sock, struct l2tp_packet_t *pack)
{
struct l2tp_hdr_t *hdr;
struct l2tp_avp_t *avp;
struct l2tp_attr_t *attr;
uint8_t *buf, *ptr;
int n, len;
buf = mempool_alloc(buf_pool);
if (!buf) {
log_emerg("l2tp: out of memory\n");
return -1;
}
memset(buf, 0, L2TP_MAX_PACKET_SIZE);
hdr = (... | vuln | Safe | C/C++ |
public void handleData(ServiceTask task) {
ServiceTask executeTask = null;
if (connection.isClosed()) {
return;
}
synchronized (this) {
if (currentTask != null) {
//currentTask is executing.
taskToPriorityQueue(task);
... | vuln | Safe | Java |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
const OpData* op_data = reinterpret_cast<OpData*>(node->user_data);
const TfLiteTensor* cond = GetInput(context, node, 0);
bool cond_value = cond->data.b[0];
Subgraph* this_subgraph = reinterpret_cast<Subgraph*>(context->impl_);
auto* subgraphs =... | vuln | Vulnerable | C/C++ |
def LoadSettingsFile(filename=SETTINGS_FILE):
"""Loads settings file in yaml format given file name.
:param filename: path for settings file. 'settings.yaml' by default.
:type filename: str.
:raises: SettingsError
"""
try:
with open(filename) as stream:
data = load(stream, L... | vuln | Safe | Python |
static int decode_pce(AACContext *ac, enum ChannelPosition new_che_pos[4][MAX_ELEM_ID],
GetBitContext *gb)
{
int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc, sampling_index;
int comment_len;
skip_bits(gb, 2);
sampling_index = get_bits(gb, 4);
if (ac->m4ac.s... | vuln | Safe | C/C++ |
static const URI_CHAR * URI_FUNC(ParseIPv6address2)(
URI_TYPE(ParserState) * state,
const URI_CHAR * first, const URI_CHAR * afterLast,
UriMemoryManager * memory) {
int zipperEver = 0;
int quadsDone = 0;
int digitCount = 0;
unsigned char digitHistory[4];
int ip4OctetsDone = 0;
unsigned char quadsAfterZippe... | vuln | Vulnerable | Unknown |
static void do_dma_pdma_cb(ESPState *s)
{
int to_device = ((s->rregs[ESP_RSTAT] & 7) == STAT_DO);
int len;
uint32_t n;
if (s->do_cmd) {
s->ti_size = 0;
s->do_cmd = 0;
do_cmd(s);
esp_lower_drq(s);
return;
}
if (!s->current_req) {
return;
}
... | vuln | Safe | Unknown |
async function userSettings() {
const tokenValidation = await AuthTokenValidation
.findOneAsync({ connectionId: this.connection.id });
if (!tokenValidation || tokenValidation.validationStatus !== ValidationStates.VALIDATED) {
Logger.warn(`Publishing UserSettings was requested by unauth connection ${this.co... | vuln | Safe | JavaScript |
$link_text = wp_get_attachment_image( $_post->ID, $size, $icon, $attr );
} else {
$link_text = '';
}
if ( trim( $link_text ) == '' )
$link_text = $_post->post_title;
/**
* Filters a retrieved attachment page link.
*
* @since 2.7.0
*
* @param string $link_html The page link HTML output.
* @pa... | vuln | Vulnerable | PHP |
av_cold int ff_rv34_decode_init(AVCodecContext *avctx)
{
RV34DecContext *r = avctx->priv_data;
MpegEncContext *s = &r->s;
int ret;
ff_MPV_decode_defaults(s);
s->avctx = avctx;
s->out_format = FMT_H263;
s->codec_id = avctx->codec_id;
s->width = avctx->width;
s->height = avctx-... | vuln | Vulnerable | C/C++ |
static ssize_t print_cpu_modalias(struct device *dev,
struct device_attribute *attr,
char *buf)
{
ssize_t n;
u32 i;
n = sprintf(buf, "cpu:type:" CPU_FEATURE_TYPEFMT ":feature:",
CPU_FEATURE_TYPEVAL);
for (i = 0; i < MAX_CPU_FEATURES; i++)
if (cpu_have_feature(i)) {
if (PAGE_SIZE < n + sizeo... | vuln | Vulnerable | Unknown |
/*
* 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 | Safe | C/C++ |
static void usb_uas_command(UASDevice *uas, uas_ui *ui)
{
UASRequest *req;
uint32_t len;
uint16_t tag = be16_to_cpu(ui->hdr.tag);
if (uas_using_streams(uas) && tag > UAS_MAX_STREAMS) {
goto invalid_tag;
}
req = usb_uas_find_request(uas, tag);
if (req) {
goto overlapped_tag;
... | vuln | Safe | C/C++ |
private void updateFixedColor() {
if (this.spell == Casts.EMPTY_SPELL) {
this.getDataManager().set(COLOR, 0);
} else {
this.getDataManager().set(COLOR, this.spell.getSpellAspect().getColorRange().get(3));
}
} | vuln | Vulnerable | Java |
private Element renderGlyphs(Element parent, GlyphArea a, Document d) {
Element g = Documents.createElement(d, SVGDocumentFrame.svgGroupEltName);
maybeMarkClasses(g, a, "glyphs");
LineArea l = a.getLine();
double bpdLine = l.getBPD();
double bpdLineAnnotationBefore = l.getAnnotat... | vuln | Vulnerable | Java |
receive_packet(NTP_Packet *message, struct timeval *now, double now_err, NCR_Instance inst, NTP_Local_Address *local_addr, int length)
{
int pkt_leap;
uint32_t pkt_refid, pkt_key_id;
double pkt_root_delay;
double pkt_root_dispersion;
/* The local time to which the (offset, delay, dispersion) triple will
... | vuln | Safe | Unknown |
static void DecodeTCPOptions(Packet *p, const uint8_t *pkt, uint16_t pktlen)
{
uint8_t tcp_opt_cnt = 0;
TCPOpt tcp_opts[TCP_OPTMAX];
uint16_t plen = pktlen;
while (plen)
{
const uint8_t type = *pkt;
/* single byte options */
if (type == TCP_OPT_EOL) {
break;
... | vuln | Safe | C/C++ |
/* GStreamer ASF/WMV/WMA demuxer
* Copyright (C) 1999 Erik Walthinsen <omega@cse.ogi.edu>
* Copyright (C) 2006-2009 Tim-Philipp Müller <tim centricular net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the... | vuln | Safe | C/C++ |
static void spapr_vio_busdev_realize(DeviceState *qdev, Error **errp)
{
sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_machine());
VIOsPAPRDevice *dev = (VIOsPAPRDevice *)qdev;
VIOsPAPRDeviceClass *pc = VIO_SPAPR_DEVICE_GET_CLASS(dev);
char *id;
Error *local_err = NULL;
if (dev->reg != -1) {
... | vuln | Safe | C/C++ |
static int encode_packets(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile, int tileno)
{
int compno, reslevelno, ret;
Jpeg2000CodingStyle *codsty = &s->codsty;
Jpeg2000QuantStyle *qntsty = &s->qntsty;
av_log(s->avctx, AV_LOG_DEBUG, "tier2\n");
for (reslevelno = 0; reslevelno < codsty->nreslevels... | vuln | Safe | C/C++ |
package fsutil
import (
"archive/zip"
"io"
"io/ioutil"
"os"
"path"
"path/filepath"
)
// Mkdir alias of os.MkdirAll()
func Mkdir(dirPath string, perm os.FileMode) error {
return os.MkdirAll(dirPath, perm)
}
// MkParentDir quick create parent dir
func MkParentDir(fpath string) error {
dirPath := filepath.Dir(f... | vuln | Vulnerable | Go |
public void save(String comment, boolean minorEdit) throws XWikiException
{
if (hasAccessLevel("edit")) {
// If the current author does not have PR don't let it set current user as author of the saved document
// since it can lead to right escalation
if (hasProgrammingRig... | vuln | Safe | Java |
PrintingContextCairo::PrintingContextCairo(const std::string& app_locale)
#if defined(OS_CHROMEOS)
: PrintingContext(app_locale) {
#else
: PrintingContext(app_locale),
print_dialog_(NULL) {
#endif
}
PrintingContextCairo::~PrintingContextCairo() {
ReleaseContext();
#if !defined(OS_CHROMEOS)
if (print... | vuln | Safe | C/C++ |
void MessageService::OpenChannelToExtension(
int source_process_id, int source_routing_id, int receiver_port_id,
const std::string& source_extension_id,
const std::string& target_extension_id,
const std::string& channel_name) {
content::RenderProcessHost* source =
content::RenderProcessHost::Fro... | vuln | Vulnerable | C/C++ |
/*
* Copyright 2021 ThoughtWorks, Inc.
*
* 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 agr... | vuln | Safe | Java |
# Define all the service endpoint handlers here.
import json
import os
import re
import tempfile
import posixpath
import urllib
import pathlib
import logging
from functools import wraps
from flask import Response, request, current_app, send_file
from google.protobuf import descriptor
from google.protobuf.json_format ... | vuln | Safe | Python |
int bdrv_has_zero_init(BlockDriverState *bs)
{
assert(bs->drv);
if (bs->drv->bdrv_has_zero_init) {
return bs->drv->bdrv_has_zero_init(bs);
}
return 0;
} | vuln | Safe | C/C++ |
def get(self, path: str) -> None:
parts = path.split("/")
component_name = parts[0]
component_root = self._registry.get_component_path(component_name)
if component_root is None:
self.write("not found")
self.set_status(404)
return
# follow syml... | vuln | Safe | Python |
@Override
public void renderAdditionalModels(EntityVehicleF_Physics vehicle, boolean blendingEnabled, float partialTicks){
//Render holograms for missing parts.
if(blendingEnabled){
//If we are holding a part, render the valid slots.
//If we are holding a scanner, render all slots, but only render the looked... | vuln | Vulnerable | Java |
@Override
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
//https://developer.android.com/guide/topics/text/image-keyboard
InputConnection ic = super.onCreateInputConnection(editorInfo);
if (ic == null)
return null;
ic = new InputConnectionWrapper... | vuln | Safe | Java |
package com.salesmanager.shop.model.catalog.product.attribute.api;
public class ReadableProductAttributeEntity extends ProductAttributeEntity {
/**
*
*/
private static final long serialVersionUID = 1L;
private String productAttributeWeight;
private String productAttributePrice;
private ReadableProductOp... | vuln | Vulnerable | Java |
void * GC_CALL GC_finalized_malloc(size_t lb,
const struct GC_finalizer_closure *fclos)
{
word *op;
GC_ASSERT(done_init);
op = GC_malloc_kind(lb + sizeof(word), GC_finalized_kind);
if (EXPECT(NULL == op, FALSE))
return NULL;
*op = (word)fclos | FINALIZER_CLOS... | vuln | Vulnerable | C/C++ |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | vuln | Safe | C/C++ |
CallResult<HermesValue> Interpreter::interpretFunction(
Runtime *runtime,
InterpreterState &state) {
// The interepter is re-entrant and also saves/restores its IP via the runtime
// whenever a call out is made (see the CAPTURE_IP_* macros). As such, failure
// to preserve the IP across calls to interpete... | vuln | Vulnerable | C/C++ |
@Override
public void addIconGroup(IconManager group) {
for (IconManager existingIconManager : mIconGroups) {
if (existingIconManager.mGroup == group.mGroup) {
// Remove existing icon group
removeIconGroup(existingIconManager);
}
}
gro... | vuln | Safe | Java |
Status KernelAndDeviceOp::Run(
ScopedStepContainer* step_container, const EagerKernelArgs& inputs,
std::vector<EagerKernelRet>* outputs,
CancellationManager* cancellation_manager,
const absl::optional<EagerRemoteFunctionParams>& remote_func_params) {
OpKernelContext::Params params;
params.device = d... | vuln | Safe | Unknown |
static int archipelago_aio_segmented_rw(BDRVArchipelagoState *s,
size_t count,
off_t offset,
ArchipelagoAIOCB *aio_cb,
int op)
{
int i, ret, segments_nr, la... | vuln | Safe | C/C++ |
@Override
public void scan(boolean directionDown, boolean skipSubChannel) throws RemoteException {
mLogger.logRadioEvent("Scan with direction %s, skipSubChannel? %s",
directionDown ? "down" : "up", skipSubChannel ? "yes" : "no");
if (!RadioServiceUserController.isCurrentOrSystemUser(... | vuln | Safe | Java |
struct crypto_template *crypto_lookup_template(const char *name)
{
return try_then_request_module(__crypto_lookup_template(name),
"crypto-%s", name);
} | vuln | Safe | C/C++ |
static noinline int btrfs_mksubvol(struct path *parent,
char *name, int namelen,
struct btrfs_root *snap_src,
u64 *async_transid, bool readonly,
struct btrfs_qgroup_inherit **inherit)
{
struct inode *dir = parent->dentry->d_inode;
struct dentry *dentry;
int error;
mutex_lock_nested(&di... | vuln | Safe | C/C++ |
static int roq_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
RoqDemuxContext *roq = s->priv_data;
AVIOContext *pb = s->pb;
int ret = 0;
unsigned int chunk_size;
unsigned int chunk_type;
unsigned int codebook_size;
unsigned char preamble[RoQ_CHUNK_PREAMBLE_SIZE];... | vuln | Vulnerable | C/C++ |
@Override
public int compress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int maxOutputLength)
{
verifyRange(input, inputOffset, inputLength);
verifyRange(output, outputOffset, maxOutputLength);
long inputAddress = ARRAY_BYTE_BASE_OFFSET + inputOffse... | vuln | Safe | Java |
public void updateCache(@NonNull Context context) {
UserManager userManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
if (userManager != null) {
int currentUserId = ActivityManager.getCurrentUser();
List<UserInfo> profiles = userManager.getPr... | vuln | Vulnerable | Java |
@Override
public byte[] transform(String name, String transformedName, byte[] basicClass) {
if(basicClass == null) {
return null;
}
ClassReader classReader = new ClassReader(basicClass);
ClassNode classNode = new ClassNode();
ClassReader classReaderForNode = new ... | vuln | Vulnerable | Java |
static int alac_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
const uint8_t *inbuffer = avpkt->data;
int input_buffer_size = avpkt->size;
ALACContext *alac = avctx->priv_data;
int channels;
unsigned int outputsamples;
int hass... | vuln | Safe | C/C++ |
int cap_bprm_set_creds(struct linux_binprm *bprm)
{
const struct cred *old = current_cred();
struct cred *new = bprm->cred;
bool effective, has_cap = false;
int ret;
effective = false;
ret = get_file_caps(bprm, &effective, &has_cap);
if (ret < 0)
return ret;
if (!issecure(SECURE_NOROOT)) {
/*
* If the ... | vuln | Safe | C/C++ |
EFI_STATUS verify_image(void *data, unsigned int datasize,
EFI_LOADED_IMAGE *li,
PE_COFF_LOADER_IMAGE_CONTEXT *context)
{
EFI_STATUS efi_status;
UINT8 sha1hash[SHA1_DIGEST_SIZE];
UINT8 sha256hash[SHA256_DIGEST_SIZE];
/*
* The binary header contains relevant context and section pointers
*/
efi_status = r... | vuln | Vulnerable | Unknown |
@Override
public void channelActive(ChannelHandlerContext ctx) throws PublicKeyException {
this.state = ChannelState.AUTH_HANDSHAKE;
log.trace("Active: {}", this.toString());
if (this.isInitiator) {
this.initHandshake(this.remoteNodeId);
}
} | vuln | Safe | Java |
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this... | vuln | Safe | Java |
__declspec(dllexport) DWORD __stdcall HttpExtensionProc(EXTENSION_CONTROL_BLOCK *p)
{
HTTPRequest *req;
HTTPResponse *resp = NULL;
WOURLComponents wc = WOURLComponents_Initializer;
const char *reqerr;
const char *qs;
char *script_name;
char *server_protocol;
char *uri;
WOURLError urlerr;
... | vuln | Vulnerable | C/C++ |
private void setDocumentContent(IDocument document, IFile file, String encoding) throws CoreException {
InputStream contentStream= file.getContents();
Reader in= null;
try {
if (encoding == null)
encoding= fManager.getDefaultEncoding();
/*
* XXX:
* This is a workaround for a corresponding bug ... | vuln | Vulnerable | Java |
//= require ./panel
//= require ./collection_view
//= require ../mixins/action_support
//= require ./menu_scroll_view
// Only to be used in Flame.MenuView. Represent menu items with normal JS objects as creation of one Ember object took
// 3.5 ms on fast IE8 machine.
Flame.MenuItem = function MenuItem(opts) {
for ... | vuln | Safe | JavaScript |
static int parse_netdev(DeviceState *dev, const char *str, void **ptr)
{
NICPeers *peers_ptr = (NICPeers *)ptr;
NICConf *conf = container_of(peers_ptr, NICConf, peers);
NetClientState **ncs = peers_ptr->ncs;
NetClientState *peers[MAX_QUEUE_NUM];
int queues, i = 0;
int ret;
queues = qemu_find... | vuln | Vulnerable | C/C++ |
package io.swagger.client;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Form;
import javax.ws.rs.core.GenericType;
import javax.ws.rs.core.MediaType;
import... | vuln | Vulnerable | Java |
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import logging
from flask import (
Blueprint,
Response,
abort,
cur... | vuln | Safe | Python |
def get_available_providers_packages():
"""Get list of all available providers packages to build."""
return [provider["package-name"] for provider in ALL_PROVIDER_YAMLS if not provider.get("suspended")] | vuln | Safe | Python |
xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr inst) {
/*
* URGENT TODO: Normally inst->psvi Should never be reserved here,
* BUT: since if we include the same stylesheet from
* multiple imports, then the stylesheet will be parsed
* again. We simply must not try to compute the stylesh... | vuln | Safe | C/C++ |
@WorkerThread
@GuardedBy("blockerLocker")
public boolean setAppOpMode(AppDetailsAppOpItem appOpItem) {
if (mIsExternalApk) return false;
boolean isSuccessful = false;
try {
if (appOpItem.isAllowed()) {
isSuccessful = appOpItem.disallowAppOp(mPackageInfo, mAppO... | vuln | Vulnerable | Java |
static void ima_adpcm_run_pull (_AFmoduleinst *module)
{
ima_adpcm_data *d = (ima_adpcm_data *) module->modspec;
AFframecount frames2read = module->outc->nframes;
AFframecount nframes = 0;
int framesPerBlock = d->framesPerBlock;
assert(module->outc->nframes % framesPerBlock == 0);
int blockCount = module->outc->... | vuln | Safe | Unknown |
static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
struct msghdr *msg, size_t len)
{
struct sock_iocb *siocb = kiocb_to_siocb(kiocb);
struct sock *sk = sock->sk;
struct net *net = sock_net(sk);
struct unix_sock *u = unix_sk(sk);
struct sockaddr_un *sunaddr=msg->msg_name;
struct sock ... | vuln | Vulnerable | Unknown |
/* Apache 2.0 - Copyright 2007-2018 - pancake and dso
class.c rewrite: Adam Pridgen <dso@rice.edu || adam.pridgen@thecoverofnight.com>
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <r_types.h>
#include <r_util.h>
#include <r_bin.h>
#include <math.h>
#include <sdb.h>
#inc... | vuln | Vulnerable | C/C++ |
Na+="@import url("+La+");\n":Ga+='@font-face {\nfont-family: "'+Ea+'";\nsrc: url("'+La+'");\n}\n'}Ha.appendChild(Aa.createTextNode(Na+Ga));qa.getElementsByTagName("defs")[0].appendChild(Ha)}null!=ja&&(this.shapeBackgroundColor=Da,this.shapeForegroundColor=Ba,this.stylesheet=ja,this.refresh());return qa};var C=Graph.pro... | vuln | Safe | JavaScript |
$body .= sprintf(' (<a href="%s?index=%s" onclick="target=\'backtrace\';">%s</a>)',
'../tools/unserialize.php',$error,$display);
else
$body .= sprintf(' (%s)',$display);
}
$body .= '</small></td></tr>';
$body .= "\n";
if (isset($line['file']))
$last['file'] = $line['file'];
}... | vuln | Vulnerable | PHP |
void impeg2d_next_code(dec_state_t *ps_dec, UWORD32 u4_start_code_val)
{
stream_t *ps_stream;
ps_stream = &ps_dec->s_bit_stream;
impeg2d_bit_stream_flush_to_byte_boundary(ps_stream);
while ((impeg2d_bit_stream_nxt(ps_stream,START_CODE_LEN) != u4_start_code_val) &&
(ps_dec->s_bit_stream.u4_... | vuln | Safe | C/C++ |
private boolean shouldListenForFaceAssistant() {
BiometricAuthenticated face = mUserFaceAuthenticated.get(getCurrentUser());
return mAssistantVisible && mKeyguardOccluded
&& !(face != null && face.mAuthenticated)
&& !mUserHasTrust.get(getCurrentUser(), false);
} | vuln | Vulnerable | Java |
ZlibInStream::ZlibInStream(size_t bufSize_)
: underlying(0), bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0),
zs(NULL), bytesIn(0)
{
ptr = end = start = new U8[bufSize];
init();
} | vuln | Safe | C/C++ |
ngx_mail_read_command(ngx_mail_session_t *s, ngx_connection_t *c)
{
ssize_t n;
ngx_int_t rc;
ngx_str_t l;
ngx_mail_core_srv_conf_t *cscf;
if (s->buffer->last < s->buffer->end) {
n = c->recv(c, s->buffer->last, s->buffer->end - s->buffer... | vuln | Vulnerable | C/C++ |
private def webSocketImpl(request: play_RequestHeader): Future[Either[
// Either an error response, if we reject the connection.
Result,
// Or an In and Out stream, for talking with the client.
Flow[JsValue, JsValue, _]]] = {
val site = globals.lookupSiteOrThrow(request)
// Syn... | vuln | Safe | Scala |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import get_path
from os.path import join as join_path, exists as... | vuln | Vulnerable | Python |
public static void showAboutWindow(Stage parent, Consumer<String> callBack) {
Platform.runLater(() -> {
Alert alert = new Alert(Alert.AlertType.INFORMATION);
alert.setTitle(FishingBot.PREFIX);
alert.setHeaderText(FishingBot.getI18n().t("dialog-about-header"));
Fl... | vuln | Vulnerable | Java |
_gnutls_recv_handshake_header (gnutls_session_t session,
gnutls_handshake_description_t type,
gnutls_handshake_description_t * recv_type)
{
int ret;
uint32_t length32 = 0;
uint8_t *dataptr = NULL; /* for realloc */
size_t handshake_header_size = HANDSHAKE_HEADER_SIZE;
/* if we have data i... | vuln | Vulnerable | Unknown |
/*
* Copyright 2017 Google Inc. 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 applica... | vuln | Safe | JavaScript |
init_ccline(int firstc, int indent)
{
ccline.overstrike = FALSE; // always start in insert mode
/*
* set some variables for redrawcmd()
*/
ccline.cmdfirstc = (firstc == '@' ? 0 : firstc);
ccline.cmdindent = (firstc > 0 ? indent : 0);
// alloc initial ccline.cmdbuff
alloc_cmdbuff... | vuln | Vulnerable | C/C++ |
public TweakData[] getTweaks(ItemStack itemStack) {
if (itemStack.hasTag()) {
String variant = itemStack.getTag().getString(variantTagKey);
return Arrays.stream(tweaks)
.filter(tweak -> variant.equals(tweak.variant))
.toArray(TweakData[]::new);
... | vuln | Safe | Java |
@Override
public int getPotentialMaxCitizens()
{
return (int) Math.min(potentialMaxCitizens, Math.min(maxCitizensFromResearch(), MineColonies.getConfig().getServer().maxCitizenPerColony.get()));
} | vuln | Vulnerable | Java |
static int nft_flush_table(struct nft_ctx *ctx)
{
int err;
struct nft_chain *chain, *nc;
struct nft_set *set, *ns;
list_for_each_entry_safe(chain, nc, &ctx->table->chains, list) {
ctx->chain = chain;
err = nft_delrule_by_chain(ctx);
if (err < 0)
goto out;
err = nft_delchain(ctx);
if (err < 0)
got... | vuln | Vulnerable | C/C++ |
var Promise = require('es6-promise').Promise;
var async = require('async');
var cp = require('child_process');
var notEmpty = function(x) {return x};
module.exports = function killport(port) {
return (new Promise(function(resolve, reject) {
var cmd = 'lsof -i:' + port;
cp.exec(cmd, function(err, stdout, std... | vuln | Vulnerable | JavaScript |
@Override
public boolean onOptionsItemSelected(final MenuItem item) {
switch (item.getItemId()) {
case R.id.action_settings:
NavigationHelper.openSettings(requireContext());
break;
case R.id.menu_item_openInBrowser:
ShareUtils.openUrlIn... | vuln | Vulnerable | Java |
static uint64_t bonito_cop_readl(void *opaque, hwaddr addr,
unsigned size)
{
uint32_t val;
PCIBonitoState *s = opaque;
val = ((uint32_t *)(&s->boncop))[addr/sizeof(uint32_t)];
return val; | vuln | Vulnerable | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.