code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
void ChromeExtensionWebContentsObserver::RenderViewCreated(
content::RenderViewHost* render_view_host) {
ReloadIfTerminated(render_view_host);
ExtensionWebContentsObserver::RenderViewCreated(render_view_host);
const Extension* extension = GetExtension(render_view_host);
if (!extension)
return;
in... | vuln | Safe | C/C++ |
void ring_buffer_reset_online_cpus(struct trace_buffer *buffer)
{
struct ring_buffer_per_cpu *cpu_buffer;
int cpu;
for_each_online_buffer_cpu(buffer, cpu) {
cpu_buffer = buffer->buffers[cpu];
atomic_inc(&cpu_buffer->resize_disabled);
atomic_inc(&cpu_buffer->record_disabled);
}
/* Make sure all commits hav... | vuln | Vulnerable | Unknown |
read_cupsd_conf(cups_file_t *fp) /* I - File to read from */
{
int linenum; /* Current line number */
char line[HTTP_MAX_BUFFER],
/* Line from file */
temp[HTTP_MAX_BUFFER],
/* Temporary buffer for value */
*value; /* Pointer to value */
int valuelen; /* Length of value */
http_addrlist_t... | vuln | Safe | Unknown |
function doSearch(searchStr)
{
if (lastSearchStr == searchStr && isGetAll == lastGetAll) return;
deselectTempCat();
tempDlgContent.scrollTop = 0;
diagramsTiles.innerText = '';
diagramsListTitle.innerHTML = mxUtils.htmlEntities(mxResources.get('searchResults')) +
' "' + mxUtils.htmlEntities(sear... | vuln | Safe | JavaScript |
cleanup_pathname(struct archive_write_disk *a)
{
struct archive_string error_string;
int error_number;
int rc;
archive_string_init(&error_string);
rc = cleanup_pathname_fsobj(a->name, &error_number, &error_string, a->flags);
if (rc != ARCHIVE_OK) {
archive_set_error(&a->archive, error_number, "%s", error_string... | vuln | Safe | Unknown |
protected void save(File prefFile, Stream<Entry<String, Setting<?>>> settings, boolean defaults) throws IOException {
if (!defaults) {
/* currently unused, but may help to fix configuration issues in future */
putInt("josm.version", Version.getInstance().getVersion());
}
... | vuln | Vulnerable | Java |
int main(int argc, char **argv)
{
int c, rc = MOUNT_EX_SUCCESS, all = 0, show_labels = 0;
struct libmnt_context *cxt;
struct libmnt_table *fstab = NULL;
char *srcbuf = NULL;
char *types = NULL;
unsigned long oper = 0;
enum {
MOUNT_OPT_SHARED = CHAR_MAX + 1,
MOUNT_OPT_SLAVE,
MOUNT_OPT_PRIVATE,
MOUNT_OPT_... | vuln | Vulnerable | C/C++ |
pickCopyFunc(TIFF* in, TIFF* out, uint16 bitspersample, uint16 samplesperpixel)
{
uint16 shortv;
uint32 w, l, tw, tl;
int bychunk;
(void) TIFFGetField(in, TIFFTAG_PLANARCONFIG, &shortv);
if (shortv != config && bitspersample != 8 && samplesperpixel > 1) {
fprintf(stderr,
"%s: Cannot handle different plana... | vuln | Vulnerable | Unknown |
/*
* Copyright (c) 2012-2019 Belledonne Communications SARL.
*
* This file is part of belle-sip.
*
* 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 3 of the License, or
* (... | vuln | Vulnerable | C/C++ |
static int matroska_parse_cluster_incremental(MatroskaDemuxContext *matroska)
{
EbmlList *blocks_list;
MatroskaBlock *blocks;
int i, res;
res = ebml_parse(matroska,
matroska_cluster_incremental_parsing,
&matroska->current_cluster);
if (res == 1) {
... | vuln | Vulnerable | C/C++ |
// imagew-jpeg.c
// Part of ImageWorsener, Copyright (c) 2011 by Jason Summers.
// For more information, see the readme.txt file.
#include "imagew-config.h"
#if IW_SUPPORT_JPEG == 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <setjmp.h>
#include <jpeglib.h>
#include <jerror... | vuln | Vulnerable | C/C++ |
static void svm_vcpu_run(struct kvm_vcpu *vcpu)
{
struct vcpu_svm *svm = to_svm(vcpu);
u16 fs_selector;
u16 gs_selector;
u16 ldt_selector;
svm->vmcb->save.rax = vcpu->arch.regs[VCPU_REGS_RAX];
svm->vmcb->save.rsp = vcpu->arch.regs[VCPU_REGS_RSP];
svm->vmcb->save.rip = vcpu->arch.regs[VCPU_REGS_RIP];
/*
* A ... | vuln | Vulnerable | Unknown |
static ssize_t DecodePSDPixels(const size_t number_compact_pixels,
const unsigned char *compact_pixels,const ssize_t depth,
const size_t number_pixels,unsigned char *pixels)
{
#define CheckNumberCompactPixels \
if (packets == 0) \
return(i); \
packets--
#define CheckNumberPixels(count) \
if (((ssize_t) i... | vuln | Vulnerable | C/C++ |
/*
Copyright 2022 The Vitess Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | vuln | Safe | Go |
static int atyfb_ioctl(struct fb_info *info, u_int cmd, u_long arg)
{
struct atyfb_par *par = (struct atyfb_par *) info->par;
#ifdef __sparc__
struct fbtype fbtyp;
#endif
switch (cmd) {
#ifdef __sparc__
case FBIOGTYPE:
fbtyp.fb_type = FBTYPE_PCI_GENERIC;
fbtyp.fb_width = par->crtc.vxres;
fbtyp.fb_height = pa... | vuln | Safe | C/C++ |
public void setWatcherUserId(String[] watcherUserId) {
this.watcherUserId = watcherUserId;
} | vuln | Vulnerable | Java |
ssize_t slirp_send(struct socket *so, const void *buf, size_t len, int flags)
{
if (so->s == -1 && so->extra) {
qemu_chr_fe_write(so->extra, buf, len);
return len;
}
return send(so->s, buf, len, flags);
} | vuln | Vulnerable | C/C++ |
static int php_plain_files_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context)
{
int ret;
if (!url_from || !url_to) {
return 0;
}
#ifdef PHP_WIN32
if (!php_win32_check_trailing_space(url_from, (int)strlen(url_from))) {
php_win32_docref2_from_... | vuln | Vulnerable | C/C++ |
static int komeda_wb_connector_add(struct komeda_kms_dev *kms,
struct komeda_crtc *kcrtc)
{
struct komeda_dev *mdev = kms->base.dev_private;
struct komeda_wb_connector *kwb_conn;
struct drm_writeback_connector *wb_conn;
u32 *formats, n_formats = 0;
int err;
if (!kcrtc->master->wb_layer)
return 0;
kwb_... | vuln | Safe | C/C++ |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | vuln | Safe | C/C++ |
mapi_attr_read (size_t len, unsigned char *buf)
{
size_t idx = 0;
uint32 i,j;
assert(len > 4);
uint32 num_properties = GETINT32(buf+idx);
MAPI_Attr** attrs = CHECKED_XMALLOC (MAPI_Attr*, (num_properties + 1));
idx += 4;
if (!attrs) return NULL;
for (i = 0; i < num_properties; i++... | vuln | Vulnerable | Unknown |
static void do_audio_out(AVFormatContext *s,
AVOutputStream *ost,
AVInputStream *ist,
unsigned char *buf, int size)
{
uint8_t *buftmp;
static uint8_t *audio_buf = NULL;
static uint8_t *audio_out = NULL;
int size_out, frame_byte... | vuln | Safe | C/C++ |
public static function getId($id = '')
{
if (isset($id)) {
$sql = sprintf("SELECT * FROM `menus` WHERE `id` = '%d'", $id);
$menus = Db::result($sql);
$n = Db::$num_rows;
} else {
$menus = '';
}
return $menus;
} | vuln | Safe | JavaScript |
gdk_pixbuf__gif_image_load_increment (gpointer data,
const guchar *buf, guint size,
GError **error)
{
gint retval;
GifContext *context = (GifContext *) data;
context->error = error;
if (context->amount_needed == 0) {
/* w... | vuln | Vulnerable | Unknown |
static int __rds_rdma_map(struct rds_sock *rs, struct rds_get_mr_args *args,
u64 *cookie_ret, struct rds_mr **mr_ret)
{
struct rds_mr *mr = NULL, *found;
unsigned int nr_pages;
struct page **pages = NULL;
struct scatterlist *sg;
void *trans_private;
unsigned long flags;
rds_rdma_cookie_t cookie;
unsigned in... | vuln | Vulnerable | Unknown |
Deploy(const char* packageName)
{
int deployStatus = DEPLOY_SUCCESS;
char* command = NULL;
int deploymentResult = 0;
char *nics;
char* cleanupCommand;
uint8 archiveType;
uint8 flags;
bool forceSkipReboot = false;
Bool cloudInitEnabled = FALSE;
const char *cloudInitConfigFilePath = "/etc/cl... | vuln | Vulnerable | Unknown |
from hashlib import sha256
from .signature import Signature
from .math import Math
from .utils.integer import RandomInteger
from .utils.binary import numberFromByteString
from .utils.compatibility import *
class Ecdsa:
@classmethod
def sign(cls, message, privateKey, hashfunc=sha256):
byteMessage = ha... | vuln | Vulnerable | Python |
int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)
{
struct net_device *dev;
struct bnep_session *s, *ss;
u8 dst[ETH_ALEN], src[ETH_ALEN];
int err;
BT_DBG("");
if (!l2cap_is_socket(sock))
return -EBADFD;
baswap((void *) dst, &l2cap_pi(sock->sk)->chan->dst);
baswap((void *) src,... | vuln | Safe | C/C++ |
static int __init atalk_init(void)
{
int rc;
rc = proto_register(&ddp_proto, 0);
if (rc)
goto out;
rc = sock_register(&atalk_family_ops);
if (rc)
goto out_proto;
ddp_dl = register_snap_client(ddp_snap_id, atalk_rcv);
if (!ddp_dl)
printk(atalk_err_snap);
dev_add_pack(<alk_packet_type);
dev_add_pack(... | vuln | Vulnerable | C/C++ |
// This file implements methods from the QPDF class that involve
// encryption.
#include <qpdf/QPDF.hh>
#include <qpdf/QPDFExc.hh>
#include <qpdf/QTC.hh>
#include <qpdf/QUtil.hh>
#include <qpdf/Pl_RC4.hh>
#include <qpdf/Pl_AES_PDF.hh>
#include <qpdf/Pl_Buffer.hh>
#include <qpdf/Pl_SHA2.hh>
#include <qpdf/RC4.hh>
#in... | vuln | Vulnerable | C/C++ |
nonComputedMember: function(left, right, context, create) {
return function(scope, locals, assign, inputs) {
var lhs = left(scope, locals, assign, inputs);
if (create && create !== 1) {
if (lhs && lhs[right] == null) {
lhs[right] = {};
}
}
var value = undefined;
if (lhs != null && Object.p... | vuln | Safe | JavaScript |
private boolean performAttack() {
MinecraftClient client = thisClient();
WeaponAttributes attributes = WeaponRegistry.getAttributes(client.player.getMainHandStack());
if (attributes != null) {
if (client.player.getAttackCooldownProgress(0) < (1.0 - UpswingRate)) {
ret... | vuln | Safe | Java |
processInitRequest(struct module_qstate* qstate, struct iter_qstate* iq,
struct iter_env* ie, int id)
{
uint8_t* delname;
size_t delnamelen;
struct dns_msg* msg = NULL;
log_query_info(VERB_DETAIL, "resolving", &qstate->qinfo);
/* check effort */
/* We enforce a maximum number of query restarts. This is primari... | vuln | Safe | Unknown |
package server
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"time"
"github.com/usememos/memos/api"
"github.com/usememos/memos/common"
metric "github.com/usememos/memos/plugin/metrics"
"github.com/labstack/echo/v4"
)
const (
// The max file size is 32MB.
maxFileSize = (32 * 8) << 2... | vuln | Safe | Go |
def login():
form = forms.UserForm()
if form.validate_on_submit():
db = get_db()
user = db.search(
(Query().username == form.username.data) & (Query().type == "user")
)
if user and check_password_hash(user[0]["hashed_password"], form.password.data):
user ... | vuln | Vulnerable | Python |
ngx_http_lua_copy_request_headers(ngx_http_request_t *sr, ngx_http_request_t *r)
{
ngx_table_elt_t *header;
ngx_list_part_t *part;
ngx_uint_t i;
if (ngx_list_init(&sr->headers_in.headers, sr->pool, 20,
sizeof(ngx_table_elt_t)) ... | vuln | Vulnerable | C/C++ |
def main():
import gradio as gr
if gr.__version__ not in ['3.28.3','3.32.2']: assert False, "请用 pip install -r requirements.txt 安装依赖"
from request_llm.bridge_all import predict
from toolbox import format_io, find_free_port, on_file_uploaded, on_report_generated, get_conf, ArgsGeneralWrapper, DummyWith
... | vuln | Vulnerable | Python |
uint32_t HELPER(servc)(CPUS390XState *env, uint64_t r1, uint64_t r2)
{
qemu_mutex_lock_iothread();
int r = sclp_service_call(env, r1, r2);
if (r < 0) {
program_interrupt(env, -r, 4);
r = 0;
}
qemu_mutex_unlock_iothread();
return r;
} | vuln | Safe | C/C++ |
uint64_t
zfs_fuid_create(zfsvfs_t *zfsvfs, uint64_t id, cred_t *cr,
zfs_fuid_type_t type, zfs_fuid_info_t **fuidpp)
{
#ifdef HAVE_KSID
const char *domain;
char *kdomain;
uint32_t fuid_idx = FUID_INDEX(id);
uint32_t rid = 0;
idmap_stat status;
uint64_t idx = UID_NOBODY;
zfs_fuid_t *zfuid = NULL;
zfs_fuid_inf... | vuln | Safe | C/C++ |
static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
{
AVIContext *avi = s->priv_data;
ByteIOContext *pb = s->pb;
int n, d[8], size;
offset_t i, sync;
void* dstr;
if (ENABLE_DV_DEMUXER && avi->dv_demux) {
size = dv_get_packet(avi->dv_demux, pkt);
if (size >= 0)
... | vuln | Safe | C/C++ |
static inline int wv_get_value_integer(WavpackFrameContext *s, uint32_t *crc,
int S)
{
unsigned bit;
if (s->extra_bits) {
S *= 1 << s->extra_bits;
if (s->got_extra_bits &&
get_bits_left(&s->gb_extra_bits) >= s->extra_bits) {
S |= g... | vuln | Safe | C/C++ |
void __l2cap_connect_rsp_defer(struct l2cap_chan *chan)
{
struct l2cap_conn_rsp rsp;
struct l2cap_conn *conn = chan->conn;
u8 buf[128];
u8 rsp_code;
rsp.scid = cpu_to_le16(chan->dcid);
rsp.dcid = cpu_to_le16(chan->scid);
rsp.result = cpu_to_le16(L2CAP_CR_SUCCESS);
rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO)... | vuln | Safe | Unknown |
kex_input_kexinit(int type, u_int32_t seq, void *ctxt)
{
struct ssh *ssh = ctxt;
struct kex *kex = ssh->kex;
const u_char *ptr;
u_int i;
size_t dlen;
int r;
debug("SSH2_MSG_KEXINIT received");
if (kex == NULL)
return SSH_ERR_INVALID_ARGUMENT;
ptr = sshpkt_ptr(ssh, &dlen);
if ((r = sshbuf_put(kex->pee... | vuln | Vulnerable | C/C++ |
/*
* 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 |
void rng_backend_request_entropy(RngBackend *s, size_t size,
EntropyReceiveFunc *receive_entropy,
void *opaque)
{
RngBackendClass *k = RNG_BACKEND_GET_CLASS(s);
RngRequest *req;
if (k->request_entropy) {
req = g_malloc(sizeof(*req));... | vuln | Safe | Unknown |
bool MYSQL_LOG::open(
#ifdef HAVE_PSI_INTERFACE
PSI_file_key log_file_key,
#endif
const char *log_name, enum_log_type log_type_arg,
const char *new_name, enum cache_type io_cache_type_arg)
{
char buff[FN_REFLEN];
MY_STAT f_stat;
File file= -1;
int o... | vuln | Vulnerable | Unknown |
@Override
protected void assertCredentialsMatch(AuthenticationToken authcToken, AuthenticationInfo info)
throws AuthenticationException {
LoginAuthenticationInfo kapuaInfo = (LoginAuthenticationInfo) info;
CredentialService credentialService = LOCATOR.getService(CredentialService.class);... | vuln | Safe | Java |
/*
* 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 |
saveNewOption:function(){
var newValF=$('#akSelectValueFieldNew');
var val=newValF.val();
if(val=='') {
return;
}
var ts = 't' + new Date().getTime();
var template=document.getElementById('akSelectValueWrapTemplate');
var newRowEl=document.createElement('div');
newRowEl.innerHTML=template.innerHTML.... | vuln | Vulnerable | JavaScript |
int
nfssvc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd_writeargs *args)
{
unsigned int len, hdr, dlen;
struct kvec *head = rqstp->rq_arg.head;
int v;
p = decode_fh(p, &args->fh);
if (!p)
return 0;
p++; /* beginoffset */
args->offset = ntohl(*p++); /* offset */
p++; /* totalcou... | vuln | Vulnerable | C/C++ |
public static void light(float x, float y, float x2, float y2, float stroke, Color tint, float alpha){
renderer.lights.line(x, y, x2, y2, stroke, tint, alpha);
} | vuln | Vulnerable | Java |
static int valid_entry_name(const char *filename)
{
return *filename != '\0' &&
strchr(filename, '/') == NULL &&
(*filename != '.' ||
(strcmp(filename, ".") != 0 &&
strcmp(filename, "..") != 0 &&
strcasecmp(filename, DOT_GIT) != 0));
} | vuln | Safe | Unknown |
nfsd4_encode_layoutget(struct nfsd4_compoundres *resp, __be32 nfserr,
struct nfsd4_layoutget *lgp)
{
struct xdr_stream *xdr = &resp->xdr;
const struct nfsd4_layout_ops *ops =
nfsd4_layout_ops[lgp->lg_layout_type];
__be32 *p;
dprintk("%s: err %d\n", __func__, nfserr);
if (nfserr)
goto out;
nfserr = nfserr_... | vuln | Vulnerable | Unknown |
yajl_status
yajl_do_finish(yajl_handle hand)
{
yajl_status stat;
stat = yajl_do_parse(hand,(const unsigned char *) " ",(size_t) 1);
if (stat != yajl_status_ok) return stat;
switch(yajl_bs_current(hand->stateStack))
{
case yajl_state_parse_error:
case yajl_state_lexical_error:
... | vuln | Vulnerable | C/C++ |
goa_web_view_init (GoaWebView *self)
{
GoaWebViewPrivate *priv;
GtkWidget *scrolled_window;
SoupCookieJar *cookie_jar;
SoupSession *session;
WebKitWebSettings *settings;
self->priv = GOA_WEB_VIEW_GET_PRIVATE (self);
priv = self->priv;
session = webkit_get_default_session ();
g_object_set (session, S... | vuln | Safe | Unknown |
static void
l2tp_ppp_discon_cc_print(netdissect_options *ndo, const u_char *dat, u_int length)
{
const uint16_t *ptr = (const uint16_t *)dat;
if (length < 5) {
ND_PRINT((ndo, "AVP too short"));
return;
}
/* Disconnect Code */
ND_PRINT((ndo, "%04x, ", EXTRACT_16BITS(dat)));
dat += 2;
length -= 2;
/* Control... | vuln | Safe | C/C++ |
static void
init_copy(mrb_state *mrb, mrb_value dest, mrb_value obj)
{
switch (mrb_type(obj)) {
case MRB_TT_CLASS:
case MRB_TT_MODULE:
copy_class(mrb, dest, obj);
mrb_iv_copy(mrb, dest, obj);
mrb_iv_remove(mrb, dest, mrb_intern_lit(mrb, "__classname__"));
break;
case MRB_TT_OBJECT:... | vuln | Safe | C/C++ |
struct bio *bio_map_user_iov(struct request_queue *q,
const struct iov_iter *iter,
gfp_t gfp_mask)
{
int j;
int nr_pages = 0;
struct page **pages;
struct bio *bio;
int cur_page = 0;
int ret, offset;
struct iov_iter i;
struct iovec iov;
struct bio_vec *bvec;
iov_for_each(iov, i, *iter) {
... | vuln | Safe | C/C++ |
static int start_frame_overlay(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
{
AVFilterContext *ctx = inlink->dst;
OverlayContext *over = ctx->priv;
inlink->cur_buf = NULL;
over->overpicref = inpicref;
over->overpicref->pts = av_rescale_q(inpicref->pts, ctx->inputs[OVERLAY]->time_base,
... | vuln | Vulnerable | C/C++ |
privsep_read_loop(void)
{
struct privsep_command cmd;
int ret;
while (1) {
ret = readn(pfd, &cmd, sizeof(cmd));
if (ret <= 0) {
/* Error or EOF, give up */
if (ret < 0) {
flog(LOG_ERR, "Exiting, privsep_read_loop had readn error: %s\n",
strerror(errno));
} else {
flog(LOG_ERR, "Exiting... | vuln | Safe | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Safe | C/C++ |
TPMI_ALG_MAC_SCHEME_Unmarshal(TPMI_ALG_MAC_SCHEME *target, BYTE **buffer, INT32 *size, BOOL allowNull)
{
TPM_RC rc = TPM_RC_SUCCESS;
if (rc == TPM_RC_SUCCESS) {
rc = TPM_ALG_ID_Unmarshal(target, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
switch (*target) {
#if ALG_SHA1
case TPM_ALG_SHA1:
#endi... | vuln | Vulnerable | Unknown |
void V8Window::namedPropertyGetterCustom(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
if (!name->IsString())
return;
auto nameString = name.As<v8::String>();
LocalDOMWindow* window = toLocalDOMWindow(V8Window::toImpl(info.Holder()));
if (!window)
return;
... | vuln | Safe | C/C++ |
def _is_not_av_media(content_type: bytes) -> bool:
"""Returns False if the content type is audio or video."""
content_type = content_type.lower()
return not content_type.startswith(
b"video/"
) and not content_type.startswith(b"audio/") | vuln | Safe | Python |
@Override
public IQData start() throws InterruptedException {
File rawFile = null;
Long startTimeMillis = null;
Long endTimeMillis = null;
try {
socket = new Socket(config.getProperty("satellites.sdrserver.host"), config.getInteger("satellites.sdrserver.port"));
OutputStream os = socket.getOutputStream()... | vuln | Vulnerable | Java |
@Override
public Point getLocationOnScreen() {
final long wlSurfacePtr = getWLSurface();
if (wlSurfacePtr != 0) {
try {
return WLRobotPeer.getLocationOfWLSurface(wlSurfacePtr);
} catch (UnsupportedOperationException ignore) {
return new Point(0... | vuln | Vulnerable | Java |
public static void onInjectTooltip(ItemStack stack, TooltipContext context, List<Text> lines) {
int count = stack.getCount();
String name = getInternalNameFromNBT(stack);
String timestamp = getTimestamp(stack);
List<String> listString = lines.stream()
.map(Text::getString... | vuln | Vulnerable | Java |
static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd,
int cmd, abi_long arg)
{
void *argptr;
struct dm_ioctl *host_dm;
abi_long guest_data;
uint32_t guest_data_size;
int target_size;
const argtype *arg_type = ie->arg_type;
abi_long ret;
... | vuln | Safe | C/C++ |
@Override
public String upload(MultipartFile file) throws Exception {
String temp = WebUtils.getAppDir("temp");
File saveFile = new File(temp, Objects.requireNonNull(file.getOriginalFilename()));
// delete when exists
if (saveFile.exists()) {
saveFile.delete();
}
... | vuln | Safe | Java |
private User login() throws IOException {
try {
final User user;
if(authMethod == AuthMethod.CUSTOM) {
// custom authentication
user = user(UserText.ADMIN);
} else {
// request authorization header, check authentication method
final String header = request.getHeader... | vuln | Safe | Java |
/*
Jappix - An open social platform
These are the Message Carbons JS script for Jappix
-------------------------------------------------
License: AGPL
Author: Valérian Saliou
*/
// Bundle
var Carbons = (function () {
/**
* Alias of this
* @private
*/
var self = {};
/**
* Configur... | vuln | Safe | JavaScript |
protected void assignOfficerToShip(final InteractionDialogAPI dialog, final CampaignFleetAPI fleet, final PersonAPI officer)
{
List<FleetMemberAPI> ships = new ArrayList<>();
for (FleetMemberAPI member : fleet.getFleetData().getMembersListCopy()) {
if (Misc.isUnremovable(member.getCaptain())) continue;
if (... | vuln | Safe | Java |
{% load i18n %}
{% load inventree_extras %}
/* globals
createNewModal,
inventreeFormDataUpload,
inventreeGet,
inventreePut,
modalEnable,
modalShowSubmitButton,
renderBuild,
renderCompany,
renderManufacturerPart,
renderOwner,
renderPart,
renderPartCategory,
renderPart... | vuln | Safe | Python |
@Override
public void onDisable()
{
EVENTS.remove(UpdateListener.class, this);
EVENTS.remove(RenderListener.class, this);
if(currentBlock != null)
{
IMC.getInteractionManager().setBreakingBlock(true);
MC.interactionManager.cancelBlockBreaking();
currentBlock = null;
}
prevBlocks.clear();
... | 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 | Python |
int disrsi_(
int stream,
int *negate,
unsigned *value,
unsigned count)
{
int c;
unsigned locval;
unsigned ndigs;
char *cp;
char scratch[DIS_BUFSIZ+1];
assert(negate != NULL);
assert(value != NULL);
assert(count);
assert(stream >= 0);
assert(dis_getc != NULL);
assert(dis... | vuln | Safe | C/C++ |
// -*- Mode: Go; indent-tabs-mode: t -*-
/*
* Copyright (C) 2014-2018 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hop... | vuln | Vulnerable | Go |
protected View prepareDecorView(View v) {
v = FontLoader.apply(v);
if (!mBase.getConfig().isDisableContextMenu() && v != null) {
v = new ContextMenuDecorView(getSupportActivity(), v, this);
}
return v;
} | vuln | Safe | Java |
check_owner_password_V4(std::string& user_password,
std::string const& owner_password,
QPDF::EncryptionData const& data)
{
// Algorithm 3.7 from the PDF 1.7 Reference Manual
unsigned char key[OU_key_bytes_V4];
compute_O_rc4_key(user_password, owner_password, ... | vuln | Safe | Unknown |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
from werkzeug.wrappers import Response
from six import text_type, string_types, StringIO
import frappe
import frappe.utils
import frappe.sessions
import frappe.desk.form.run_met... | vuln | Safe | Python |
/*
* Copyright (c) 2009, The MilkyTracker Team.
* 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 o... | vuln | Safe | C/C++ |
private void removeShortcutAsync(@NonNull final Collection<String> ids) {
if (!isAppSearchEnabled()) {
return;
}
runAsSystem(() -> fromAppSearch().thenAccept(session ->
session.remove(
new RemoveByDocumentIdRequest.Builder(getPackageName()).add... | 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 ... | vuln | Safe | C/C++ |
local void process(char *path)
{
int method = -1; /* get_header() return value */
size_t len; /* length of base name (minus suffix) */
struct stat st; /* to get file type and mod time */
/* all compressed suffixes for decoding search, in length order */... | vuln | Safe | C/C++ |
static ssize_t virtio_net_receive_rcu(NetClientState *nc, const uint8_t *buf,
size_t size, bool no_rss)
{
VirtIONet *n = qemu_get_nic_opaque(nc);
VirtIONetQueue *q = virtio_net_get_subqueue(nc);
VirtIODevice *vdev = VIRTIO_DEVICE(n);
VirtQueueElement *elems[VIRTQUEU... | vuln | Vulnerable | Unknown |
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++ |
int
verify_user(const struct sudoers_context *ctx, struct passwd *pw, char *prompt,
unsigned int validated, struct sudo_conv_callback *callback)
{
unsigned int ntries;
int ret, status, success = AUTH_FAILURE;
sudo_auth *auth;
sigset_t mask, omask;
struct sigaction sa, saved_sigtstp;
debug_de... | vuln | Vulnerable | C/C++ |
void Compute(OpKernelContext* ctx) override {
const Tensor& in0 = ctx->input(0);
const Tensor& in1 = ctx->input(1);
ValidateInputTensors(ctx, in0, in1);
if (!ctx->status().ok()) return;
MatMulBCast bcast(in0.shape().dim_sizes(), in1.shape().dim_sizes());
OP_REQUIRES(
ctx, bcast.IsValid... | vuln | Safe | C/C++ |
/*
* Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU General Public Licen... | vuln | Safe | C/C++ |
static int null_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
{
return 0;
} | vuln | Vulnerable | C/C++ |
static void kvmclock_reset(struct kvm_vcpu *vcpu)
{
if (vcpu->arch.time_page) {
kvm_release_page_dirty(vcpu->arch.time_page);
vcpu->arch.time_page = NULL;
}
} | vuln | Vulnerable | Unknown |
public Group createDefaultReadGroup(Context context, Collection collection, String typeOfGroupString,
int defaultRead)
throws SQLException, AuthorizeException {
Group role = groupService.create(context);
groupService.setName(role, getDefaultReadGroupName(c... | vuln | Safe | Java |
int parse_sequence_header(davs2_mgr_t *mgr, davs2_seq_t *seq, davs2_bs_t *bs)
{
rps_t *p_rps = NULL;
int i, j;
int num_of_rps;
bs->i_bit_pos += 32; /* skip start code */
memset(seq, 0, sizeof(davs2_seq_t)); // reset all value
seq->head.profile_id = u_v(bs, 8, "profile_id");
seq->h... | vuln | Safe | Unknown |
public static void entityRender(Player player, double distance, PoseStack matrices, boolean hasLabel, MultiBufferSource vertexConsumers, int light) {
if (VoiceClient.getClientConfig().showIcons.get() == 2) {
return;
}
if (player.getUUID().equals(client.player.getUUID())) {
... | vuln | Safe | Java |
/* 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 |
/* Copyright 2015 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 |
public Connection getConnection(Context context) throws SQLException {
DatabaseTypePojo type = databaseTypeDao.selectByDatabaseType(context.getDatabaseType());
File driverFile = driverResources.loadOrDownload(context.getDatabaseType(), type.getJdbcDriverFileUrl());
URLClassLoader loader = null;
... | vuln | Vulnerable | Java |
static int usb_net_handle_statusin(USBNetState *s, USBPacket *p)
{
int ret = 8;
if (p->len < 8)
return USB_RET_STALL;
((le32 *) p->data)[0] = cpu_to_le32(1);
((le32 *) p->data)[1] = cpu_to_le32(0);
if (!s->rndis_resp.tqh_first)
ret = USB_RET_NAK;
#ifdef TRAFFIC_DEBUG
fprintf(stde... | vuln | Vulnerable | C/C++ |
TPM2B_PUBLIC_KEY_RSA_Marshal(TPM2B_PUBLIC_KEY_RSA *source, BYTE **buffer, INT32 *size)
{
UINT16 written = 0;
written += TPM2B_Marshal(&source->b, buffer, size);
return written;
} | vuln | Vulnerable | Unknown |
@Override
protected int doProcess(Buffer inBuf, Buffer outBuf)
{
Format inFormat = inBuf.getFormat();
if ((inFormat != null)
&& (inFormat != this.inputFormat)
&& !inFormat.equals(this.inputFormat)
&& (null == setInputFormat(inFormat)))
{
... | vuln | Safe | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.