code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static void libxsmm_sparse_csr_reader( const char* i_csr_file_in,
unsigned int** o_row_idx,
unsigned int** o_column_idx,
REALTYPE** o_values,
unsigned int* ... | vuln | Vulnerable | Unknown |
static void dbEvalSetColumn(DbEvalContext *p, int iCol, Jsi_DString *dStr) {
Jsi_Interp *interp = p->jdb->interp;
char nbuf[JSI_MAX_NUMBER_STRING];
sqlite3_stmt *pStmt = p->pPreStmt->pStmt;
switch( sqlite3_column_type(pStmt, iCol) ) {
case SQLITE_BLOB: {
int bytes = sqlite3_column_bytes(pS... | vuln | Safe | C/C++ |
onChange: function () {
imagePreview('file');
} | vuln | Vulnerable | JavaScript |
static int vsock_stream_sendmsg(struct socket *sock, struct msghdr *msg,
size_t len)
{
struct sock *sk;
struct vsock_sock *vsk;
const struct vsock_transport *transport;
ssize_t total_written;
long timeout;
int err;
struct vsock_transport_send_notify_data send_data;
DEFINE_WAIT_FUNC(wait, woken_wake_function... | vuln | Vulnerable | Unknown |
u_int
juniper_ggsn_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, register const u_char *p)
{
struct juniper_l2info_t l2info;
struct juniper_ggsn_header {
uint8_t svc_id;
uint8_t flags_len;
uint8_t proto;
uint8_t flags;
... | vuln | Safe | C/C++ |
/*
* Copyright (C) 2009-2010 Julien BLACHE <jb@jblache.org>
*
* Some code included below is in the public domain, check comments
* in the file.
*
* Pieces of code adapted from mt-daapd:
* Copyright (C) 2003-2007 Ron Pedde (ron@pedde.com)
*
* This program is free software; you can redistribute it and/or modify
... | vuln | Safe | C/C++ |
public CodeEditor getEditor() {
return mBinding.editor;
} | vuln | Vulnerable | Java |
static void LogOpenCLBuildFailure(MagickCLDevice device,const char *kernel,
ExceptionInfo *exception)
{
char
filename[MagickPathExtent],
*log;
size_t
log_size;
(void) FormatLocaleString(filename,MagickPathExtent,"%s%s%s",
GetOpenCLCacheDirectory(),DirectorySeparator,"magick_badcl.cl");
(voi... | vuln | Safe | Unknown |
int svc_rdma_sendto(struct svc_rqst *rqstp)
{
struct svc_xprt *xprt = rqstp->rq_xprt;
struct svcxprt_rdma *rdma =
container_of(xprt, struct svcxprt_rdma, sc_xprt);
struct rpcrdma_msg *rdma_argp;
struct rpcrdma_msg *rdma_resp;
struct rpcrdma_write_array *wr_ary, *rp_ary;
int ret;
int inline_bytes;
struct ... | vuln | Vulnerable | C/C++ |
static int tight_compress_data(VncState *vs, int stream_id, size_t bytes,
int level, int strategy)
{
z_streamp zstream = &vs->tight->stream[stream_id];
int previous_out;
if (bytes < VNC_TIGHT_MIN_TO_COMPRESS) {
vnc_write(vs, vs->tight->tight.buffer, vs->tight->tight.o... | vuln | Safe | Unknown |
struct mosquitto *context__init(mosq_sock_t sock)
{
struct mosquitto *context;
char address[1024];
context = mosquitto__calloc(1, sizeof(struct mosquitto));
if(!context) return NULL;
#ifdef WITH_EPOLL
context->ident = id_client;
#else
context->pollfd_index = -1;
#endif
mosquitto__set_state(context, mosq_cs_new... | vuln | Safe | C/C++ |
static void m5206_mbar_writeb(void *opaque, target_phys_addr_t offset,
uint32_t value)
{
m5206_mbar_state *s = (m5206_mbar_state *)opaque;
int width;
offset &= 0x3ff;
if (offset > 0x200) {
hw_error("Bad MBAR write offset 0x%x", (int)offset);
}
width = m5206_... | vuln | Vulnerable | C/C++ |
public static Map<String, Object> userLogin(DispatchContext ctx, Map<String, ?> context) {
LocalDispatcher dispatcher = ctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
Delegator delegator = ctx.getDelegator();
// load the external auth modules -- note: this will onl... | vuln | Safe | Java |
/**
* Copyright (c) 2006-2017, JGraph Ltd
* Copyright (c) 2006-2017, Gaudenz Alder
*/
(function()
{
/**
* Version
*/
EditorUi.VERSION = '@DRAWIO-VERSION@';
/**
* Overrides compact UI setting.
*/
EditorUi.compactUi = uiTheme != 'atlas';
/**
* Overrides default grid color for dark mode
*/
if (Edit... | vuln | Vulnerable | JavaScript |
free_buf_options(
buf_T *buf,
int free_p_ff)
{
if (free_p_ff)
{
clear_string_option(&buf->b_p_fenc);
clear_string_option(&buf->b_p_ff);
clear_string_option(&buf->b_p_bh);
clear_string_option(&buf->b_p_bt);
}
#ifdef FEAT_FIND_ID
clear_string_option(&buf->b_p_def);
clear_string_option(&bu... | vuln | Safe | C/C++ |
public String prepareAuthenticationForStep(SessionId sessionId) {
Map<String, String> sessionIdAttributes = sessionIdService.getSessionAttributes(sessionId);
if (sessionIdAttributes == null) {
logger.debug("Unable to get attributes from session");
return Constants.RESULT_EXPIRED;... | vuln | Vulnerable | Java |
void arch_seccomp_spec_mitigate(struct task_struct *task)
{
if (ssb_mode == SPEC_STORE_BYPASS_SECCOMP)
ssb_prctl_set(task, PR_SPEC_FORCE_DISABLE);
if (spectre_v2_user_ibpb == SPECTRE_V2_USER_SECCOMP ||
spectre_v2_user_stibp == SPECTRE_V2_USER_SECCOMP)
ib_prctl_set(task, PR_SPEC_FORCE_DISABLE);
} | vuln | Safe | Unknown |
SYSCALL_DEFINE5(perf_event_open,
struct perf_event_attr __user *, attr_uptr,
pid_t, pid, int, cpu, int, group_fd, unsigned long, flags)
{
struct perf_event *group_leader = NULL, *output_event = NULL;
struct perf_event *event, *sibling;
struct perf_event_attr attr;
struct perf_event_context *ctx;
struct file *e... | vuln | Vulnerable | Unknown |
private void setOptions() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
swConfirmLinks.setChecked(prefs.getBoolean("confirm_links", true));
swCheckLinksDbl.setChecked(prefs.getBoolean("check_links_dbl", BuildConfig.PLAY_STORE_RELEASE));
swCheck... | vuln | Vulnerable | Java |
/*
* Generic PPP layer for Linux.
*
* Copyright 1999-2002 Paul Mackerras.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any... | vuln | Safe | C/C++ |
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | vuln | Vulnerable | Python |
@Override
protected void configure(final HttpSecurity http) throws Exception {
http.csrf().disable()
.authorizeRequests()
.antMatchers(AUTH_WHITELIST).permitAll()
.antMatchers(API, PUBLIC_API, ROOT).authenticated()
.and().exceptionHandling()
.authenticationEntryPoint(this::failureH... | vuln | Safe | Java |
static inline void vma_adjust_trans_huge(struct vm_area_struct *vma,
unsigned long start,
unsigned long end,
long adjust_next)
{
if (!vma->anon_vma || vma->vm_ops)
return;
__vma_adjust_trans_huge(vma, start, end, adjust_next);
} | vuln | Safe | C/C++ |
void DoCompute(OpKernelContext* c) {
core::RefCountPtr<Var> v;
OP_REQUIRES_OK(c, LookupResource(c, HandleFromInput(c, 0), &v));
Tensor* params = v->tensor();
const Tensor& indices = c->input(1);
const Tensor& updates = c->input(2);
// Check that rank(updates.shape) = rank(indices.shape + params... | vuln | Vulnerable | C/C++ |
inline bool ResolveAxis(const int num_dims, const int* axis,
const int64_t num_axis, int* out_axis,
int* out_num_axis) {
*out_num_axis = 0; // Just in case.
// Short-circuit axis resolution for scalars; the axis will go unused.
if (num_dims == 0) {
return true;... | vuln | Safe | C/C++ |
do_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, unsigned long sp)
{
stack_t oss;
int error;
if (uoss) {
oss.ss_sp = (void __user *) current->sas_ss_sp;
oss.ss_size = current->sas_ss_size;
oss.ss_flags = sas_ss_flags(sp);
}
if (uss) {
void __user *ss_sp;
size_t ss_size;
int ss_flags;
... | vuln | Vulnerable | Unknown |
public float getFlippingProgress(float partialTicks) {
return MathHelper.lerp(partialTicks, this.prevAnimationCounter, this.animationCounter)/FLIPPING_DURATION;
} | vuln | Vulnerable | Java |
/* FriBidi
* fribidi-bidi.c - bidirectional algorithm
*
* Authors:
* Behdad Esfahbod, 2001, 2002, 2004
* Dov Grobgeld, 1999, 2000, 2017
*
* Copyright (C) 2004 Sharif FarsiWeb, Inc
* Copyright (C) 2001,2002 Behdad Esfahbod
* Copyright (C) 1999,2000,2017 Dov Grobgeld
*
* This library is free software; you ... | vuln | Vulnerable | C/C++ |
static int decode_styl(const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
{
int i;
m->style_entries = AV_RB16(tsmb);
tsmb += 2;
if (m->tracksize + m->size_var + 2 + m->style_entries * 12 > avpkt->size)
return -1;
m->box_flags |= STYL_BOX;
for(i = 0; i < m->style_entries; i++) ... | vuln | Vulnerable | C/C++ |
protected void stepTwoC() throws OracleException {
byte[] send;
boolean pkcsConform;
BigInteger n = publicKey.getModulus();
LOGGER.debug("Step 2c: Searching with one interval left");
// initial ri computation - ri = 2(b*(si-1)-2*B)/n
BigInteger ri = si.multiply(interval... | vuln | Safe | Java |
static inline int check_pmd_range(struct vm_area_struct *vma, pud_t *pud,
unsigned long addr, unsigned long end,
const nodemask_t *nodes, unsigned long flags,
void *private)
{
pmd_t *pmd;
unsigned long next;
pmd = pmd_offset(pud, addr);
do {
next = pmd_addr_end(addr, end);
split_huge_page_pmd(vma->vm_mm,... | vuln | Vulnerable | Unknown |
static void sig_int_handler(int sig) {
struct sigaction *old = NULL;
switch (sig) {
#if !FIO_DISABLE_HOT_RESTART
case SIGUSR1:
fio_signal_children_flag = 1;
old = &fio_old_sig_usr1;
break;
#endif
/* fallthrough */
case SIGINT:
if (!old)
old = &fio_old_sig_int;
/* fallthrough */
c... | vuln | Vulnerable | C/C++ |
jSuites.toolbar = (function(el, options) {
var obj = {};
obj.options = {};
// Default configuration
var defaults = {
app: null,
container: false,
badge: false,
title: false,
responsive: false,
items: [],
}
// Loop through our object
for (var ... | vuln | Vulnerable | JavaScript |
static int gather_pid_metadata(
char* context[_CONTEXT_MAX],
char **comm_fallback,
struct iovec *iovec, size_t *n_iovec) {
/* We need 27 empty slots in iovec!
*
* Note that if we fail on oom later on, we do not roll-back changes to the iovec str... | vuln | Vulnerable | Unknown |
PHP_FUNCTION(openssl_x509_parse)
{
zval ** zcert;
X509 * cert = NULL;
long certresource = -1;
int i;
zend_bool useshortnames = 1;
char * tmpstr;
zval * subitem;
X509_EXTENSION *extension;
char *extname;
BIO *bio_out;
BUF_MEM *bio_buf;
char buf[256];
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z... | vuln | Vulnerable | Unknown |
MYSQL *mysql_connect_ssl_check(MYSQL *mysql_arg, const char *host,
const char *user, const char *passwd,
const char *db, uint port,
const char *unix_socket, ulong client_flag,
my_bool ssl_required... | vuln | Vulnerable | Unknown |
def get_mails
if params[:action] == 'get_mails'
Log.add_info(request, params.inspect)
end
if !params[:pop].nil? and params[:pop] == 'true'
mail_account_id = params[:mail_account_id]
SqlHelper.validate_token([mail_account_id])
begin
new_arrivals_h = {}
if mail_acco... | vuln | Safe | Ruby |
void snd_info_free_entry(struct snd_info_entry * entry)
{
struct snd_info_entry *p, *n;
if (!entry)
return;
if (entry->p) {
mutex_lock(&info_mutex);
snd_info_disconnect(entry);
mutex_unlock(&info_mutex);
}
/* free all children at first */
list_for_each_entry_safe(p, n, &entry->children, list)
snd_info... | vuln | Safe | Unknown |
protected CompletableFuture<Void> internalUpdatePropertiesAsync(boolean authoritative,
Map<String, String> properties) {
if (properties == null || properties.isEmpty()) {
log.warn("[{}] [{}] properties is empty, ignore update", clie... | vuln | Safe | Java |
static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
uint8_t *dest_y,
uint8_t *dest_cb,
uint8_t *dest_cr,
int fiel... | vuln | Safe | C/C++ |
static void
virtio_hdcp_deinit(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
{
struct virtio_hdcp *vhdcp = (struct virtio_hdcp *)dev->arg;
if (vhdcp) {
DPRINTF(("free struct virtio_hdcp\n"));
free(vhdcp);
}
} | vuln | Vulnerable | C/C++ |
/**
* Connect is a middleware framework for node,
* shipping with over 18 bundled middleware and a rich selection of
* 3rd-party middleware.
*
* var app = connect()
* .use(connect.logger('dev'))
* .use(connect.static('public'))
* .use(function(req, res){
* res.end('hello world\n'... | vuln | Safe | Java |
main(int argc, char **argv)
{
const char *safepath = "/bin:/sbin:/usr/bin:/usr/sbin:"
"/usr/local/bin:/usr/local/sbin";
const char *confpath = NULL;
char *shargv[] = { NULL, NULL };
char *sh;
const char *p;
const char *cmd;
char cmdline[LINE_MAX];
struct passwd mypwstore, targpwstore;
struct passwd *mypw,... | vuln | Safe | C/C++ |
xmlParseCommentComplex(xmlParserCtxtPtr ctxt, xmlChar *buf, int len, int size) {
int q, ql;
int r, rl;
int cur, l;
int count = 0;
int inputid;
inputid = ctxt->input->id;
if (buf == NULL) {
len = 0;
size = XML_PARSER_BUFFER_SIZE;
buf = (xmlChar *) xmlMallocAtomic(size * sizeof(xml... | vuln | Vulnerable | C/C++ |
UNCURL_EXPORT int32_t uncurl_ws_accept(struct uncurl_conn *ucc, char **origins, int32_t n_origins)
{
int32_t e;
e = uncurl_read_header(ucc);
if (e != UNCURL_OK) return e;
uncurl_set_header_str(ucc, "Upgrade", "websocket");
uncurl_set_header_str(ucc, "Connection", "Upgrade");
char *origin = NULL;
e = uncurl_g... | vuln | Safe | C/C++ |
static int thread_execute(AVCodecContext *avctx, action_func* func, void *arg, int *ret, int job_count, int job_size)
{
SliceThreadContext *c = avctx->internal->thread_ctx;
if (!(avctx->active_thread_type&FF_THREAD_SLICE) || avctx->thread_count <= 1)
return avcodec_default_execute(avctx, func, arg, ret,... | vuln | Vulnerable | C/C++ |
static void rtl8139_io_writel(void *opaque, uint8_t addr, uint32_t val)
{
RTL8139State *s = opaque;
addr &= 0xfc;
switch (addr)
{
case RxMissed:
DPRINTF("RxMissed clearing on write\n");
s->RxMissed = 0;
break;
case TxConfig:
rtl8139_TxConfi... | vuln | Vulnerable | C/C++ |
private void launchDeepLinkIntentToRight() {
if (!(this instanceof DeepLinkHomepageActivity
|| this instanceof DeepLinkHomepageActivityInternal)) {
Log.e(TAG, "Not a deep link component");
finish();
return;
}
if (!WizardManagerHelper.isUserSet... | vuln | Safe | Java |
long Block::Parse(const Cluster* pCluster) {
if (pCluster == NULL)
return -1;
if (pCluster->m_pSegment == NULL)
return -1;
assert(m_start >= 0);
assert(m_size >= 0);
assert(m_track <= 0);
assert(m_frames == NULL);
assert(m_frame_count <= 0);
long long pos = m_start;
const long long stop = m_start + m... | vuln | Vulnerable | C/C++ |
static int iothread_stop(Object *object, void *opaque)
{
IOThread *iothread;
iothread = (IOThread *)object_dynamic_cast(object, TYPE_IOTHREAD);
if (!iothread || !iothread->ctx || iothread->stopping) {
return 0;
}
iothread->stopping = true;
aio_notify(iothread->ctx);
if (atomic_read(&... | vuln | Safe | C/C++ |
cmsHPROFILE CMSEXPORT cmsCreateLab4ProfileTHR(cmsContext ContextID, const cmsCIExyY* WhitePoint)
{
cmsHPROFILE hProfile;
cmsPipeline* LUT = NULL;
hProfile = cmsCreateRGBProfileTHR(ContextID, WhitePoint == NULL ? cmsD50_xyY() : WhitePoint, NULL, NULL);
if (hProfile == NULL) return NULL;
cmsSetProfi... | vuln | Safe | Unknown |
PHP_METHOD(Phar, isValidPharFilename)
{
char *fname;
const char *ext_str;
size_t fname_len;
int ext_len, is_executable;
zend_bool executable = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &fname, &fname_len, &executable) == FAILURE) {
return;
}
is_executabl... | vuln | Vulnerable | C/C++ |
def getGameID(ID):
db.execute("SELECT * FROM games WHERE ID = %i" % ID)
ID = db.fetchone()
return ID | vuln | Vulnerable | Python |
function error(message) {
throw peg$buildException(
message,
null,
input.substring(peg$savedPos, peg$currPos),
peg$computeLocation(peg$savedPos, peg$currPos)
);
} | vuln | Safe | JavaScript |
def exec_command(self, cmd, tmp_path, become_user=None, sudoable=False, executable='/bin/sh', in_data=None):
''' run a command on the jail '''
p = self._buffered_exec_command(cmd, tmp_path, become_user, sudoable, executable, in_data)
stdout, stderr = p.communicate()
return (p.returncod... | vuln | Safe | Python |
static MagickBooleanType WriteSGIImage(const ImageInfo *image_info,Image *image)
{
CompressionType
compression;
const char
*value;
MagickBooleanType
status;
MagickOffsetType
scene;
MagickSizeType
number_pixels;
MemoryInfo
*pixel_info;
SGIInfo
iris_info;
register const ... | vuln | Safe | C/C++ |
@Nonnull
public String asString() {
final String value = get(myKey, null, true);
assert value != null : myKey;
return value;
} | vuln | Vulnerable | Java |
static int dxtory_decode_v1_410(AVCodecContext *avctx, AVFrame *pic,
const uint8_t *src, int src_size)
{
int h, w;
uint8_t *Y1, *Y2, *Y3, *Y4, *U, *V;
int ret;
if (src_size < avctx->width * avctx->height * 18 / 16) {
av_log(avctx, AV_LOG_ERROR, "packet too small\... | vuln | Vulnerable | Unknown |
static Image *ReadVIPSImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
char
buffer[MaxTextExtent],
*metadata;
Image
*image;
MagickBooleanType
status;
ssize_t
n;
unsigned int
channels,
marker;
VIPSBandFormat
format;
VIPSCoding
coding;
VIPSType
... | vuln | Safe | C/C++ |
def incrementOption(cursor, poll_name, option):
key = poll_name+"-"+option
req = "UPDATE {} SET count=count+1 WHERE name_option = '{}';".format(CFG("options_table_name"), key)
cursor.execute(req) | vuln | Vulnerable | Python |
public QueryResult query(int flags) {
if (GO_DISABLE_WIDGETS || mFailed) {
return QueryResult.DEFAULT;
}
mQuery.setQueryFlags(flags);
try {
return new QueryResult(mContext.getSystemService(LauncherApps.class)
.getShortcuts(mQuery, mUserHandle)... | vuln | Vulnerable | Java |
*/
static void php_wddx_pop_element(void *user_data, const XML_Char *name)
{
st_entry *ent1, *ent2;
wddx_stack *stack = (wddx_stack *)user_data;
HashTable *target_hash;
zend_class_entry *pce;
zval obj;
/* OBJECTS_FIXME */
if (stack->top == 0) {
return;
}
if (!strcmp((char *)name, EL_STRING) || ... | vuln | Safe | C/C++ |
def call(env)
return @app.call(env) unless env['PATH_INFO'].start_with? "#{@bus.base_route}message-bus/_diagnostics"
route = env['PATH_INFO'].split("#{@bus.base_route}message-bus/_diagnostics")[1]
if @bus.is_admin_lookup.nil? || !@bus.is_admin_lookup.call(env)
return [403, {}, ['not allowed']]
e... | vuln | Vulnerable | Ruby |
Set<String> allSources(String topic) {
Set<String> sources = new HashSet<>();
String source = replicationPolicy.topicSource(topic);
while (source != null && !sources.contains(source)) {
// The extra Set.contains above is for ReplicationPolicies that cannot prevent cycles.
... | vuln | Safe | Java |
mp_dss_print(netdissect_options *ndo,
const u_char *opt, u_int opt_len, u_char flags)
{
const struct mp_dss *mdss = (const struct mp_dss *) opt;
if ((opt_len != mp_dss_len(mdss, 1) &&
opt_len != mp_dss_len(mdss, 0)) || flags & TH_SYN)
return 0;
if (mds... | vuln | Vulnerable | C/C++ |
public void setSourceSpawnerName(final String name) {
this.sourceSpawnerName = name;
if (!getPDCLock()) return;
try {
if (name == null && getPDC().has(main.namespaced_keys.sourceSpawnerName, PersistentDataType.STRING))
getPDC().remove(main.namespaced_keys.sourceSpawn... | vuln | Safe | Java |
ssize_t
cdf_read_short_sector(const cdf_stream_t *sst, void *buf, size_t offs,
size_t len, const cdf_header_t *h, cdf_secid_t id)
{
size_t ss = CDF_SHORT_SEC_SIZE(h);
size_t pos = CDF_SHORT_SEC_POS(h, id);
assert(ss == len);
if (sst->sst_len < (size_t)id) {
DPRINTF(("bad sector id %d > %d\n", id, sst->sst_len... | vuln | Safe | C/C++ |
_zip_cdir_new(int nentry, struct zip_error *error)
{
struct zip_cdir *cd;
if ((cd=(struct zip_cdir *)malloc(sizeof(*cd))) == NULL) {
_zip_error_set(error, ZIP_ER_MEMORY, 0);
return NULL;
}
if ((cd->entry=(struct zip_dirent *)malloc(sizeof(*(cd->entry))*nentry))
== NULL) {
... | vuln | Vulnerable | C/C++ |
void Cues::Init() const {
if (m_cue_points)
return;
assert(m_count == 0);
assert(m_preload_count == 0);
IMkvReader* const pReader = m_pSegment->m_pReader;
const long long stop = m_start + m_size;
long long pos = m_start;
long cue_points_size = 0;
while (pos < stop) {
const long long idpos = p... | vuln | Vulnerable | C/C++ |
PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv)
{
int i, rv;
const char *user = NULL;
char *password;
unsigned int slot_num = 0;
int is_a_screen_saver = 0;
struct configuration_st *configuration;
int pkcs11_pam_fail = PAM_AUTHINFO_UNAVAIL;
pkcs11_handle_t ... | vuln | Safe | Unknown |
/* 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 | Vulnerable | Python |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_enc_sess_ietf.c -- Crypto session for IETF QUIC
*/
#include <assert.h>
#include <errno.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <sys/queue.h>
#if LSQUIC_PREFERRED_ADDR
#include <arpa/inet.h>
#endif
#... | vuln | Vulnerable | C/C++ |
/*
* Copyright (C) 2014, 2021 XStream Committers.
* All rights reserved.
*
* Created on 08. January 2014 by Joerg Schaible
*/
package com.thoughtworks.xstream.security;
/**
* Exception thrown for a forbidden class.
*
* @author Jörg Schaible
* @since 1.4.7
*/
public class ForbiddenClassException extends... | vuln | Safe | Java |
public function twoFactorAuthenticationAction(Request $request)
{
$view = $this->buildLoginPageViewModel();
if ($request->hasSession()) {
$session = $request->getSession();
$authException = $session->get(Security::AUTHENTICATION_ERROR);
if ($authException instanc... | vuln | Vulnerable | PHP |
static int fix_acl(int fd, uid_t uid) {
#if HAVE_ACL
int r;
assert(fd >= 0);
assert(uid_is_valid(uid));
if (uid_is_system(uid) || uid_is_dynamic(uid) || uid == UID_NOBODY)
return 0;
/* Make sure normal users can read (but not write or delete) their own coredum... | vuln | Vulnerable | C/C++ |
_rpc_launch_tasks(slurm_msg_t *msg)
{
int errnum = SLURM_SUCCESS;
uint16_t port;
char host[MAXHOSTNAMELEN];
uid_t req_uid;
launch_tasks_request_msg_t *req = msg->data;
bool super_user = false;
bool mem_sort = false;
#ifndef HAVE_FRONT_END
bool first_job_run;
#endif
slurm_addr_t self;
s... | vuln | Vulnerable | Unknown |
import { mainPage } from "../../support/page_objects/mainPage";
import { isTestSuiteActive } from "../../support/page_objects/projectConstants";
export const genTest = (apiType, dbType) => {
if (!isTestSuiteActive(apiType, dbType)) return;
describe(`${apiType.toUpperCase()} api - Table: belongs to, link recor... | vuln | Safe | JavaScript |
void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &inPen)
{
#ifdef QT_DEBUG_DRAW
qDebug() << "QPaintEngineEx::stroke()" << pen;
#endif
Q_D(QPaintEngineEx);
if (path.isEmpty())
return;
if (!d->strokeHandler) {
d->strokeHandler = new StrokeHandler(path.elementCount()+4);
... | vuln | Vulnerable | C/C++ |
@SuppressLint("MissingPermission")
@SuppressWarnings({"unused","WeakerAccess"})
@RequiresApi(21)
public boolean runTransmitterTest(final Context context) {
initializeWithContext(context);
if (isBleAdvertisePermissionDenied()) {
LogManager.i(TAG, "Cannot run transmitter test -- ad... | vuln | Safe | Java |
/*
* IPP routines for the CUPS scheduler.
*
* Copyright 2007-2016 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* This file contains Kerberos support code, copyright 2006 by
* Jelmer Vernooij.
*
* These coded instructions, statements, and computer programs are the
* pro... | vuln | Safe | C/C++ |
static gboolean
try_resolve_op_from_metadata (FlatpakTransaction *self,
FlatpakTransactionOperation *op,
const char *checksum,
GFile *sideload_path,
FlatpakRemoteState *state)
{
g_autoptr(GBytes) me... | vuln | Vulnerable | C/C++ |
public static boolean isParallelOrientedPortal(Portal currPortal, Portal outerPortal) {
return currPortal.world.getRegistryKey() == outerPortal.dimensionTo &&
currPortal.getNormal().dotProduct(outerPortal.getContentDirection()) < -0.9 &&
!outerPortal.isInside(currPortal.getOriginPos(), 0... | vuln | Safe | Java |
static int mov_read_ddts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
const uint32_t ddts_size = 20;
AVStream *st = NULL;
uint8_t *buf = NULL;
uint32_t frame_duration_code = 0;
uint32_t channel_layout_code = 0;
GetBitContext gb;
buf = av_malloc(ddts_size + AV_INPUT_BUFFER_PADDING_SIZE);
... | vuln | Safe | C/C++ |
static int jpc_calcssexp(jpc_fix_t stepsize)
{
return jpc_fix_firstone(stepsize) - JPC_FIX_FRACBITS;
} | vuln | Safe | Unknown |
private void polymer_initLazy() {
if (this.polymer_locked) {
this.polymer_offset = this.nextId;
this.polymer_locked = false;
((List<T>) this.polymer_lazyList).forEach(this::add);
this.polymer_lazyList.clear();
}
} | vuln | Vulnerable | Java |
private static void enableAntiCrash() {
enableAntiCrash = getBoolean("settings.anti-crash.enabled", true);
maxBookPages = getInt("settings.anti-crash.max-book-pages", 50);
} | vuln | Safe | Java |
static void malloc_consolidate(mstate av)
{
mfastbinptr* fb; /* current fastbin being consolidated */
mfastbinptr* maxfb; /* last fastbin (for loop control) */
mchunkptr p; /* current chunk being consolidated */
mchunkptr nextp; /* nex... | vuln | Safe | Unknown |
this.log = function (type, args) {
var values = []
for (var i = 0; i < args.length; i++) {
values.push(this.stringify(args[i], 3))
}
this.info({ log: values.join(', '), type: type })
}
this.stringify = stringify
function getLocation (url, lineno, colno) {
var location = ''
if (u... | vuln | Safe | JavaScript |
static int connect_to_db(char *host, char *user,char *passwd)
{
char buff[20+FN_REFLEN];
DBUG_ENTER("connect_to_db");
verbose_msg("-- Connecting to %s...\n", host ? host : "localhost");
mysql_init(&mysql_connection);
if (opt_compress)
mysql_options(&mysql_connection,MYSQL_OPT_COMPRESS,NullS);
#ifdef HAVE... | vuln | Vulnerable | Unknown |
/*
Copyright 2022 The Fluid 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, softw... | vuln | Safe | Go |
int qio_channel_readv_all(QIOChannel *ioc,
const struct iovec *iov,
size_t niov,
Error **errp)
{
int ret = -1;
struct iovec *local_iov = g_new(struct iovec, niov);
struct iovec *local_iov_head = local_iov;
unsigned int nlocal_... | vuln | Vulnerable | C/C++ |
static int pagemap_open(struct inode *inode, struct file *file)
{
pr_warn_once("Bits 55-60 of /proc/PID/pagemap entries are about "
"to stop being page-shift some time soon. See the "
"linux/Documentation/vm/pagemap.txt for details.\n");
return 0;
} | vuln | Vulnerable | C/C++ |
authhavekey(
keyid_t id
)
{
symkey * sk;
authkeylookups++;
if (0 == id || cache_keyid == id) {
return TRUE;
}
/*
* Seach the bin for the key. If found and the key type
* is zero, somebody marked it trusted without specifying
* a key or key type. In this case consider the key missing.
*/
authkeyunca... | vuln | Vulnerable | Unknown |
// Copyright 2009 Indeed
package com.indeed.util.varexport;
import com.google.common.base.CharMatcher;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableSet;
import com.google.common.escape.Escaper;
import java.io.PrintWriter;
import java.util.Map;
import java.util.Set;
import java.uti... | vuln | Vulnerable | Java |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Vulnerable | C/C++ |
e1000e_init_msi(E1000EState *s)
{
int res;
res = msi_init(PCI_DEVICE(s), 0xD0, 1, true, false, NULL);
if (!res) {
s->intr_state |= E1000E_USE_MSI;
} else {
trace_e1000e_msi_init_fail(res);
}
} | vuln | Safe | C/C++ |
public static void applySpansToSpannable(int rS, int rE, Editable spannableString, int startSpan, int endSpan, boolean includeLinks) {
if (endSpan - startSpan <= 0) {
return;
}
if (rS >= 0 && rE >= 0) {
CharacterStyle[] mSpansDelete = spannableString.getSpans(rS, rE, Char... | vuln | Safe | Java |
static int dvbsub_parse_region_segment(AVCodecContext *avctx,
const uint8_t *buf, int buf_size)
{
DVBSubContext *ctx = avctx->priv_data;
const uint8_t *buf_end = buf + buf_size;
int region_id, object_id;
int av_unused version;
DVBSubRegion *region;
DVBSubOb... | vuln | Vulnerable | C/C++ |
/*
Copyright The containerd 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... | vuln | Safe | Go |
GC_API GC_ATTR_MALLOC void * GC_CALL GC_debug_malloc_atomic(size_t lb,
GC_EXTRA_PARAMS)
{
void * result = GC_malloc_atomic(SIZET_SAT_ADD(lb, DEBUG_BYTES));
if (result == 0) {
GC_err_printf("GC_debug_malloc_atomic(%lu) returning NULL (%s:%d)\n"... | vuln | Safe | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.