code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
@Override
public String tabSeparatedToString() {
return String.join(
"\t",
type.toString(),
enclosingClass.flatName(),
"null",
variableSymbol.toString(),
"null",
uri != null ? uri.toASCIIString() : "null");
} | vuln | Safe | Java |
static void gen_lq(DisasContext *ctx)
{
int ra, rd;
TCGv EA;
bool legal_in_user_mode = (ctx->insns_flags2 & PPC2_LSQ_ISA207) != 0;
bool le_is_supported = (ctx->insns_flags2 & PPC2_LSQ_ISA207) != 0;
if (!legal_in_user_mode && is_user_mode(ctx)) {
gen_inval_exception(ctx, POWERPC_EXCP_PRI... | vuln | Safe | C/C++ |
int xbzrle_encode_buffer(uint8_t *old_buf, uint8_t *new_buf, int slen,
uint8_t *dst, int dlen)
{
uint32_t zrun_len = 0, nzrun_len = 0;
int d = 0, i = 0;
long res, xor;
uint8_t *nzrun_start = NULL;
g_assert(!(((uintptr_t)old_buf | (uintptr_t)new_buf | slen) %
s... | vuln | Vulnerable | C/C++ |
private void drawIcon(ItemStack item, int slotX, int slotY) {
if (!(item instanceof UnidentifiedItemStack unidentifiedItem)) return;
if (unidentifiedItem.getItemType().isEmpty()) return;
RenderUtils.drawTexturedRect(
new PoseStack(),
Texture.GEAR_ICONS.resource()... | vuln | Safe | Java |
m48t59_t *m48t59_init_isa(uint32_t io_base, uint16_t size, int type)
{
M48t59ISAState *d;
ISADevice *dev;
m48t59_t *s;
dev = isa_create("m48t59_isa");
qdev_prop_set_uint32(&dev->qdev, "type", type);
qdev_prop_set_uint32(&dev->qdev, "size", size);
qdev_prop_set_uint32(&dev->qdev, "io_base", i... | vuln | Safe | C/C++ |
static int decode_preamble(void *p, struct ceph_frame_desc *desc)
{
void *crcp = p + CEPH_PREAMBLE_LEN - CEPH_CRC_LEN;
u32 crc, expected_crc;
int i;
crc = crc32c(0, p, crcp - p);
expected_crc = get_unaligned_le32(crcp);
if (crc != expected_crc) {
pr_err("bad preamble crc, calculated %u, expected %u\n",
... | vuln | Safe | C/C++ |
static int check_passwd(unsigned char *passwd, size_t length)
{
struct digest *d = NULL;
unsigned char *passwd1_sum;
unsigned char *passwd2_sum;
int ret = 0;
int hash_len;
if (IS_ENABLED(CONFIG_PASSWD_CRYPTO_PBKDF2)) {
hash_len = PBKDF2_LENGTH;
} else {
d = digest_alloc(PASSWD_SUM);
if (!d) {
pr_err("N... | vuln | Safe | C/C++ |
public int recalculateCuriosSlots(PlayerEntity player)
{
ISlotHelper slotHelper = CuriosApi.getSlotHelper();
if (LivingUtil.hasFullSet(player))
{
LivingStats stats = LivingStats.fromPlayer(player);
int curiosLevel = stats != null ? stats.getLevel(LivingArmorRegistrar.UPGRADE_CURIOS_SOCKET.get().getKey())
... | vuln | Safe | Java |
MagickExport void RemoveDuplicateLayers(Image **images,
ExceptionInfo *exception)
{
register Image
*curr,
*next;
RectangleInfo
bounds;
assert((*images) != (const Image *) NULL);
assert((*images)->signature == MagickCoreSignature);
if ((*images)->debug != MagickFalse)
(void) LogMag... | vuln | Vulnerable | C/C++ |
/*
*
* * Copyright (c) 2016. David Sowerby
* *
* * 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 la... | vuln | Vulnerable | Java |
def receive_data(self, s):
save_path = prefs.get_save_path()
path = os.path.join(save_path, s.relative_path)
if path != self.current_path:
self.close_current_file()
self.current_path = path
self.current_mode = s.file_mode
self.current_type = s.fil... | vuln | Vulnerable | Python |
protected ObjectStreamClass readClassDescriptor()
throws IOException, ClassNotFoundException {
int type = read();
if (type < 0) {
throw new EOFException();
}
switch (type) {
case ThrowableObjectOutputStream.TYPE_EXCEPTION:
return Object... | vuln | Vulnerable | Java |
static void omap2_inth_write(void *opaque, target_phys_addr_t addr,
uint64_t value, unsigned size)
{
struct omap_intr_handler_s *s = (struct omap_intr_handler_s *) opaque;
int offset = addr;
int bank_no, line_no;
struct omap_intr_handler_bank_s *bank = NULL;
if ((offset ... | vuln | Safe | C/C++ |
// SPDX-License-Identifier: GPL-2.0+
/*
* inode.c -- user mode filesystem api for usb gadget controllers
*
* Copyright (C) 2003-2004 David Brownell
* Copyright (C) 2003 Agilent Technologies
*/
/* #define VERBOSE_DEBUG */
#include <linux/init.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/fs_... | vuln | Safe | C/C++ |
static CharDriverState *qemu_chr_open_msmouse(const char *id,
ChardevBackend *backend,
ChardevReturn *ret,
Error **errp)
{
ChardevCommon *common = backend->u.msmouse.data;
Mo... | vuln | Safe | C/C++ |
bool read(ReadonlyBytes buffer)
{
auto fields_size = sizeof(CentralDirectoryRecord) - (sizeof(u8*) * 3);
if (buffer.size() < sizeof(central_directory_record_signature) + fields_size)
return false;
if (memcmp(buffer.data(), central_directory_record_signature, sizeof(central_direct... | vuln | Safe | C/C++ |
int effect_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize,
void *pCmdData, uint32_t *replySize, void *pReplyData)
{
effect_context_t * context = (effect_context_t *)self;
int retsize;
int status = 0;
pthread_mutex_lock(&lock);
if (!effect_exists(context)) {
status = -ENOSYS;
goto ... | vuln | Vulnerable | C/C++ |
libspdm_return_t libspdm_receive_response(void *context, const uint32_t *session_id,
bool is_app_message,
size_t *response_size,
void **response)
{
libspdm_context_t *spdm_context;
void ... | vuln | Vulnerable | C/C++ |
BGD_DECLARE(void *) gdImagePngPtr (gdImagePtr im, int *size)
{
void *rv;
gdIOCtx *out = gdNewDynamicCtx (2048, NULL);
if (out == NULL) return NULL;
gdImagePngCtxEx (im, out, -1);
rv = gdDPExtractData (out, size);
out->gd_free (out);
return rv;
} | vuln | Vulnerable | Unknown |
void PaymentRequest::Abort() {
if (!IsInitialized()) {
log_.Error("Attempted abort without initialization");
OnConnectionTerminated();
return;
}
if (!IsThisPaymentRequestShowing()) {
log_.Error("Attempted abort without show");
OnConnectionTerminated();
return;
}
bool accepting_abort... | vuln | Safe | C/C++ |
public static synchronized void send(@NotNull String message) throws Exception {
if (!message.contains(System.lineSeparator())) {
bw.write(message + System.lineSeparator());
} else {
bw.write(message);
}
bw.flush();
AL.debug(OnlineConsoleSendConnection.cl... | vuln | Vulnerable | Java |
static XICSState *try_create_xics(const char *type, int nr_servers,
int nr_irqs, Error **errp)
{
Error *err = NULL;
DeviceState *dev;
dev = qdev_create(NULL, type);
qdev_prop_set_uint32(dev, "nr_servers", nr_servers);
qdev_prop_set_uint32(dev, "nr_irqs", nr_irqs);
... | vuln | Safe | C/C++ |
/**
* @overview Contains functionality specifically for Windows systems.
* @license MPL-2.0
* @author Eric Cornelissen <ericornelissen@gmail.com>
*/
/**
* Escape a shell argument.
*
* @param {string} arg The argument to escape.
* @returns {string} The escaped argument.
*/
function escapeShellArg(arg) {
retu... | vuln | Safe | JavaScript |
/*
* 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 | Vulnerable | Java |
static inline char *parse_ip_address_ex(const char *str, size_t str_len, int *portno, int get_err, zend_string **err)
{
char *colon;
char *host = NULL;
#ifdef HAVE_IPV6
char *p;
if (*(str) == '[' && str_len > 1) {
/* IPV6 notation to specify raw address with port (i.e. [fe80::1]:80) */
p = memchr(str + 1, ']'... | vuln | Vulnerable | C/C++ |
/*
* 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 | Safe | Java |
/*
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 |
policy_summarize(smartlist_t *policy)
{
smartlist_t *summary = policy_summary_create();
smartlist_t *accepts, *rejects;
int i, last, start_prt;
size_t accepts_len, rejects_len, shorter_len, final_size;
char *accepts_str = NULL, *rejects_str = NULL, *shorter_str, *result;
const char *prefix;
tor_assert(po... | vuln | Vulnerable | C/C++ |
#ifndef JSI_LITE_ONLY
#ifndef JSI_AMALGAMATION
#include "jsiInt.h"
#endif
#if JSI__MUSL==1 || defined(__FreeBSD__)
#define NO_QSORT_R 1
#endif
static Jsi_RC jsi_ArrayPushCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
Jsi_Obj *obj;
if (_this->vt != JSI... | vuln | Vulnerable | C/C++ |
package middleware
import (
"errors"
jwt "github.com/appleboy/gin-jwt/v2"
"github.com/gin-gonic/gin"
"github.com/px-org/PanIndex/module"
log "github.com/sirupsen/logrus"
"net/http"
"net/url"
"strings"
"time"
)
const (
LoginTimeOut = 24 * 365
identityKey = "id"
)
func JWTMiddlewar() (*jwt.GinJWTMiddleware... | vuln | Safe | Go |
function tagSpanFadeOut( postid, ame_tags ) {
jQuery("span#ame_tags" + postid).fadeOut('fast', function() {
var loading = '<img border="0" alt="" src="' + ameAjaxL10n.imgUrl + 'loader.gif" align="absbottom" /> ' + ameAjaxL10n.pleaseWait;
jQuery("span#ame_tags" + postid).fadeIn('fast', function() {
var ame_sack ... | vuln | Vulnerable | JavaScript |
def get_configs_cluster(nodes, cluster_name)
data = {
'cluster_name' => cluster_name,
}
$logger.debug 'Fetching configs from the cluster'
threads = []
node_configs = {}
nodes.each { |node|
threads << Thread.new {
code, out = send_request_with_token(
... | vuln | Vulnerable | Ruby |
package api
type Shortcut struct {
ID int `json:"id"`
// Standard fields
RowStatus RowStatus `json:"rowStatus"`
CreatorID int `json:"creatorId"`
CreatedTs int64 `json:"createdTs"`
UpdatedTs int64 `json:"updatedTs"`
// Domain specific fields
Title string `json:"title"`
Payload string `json:"p... | vuln | Vulnerable | Go |
def make_eb_config(application_name, default_region):
# Capture our current directory
UTILS_DIR = os.path.dirname(os.path.abspath(__file__))
# Create the jinja2 environment.
# Notice the use of trim_blocks, which greatly helps control whitespace.
j2_env = Environment(loader=FileSystemLoader(UTILS_DI... | vuln | Vulnerable | Python |
gx_begin_image4(gx_device * dev,
const gs_gstate * pgs, const gs_matrix * pmat,
const gs_image_common_t * pic, const gs_int_rect * prect,
const gx_drawing_color * pdcolor, const gx_clip_path * pcpath,
gs_memory_t * mem, gx_image_enum_common_t ** pinfo)
{
... | vuln | Safe | Unknown |
int
parse_endpoints(tcpr_cidrmap_t **cidrmap1, tcpr_cidrmap_t **cidrmap2, const char *optarg)
{
#define NEWMAP_LEN (INET6_ADDRSTRLEN * 2)
char *map = NULL, newmap[NEWMAP_LEN];
char *token = NULL;
char *string;
char *p;
int res = 0;
string = safe_strdup(optarg);
if (*string == '[') {
... | vuln | Safe | C/C++ |
static int qcow2_set_up_encryption(BlockDriverState *bs, const char *encryptfmt,
QemuOpts *opts, Error **errp)
{
BDRVQcow2State *s = bs->opaque;
QCryptoBlockCreateOptions *cryptoopts = NULL;
QCryptoBlock *crypto = NULL;
int ret = -EINVAL;
QDict *options, *encryptop... | vuln | Safe | C/C++ |
public static void handle(PacketUpdateTile message, Supplier<Context> context) {
Context ctx = context.get();
ctx.enqueueWork(() -> {
ClientWorld world = Minecraft.getInstance().world;
if (world != null) {
TileEntity tile = world.getTileEntity(message.pos);
if (tile instanceof IUpdateableTile) {
I... | vuln | Vulnerable | Java |
int spapr_h_cas_compose_response(sPAPRMachineState *spapr,
target_ulong addr, target_ulong size,
bool cpu_update)
{
void *fdt, *fdt_skel;
sPAPRDeviceTreeUpdateHeader hdr = { .version_id = 1 };
sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(... | vuln | Vulnerable | C/C++ |
int pcie_aer_init(PCIDevice *dev, uint16_t offset, uint16_t size,
Error **errp)
{
pcie_add_capability(dev, PCI_EXT_CAP_ID_ERR, PCI_ERR_VER,
offset, size);
dev->exp.aer_cap = offset;
if (dev->exp.aer_log.log_max > PCIE_AER_LOG_MAX_LIMIT) {
error_setg(err... | vuln | Safe | C/C++ |
@Override
protected HashFunction getHMac(final byte[] key) {
return Hashing.hmacSha1(key);
} | vuln | Vulnerable | Java |
list_restrict6(
const restrict_u * res,
struct info_restrict ** ppir
)
{
RestrictStackT * rpad;
struct info_restrict * pir;
pir = *ppir;
for (rpad = NULL; res; res = res->link)
if (!pushRestriction(&rpad, res))
break;
while (pir && popRestriction(&rpad, &res)) {
pir->addr6 = res->u.v6.addr;
pir->mas... | vuln | Safe | Unknown |
function Q(){throw new Error("BigInt not supported")} | vuln | Safe | JavaScript |
private void notifyParentIfPossible () {
adapter.updateItemById(R.id.btn_openChat);
if (getArgumentsStrict().parent == null) {
return;
}
getArgumentsStrict().parent.smOnUserLinkCountChanged(adminUserId, inviteLinks.size() + inviteLinksRevoked.size());
} | vuln | Vulnerable | Java |
define([
'exports',
'../errors/RequestError',
'../errors/CancelError',
'../Deferred',
'../io-query',
'../_base/array',
'../_base/lang',
'../promise/Promise',
'../has'
], function(exports, RequestError, CancelError, Deferred, ioQuery, array, lang, Promise, has){
function isArrayBuffer(value) {
return has('n... | vuln | Vulnerable | Java |
static int qcow2_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
BDRVQcowState *s = bs->opaque;
int len, i, ret = 0;
QCowHeader header;
QemuOpts *opts;
Error *local_err = NULL;
uint64_t ext_end;
uint64_t l1_vm_state_index;
const char *opt_overl... | vuln | Vulnerable | C/C++ |
static __inline__ int scm_send(struct socket *sock, struct msghdr *msg,
struct scm_cookie *scm, bool forcecreds)
{
memset(scm, 0, sizeof(*scm));
if (forcecreds)
scm_set_cred(scm, task_tgid(current), current_cred());
unix_get_peersec_dgram(sock, scm);
if (msg->msg_controllen <= 0)
return 0;
return __s... | vuln | Safe | C/C++ |
int use_conf(char *test_path)
{
int ret;
size_t flags = 0;
char filename[1024], errstr[1024];
char *buffer;
FILE *infile, *conffile;
json_t *json;
json_error_t error;
sprintf(filename, "%s%cinput", test_path, dir_sep);
if (!(infile = fopen(filename, "rb"))) {
fprintf(stderr,... | vuln | Vulnerable | Unknown |
static ssize_t allocation_policy_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct cacheinfo *this_leaf = dev_get_drvdata(dev);
unsigned int ci_attr = this_leaf->attributes;
int n = 0;
if ((ci_attr & CACHE_READ_ALLOCATE) && (ci_attr & CACHE_WRITE_ALLOCATE))
n = sprintf(buf, "R... | vuln | Vulnerable | Unknown |
init_connection_options(MYSQL *mysql)
{
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
if (opt_use_ssl)
{
mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(mysql, MYS... | vuln | Vulnerable | Unknown |
static int decode_nal_units(H264Context *h, uint8_t *buf, int buf_size){
MpegEncContext * const s = &h->s;
AVCodecContext * const avctx= s->avctx;
int buf_index=0;
#if 0
int i;
for(i=0; i<50; i++){
av_log(NULL, AV_LOG_ERROR,"%02X ", buf[i]);
}
#endif
h->slice_num = 0;
s->current_... | vuln | Vulnerable | C/C++ |
public static function factory($type)
{
include_once './libraries/gis/GIS_Geometry.class.php';
$type_lower = strtolower($type);
if (! PMA_isValid($type_lower, PMA_Util::getGISDatatypes())
|| ! file_exists('./libraries/gis/GIS_' . ucfirst($type_lower) . '.class.php')
) {
... | vuln | Safe | PHP |
async def account_register_post(
request: Request,
U: str = Form(default=str()), # Username
E: str = Form(default=str()), # Email
H: str = Form(default=False), # Hide Email
BE: str = Form(default=None), # Backup Email
R: str = Form(default=""), # Real Name
HP: str = Form(default=None), ... | vuln | Vulnerable | Python |
struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,
const union sctp_addr *addr,
const gfp_t gfp,
const int peer_state)
{
struct sctp_transport *peer;
struct sctp_sock *sp;
unsigned short port;
sp = sctp_sk(asoc->base.sk);
/* AF_INET and AF_INET6 share common port fi... | vuln | Safe | Unknown |
private CompletableFuture<Boolean> isNamespaceOperationAllowed(NamespaceName namespaceName,
NamespaceOperation operation) {
if (!service.isAuthorizationEnabled()) {
return CompletableFuture.completedFuture(true);
}
Co... | vuln | Vulnerable | Java |
static ssize_t fuse_fill_write_pages(struct fuse_req *req,
struct address_space *mapping,
struct iov_iter *ii, loff_t pos)
{
struct fuse_conn *fc = get_fuse_conn(mapping->host);
unsigned offset = pos & (PAGE_CACHE_SIZE - 1);
size_t count = 0;
int err;
req->in.argpages = 1;
req->page_descs[0].... | vuln | Safe | C/C++ |
#include "PipeSocketHandler.hpp"
namespace et {
PipeSocketHandler::PipeSocketHandler() {}
int PipeSocketHandler::connect(const SocketEndpoint& endpoint) {
lock_guard<std::recursive_mutex> mutexGuard(globalMutex);
string pipePath = endpoint.name();
sockaddr_un remote;
int sockFd = ::socket(AF_UNIX, SOCK_STRE... | vuln | Safe | C/C++ |
static Image *ReadLABELImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
char
geometry[MaxTextExtent],
*property;
const char
*label;
DrawInfo
*draw_info;
Image
*image;
MagickBooleanType
status;
TypeMetric
metrics;
size_t
height,
width;
/*
Ini... | vuln | Vulnerable | 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 |
png_write_PLTE(png_structp png_ptr, png_colorp palette, png_uint_32 num_pal)
{
#ifdef PNG_USE_LOCAL_ARRAYS
PNG_PLTE;
#endif
png_uint_32 i;
png_colorp pal_ptr;
png_byte buf[3];
png_debug(1, "in png_write_PLTE");
if ((
#ifdef PNG_MNG_FEATURES_SUPPORTED
!(png_ptr->mng_features_permit... | vuln | Vulnerable | C/C++ |
static int xen_pt_config_reg_init(XenPCIPassthroughState *s,
XenPTRegGroup *reg_grp, XenPTRegInfo *reg)
{
XenPTReg *reg_entry;
uint32_t data = 0;
int rc = 0;
reg_entry = g_new0(XenPTReg, 1);
reg_entry->reg = reg;
if (reg->init) {
rc = reg->init(... | vuln | Vulnerable | C/C++ |
static void process_bin_complete_sasl_auth(conn *c) {
assert(settings.sasl);
const char *out = NULL;
unsigned int outlen = 0;
assert(c->item);
init_sasl_conn(c);
int nkey = c->binary_header.request.keylen;
int vlen = c->binary_header.request.bodylen - nkey;
char mech[nkey+1];
memc... | vuln | Vulnerable | Unknown |
parse_object(JsonLexContext *lex, JsonSemAction *sem)
{
/*
* an object is a possibly empty sequence of object fields, separated by
* commas and surrounded by curly braces.
*/
json_struct_action ostart = sem->object_start;
json_struct_action oend = sem->object_end;
JsonTokenType tok;
if (ostart != ... | vuln | Vulnerable | C/C++ |
def _default_logfile(exe_name):
'''
Retrieve the logfile name
'''
if salt.utils.is_windows():
logfile_tmp = tempfile.NamedTemporaryFile(dir=os.environ['TMP'],
prefix=exe_name,
suffix='.log',
... | vuln | Vulnerable | Python |
static int mode_sense_page(SCSIDiskState *s, int page, uint8_t **p_outbuf,
int page_control)
{
static const int mode_sense_valid[0x3f] = {
[MODE_PAGE_HD_GEOMETRY] = (1 << TYPE_DISK),
[MODE_PAGE_FLEXIBLE_DISK_GEOMETRY] = (1 << TYPE_DISK),
[MODE_PAGE_CACHI... | vuln | Vulnerable | C/C++ |
def self.search_by_host(key, operator, value)
conditions = sanitize_sql_for_conditions(["hosts.name #{operator} ?", value_to_sql(operator, value)])
direct = Puppetclass.joins(:hosts).where(conditions).select('puppetclasses.id').map(&:id).uniq
hostgroup = Hostgroup.joins(:hosts).where(conditions).first
... | vuln | Safe | Ruby |
sysName_handler(snmp_varbind_t *varbind, uint32_t *oid)
{
snmp_api_set_string(varbind, oid, "Contiki-NG - "CONTIKI_TARGET_STRING);
} | vuln | Vulnerable | C/C++ |
static bool matchExpression(MprJson *obj, int operator, char *value)
{
if (!(obj->type & MPR_JSON_VALUE)) {
return 0;
}
if ((value = stok(value, "'\"", NULL)) == 0) {
return 0;
}
switch (operator) {
case JSON_OP_EQ:
return smatch(obj->value, value);
case JSON_OP_NE:
... | vuln | Safe | C/C++ |
public static void addFragment(FragmentActivity fragmentActivity, Fragment fragmentToAdd, String fragmentTag) {
FragmentManager supportFragmentManager = fragmentActivity.getSupportFragmentManager();
// Fragment activeFragment = UIService.getActiveFragment(fragmentActivity);
FragmentTransaction ... | vuln | Vulnerable | Java |
AppControllerImpl::~AppControllerImpl() {
if (apps::AppServiceProxy::Get(profile_))
app_service_proxy_->AppRegistryCache().RemoveObserver(this);
} | vuln | Vulnerable | C/C++ |
package com.salesmanager.shop.admin.model.content;
public class ProductImages extends ContentFiles {
/**
*
*/
private static final long serialVersionUID = 7732719188032287938L;
private long productId;
public long getProductId() {
return productId;
}
public void setProductId(long productId) {
this.pr... | vuln | Vulnerable | Java |
static void process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eof)
{
int i;
int repeating = 0;
AVPacket avpkt;
if (ist->next_dts == AV_NOPTS_VALUE)
ist->next_dts = ist->last_dts;
if (!pkt) {
av_init_packet(&avpkt);
avpkt.data = NULL;
avpkt.si... | vuln | Safe | C/C++ |
static long __media_device_enum_links(struct media_device *mdev,
struct media_links_enum *links)
{
struct media_entity *entity;
entity = find_entity(mdev, links->entity);
if (entity == NULL)
return -EINVAL;
if (links->pads) {
unsigned int p;
for (p = 0; p < entity->num_pads; p++) {
struct m... | vuln | Vulnerable | C/C++ |
xmlXPtrNewRangeNodeObject(xmlNodePtr start, xmlXPathObjectPtr end) {
xmlXPathObjectPtr ret;
if (start == NULL)
return(NULL);
if (end == NULL)
return(NULL);
switch (end->type) {
case XPATH_POINT:
case XPATH_RANGE:
break;
case XPATH_NODESET:
/*
* Empty set ...
*/
if (end->... | vuln | Vulnerable | Unknown |
T1_Get_Private_Dict( T1_Parser parser,
PSAux_Service psaux )
{
FT_Stream stream = parser->stream;
FT_Memory memory = parser->root.memory;
FT_Error error = FT_Err_Ok;
FT_ULong size;
if ( parser->in_pfb )
{
/* in the case of the PFB format, the private... | vuln | Vulnerable | Unknown |
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.render(JavaScriptHeaderItem.forReference(new MarkdownResourceReference()));
String encodedAttachmentSupport;
if (getAttachmentSupport() != null) {
encodedAttachmentSupport = Base64.encodeBase64String(SerializationUtils... | vuln | Vulnerable | JavaScript |
// SPDX-License-Identifier: GPL-3.0-or-later
#include "../libnetdata.h"
// ----------------------------------------------------------------------------
// URL encode / decode
// code from: http://www.geekhideout.com/urlcode.shtml
/* Converts a hex character to its integer value */
char from_hex(char ch) {
return... | vuln | Safe | C/C++ |
static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs)
{
ARMCPU *cpu = s->cpu;
uint32_t val;
switch (offset) {
case 4:
return ((s->num_irq - NVIC_FIRST_IRQ) / 32) - 1;
case 0x380 ... 0x3bf:
{
int startvec = 8 * (offset - 0x380) + NVIC_FIRST_IRQ;
int... | vuln | Safe | C/C++ |
public function pageToContainedHtml(Page $page)
{
$page->html = (new PageContent($page))->render();
$pageHtml = view('pages.export', [
'page' => $page,
'format' => 'html',
'cspContent' => $this->cspService->getCspMetaTagValue(),
])->render();
... | vuln | Safe | PHP |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
// Retrieve tensors (All should be allocated by now)
const TfLiteTensor* output_shape;
TF_LITE_ENSURE_OK(
context, GetInputSafe(context, node, kOutputShapeTensor, &output_shape));
const TfLiteTensor* weights;
TF_LITE_ENSURE_OK(context,
... | vuln | Safe | Unknown |
int __ext4_journal_stop(const char *where, unsigned int line, handle_t *handle)
{
struct super_block *sb;
int err;
int rc;
if (!ext4_handle_valid(handle)) {
ext4_put_nojournal(handle);
return 0;
}
err = handle->h_err;
if (!handle->h_transaction) {
rc = jbd2_journal_stop(handle);
return err ? err : ... | vuln | Safe | C/C++ |
static int targa_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *p, int *got_packet)
{
TargaContext *s = avctx->priv_data;
int bpp, picsize, datasize = -1, ret;
uint8_t *out;
if(avctx->width > 0xffff || avctx->height > 0xffff) {
av_log(avctx, AV_LO... | vuln | Vulnerable | C/C++ |
@Override
protected LinkedHashMap<String, Quality> doInBackground(String... params) {
String vodId = params[0];
String signature = "";
String token = "";
Request request = new Request.Builder()
.url("https://gql.twitch.tv/gql")
.header("Client-ID", Se... | vuln | Safe | Java |
static ssize_t yurex_read(struct file *file, char __user *buffer, size_t count,
loff_t *ppos)
{
struct usb_yurex *dev;
int len = 0;
char in_buffer[20];
unsigned long flags;
dev = file->private_data;
mutex_lock(&dev->io_mutex);
if (!dev->interface) { /* already disconnected */
mutex_unlock(&de... | vuln | Safe | C/C++ |
void CharToWideMap(const char *Src,wchar *Dest,size_t DestSize,bool &Success)
{
// Map inconvertible characters to private use Unicode area 0xE000.
// Mark such string by placing special non-character code before
// first inconvertible character.
Success=false;
bool MarkAdded=false;
uint SrcPos=0,DestPos=0;... | vuln | Safe | C/C++ |
#include "cache.h"
#include "config.h"
#include "column.h"
#include "string-list.h"
#include "parse-options.h"
#include "run-command.h"
#include "utf8.h"
#define XY2LINEAR(d, x, y) (COL_LAYOUT((d)->colopts) == COL_COLUMN ? \
(x) * (d)->rows + (y) : \
(y) * (d)->cols + (x))
struct column_data {
const st... | vuln | Safe | C/C++ |
def self.get_tree(folder_tree, conditions, parent, admin)
if parent.instance_of?(Folder)
tree_id = parent.id.to_s
else
tree_id = parent.to_s
parent = nil
if tree_id != '0'
begin
parent = Folder.find(tree_id)
rescue
end
return folder_tree if pare... | vuln | Vulnerable | Ruby |
def get_current_user(self):
"""Tornado's authentication method
Returns:
user_model (dict): The user model, if a user is identified, None if authentication fails.
"""
if hasattr(self, '_hub_auth_user_cache'):
return self._hub_auth_user_cache
user_model = s... | vuln | Safe | Python |
static int decode_blocks(SnowContext *s){
int x, y;
int w= s->b_width;
int h= s->b_height;
int res;
for(y=0; y<h; y++){
for(x=0; x<w; x++){
if ((res = decode_q_branch(s, 0, x, y)) < 0)
return res;
}
}
return 0;
} | vuln | Vulnerable | C/C++ |
static async getInitialProps (ctx) {
const session = new Session({req: ctx.req});
let initialProps = {};
if (Component.getInitialProps) {
initialProps = Component.getInitialProps({...ctx, session});
}
const sessionData = await session.getSession();
let isLoggedIn = false;
if (session... | vuln | Vulnerable | JavaScript |
// termout.c (part of mintty)
// Copyright 2008-12 Andy Koppe, 2017-20 Thomas Wolff
// Adapted from code from PuTTY-0.60 by Simon Tatham and team.
// Licensed under the terms of the GNU General Public License v3 or later.
#include "termpriv.h"
#include "winpriv.h" // colours, win_get_font, win_change_font, win_led, w... | vuln | Vulnerable | C/C++ |
@Override
public void run() {
// init firstValidVersionId
firstValidVersionId = checkpointManager.getFirstValidWALVersionId();
if (firstValidVersionId == Long.MIN_VALUE) {
// roll wal log writer to delete current wal file
if (buffer.getCurrentWALFileSize() > 0) {
rollWALF... | vuln | Safe | Java |
static void virtio_gpu_set_scanout(VirtIOGPU *g,
struct virtio_gpu_ctrl_command *cmd)
{
struct virtio_gpu_simple_resource *res;
struct virtio_gpu_scanout *scanout;
pixman_format_code_t format;
uint32_t offset;
int bpp;
struct virtio_gpu_set_scanout ss;
VIR... | vuln | Vulnerable | C/C++ |
static size_t write_cb(void *contents, size_t size, size_t nmemb, void *data)
{
size_t realsize = 0;
connection_t *conn = NULL;
char *ptr = NULL;
conn = data;
ogs_assert(conn);
realsize = size * nmemb;
ptr = ogs_realloc(conn->memory, conn->size + realsize + 1);
if(!ptr) {
ogs_f... | vuln | Vulnerable | C/C++ |
TPMI_CAMELLIA_KEY_BITS_Unmarshal(TPMI_CAMELLIA_KEY_BITS *target, BYTE **buffer, INT32 *size)
{
TPM_RC rc = TPM_RC_SUCCESS;
TPMI_CAMELLIA_KEY_BITS orig_target = *target; // libtpms added
if (rc == TPM_RC_SUCCESS) {
rc = TPM_KEY_BITS_Unmarshal(target, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
... | vuln | Safe | Unknown |
dtls1_process_out_of_seq_message(SSL *s, struct hm_header_st* msg_hdr, int *ok)
{
int i=-1;
hm_fragment *frag = NULL;
pitem *item = NULL;
unsigned char seq64be[8];
unsigned long frag_len = msg_hdr->frag_len;
if ((msg_hdr->frag_off+frag_len) > msg_hdr->msg_len)
goto err;
/* Try to find item in queue, to preve... | vuln | Vulnerable | Unknown |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2012
* All rights reserved
*
* This file is part of GPAC / Media Tools sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser Gene... | vuln | Vulnerable | C/C++ |
SSL_SESSION *ssl_session_dup(SSL_SESSION *src, int ticket)
{
SSL_SESSION *dest;
dest = OPENSSL_malloc(sizeof(*src));
if (dest == NULL) {
goto err;
}
memcpy(dest, src, sizeof(*dest));
#ifndef OPENSSL_NO_PSK
if (src->psk_identity_hint) {
dest->psk_identity_hint = BUF_strdup(src->... | vuln | Vulnerable | Unknown |
MagickExport const char *GetMagickProperty(ImageInfo *image_info,
Image *image,const char *property,ExceptionInfo *exception)
{
char
value[MagickPathExtent];
const char
*string;
assert(property[0] != '\0');
assert(image != (Image *) NULL || image_info != (ImageInfo *) NULL );
if (property[1] == '\... | vuln | Vulnerable | C/C++ |
function updateConsent(database){
//Still need to grab emails from a sensitive data file
const emails = JSON.parse(fs.readFileSync('./tmp/consented-latest.json'))
const emailString = emails.consented.map(x => "'" + x + "'").toString();
const pool = new Pool({database});
const sql = `
INSERT INTO consented... | vuln | Safe | JavaScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.