code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
BuildIndexValueDescription(Relation indexRelation,
Datum *values, bool *isnull)
{
StringInfoData buf;
Form_pg_index idxrec;
HeapTuple ht_idx;
int natts = indexRelation->rd_rel->relnatts;
int i;
int keyno;
Oid indexrelid = RelationGetRelid(indexRelation);
Oid indrelid;
AclResult aclresult;
... | vuln | Safe | Unknown |
Graph.prototype.createTagsDialog = function(isEnabled, invert, addFn)
{
var graph = this;
var allTags = graph.hiddenTags.slice();
var div = document.createElement('div');
div.style.userSelect = 'none';
div.style.overflow = 'hidden';
div.style.padding = '10px';
div.style.height = '100%';
var tagCl... | vuln | Vulnerable | JavaScript |
static u32 __ipv6_select_ident(struct net *net,
const struct in6_addr *dst,
const struct in6_addr *src)
{
const struct {
struct in6_addr dst;
struct in6_addr src;
} __aligned(SIPHASH_ALIGNMENT) combined = {
.dst = *dst,
.src = *src,
};
u32 hash, id;
/* Note the following code is not sa... | vuln | Vulnerable | Unknown |
static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size,
AVPacket *avpkt) {
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
AVSContext *h = avctx->priv_data;
MpegEncContext *s = &h->s;
int input_size;
const uint8_t *buf_end;
c... | vuln | Safe | C/C++ |
grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
grub_off_t offset, grub_size_t size, void *buf)
{
char *tmp_buf;
unsigned real_offset;
/* First of all, check if the region is within the disk. */
if (grub_disk_adjust_range (disk, §or, &offset, size) != GRUB_ERR_NONE)
{
grub_error_pus... | vuln | Safe | C/C++ |
protected SavingsAccountTransactionData findInterestPostingTransactionFor(final LocalDate postingDate,
final SavingsAccountData savingsAccountData) {
SavingsAccountTransactionData postingTransation = null;
List<SavingsAccountTransactionData> trans = savingsAccountData.getSavingsAccountTransa... | vuln | Vulnerable | Java |
keepalived_main(int argc, char **argv)
{
bool report_stopped = true;
struct utsname uname_buf;
char *end;
/* Ensure time_now is set. We then don't have to check anywhere
* else if it is set. */
set_time_now();
/* Save command line options in case need to log them later */
save_cmd_line_options(argc, argv);
... | vuln | Vulnerable | C/C++ |
@Override
protected void configure(HttpSecurity http) throws Exception {
http.requestMatcher(getFullRequestMatcher());
http.httpBasic().authenticationEntryPoint(samlEntryPoint());
http.csrf().disable();
http
.addFilterBefore(metadataGeneratorFilter(), ChannelProcessin... | vuln | Vulnerable | Java |
processFile(file) {
// Update our input label here based on instance currentFileCount
if (this.currentFileCount === 0) {
this.inputLabel.innerHTML = this.options.text.chooseFile
} else if (this.currentFileCount === 1) {
this.inputLabel.textContent = file.name
} el... | vuln | Safe | JavaScript |
public long parseXML(Reader input) throws XMLStreamException {
Map<String, String> cache = new HashMap<>(1024*32);
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
inputFactory.setProperty("javax.xml.stream.isCoalescing", true);
inputFactory.setProperty(XMLInputFactory.IS_NA... | vuln | Safe | Java |
TfLiteStatus EvalHybridPerChannel(TfLiteContext* context, TfLiteNode* node,
TfLiteDepthwiseConvParams* params,
OpData* data, const TfLiteTensor* input,
const TfLiteTensor* filter,
cons... | vuln | Safe | Unknown |
static int nut_write_header(AVFormatContext * avf) {
NUTContext * priv = avf->priv_data;
AVIOContext * bc = avf->pb;
nut_muxer_opts_tt mopts = {
.output = {
.priv = bc,
.write = av_write,
},
.alloc = { av_malloc, av_realloc, av_free },
.write_index = 1... | vuln | Vulnerable | C/C++ |
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String modulePackageName = getIntent().getStringExtra("modulePackageName");
String moduleName = getIntent().getStringExtra("moduleName");
binding = ActivityAppListBinding.inflate... | vuln | Vulnerable | Java |
gst_aac_parse_sink_setcaps (GstBaseParse * parse, GstCaps * caps)
{
GstAacParse *aacparse;
GstStructure *structure;
gchar *caps_str;
const GValue *value;
aacparse = GST_AAC_PARSE (parse);
structure = gst_caps_get_structure (caps, 0);
caps_str = gst_caps_to_string (caps);
GST_DEBUG_OBJECT (aacparse, "s... | vuln | Vulnerable | Unknown |
/*
* Copyright (C) 2002,2003 by Andreas Gruenbacher <a.gruenbacher@computer.org>
*
* Fixes from William Schumacher incorporated on 15 March 2001.
* (Reported by Charles Bertsch, <CBertsch@microtest.com>).
*/
/*
* This file contains generic functions for manipulating
* POSIX 1003.1e draft standard 17 ACLs.
... | vuln | Safe | C/C++ |
MagickExport MemoryInfo *AcquireVirtualMemory(const size_t count,
const size_t quantum)
{
MemoryInfo
*memory_info;
size_t
extent;
if (CheckMemoryOverflow(count,quantum) != MagickFalse)
return((MemoryInfo *) NULL);
memory_info=(MemoryInfo *) MagickAssumeAligned(AcquireAlignedMemory(1,
sizeof(... | vuln | Vulnerable | C/C++ |
def __call__(self, func):
@functools.wraps(func)
def check_user_or_serial_in_request_wrapper(*args, **kwds):
user = self.request.all_data.get("user")
serial = self.request.all_data.get("serial")
if not serial and not user:
raise ParameterError(_("You n... | vuln | Vulnerable | Python |
static int xfrm_alloc_replay_state_esn(struct xfrm_replay_state_esn **replay_esn,
struct xfrm_replay_state_esn **preplay_esn,
struct nlattr *rta)
{
struct xfrm_replay_state_esn *p, *pp, *up;
if (!rta)
return 0;
up = nla_data(rta);
p = kmemdup(up, xfrm_replay_state_esn_len(up), GFP_KERNEL)... | vuln | Vulnerable | C/C++ |
protected Azure getOrCreateAzureClient() throws AzureAuthFailureException, AzureExecutionException {
try {
final MavenAuthConfiguration mavenAuthConfiguration = auth == null ? new MavenAuthConfiguration() : auth;
mavenAuthConfiguration.setType(getAuthType());
SystemPropertyU... | vuln | Vulnerable | Java |
void
ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port)
{
char *myproposal[PROPOSAL_MAX] = { KEX_CLIENT };
char *s;
struct kex *kex;
int r;
xxx_host = host;
xxx_hostaddr = hostaddr;
if ((s = kex_names_cat(options.kex_algorithms, "ext-info-c")) == NULL)
fatal("%s: kex_names_cat", __func__);
myprop... | vuln | Safe | C/C++ |
njs_function_lambda_call(njs_vm_t *vm)
{
uint32_t n;
njs_int_t ret;
njs_frame_t *frame;
njs_value_t *args, **local, *value;
njs_value_t **cur_local, **cur_closures, **cur_temp;
njs_function_t *function;
njs_declaration_t ... | vuln | Vulnerable | C/C++ |
WebGLObject::WebGLObject(WebGLRenderingContext* context)
: m_object(0)
, m_attachmentCount(0)
, m_deleted(false)
{
} | vuln | Vulnerable | Unknown |
private boolean isTargetingMineableBlock() {
if (!BetterCombatClient.config.isMiningWithWeaponsEnabled) {
return false;
}
MinecraftClient client = thisClient();
HitResult crosshairTarget = client.crosshairTarget;
if (crosshairTarget != null && crosshairTarget.getType(... | vuln | Vulnerable | Java |
pax_decode_header (struct tar_sparse_file *file)
{
if (file->stat_info->sparse_major > 0)
{
uintmax_t u;
char nbuf[UINTMAX_STRSIZE_BOUND];
union block *blk;
char *p;
size_t i;
off_t start;
#define COPY_BUF(b,buf,src) do \
{ ... | vuln | Safe | C/C++ |
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Common library for ADIS16XXX devices
*
* Copyright 2012 Analog Devices Inc.
* Author: Lars-Peter Clausen <lars@metafoo.de>
*/
#include <linux/export.h>
#include <linux/interrupt.h>
#include <linux/mutex.h>
#include <linux/kernel.h>
#include <linux/spi/spi.h>
#in... | vuln | Safe | C/C++ |
FFAMediaCodec* ff_AMediaCodec_createCodecByName(const char *name)
{
int ret = -1;
JNIEnv *env = NULL;
FFAMediaCodec *codec = NULL;
jstring codec_name = NULL;
jobject object = NULL;
codec = av_mallocz(sizeof(FFAMediaCodec));
if (!codec) {
return NULL;
}
codec->class = &amediac... | vuln | Safe | C/C++ |
static int ssl_parse_client_key_exchange( ssl_context *ssl )
{
int ret;
size_t i, n = 0;
SSL_DEBUG_MSG( 2, ( "=> parse client key exchange" ) );
if( ( ret = ssl_read_record( ssl ) ) != 0 )
{
SSL_DEBUG_RET( 1, "ssl_read_record", ret );
return( ret );
}
if( ssl->in_msgtype !... | vuln | Safe | Unknown |
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: https://www.espocrm.com
*
* EspoCRM is free software: you can redistribute i... | vuln | Vulnerable | JavaScript |
int64_t ff_lsb2full(StreamContext *stream, int64_t lsb){
int64_t mask = (1ULL<<stream->msb_pts_shift)-1;
int64_t delta= stream->last_pts - mask/2;
return ((lsb - delta)&mask) + delta;
} | vuln | Safe | C/C++ |
void do_mullwo (void)
{
int64_t res = (int64_t)T0 * (int64_t)T1;
if (likely((int32_t)res == res)) {
xer_ov = 0;
} else {
xer_ov = 1;
xer_so = 1;
}
T0 = (int32_t)res;
} | vuln | Safe | C/C++ |
def _check_signature(self, decoded_xml, item, node_name=NODE_NAME, origdoc=None, id_attr='', must=False, only_valid_cert=False, issuer=None):
try:
_issuer = item.issuer.text.strip()
except AttributeError:
_issuer = None
if _issuer is None:
try:
... | vuln | Vulnerable | Python |
@WorkerThread
@GuardedBy("blockerLocker")
public boolean resetAppOps() {
if (mIsExternalApk) return false;
if (getPackageInfoInternal() == null || mPackageName == null) return false;
try {
mAppOpsService.resetAllModes(mUserHandle, mPackageName);
mExecutor.submit(t... | vuln | Safe | Java |
static int blk_connect(struct XenDevice *xendev)
{
struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
int pers, index, qflags;
bool readonly = true;
if (blkdev->directiosafe) {
qflags = BDRV_O_NOCACHE | BDRV_O_NATIVE_AIO;
} else {
qflags = BDRV_O_CACHE_WB... | vuln | Safe | C/C++ |
static const char *skip( const char *in ) | vuln | Safe | C/C++ |
static int mpeg1_decode_picture(AVCodecContext *avctx, const uint8_t *buf,
int buf_size)
{
Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
int ref, f_code, vbv_delay;
init_get_bits(&s->gb, buf, buf_size * 8);
ref = get_bits(&s->gb, 10);
... | vuln | Safe | C/C++ |
package plugin
import (
"fmt"
"strconv"
"sync"
"github.com/docker/libnetwork/drivers/remote/api"
"github.com/docker/libnetwork/netlabel"
"github.com/docker/libnetwork/types"
"golang.org/x/sys/unix"
"github.com/vishvananda/netlink"
weaveapi "github.com/weaveworks/weave/api"
"github.com/weaveworks/weave/comm... | vuln | Vulnerable | Go |
pqParseInput3(PGconn *conn)
{
char id;
int msgLength;
int avail;
/*
* Loop to parse successive complete messages available in the buffer.
*/
for (;;)
{
/*
* Try to read a message. First get the type code and length. Return
* if not enough data.
*/
conn->inCursor = conn->inStart;
if (pqGe... | vuln | Vulnerable | Unknown |
build_version_comments(docinfo, out) {
var me = this;
docinfo.versions.forEach(function(version) {
if(!version.data) return;
var data = JSON.parse(version.data);
// comment
if(data.comment) {
out.push(me.get_version_comment(version, data.comment, data.comment_type));
return;
}
// value c... | vuln | Safe | JavaScript |
static int crypto_open(URLContext *h, const char *uri, int flags)
{
const char *nested_url;
int ret;
CryptoContext *c = h->priv_data;
if (!av_strstart(uri, "crypto+", &nested_url) &&
!av_strstart(uri, "crypto:", &nested_url)) {
av_log(h, AV_LOG_ERROR, "Unsupported url %s\n", uri);
... | vuln | Safe | C/C++ |
static INLINE int vpx_read(vpx_reader *r, int prob) {
unsigned int bit = 0;
BD_VALUE value;
BD_VALUE bigsplit;
int count;
unsigned int range;
unsigned int split = (r->range * prob + (256 - prob)) >> CHAR_BIT;
if (r->count < 0) vpx_reader_fill(r);
value = r->value;
count = r->count;
bigsplit = (BD... | vuln | Vulnerable | Unknown |
static int xen_platform_initfn(PCIDevice *dev)
{
PCIXenPlatformState *d = XEN_PLATFORM(dev);
uint8_t *pci_conf;
pci_conf = dev->config;
pci_set_word(pci_conf + PCI_COMMAND, PCI_COMMAND_IO | PCI_COMMAND_MEMORY);
pci_config_set_prog_interface(pci_conf, 0);
pci_conf[PCI_INTERRUPT_PIN] = 1;
plat... | vuln | Vulnerable | C/C++ |
static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf, size_t length, size_t displacement TSRMLS_DC)
{
unsigned exif_value_2a, offset_of_ifd;
/* set the thumbnail stuff to nothing so we can test to see if they get set up */
if (memcmp(CharBuf, "II", 2) == 0) {
ImageInfo->motorola_intel =... | vuln | Safe | Unknown |
static void adjust_frame_information(ChannelElement *cpe, int chans)
{
int i, w, w2, g, ch;
int start, maxsfb, cmaxsfb;
for (ch = 0; ch < chans; ch++) {
IndividualChannelStream *ics = &cpe->ch[ch].ics;
start = 0;
maxsfb = 0;
cpe->ch[ch].pulse.num_pulse = 0;
for (w = 0... | vuln | Vulnerable | C/C++ |
int vnc_display_open(DisplayState *ds, const char *display)
{
VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
const char *options;
int password = 0;
int reverse = 0;
int to_port = 0;
#ifdef CONFIG_VNC_TLS
int tls = 0, x509 = 0;
#endif
#ifdef CONFIG_VNC_SASL
int sasl = 0;
in... | vuln | Safe | C/C++ |
GF_EXPORT
Bool gf_sg_proto_field_is_sftime_offset(GF_Node *node, GF_FieldInfo *field)
{
u32 i;
GF_Route *r;
GF_ProtoInstance *inst;
GF_FieldInfo inf;
if (node->sgprivate->tag != TAG_ProtoNode) return 0;
if (field->fieldType != GF_SG_VRML_SFTIME) return 0;
inst = (GF_ProtoInstance *) node;
/*check in interface ... | vuln | Vulnerable | C/C++ |
string sanitize_proprietary_tags(string input_string)
{
unsigned int i;
bool strip = false;
bool tag_open = false;
int tag_open_idx = 0; //Are we within < > ?
bool closing_tag_open = false; //Are we within </ > ?
int orig_tag_open_idx = 0;
bool proprietary_tag = false; //Are we within a proprietary elemen... | vuln | Safe | C/C++ |
sparse_extract_region (struct tar_sparse_file *file, size_t i)
{
off_t write_size;
if (!lseek_or_error (file, file->stat_info->sparse_map[i].offset))
return false;
write_size = file->stat_info->sparse_map[i].numbytes;
if (write_size == 0)
{
/* Last block of the file is a hole */
if (file-... | vuln | Vulnerable | Unknown |
static int send_png_rect(VncState *vs, int x, int y, int w, int h,
VncPalette *palette)
{
png_byte color_type;
png_structp png_ptr;
png_infop info_ptr;
png_colorp png_palette = NULL;
pixman_image_t *linebuf;
int level = tight_png_conf[vs->tight->compression].png_zlib_lev... | vuln | Safe | Unknown |
XML_GetBuffer(XML_Parser parser, int len)
{
switch (ps_parsing) {
case XML_SUSPENDED:
errorCode = XML_ERROR_SUSPENDED;
return NULL;
case XML_FINISHED:
errorCode = XML_ERROR_FINISHED;
return NULL;
default: ;
}
if (len > bufferLim - bufferEnd) {
/* FIXME avoid integer overflow */
int ... | vuln | Vulnerable | C/C++ |
lasso_saml20_login_check_assertion_signature(LassoLogin *login,
LassoSaml2Assertion *assertion)
{
xmlNode *original_node = NULL;
LassoSaml2NameID *Issuer = NULL;
LassoServer *server = NULL;
LassoProfile *profile = NULL;
char *remote_provider_id = NULL;
LassoProvider *remote_provider;
int rc = 0;
lasso_bad_pa... | vuln | Safe | Unknown |
@Override
public void accept(IClientPacketHandler packetHandler, Player player) {
try {
Object data = value;
switch (mode) {
case GET: {
Field field = object.getField(key);
data = field.get(object);
break;
... | vuln | Safe | Java |
static int fprintf_utab_fs(FILE *f, struct libmnt_fs *fs)
{
char *p;
assert(fs);
assert(f);
if (!fs || !f)
return -EINVAL;
p = mangle(mnt_fs_get_source(fs));
if (p) {
fprintf(f, "SRC=%s ", p);
free(p);
}
p = mangle(mnt_fs_get_target(fs));
if (p) {
fprintf(f, "TARGET=%s ", p);
free(p);
}
p = mang... | vuln | Vulnerable | Unknown |
static av_always_inline void MPV_motion_internal(MpegEncContext *s,
uint8_t *dest_y,
uint8_t *dest_cb,
uint8_t *dest_cr,
int... | 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 |
def element():
element_url = src_url = request.args.get('url')
if element_url.startswith('gAAAAA'):
try:
cipher_suite = Fernet(g.session_key)
src_url = cipher_suite.decrypt(element_url.encode()).decode()
except (InvalidSignature, InvalidToken) as e:
return ren... | vuln | Vulnerable | Python |
int av_base64_decode(uint8_t *out, const char *in, int out_size)
{
int i, v;
uint8_t *dst = out;
v = 0;
for (i = 0; in[i] && in[i] != '='; i++) {
unsigned int index= in[i]-43;
if (index>=FF_ARRAY_ELEMS(map2) || map2[index] == 0xff)
return -1;
v = (v << 6) + map2[index... | vuln | Vulnerable | C/C++ |
@Override
public int setErrorParameter(BeforeEnterEvent event,
ErrorParameter<NotFoundException> parameter) {
if (getLogger().isDebugEnabled()) {
getLogger().debug(
parameter.hasCustomMessage() ? parameter.getCustomMessage()
: "Route is... | vuln | Safe | Java |
int diskutil_dd(const char *in, const char *out, const int bs, const long long count)
{
char *output = NULL;
if (in && out) {
LOGINFO("copying data from '%s'\n", in);
LOGINFO(" to '%s' (blocks=%lld)\n", out, count);
output = pruntf(TRUE, "%s %s if=%s of=%s bs=%d count=%lld... | vuln | Vulnerable | Unknown |
/*
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2017 The PHP Group |
+---------... | vuln | Vulnerable | C/C++ |
static int img_bench(int argc, char **argv)
{
int c, ret = 0;
const char *fmt = NULL, *filename;
bool quiet = false;
bool image_opts = false;
bool is_write = false;
int count = 75000;
int depth = 64;
int64_t offset = 0;
size_t bufsize = 4096;
int pattern = 0;
size_t step = 0;... | vuln | Vulnerable | C/C++ |
R_API size_t r_str_ansi_strip(char *str) {
size_t i = 0;
while (str[i]) {
size_t chlen = __str_ansi_length (str + i);
if (chlen > 1) {
r_str_cpy (str + i, str + i + chlen);
} else {
i++;
}
}
return i;
} | vuln | Safe | C/C++ |
int main(int argc,char** argv)
{
char *repeaterHost;
int repeaterPort, sock;
char id[250];
rfbClientPtr cl;
int i,j;
uint16_t* f;
/* Parse command-line arguments */
if (argc < 3) {
fprintf(stderr,
"Usage: %s <id> <repeater-host> [<repeater-port>]\n", argv[0]);
exit(1);
}
snprintf(id,... | vuln | Vulnerable | Unknown |
static struct sk_buff *xfrm_state_netlink(struct sk_buff *in_skb,
struct xfrm_state *x, u32 seq)
{
struct xfrm_dump_info info;
struct sk_buff *skb;
int err;
skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
if (!skb)
return ERR_PTR(-ENOMEM);
info.in_skb = in_skb;
info.out_skb = skb;
info.nlmsg_seq = s... | vuln | Safe | C/C++ |
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator p... | vuln | Vulnerable | Java |
function displayChannelQuotes() {
var tbody = $('.js-quotes-tbody');
var rows = "";
var shouldSortTable = true;
for (var i = 0; i < channelData.quotes.length; i++) {
var quote = channelData.quotes[i];
var row = '<tr>';
row += '<td class="js-quotes-editcolumn"><span class="table-edit-btn" data-toggle=... | vuln | Safe | JavaScript |
import string
import hashlib
import requests
import secrets
class passeo:
def __init__(self):
def generate(length, numbers=False, symbols=False, uppercase=False, lowercase=False, space=False, save=False):
password = ''
if numbers is True:
password += secrets.choice... | vuln | Safe | Python |
void HttpAuthFilterWhitelist::SetWhitelist(
const std::string& server_whitelist) {
// TODO(eroman): Is this necessary? The issue is that
// HttpAuthFilterWhitelist is trying to use ProxyBypassRules as a generic
// URL filter. However internally it has some implicit rules for localhost
// and linklocal addr... | vuln | Safe | C/C++ |
HeaderLookupTable_t::lookup (const char *buf, const std::size_t len) const {
const HeaderTableRecord *r = HttpHeaderHashTable::lookup(buf, len);
if (!r || r->id == Http::HdrType::OTHER)
return BadHdr;
return *r;
} | vuln | Safe | Unknown |
// 处理页面数据相关的逻辑
// 定义一个html反转义的函数
const unescapeHTML = str =>
str.replace(
/&|<|>|'|"/g,
tag =>
({
'&': '&',
'<': '<',
'>': '>',
''': "'",
'"': '"'
}[tag] || tag)
)
// 渲染来自runapi的文档
const rederPageContent = (page_cont... | vuln | Safe | JavaScript |
TPM_RC
TPM2B_Unmarshal(TPM2B *target, UINT16 targetSize, BYTE **buffer, INT32 *size)
{
TPM_RC rc = TPM_RC_SUCCESS;
if (rc == TPM_RC_SUCCESS) {
rc = UINT16_Unmarshal(&target->size, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
if (target->size > targetSize) {
rc = TPM_RC_SIZE;
}
}
if (rc ... | vuln | Vulnerable | C/C++ |
int write_output(void)
{
int fd;
struct filter_op *fop;
struct filter_header fh;
size_t ninst, i;
u_char *data;
/* conver the tree to an array of filter_op */
ninst = compile_tree(&fop);
if (fop == NULL)
return -E_NOTHANDLED;
/* create the file */
fd = open(EF_GBL_OPTIONS->ou... | vuln | Vulnerable | C/C++ |
static void do_agent_file_xfer_status(UdscsConnection *conn,
struct udscs_message_header *header,
guint8 *data)
{
gpointer task_id = GUINT_TO_POINTER(GUINT32_TO_LE(header->arg1));
const gchar *log_msg = ... | vuln | Safe | Unknown |
static bool set_sockaddr(sockaddr_storage &sa_storage, req::ptr<Socket> sock,
const String& addr, int port,
struct sockaddr *&sa_ptr, size_t &sa_size) {
// Always zero it out:
// - fields are added over time; zeroing it out is future-proofing; for
// example, so... | vuln | Safe | C/C++ |
package com.salesmanager.core.business.repositories.catalog.product.attribute;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import com.salesmanager.core.model.catalog.product.attribute.ProductOptionSet;
public interface Pr... | vuln | Vulnerable | Java |
TPM_RC
TPML_TAGGED_PCR_PROPERTY_Unmarshal(TPML_TAGGED_PCR_PROPERTY *target, BYTE **buffer, INT32 *size)
{
TPM_RC rc = TPM_RC_SUCCESS;
UINT32 i;
if (rc == TPM_RC_SUCCESS) {
rc = UINT32_Unmarshal(&target->count, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
if (target->count > MAX_PCR_PROPERTIES) {
... | vuln | Safe | C/C++ |
stringprep (char *in,
size_t maxlen,
Stringprep_profile_flags flags,
const Stringprep_profile * profile)
{
int rc;
char *utf8 = NULL;
uint32_t *ucs4 = NULL;
size_t ucs4len, maxucs4len, adducs4len = 50;
do
{
uint32_t *newp;
free (ucs4);
ucs4 = stringprep_utf8_to_ucs4 (... | vuln | Vulnerable | C/C++ |
ldns_pkt_tsig_verify_next(ldns_pkt *pkt, const uint8_t *wire, size_t wirelen, const char* key_name,
const char *key_data, const ldns_rdf *orig_mac_rdf, int tsig_timers_only)
{
ldns_rdf *fudge_rdf;
ldns_rdf *algorithm_rdf;
ldns_rdf *time_signed_rdf;
ldns_rdf *orig_id_rdf;
ldns_rdf *error_rdf;
ldns_rdf *other_data... | vuln | Safe | Unknown |
set_attribute_9(TERMTYPE2 *tp, int flag)
{
const char *value;
char *result;
value = tparm(set_attributes, 0, 0, 0, 0, 0, 0, 0, 0, flag);
if (PRESENT(value))
result = strdup(value);
else
result = 0;
return result;
} | vuln | Vulnerable | Unknown |
bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {
// Filter out most IPC messages if this renderer is swapped out.
// We still want to handle certain ACKs to keep our state consistent.
// TODO(nasko): Only check RenderViewHost state, as this object's own state
// isn't yet properly updated.... | vuln | Safe | C/C++ |
@Override
@Nullable
public String onUnfetchedAttribute(FetchGroupTracker entity, String attributeName) {
if (cannotAccessUnfetched(entity))
return "Cannot get unfetched attribute [" + attributeName + "] from object " + entity;
return wrappedFetchGroup.onUnfetchedAttribute(entity, at... | vuln | Vulnerable | Java |
function setPopoverHtmlContent($enteredElement, content) {
replaceHtmlContent($enteredElement, content);
} | vuln | Safe | JavaScript |
const got = require('@/utils/got');
const cheerio = require('cheerio');
const config = require('@/config').value;
const { allowHost } = require('./common');
module.exports = async (ctx) => {
let { type, host } = ctx.params;
type = type === 'all' ? '' : type;
host = host ? host : 'gitlab.com';
const typ... | vuln | Safe | JavaScript |
static inline int inet_getid(struct inet_peer *p, int more)
{
int old, new;
more++;
inet_peer_refcheck(p);
do {
old = atomic_read(&p->ip_id_count);
new = old + more;
if (!new)
new = 1;
} while (atomic_cmpxchg(&p->ip_id_count, old, new) != old);
return new;
} | vuln | Safe | C/C++ |
function paginationItem() {
var totalNumberOfPages = Math.ceil($('.recommenderResource', element).length/ENTRIES_PER_PAGE);
$('.paginationItem', element).remove();
$('.recommender_paginationPageNumber', element).unbind();
if (totalNumberOfPages === 1) { return; }
/* Each paginat... | vuln | Safe | JavaScript |
default boolean isItemValid(int slot, ItemStack bullet) {
if (!isSocketSlotAvailable(slot)) {
return false;
}
if (bullet.isEmpty()) {
return false;
}
ISpellAcceptor container = ISpellAcceptor.acceptor(bullet);
return this instanceof ICADData || !container.isCADOnlyContainer();
} | vuln | Vulnerable | Java |
static int dxtory_decode_v1_420(AVCodecContext *avctx, AVFrame *pic,
const uint8_t *src, int src_size)
{
int h, w;
uint8_t *Y1, *Y2, *U, *V;
int ret;
if (src_size < avctx->width * avctx->height * 3L / 2) {
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
... | vuln | Safe | C/C++ |
@Timed
@GET
@ApiOperation(
value = "Get all namespaces",
notes = "Retrieve all available namespaces.",
response = ResponseWrapper.class,
responseContainer = "List")
@ApiResponses(
value = {
@ApiResponse(code = 200, message = "OK", response = ResponseWrapper.class),
@A... | vuln | Vulnerable | Java |
public boolean canSpit() {
return this.getCatfishSize() == 2 ? this.hasSwallowedEntity() : this.catfishInventory != null && !this.catfishInventory.isEmpty();
} | vuln | Safe | Java |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Patrick Pichler <ppichler+ansible@mgit.at>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
modu... | vuln | Vulnerable | C/C++ |
MagickExport MemoryInfo *AcquireVirtualMemory(const size_t count,
const size_t quantum)
{
MemoryInfo
*memory_info;
size_t
extent;
static ssize_t
virtual_anonymous_memory = (-1);
if (HeapOverflowSanityCheck(count,quantum) != MagickFalse)
return((MemoryInfo *) NULL);
memory_info=(MemoryInfo... | vuln | Safe | Unknown |
static int nist_read_header(AVFormatContext *s)
{
char buffer[32], coding[32] = "pcm", format[32] = "01";
int bps = 0, be = 0;
int32_t header_size;
AVStream *st;
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
ff_get... | vuln | Vulnerable | C/C++ |
static inline int xrstor_state(struct xsave_struct *fx, u64 mask)
{
int err = 0;
u32 lmask = mask;
u32 hmask = mask >> 32;
/*
* Use xrstors to restore context if it is enabled. xrstors supports
* compacted format of xsave area which is not supported by xrstor.
*/
alternative_input(
"1: " XRSTOR,
"1: " X... | vuln | Vulnerable | C/C++ |
static int holtekff_init(struct hid_device *hid)
{
struct holtekff_device *holtekff;
struct hid_report *report;
struct hid_input *hidinput;
struct list_head *report_list =
&hid->report_enum[HID_OUTPUT_REPORT].report_list;
struct input_dev *dev;
int error;
if (list_empty(&hid->inputs)) {
hid_err(hid, "no in... | vuln | Safe | C/C++ |
static int img_map(int argc, char **argv)
{
int c;
OutputFormat output_format = OFORMAT_HUMAN;
BlockBackend *blk;
BlockDriverState *bs;
const char *filename, *fmt, *output;
int64_t length;
MapEntry curr = { .length = 0 }, next;
int ret = 0;
bool image_opts = false;
fmt = NULL;
... | vuln | Safe | C/C++ |
public static void affectEntityHolyWaterSplash(LivingEntity entity, EnumStrength strength, double distSq, boolean directHit, @Nullable LivingEntity source) {
if (!entity.isAlive()) return;
boolean vampire = Helper.isVampire(entity);
if (entity.canBeHitWithPotion() && (vampire || CreatureAttribut... | vuln | Vulnerable | Java |
static void urlParsePostBody(struct URL *url,
const struct HttpConnection *http,
const char *buf, int len) {
struct HashMap contentType;
initHashMap(&contentType, urlDestroyHashMapEntry, NULL);
const char *ctHeader = getFromHashMap(&http->header, "cont... | vuln | Safe | C/C++ |
static int tiocgsid(struct tty_struct *tty, struct tty_struct *real_tty, pid_t __user *p)
{
/*
* (tty == real_tty) is a cheap way of
* testing if the tty is NOT a master pty.
*/
if (tty == real_tty && current->signal->tty != real_tty)
return -ENOTTY;
if (!real_tty->session)
return -ENOTTY;
return put_user(... | vuln | Vulnerable | Unknown |
public String[] getSheetNums() {
return sheetNums;
} | vuln | Vulnerable | Java |
static void show_packets(AVFormatContext *fmt_ctx)
{
AVPacket pkt;
av_init_packet(&pkt);
probe_array_header("packets", 0);
while (!av_read_frame(fmt_ctx, &pkt))
show_packet(fmt_ctx, &pkt);
probe_array_footer("packets", 0);
} | vuln | Vulnerable | C/C++ |
def _get_flashcopy_mapping_attributes(self, fc_map_id):
LOG.debug(_('enter: _get_flashcopy_mapping_attributes: mapping %s')
% fc_map_id)
fc_ls_map_cmd = 'svcinfo lsfcmap -filtervalue id=%s -delim !' % \
fc_map_id
out, err = self._run_ssh(fc_ls_map_cmd)
if n... | vuln | Vulnerable | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.