code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
void bn_gcd_lehme(bn_t c, const bn_t a, const bn_t b) {
bn_t x, y, u, v, t0, t1, t2, t3;
dig_t _x, _y, q, _q, t, _t;
dis_t _a, _b, _c, _d;
if (bn_is_zero(a)) {
bn_abs(c, b);
return;
}
if (bn_is_zero(b)) {
bn_abs(c, a);
return;
}
bn_null(x);
bn_null(y);
bn_null(u);
bn_null(v);
bn_null(t0);
bn_nul... | vuln | Vulnerable | C/C++ |
public long lastEncounterTime() {
return encounters.stream().mapToLong(e -> e.stop).max().getAsLong();
} | vuln | Vulnerable | Java |
int load_uboot(const char *filename, target_ulong *ep, int *is_linux)
{
int fd;
int size;
uboot_image_header_t h;
uboot_image_header_t *hdr = &h;
uint8_t *data = NULL;
fd = open(filename, O_RDONLY | O_BINARY);
if (fd < 0)
return -1;
size = read(fd, hdr, sizeof(uboot_image_header_... | vuln | Vulnerable | C/C++ |
add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high, unsigned int out, int check_for_overlap, int many)
{
int current;
cmap_splay *tree;
if (low > high)
{
fz_warn(ctx, "range limits out of range in cmap %s", cmap->cmap_name);
return;
}
tree = cmap->tree;
if (cmap->tlen)
{
uns... | vuln | Vulnerable | C/C++ |
@Override
public boolean isChecked() {
try {
return mTelephonyManager.isNullCipherAndIntegrityPreferenceEnabled();
} catch (Exception e) {
Log.e(LOG_TAG,
"Failed isNullCipherAndIntegrityEnabled. Defaulting toggle to "
+ "checked... | vuln | Safe | Java |
olsr_print(netdissect_options *ndo,
const u_char *pptr, u_int length, int is_ipv6)
{
union {
const struct olsr_common *common;
const struct olsr_msg4 *msg4;
const struct olsr_msg6 *msg6;
const struct olsr_hello *hello;
const struct olsr_hello_link *hello_link;
... | vuln | Vulnerable | C/C++ |
static bool coroutine_fn yield_and_check(BackupBlockJob *job)
{
if (block_job_is_cancelled(&job->common)) {
return true;
}
if (job->common.speed) {
uint64_t delay_ns = ratelimit_calculate_delay(&job->limit,
job->sectors_read);
... | vuln | Vulnerable | C/C++ |
int sd_do_command(SDState *sd, SDRequest *req,
uint8_t *response) {
uint32_t last_status = sd->card_status;
sd_rsp_type_t rtype;
int rsplen;
if (!sd->bdrv || !bdrv_is_inserted(sd->bdrv) || !sd->enable) {
return 0;
}
if (sd_req_crc_validate(req)) {
sd->card_statu... | vuln | Vulnerable | C/C++ |
static void msmouse_chr_close (struct CharDriverState *chr)
{
MouseState *mouse = chr->opaque;
qemu_input_handler_unregister(mouse->hs);
g_free(mouse);
g_free(chr);
} | vuln | Vulnerable | C/C++ |
function workspaceEndpoints(app) {
if (!app) return;
app.post("/workspace/new", [validatedRequest], async (request, response) => {
try {
const user = await userFromSession(request, response);
const { name = null } = reqBody(request);
const { workspace, message } = await Workspace.new(name, us... | vuln | Vulnerable | JavaScript |
const Cluster* Segment::FindOrPreloadCluster(long long requested_pos) {
if (requested_pos < 0)
return 0;
Cluster** const ii = m_clusters;
Cluster** i = ii;
const long count = m_clusterCount + m_clusterPreloadCount;
Cluster** const jj = ii + count;
Cluster** j = jj;
while (i < j) {
Cluster** const k = i + ... | vuln | Vulnerable | C/C++ |
// imagew-bmp.c
// Part of ImageWorsener, Copyright (c) 2011 by Jason Summers.
// For more information, see the readme.txt file.
#include "imagew-config.h"
#include <stdio.h> // for SEEK_SET
#include <stdlib.h>
#include <string.h>
#define IW_INCLUDE_UTIL_FUNCTIONS
#include "imagew.h"
#define IWBMP_BI_RGB 0 //... | vuln | Vulnerable | C/C++ |
static void uhci_async_cancel_device(UHCIState *s, USBDevice *dev)
{
UHCIAsync *curr, *n;
QTAILQ_FOREACH_SAFE(curr, &s->async_pending, next, n) {
if (curr->packet.owner == NULL ||
curr->packet.owner->dev != dev) {
continue;
}
uhci_async_unlink(s, curr);
uh... | vuln | Vulnerable | C/C++ |
package com.salesmanager.core.business.services.common.generic;
import java.io.Serializable;
import java.lang.reflect.ParameterizedType;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import com.salesmanager.core.business.exception.ServiceException;
import com.salesmanager.core.... | vuln | Vulnerable | 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 |
int
obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena)
{
PyObject* tmp = NULL;
asdl_seq* args;
arg_ty vararg;
asdl_seq* kwonlyargs;
asdl_seq* kw_defaults;
arg_ty kwarg;
asdl_seq* defaults;
if (lookup_attr_id(obj, &PyId_args, &tmp) < 0) {
return 1;
}
if (... | vuln | Safe | C/C++ |
void kvm_ioapic_dump_state(Monitor *mon, const QDict *qdict)
{
IOAPICCommonState s;
kvm_ioapic_get(&s);
ioapic_print_redtbl(mon, &s);
} | vuln | Vulnerable | C/C++ |
synchronize: function(requisition, errorHandler) {
/**
* @param {object} requisition The requisition object
* @param {string} rescanExisting true to perform a full scan, false to only add/remove nodes without scan, dbonly for all DB operations without scan
*/
var doSynchronize = ... | vuln | Safe | JavaScript |
static noinline_for_stack int
ccp_run_sha_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
{
struct ccp_sha_engine *sha = &cmd->u.sha;
struct ccp_dm_workarea ctx;
struct ccp_data src;
struct ccp_op op;
unsigned int ioffset, ooffset;
unsigned int digest_size;
int sb_count;
const void *init;
u64 block_size;... | vuln | Vulnerable | C/C++ |
static int vp3_decode_frame(AVCodecContext *avctx,
void *data, int *got_frame,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
Vp3DecodeContext *s = avctx->priv_data;
GetBitContext gb;
int i, ret;
if... | vuln | Vulnerable | C/C++ |
@Override
public long skip(long n) throws IOException {
int retval;
if (n < 0)
retval = 0;
else {
retval = read(SKIP_BUFFER, 0, (int) Math.min(n, SKIP_BUFFER_SIZE));
if (retval < 0)
retval = 0;
}
return retval;
} | vuln | Safe | Java |
static int virtio_ccw_set_vqs(SubchDev *sch, uint64_t addr, uint32_t align,
uint16_t index, uint16_t num)
{
VirtIODevice *vdev = virtio_ccw_get_vdev(sch);
if (index >= VIRTIO_PCI_QUEUE_MAX) {
return -EINVAL;
}
if (addr && (align != 4096)) {
return -EINV... | vuln | Safe | C/C++ |
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* 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, including without limitation the rights
* to use, copy,... | vuln | Safe | Java |
static uint64_t *l2_allocate(BlockDriverState *bs, int l1_index)
{
BDRVQcowState *s = bs->opaque;
int min_index;
uint64_t old_l2_offset;
uint64_t *l2_table;
int64_t l2_offset;
old_l2_offset = s->l1_table[l1_index];
l2_offset = qcow2_alloc_clusters(bs, s->l2_size * sizeof(uint64_t));
... | vuln | Safe | C/C++ |
/*
Terminal Kit
Copyright (c) 2009 - 2021 Cédric Ronvel
The MIT License (MIT)
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, including without limitation the rights
... | vuln | Vulnerable | JavaScript |
static void numa_add(const char *optarg)
{
char option[128];
char *endptr;
unsigned long long value, endvalue;
unsigned long long nodenr;
value = endvalue = 0ULL;
optarg = get_opt_name(option, 128, optarg, ',');
if (*optarg == ',') {
optarg++;
}
if (!strcmp(option, "node")) {... | vuln | Vulnerable | C/C++ |
function Ws(e){return(e=bs(e))&&e.replace(xe,on).replace(tt,"")} | vuln | Safe | JavaScript |
int jas_stream_read(jas_stream_t *stream, void *buf, int cnt)
{
int n;
int c;
char *bufptr;
bufptr = buf;
n = 0;
while (n < cnt) {
if ((c = jas_stream_getc(stream)) == EOF) {
return n;
}
*bufptr++ = c;
++n;
}
return n;
} | vuln | Vulnerable | C/C++ |
var express = require('express');
var log4js = require('log4js');
var httpLogger = log4js.getLogger("http");
var settings = require('../../utils/Settings');
var hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
var ueberStore = require('../../db/SessionStore');
var stats = require('ep_etherpad-lite/node/sta... | vuln | Safe | JavaScript |
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
# -----------------------------------------------------------------------------
# Minimal Python version sanity check (from IPython/Jupyterhub)
# -----------------------------------... | vuln | Safe | Python |
(function()
{
/**
* Download from following URL as TSV and convert using https://jgraph.github.io/drawio-tools/tools/convert.html:
* https://docs.google.com/spreadsheets/d/1sAL1zn-UtmJtKPH4cLApGjRX-TRSJa5dYdfZ9NKYfRs
* Maps package and stencil names to additional tags.
*/
Sidebar.prototype.tagIndex = '5V1dV+M... | vuln | Vulnerable | JavaScript |
function Glance(options) {
EE.call(this)
options = xtend(defaults, options || {})
this.port = options.port
this.hideindex = options.hideindex
this.indices = options.indices
this.dir = path.normalize(options.dir)
this.nodot = options.nodot
return this
} | vuln | Vulnerable | JavaScript |
package org.hswebframework.web.workflow.web;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import io.swagger.annotations.Api;
import io.... | vuln | Safe | Java |
QPDF::readLinearizationData()
{
// This function throws an exception (which is trapped by
// checkLinearization()) for any errors that prevent loading.
// Hint table parsing code needs at least 32 bits in a long.
assert(sizeof(long) >= 4);
if (! isLinearized())
{
throw std::logic_error("calle... | vuln | Safe | Unknown |
def requires_access(permissions: Sequence[tuple[str, str]] | None = None) -> Callable[[T], T]:
"""Factory for decorator that checks current user's permissions against required permissions."""
appbuilder = get_airflow_app().appbuilder
appbuilder.sm.sync_resource_permissions(permissions)
def requires_acc... | vuln | Vulnerable | Python |
def upload_image_to_s3(
bucket_name: str,
file_name: str,
content_type: Optional[str],
user_profile: UserProfile,
contents: bytes) -> None:
conn = S3Connection(settings.S3_KEY, settings.S3_SECRET_KEY)
bucket = get_bucket(conn, bucket_name)
key = Key(bucket)
key.k... | vuln | Safe | Python |
private void sendEmbedMessage(EmbedCreateSpec embedCreateSpec) {
RestChannel restChannel = restClient.getChannelById(Snowflake.of(CONFIG.discord.channelId));
restChannel.createMessage(MessageCreateSpec.builder()
.addEmbed(embedCreateSpec)
.build().asRequest()).block();
... | vuln | Vulnerable | Java |
RenderWidgetHostViewAndroid::~RenderWidgetHostViewAndroid() {
SetContentViewCore(NULL);
if (!shared_surface_.is_null()) {
ImageTransportFactoryAndroid::GetInstance()->DestroySharedSurfaceHandle(
shared_surface_);
}
} | vuln | Vulnerable | C/C++ |
lspci_process(STREAM s)
{
unsigned int pkglen;
static char *rest = NULL;
char *buf;
pkglen = s->end - s->p;
/* str_handle_lines requires null terminated strings */
buf = xmalloc(pkglen + 1);
STRNCPY(buf, (char *) s->p, pkglen + 1);
#if 0
printf("lspci recv:\n");
hexdump(s->p, pkglen);
#endif
str_handle_line... | vuln | Vulnerable | Unknown |
static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zend_op_array *new_op_array=NULL;
int return_value_used;
zval *inc_filename = &opline->op1.u.constant;
zval tmp_inc_filename;
zend_bool failure_retval=0;
if (inc_filename->type!=IS_STRING... | vuln | Safe | Unknown |
static void gatherSecurityPolicyViolationEventData(
SecurityPolicyViolationEventInit& init,
ExecutionContext* context,
const String& directiveText,
const ContentSecurityPolicy::DirectiveType& effectiveType,
const KURL& blockedURL,
const String& header,
RedirectStatus redirectStatus,
Cont... | vuln | Vulnerable | C/C++ |
public function getCookiePath()
{
static $cookie_path = null;
if (null !== $cookie_path && !defined('TESTSUITE')) {
return $cookie_path;
}
if (isset($GLOBALS['PMA_PHP_SELF'])) {
$parsed_url = parse_url($GLOBALS['PMA_PHP_SELF']);
} else {
... | vuln | Vulnerable | PHP |
@Override
public void handle(Object msg, Supplier<NetworkEvent.Context> contextSupplier) {
PartialBlockRemovalPacket packet = (PartialBlockRemovalPacket) msg;
contextSupplier.get().enqueueWork(() -> MultiMineClient.instance().onServerSentPartialBlockDeleteCommand(packet.pos));
contextSupplie... | vuln | Safe | Java |
_hivex_get_children (hive_h *h, hive_node_h node,
hive_node_h **children_ret, size_t **blocks_ret,
int flags)
{
if (!IS_VALID_BLOCK (h, node) || !block_id_eq (h, node, "nk")) {
SET_ERRNO (EINVAL, "invalid block or not an 'nk' block");
return -1;
}
struct ntreg_nk... | vuln | Vulnerable | Unknown |
rfbSendServerCutText(rfbScreenInfoPtr rfbScreen,char *str, int len)
{
rfbClientPtr cl;
rfbServerCutTextMsg sct;
rfbClientIteratorPtr iterator;
iterator = rfbGetClientIterator(rfbScreen);
while ((cl = rfbClientIteratorNext(iterator)) != NULL) {
/* Client is not authenticated, ignore. See GNO... | vuln | Safe | Unknown |
static int peer_recv_callback(rdpTransport* transport, wStream* s, void* extra)
{
freerdp_peer* client = (freerdp_peer*) extra;
rdpRdp* rdp = client->context->rdp;
switch (rdp->state)
{
case CONNECTION_STATE_INITIAL:
if (!rdp_server_accept_nego(rdp, s))
return -1;
if (rdp->nego->selected_protocol & PR... | vuln | Vulnerable | C/C++ |
[CHECKPATH] (entry) {
if (this.strip) {
const parts = entry.path.split(/\/|\\/)
if (parts.length < this.strip)
return false
entry.path = parts.slice(this.strip).join('/')
if (entry.type === 'Link') {
const linkparts = entry.linkpath.split(/\/|\\/)
if (linkparts.lengt... | vuln | Safe | JavaScript |
protected AzureAppService getOrCreateAzureAppServiceClient() throws AzureExecutionException {
if (appServiceClient == null) {
try {
final Account account = getAzureAccount();
final List<Subscription> subscriptions = account.getSubscriptions();
final St... | vuln | Safe | Java |
GetCode_(gdIOCtx *fd, CODE_STATIC_DATA *scd, int code_size, int flag, int *ZeroDataBlockP)
{
int i, j, ret;
int count;
if (flag) {
scd->curbit = 0;
scd->lastbit = 0;
scd->last_byte = 0;
scd->done = FALSE;
return 0;
}
if ( (scd->curbit + code_size) >= scd->lastbit) {
if (scd->done)... | vuln | Safe | C/C++ |
static int shorten_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
AVFrame *frame = data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
ShortenContext *s = avctx->priv_data;
int i, input_buf_size = 0;
... | vuln | Vulnerable | Unknown |
xfs_dinode_verify(
struct xfs_mount *mp,
xfs_ino_t ino,
struct xfs_dinode *dip)
{
xfs_failaddr_t fa;
uint16_t mode;
uint16_t flags;
uint64_t flags2;
uint64_t di_size;
if (dip->di_magic != cpu_to_be16(XFS_DINODE_MAGIC))
return __this_address;
/* Verify v3 integrity information first */
if (dip->di_... | vuln | Vulnerable | C/C++ |
void md_map_b2s256(uint8_t *hash, const uint8_t *msg, size_t len) {
memset(hash, 0, RLC_MD_LEN_B2S256);
blake2s(hash, RLC_MD_LEN_B2S256, msg, len, NULL, 0);
} | vuln | Safe | C/C++ |
MOBI_RET mobi_find_attrvalue(MOBIResult *result, const unsigned char *data_start, const unsigned char *data_end, const MOBIFiletype type, const char *needle) {
if (!result) {
debug_print("Result structure is null%s", "\n");
return MOBI_PARAM_ERR;
}
result->start = result->end = NULL;
*(r... | vuln | Safe | C/C++ |
static int ac3_probe(AVProbeData *p)
{
int max_frames, first_frames, frames;
uint8_t *buf, *buf2, *end;
AC3HeaderInfo hdr;
if(p->buf_size < 7)
return 0;
max_frames = 0;
buf = p->buf;
end = buf + FFMIN(4096, p->buf_size - 7);
for(; buf < end; buf++) {
buf2 = buf;
f... | vuln | Vulnerable | C/C++ |
void read_boot(DOS_FS * fs)
{
struct boot_sector b;
unsigned total_sectors;
unsigned short logical_sector_size, sectors;
off_t fat_length;
unsigned total_fat_entries;
off_t data_size;
fs_read(0, sizeof(b), &b);
logical_sector_size = GET_UNALIGNED_W(b.sector_size);
if (!logical_secto... | vuln | Safe | C/C++ |
public function update_item_permissions_check( $request ) {
$user = $this->get_user( $request['id'] );
if ( is_wp_error( $user ) ) {
return $user;
}
if ( ! current_user_can( 'edit_user', $user->ID ) ) {
return new WP_Error( 'rest_cannot_edit', __( 'Sorry, you are not allowed to edit this user.' ), array(... | vuln | Safe | PHP |
static libspdm_return_t libspdm_handle_response_not_ready(libspdm_context_t *spdm_context,
const uint32_t *session_id,
size_t *response_size,
void... | vuln | Vulnerable | C/C++ |
static int mov_create_timecode_track(AVFormatContext *s, int index, int src_index, const char *tcstr)
{
int ret;
MOVMuxContext *mov = s->priv_data;
MOVTrack *track = &mov->tracks[index];
AVStream *src_st = s->streams[src_index];
AVTimecode tc;
AVPacket pkt = {.stream_index = index, .f... | vuln | Vulnerable | C/C++ |
static ssize_t qrtr_tun_write_iter(struct kiocb *iocb, struct iov_iter *from)
{
struct file *filp = iocb->ki_filp;
struct qrtr_tun *tun = filp->private_data;
size_t len = iov_iter_count(from);
ssize_t ret;
void *kbuf;
kbuf = kzalloc(len, GFP_KERNEL);
if (!kbuf)
return -ENOMEM;
if (!copy_from_iter_full(kbuf,... | vuln | Safe | C/C++ |
static int whereIndexExprTransColumn(Walker *p, Expr *pExpr){
if( pExpr->op==TK_COLUMN ){
IdxExprTrans *pX = p->u.pIdxTrans;
if( pExpr->iTable==pX->iTabCur && pExpr->iColumn==pX->iTabCol ){
pExpr->iTable = pX->iIdxCur;
pExpr->iColumn = pX->iIdxCol;
pExpr->y.pTab = 0;
}
}
return WRC_C... | vuln | Vulnerable | C/C++ |
xmlBufResize(xmlBufPtr buf, size_t size)
{
size_t newSize;
xmlChar* rebuf = NULL;
size_t start_buf;
if ((buf == NULL) || (buf->error))
return(0);
CHECK_COMPAT(buf)
if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return(0);
if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) {
/*
* ... | vuln | Safe | Unknown |
function addMenu(id, small, img)
{
var menu = ui.menus.get(id);
var elt = menuObj.addMenu(mxResources.get(id), mxUtils.bind(this, function()
{
// Allows extensions of menu.functid
menu.funct.apply(this, arguments);
}), before);
elt.className = (urlParams['sketch'] == '1') ? 'geToo... | vuln | Safe | JavaScript |
static void decode_residue(vorb *f, float *residue_buffers[], int ch, int n, int rn, uint8 *do_not_decode)
{
int i,j,pass;
Residue *r = f->residue_config + rn;
int rtype = f->residue_types[rn];
int c = r->classbook;
int classwords = f->codebooks[c].dimensions;
int n_read = r->end - r->begin;
... | vuln | Vulnerable | C/C++ |
@Override
public Cursor loadInBackground() {
SQLiteDatabase db = dbHelper.getReadableDatabase();
Cursor cursor;
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("SELECT ").append(" * ").
append(" FR... | vuln | Vulnerable | Java |
/*
Copyright 2008-2017 LibRaw LLC (info@libraw.org)
LibRaw is free software; you can redistribute it and/or modify
it under the terms of the one of two licenses as you choose:
1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
(See file LICENSE.LGPL provided in LibRaw distribution archive for details).
2. COMMON... | vuln | Safe | C/C++ |
static struct sock *sctp_v6_create_accept_sk(struct sock *sk,
struct sctp_association *asoc,
bool kern)
{
struct sock *newsk;
struct ipv6_pinfo *newnp, *np = inet6_sk(sk);
struct sctp6_sock *newsctp6sk;
struct ipv6_txoptions *opt;
newsk = sk_alloc(sock_net(sk), PF_INET6, GFP_KERNEL, sk->sk_pro... | vuln | Vulnerable | Unknown |
vhost_user_check_and_alloc_queue_pair(struct virtio_net *dev,
struct vhu_msg_context *ctx)
{
uint32_t vring_idx;
switch (ctx->msg.request.master) {
case VHOST_USER_SET_VRING_KICK:
case VHOST_USER_SET_VRING_CALL:
case VHOST_USER_SET_VRING_ERR:
vring_idx = ctx->msg.payload.u64 & VHOST_USER_VRING_IDX_MASK;
br... | vuln | Safe | C/C++ |
def _sqlglot_lineage_inner(
sql: sqlglot.exp.ExpOrStr,
schema_resolver: SchemaResolver,
default_db: Optional[str] = None,
default_schema: Optional[str] = None,
) -> SqlParsingResult:
dialect = _get_dialect(schema_resolver.platform)
if dialect == "snowflake":
# in snowflake, table identif... | vuln | Safe | Python |
private void fillPermissionList()
{
actionsList.setDataProvider(new ScrollingList.DataProvider()
{
@Override
public int getElementCount()
{
return actions.size();
}
@Override
public void updateElement(final int ... | vuln | Safe | Java |
void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a)
{
BN_ULONG t[8];
bn_sqr_normal(r,a,4,t);
} | vuln | Vulnerable | Unknown |
static void assert_file_overwrite(const char *filename)
{
if (file_overwrite && no_file_overwrite) {
fprintf(stderr, "Error, both -y and -n supplied. Exiting.\n");
exit_program(1);
}
if (!file_overwrite &&
(strchr(filename, ':') == NULL || filename[1] == ':' ||
av_strstart(f... | vuln | Vulnerable | C/C++ |
void FTPs_CtrlTask (void *p_arg)
{
FTPs_SESSION_STRUCT ftp_session;
NET_SOCK_ID *p_sock_id;
CPU_INT32U net_buf_len;
CPU_CHAR *p_net_buf;
CPU_CHAR *p_net_buf2;
CPU_CHAR *p_cmd;
NET_ERR net_err;
CPU_INT32S ... | vuln | Safe | C/C++ |
static void gd_update_geometry_hints(VirtualConsole *vc)
{
GtkDisplayState *s = vc->s;
GdkWindowHints mask = 0;
GdkGeometry geo = {};
GtkWidget *geo_widget = NULL;
GtkWindow *geo_window;
if (vc->type == GD_VC_GFX) {
if (!vc->gfx.ds) {
return;
}
if (s->free_sca... | vuln | Vulnerable | C/C++ |
int cp_cmlhs_sig(g1_t sig, g2_t z, g1_t a, g1_t c, g1_t r, g2_t s,
const bn_t msg, const char *data, int label, const bn_t x, const g1_t h,
const uint8_t prf[], size_t plen, const bn_t d, const bn_t sk,
int bls) {
bn_t k, m, n;
g1_t t;
uint8_t mac[RLC_MD_LEN];
int len, dlen = strlen(data), result = RLC_OK;
u... | vuln | Vulnerable | C/C++ |
int main(int argc, char *argv[])
{
int opt;
char *line;
progname = basename(argv[0]);
#if POSIXLY_CORRECT
cmd_line_options = POSIXLY_CMD_LINE_OPTIONS;
#else
if (getenv(POSIXLY_CORRECT_STR))
posixly_correct = 1;
if (!posixly_correct)
cmd_line_options = CMD_LINE_OPTIONS;
else
cmd_line_options = POSIXLY_CMD... | vuln | Safe | Unknown |
QInt *qobject_to_qint(const QObject *obj)
{
if (qobject_type(obj) != QTYPE_QINT)
return NULL;
return container_of(obj, QInt, base);
} | vuln | Vulnerable | C/C++ |
static inline void phar_set_inode(phar_entry_info *entry TSRMLS_DC) /* {{{ */
{
char tmp[MAXPATHLEN];
int tmp_len;
tmp_len = entry->filename_len + entry->phar->fname_len;
memcpy(tmp, entry->phar->fname, entry->phar->fname_len);
memcpy(tmp + entry->phar->fname_len, entry->filename, entry->filename_len);
entry->in... | vuln | Vulnerable | C/C++ |
static void sig_channel_destroyed(IRC_CHANNEL_REC *channel)
{
g_return_if_fail(channel != NULL);
if (IS_IRC_CHANNEL(channel) && !channel->server->disconnected &&
!channel->synced)
query_remove_all(channel);
} | vuln | Vulnerable | Unknown |
Map1toN(SDL_PixelFormat * src, Uint8 Rmod, Uint8 Gmod, Uint8 Bmod, Uint8 Amod,
SDL_PixelFormat * dst)
{
Uint8 *map;
int i;
int bpp;
SDL_Palette *pal = src->palette;
bpp = ((dst->BytesPerPixel == 3) ? 4 : dst->BytesPerPixel);
map = (Uint8 *) SDL_malloc(pal->ncolors * bpp);
if (map ==... | vuln | Vulnerable | C/C++ |
int main(int argc, char *argv[])
{
libettercap_init();
ef_globals_alloc();
select_text_interface();
libettercap_ui_init();
/* etterfilter copyright */
fprintf(stdout, "\n" EC_COLOR_BOLD "%s %s" EC_COLOR_END " copyright %s %s\n\n",
PROGRAM, EC_VERSION, EC_COPYRIGHT, EC_AUTHORS);
... | vuln | Vulnerable | Unknown |
static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
int addr_len)
{
struct sockaddr_in6 *usin = (struct sockaddr_in6 *)uaddr;
struct inet_connection_sock *icsk = inet_csk(sk);
struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk);
struct dccp_sock *dp = dccp_sk(sk);
stru... | vuln | Safe | Unknown |
static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
{
php_curl *ch = (php_curl *) ctx;
php_curl_write *t = ch->handlers->write;
size_t length = size * nmemb;
TSRMLS_FETCH_FROM_CTX(ch->thread_ctx);
#if PHP_CURL_DEBUG
fprintf(stderr, "curl_write() called\n");
fprintf(... | vuln | Safe | Unknown |
size_t intsetBlobLen(intset *is) {
return sizeof(intset)+intrev32ifbe(is->length)*intrev32ifbe(is->encoding);
} | vuln | Vulnerable | C/C++ |
function le(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(a(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(a(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:K(n)}} | vuln | Vulnerable | JavaScript |
static int cp2112_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
{
struct cp2112_device *dev = gpiochip_get_data(chip);
struct hid_device *hdev = dev->hdev;
u8 *buf = dev->in_out_buffer;
int ret;
mutex_lock(&dev->lock);
ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf,
CP2112_GPIO_CONF... | vuln | Vulnerable | C/C++ |
int bpf_check(struct bpf_prog **prog, union bpf_attr *attr)
{
struct bpf_verifier_env *env;
struct bpf_verifer_log *log;
int ret = -EINVAL;
/* no program is valid */
if (ARRAY_SIZE(bpf_verifier_ops) == 0)
return -EINVAL;
/* 'struct bpf_verifier_env' can be global, but since it's not small,
* allocate/free i... | vuln | Safe | Unknown |
public static double[] readDoubleArray(DataInput in)
throws IOException
{
double[] adfl;
if (in instanceof PofInputStream)
{
adfl = (double[]) ((PofInputStream) in).readObject();
}
else
{
int cdfl = in.readInt();
... | vuln | Vulnerable | Java |
public void parse(List<String> words){
int size = words.size();
if(size == 1){
command = words.get(0);
args = new LinkedList<>();
}else if(size > 1){
command = words.get(0);
args = new LinkedList<>(words.subList(1, size));
args.removeIf... | vuln | Vulnerable | Java |
ExecAlterObjectDependsStmt(AlterObjectDependsStmt *stmt, ObjectAddress *refAddress)
{
ObjectAddress address;
ObjectAddress refAddr;
Relation rel;
address =
get_object_address_rv(stmt->objectType, stmt->relation, (List *) stmt->object,
&rel, AccessExclusiveLock, false);
/*
* Verify that the user is e... | vuln | Safe | C/C++ |
void
continuous_agg_refresh_internal(const ContinuousAgg *cagg,
const InternalTimeRange *refresh_window_arg,
const CaggRefreshCallContext callctx, const bool start_isnull,
const bool end_isnull)
{
Catalog *catalog = ts_catalog_get();
int32 mat_id = cagg->data.mat_hypertable_id;
InternalTimeRa... | vuln | Vulnerable | C/C++ |
int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index)
{
struct mlx4_mac_table *table = &mlx4_priv(dev)->port[port].mac_table;
int i, err = 0;
int free = -1;
mlx4_dbg(dev, "Registering MAC: 0x%llx\n", (unsigned long long) mac);
mutex_lock(&table->mutex);
for (i = 0; i < MLX4_MAX_MAC_NUM - 1; i... | vuln | Vulnerable | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Safe | C/C++ |
@VisibleForTesting
@ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
public void updateFooter() {
boolean showDismissView = mClearAllEnabled && hasActiveClearableNotifications(ROWS_ALL);
boolean showFooterView = (showDismissView ||
mEntryManager.getNotificationData().getActiveNoti... | vuln | Vulnerable | Java |
void *av_tree_insert(AVTreeNode **tp, void *key, int (*cmp)(void *key, const void *b), AVTreeNode **next){
AVTreeNode *t= *tp;
if(t){
unsigned int v= cmp(t->elem, key);
void *ret;
if(!v){
if(*next)
return t->elem;
else if(t->child[0]||t->child[1]){... | vuln | Vulnerable | C/C++ |
def authenticate(api_handle, username: str, password: str) -> bool:
"""
Validate PAM authentication, returning whether the authentication was successful or not.
:param api_handle: Used for resolving the the pam service name and getting the Logger.
:param username: The username to log in with.
:para... | vuln | Safe | Python |
static ssize_t state_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct memory_block *mem = to_memory_block(dev);
ssize_t len = 0;
/*
* We can probably put these states in a nice little array
* so that they're not open-coded
*/
switch (mem->state) {
case MEM_ONLINE:
len = sys... | vuln | Safe | Unknown |
function &getAll(&$dbh, $proposalId)
{
$sql = "SELECT *, UNIX_TIMESTAMP(timestamp) AS timestamp FROM package_proposal_votes WHERE pkg_prop_id = ". $dbh->quoteSmart($proposalId) ." ORDER BY timestamp ASC";
$res = $dbh->query($sql);
if (DB::isError($res)) {
return $res;
}
... | vuln | Vulnerable | PHP |
async def __send_notice(
self, guild: discord.guild, user: Union[discord.Member, discord.User], event: str, *, message_format=None
) -> Optional[discord.Message]:
"""Sends the notice for the event."""
format_str = message_format or await self.__get_random_message_format(guild, event)
... | vuln | Safe | Python |
ssize_t nbd_wr_sync(int fd, void *buffer, size_t size, bool do_read)
{
size_t offset = 0;
int err;
if (qemu_in_coroutine()) {
if (do_read) {
return qemu_co_recv(fd, buffer, size);
} else {
return qemu_co_send(fd, buffer, size);
}
}
while (offset < size... | vuln | Vulnerable | C/C++ |
$(document).ready(function(){
'use strict';
function addKey(ev) {
var kid, key, csrf;
var $row = $(ev.target).parents('tr');
kid = $row.find('input[name="kid"]').val();
key = $row.find('input[name="key"]').val();
csrf = $('#keys').data('csrf');
console.log('add ke... | vuln | Vulnerable | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.