code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
// SPDX-License-Identifier: GPL-2.0-only
/*
* Xen event channels
*
* Xen models interrupts with abstract event channels. Because each
* domain gets 1024 event channels, but NR_IRQ is not that large, we
* must dynamically map irqs<->event channels. The event channels
* interface with the rest of the kernel by de... | vuln | Vulnerable | C/C++ |
int vt_ioctl(struct tty_struct *tty,
unsigned int cmd, unsigned long arg)
{
struct vc_data *vc = tty->driver_data;
struct console_font_op op; /* used in multiple places here */
unsigned int console;
unsigned char ucval;
unsigned int uival;
void __user *up = (void __user *)arg;
int i, perm;
int ret = 0;
... | vuln | Safe | C/C++ |
IHEVCD_ERROR_T ihevcd_parse_sps(codec_t *ps_codec)
{
IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
WORD32 value;
WORD32 i;
WORD32 vps_id;
WORD32 sps_max_sub_layers;
WORD32 sps_id;
WORD32 sps_temporal_id_nesting_flag;
sps_t *ps_sps;
profile_tier_lvl_info_t s_ptl;
bitstrm_t *ps_bits... | vuln | Safe | Unknown |
static void bdrv_qed_drain(BlockDriverState *bs)
{
BDRVQEDState *s = bs->opaque;
qed_cancel_need_check_timer(s);
qed_plug_allocating_write_reqs(s);
bdrv_aio_flush(s->bs, qed_clear_need_check, s);
} | vuln | Vulnerable | C/C++ |
static void idreg_init(target_phys_addr_t addr)
{
DeviceState *dev;
SysBusDevice *s;
dev = qdev_create(NULL, "macio_idreg");
qdev_init(dev);
s = sysbus_from_qdev(dev);
sysbus_mmio_map(s, 0, addr);
cpu_physical_memory_write_rom(addr, idreg_data, sizeof(idreg_data));
} | vuln | Vulnerable | C/C++ |
public static long[] readSerializedIDs(String idsStr) {
String[] ids = idsStr.split(";");
long[] result = new long[ids.length];
for (int i = 0; i < ids.length ; i++) {
result[i] = Long.parseLong(ids[i]);
}
return result;
} | vuln | Vulnerable | Java |
@Override
public TweakData[] getTweaks(ItemStack itemStack) {
if (itemStack.hasTag()) {
String variant = itemStack.getTag().getString(this.variantTagKey);
String[] improvementKeys = Arrays.stream(getImprovements(itemStack))
.map(improvement -> improvement.key)
... | vuln | Safe | Java |
void PrintingMessageFilter::OnUpdatePrintSettingsReply(
scoped_refptr<printing::PrinterQuery> printer_query,
IPC::Message* reply_msg) {
PrintMsg_PrintPages_Params params;
if (!printer_query.get() ||
printer_query->last_status() != printing::PrintingContext::OK) {
params.Reset();
} else {
... | vuln | Safe | C/C++ |
static void queue_delete(struct snd_seq_queue *q)
{
/* stop and release the timer */
snd_seq_timer_stop(q->timer);
snd_seq_timer_close(q);
/* wait until access free */
snd_use_lock_sync(&q->use_lock);
/* release resources... */
snd_seq_prioq_delete(&q->tickq);
snd_seq_prioq_delete(&q->timeq);
snd_seq_ti... | vuln | Vulnerable | C/C++ |
int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work)
codetype type;
unsigned short FAR *lens;
unsigned codes;
code FAR * FAR *table;
unsigned FAR *bits;
unsigned short FAR *work;
{
unsigned len; /* a code's length in bits */
unsigned sym; /* index of code symbols */
... | vuln | Vulnerable | C/C++ |
ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
struct fru_info fru;
uint8_t *spd_data, msg_data[4];
int len, offset;
msg_data[0] = id;
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_STORAGE;
req.msg.cmd = GET_FRU_INFO;
req.msg.data = msg_data;
... | vuln | Vulnerable | C/C++ |
bool Decoder::canSplitFunctionOn(
utils::Address addr,
llvm::BasicBlock* splitBb,
std::set<llvm::BasicBlock*>& newFncStarts)
{
newFncStarts.insert(splitBb);
auto* f = splitBb->getParent();
auto fAddr = getFunctionAddress(f);
auto fSzIt = _fnc2sz.find(f);
if (fSzIt != _fnc2sz.end())
{
if (fAddr <= addr &... | vuln | Safe | Unknown |
php_http_url_t *php_http_url_parse(const char *str, size_t len, unsigned flags TSRMLS_DC)
{
size_t maxlen = 3 * len + 8 /* null bytes for all components */;
struct parse_state *state = ecalloc(1, sizeof(*state) + maxlen);
state->end = str + len;
state->ptr = str;
state->flags = flags;
state->maxlen = maxlen;... | vuln | Safe | C/C++ |
/* libcomps - C alternative to yum.comps library
* Copyright (C) 2013 Jindrich Luza
*
* 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
* any later versio... | vuln | Vulnerable | C/C++ |
ssize_t AsyncConnection::_process_connection()
{
ssize_t r = 0;
switch(state) {
case STATE_WAIT_SEND:
{
std::lock_guard<std::mutex> l(write_lock);
if (!outcoming_bl.length()) {
assert(state_after_send);
state = state_after_send;
state_after_send = STATE_NONE;... | vuln | Safe | Unknown |
static void test_json_append_escaped_data(void)
{
static const unsigned char test_input[] =
"\b\f\r\n\t\"\\\000\001\002-\xC3\xA4\xf0\x90\x90\xb7";
string_t *str = t_str_new(32);
test_begin("json_append_escaped()");
json_append_escaped_data(str, test_input, sizeof(test_input)-1);
test_assert(strcmp(str_c(str), "... | vuln | Vulnerable | Unknown |
@Override
public void setPreviewSize(int width, int height) {
if( MyDebug.LOG )
Log.d(TAG, "setPreviewSize: " + width + " , " + height);
preview_width = width;
preview_height = height;
if( previewImageReader != null ) {
previewBuilder.removeTarget(previewImage... | vuln | Safe | Java |
@NonNull
public static String ascii(String string) {
return string.replaceAll("[\\x00-\\x1F\\x2F\\x7F]", "");
} | vuln | Vulnerable | Java |
static int rndis_query_response(USBNetState *s,
rndis_query_msg_type *buf, unsigned int length)
{
rndis_query_cmplt_type *resp;
uint8_t infobuf[sizeof(oid_supported_list)];
uint32_t bufoffs, buflen;
int infobuflen;
unsigned int resplen;
bufoffs = le32_to_cpu(buf->Information... | vuln | Vulnerable | C/C++ |
archive_read_format_lha_read_header(struct archive_read *a,
struct archive_entry *entry)
{
struct archive_string linkname;
struct archive_string pathname;
struct lha *lha;
const unsigned char *p;
const char *signature;
int err;
lha_crc16_init();
a->archive.archive_format = ARCHIVE_FORMAT_LHA;
if (a->arc... | vuln | Safe | Unknown |
private void hidePreferenceSettingComponents() {
// Intro
mTopIntroPreference.setVisible(false);
// Setting of magnification type
mSettingsPreference.setVisible(false);
// Setting of following typing
mFollowingTypingSwitchPreference.setVisible(false);
} | vuln | Vulnerable | Java |
bool virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *blk,
VirtIOBlockDataPlane **dataplane)
{
VirtIOBlockDataPlane *s;
int fd;
*dataplane = NULL;
if (!blk->data_plane) {
return true;
if (blk->scsi) {
error_report("device is incompatib... | vuln | Vulnerable | C/C++ |
long long EBMLHeader::Parse(IMkvReader* pReader, long long& pos) {
assert(pReader);
long long total, available;
long status = pReader->Length(&total, &available);
if (status < 0) // error
return status;
pos = 0;
long long end = (available >= 1024) ? 1024 : available;
for (;;) {
unsigned char b = 0;
... | vuln | Vulnerable | C/C++ |
__rta_reserve(struct sk_buff *skb, int attrtype, int attrlen)
{
struct rtattr *rta;
int size = RTA_LENGTH(attrlen);
rta = (struct rtattr*)skb_put(skb, RTA_ALIGN(size));
rta->rta_type = attrtype;
rta->rta_len = size;
memset(RTA_DATA(rta) + attrlen, 0, RTA_ALIGN(size) - size);
return rta;
} | vuln | Safe | Unknown |
private Entity getHeadLookTarget() {
Entity pointedEntity = null;
double range = 30.0D;
double offset = 3.0D;
Vec3 srcVec = new Vec3(this.entityHost.getX(), this.entityHost.getY() + 0.25, this.entityHost.getZ());
Vec3 lookVec = this.entityHost.getViewVector(1.0F);
Vec3 destVec = srcVec.add(lookVec.x * range... | vuln | Vulnerable | Java |
_XimOpen(
Xim im)
{
CARD32 buf32[BUFSIZE/4];
CARD8 *buf = (CARD8 *)buf32;
CARD8 *buf_b = &buf[XIM_HEADER_SIZE];
CARD16 *buf_s;
INT16 len;
CARD32 reply32[BUFSIZE/4];
char *reply = (char *)reply32;
XPointer preply;
int buf_size;
int ret_code;
char *loc... | vuln | Vulnerable | Unknown |
static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
Image
*chroma_image,
*image,
*resize_image;
InterlaceType
interlace;
MagickBooleanType
status;
register const Quantum
*chroma_pixels;
register ssize_t
x;
register Quantum
*q;
register u... | vuln | Safe | C/C++ |
paint_mouse_pointer(XImage *image, struct x11_grab *s)
{
int x_off = s->x_off;
int y_off = s->y_off;
int width = s->width;
int height = s->height;
Display *dpy = s->dpy;
XFixesCursorImage *xcim;
int x, y;
int line, column;
int to_line, to_column;
int pixstride = image->bits_per_p... | vuln | Safe | C/C++ |
import datetime
from pathlib import Path
from vantage6.common.globals import APPNAME
#
# INSTALLATION SETTINGS
#
PACKAGE_FOLDER = Path(__file__).parent.parent.parent
DATA_FOLDER = PACKAGE_FOLDER / APPNAME / "server" / "_data"
#
# RUNTIME SETTINGS
#
# Expiretime of JWT tokens
JWT_ACCESS_TOKEN_EXPIRES = datetim... | vuln | Vulnerable | Python |
private List<String> getFromClient(String clientId, Jwt jwt) {
JSONObject resourceAccess = jwt.getClaim("resource_access");
if (resourceAccess.get(clientId) != null) {
return getRoles((JSONObject) resourceAccess.get(clientId));
} else {
return Collections.emptyList();
... | vuln | Vulnerable | Java |
protected void doLoadDeck() {
Command c = loadDeck();
if (!c.isNull() && Map.isChangeReportingEnabled()) {
c = c.append(reportCommand(loadReport, Resources.getString(Resources.LOAD)));
}
gameModule.sendAndLog(c);
repaintMap();
} | vuln | Vulnerable | Java |
static krb5_error_code
get_matching_data(krb5_context context,
pkinit_plg_crypto_context plg_cryptoctx,
pkinit_req_crypto_context req_cryptoctx, X509 *cert,
pkinit_cert_matching_data **md_out)
{
krb5_error_code ret = ENOMEM;
pkinit_cert_matching_data *md = N... | vuln | Vulnerable | C/C++ |
int64_t address_space_cache_init(MemoryRegionCache *cache,
AddressSpace *as,
hwaddr addr,
hwaddr len,
bool is_write)
{
AddressSpaceDispatch *d;
hwaddr l;
MemoryRegion *mr;
... | vuln | Safe | Unknown |
private void internalCreateSubscriptionForNonPartitionedTopic(
AsyncResponse asyncResponse, String subscriptionName,
MessageIdImpl targetMessageId, boolean authoritative, boolean replicated,
Map<String, String> properties) {
boolean isAllowAutoTopicCreation = pulsar().getBro... | vuln | Safe | Java |
def _try_init_vertexai(cls, values: Dict) -> None:
allowed_params = ["project", "location", "credentials"]
params = {k: v for k, v in values.items() if v in allowed_params}
init_vertexai(**params)
return None | vuln | Vulnerable | Python |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "hermes/VM/Operations.h"
#include "hermes/Support/Conversions.h"
#include "hermes/Support/OSCompat.h"
#include "hermes/... | vuln | Vulnerable | C/C++ |
static int huff_build(VLC *vlc, uint8_t *len)
{
HuffEntry he[256];
uint32_t codes[256];
uint8_t bits[256];
uint8_t syms[256];
uint32_t code;
int i;
for (i = 0; i < 256; i++) {
he[i].sym = 255 - i;
he[i].len = len[i];
if (len[i] == 0)
return AVERROR_INVALID... | vuln | Vulnerable | C/C++ |
public void uploadAndView(String pdkHash, UserDetail user, PdkFileTypeEnum type, HttpServletResponse response) {
Criteria criteria = Criteria.where("pdkHash").is(pdkHash);
Query query = new Query(criteria);
switch (type) {
case JAR:
query.fields().include("jarRid");
... | vuln | Vulnerable | Java |
/*
* chsh.c -- change your login shell
* (c) 1994 by salvatore valente <svalente@athena.mit.edu>
* (c) 2012 by Cody Maloney <cmaloney@theoreticalchaos.com>
*
* this program is free software. you can redistribute it and
* modify it under the terms of the gnu general public license.
* there is no warr... | vuln | Vulnerable | C/C++ |
static void render_fragments(Vp3DecodeContext *s,
int first_fragment,
int width,
int height,
int plane )
{
int x, y;
int m, n;
int i = first_fragment;
int16_t *dequantizer;
DCTELEM __... | vuln | Safe | C/C++ |
static int
_Unpickler_MemoPut(UnpicklerObject *self, size_t idx, PyObject *value)
{
PyObject *old_item;
if (idx >= self->memo_size) {
if (_Unpickler_ResizeMemoList(self, idx * 2) < 0)
return -1;
assert(idx < self->memo_size);
}
Py_INCREF(value);
old_item = self->memo[idx... | vuln | Safe | C/C++ |
void DeviceTokenFetcher::SetState(FetcherState state) {
state_ = state;
if (state_ != STATE_TEMPORARY_ERROR)
effective_token_fetch_error_delay_ms_ = kTokenFetchErrorDelayMilliseconds;
base::Time delayed_work_at;
switch (state_) {
case STATE_INACTIVE:
notifier_->Inform(CloudPolicySubsystem::... | vuln | Vulnerable | C/C++ |
brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_ap_settings *settings)
{
s32 ie_offset;
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
struct brcmf_if *ifp = netdev_priv(ndev);
const struct brcmf_tlv *ssid_ie;
const struct brcmf_tlv *country_ie;
struct brcmf_ssid_l... | vuln | Vulnerable | C/C++ |
static int avi_sync(AVFormatContext *s, int exit_early)
{
AVIContext *avi = s->priv_data;
AVIOContext *pb = s->pb;
int n;
unsigned int d[8];
unsigned int size;
int64_t i, sync;
start_sync:
memset(d, -1, sizeof(d));
for(i=sync=avio_tell(pb); !url_feof(pb); i++) {
int j;
fo... | vuln | Vulnerable | C/C++ |
ga_concat_shorten_esc(garray_T *gap, char_u *str)
{
char_u *p;
char_u *s;
int c;
int clen;
char_u buf[NUMBUFLEN];
int same_len;
if (str == NULL)
{
ga_concat(gap, (char_u *)"NULL");
return;
}
for (p = str; *p != NUL; ++p)
{
same_len = 1;
s = p;
c = mb_cpt... | vuln | Safe | C/C++ |
static void decode_block_params(DiracContext *s, DiracArith arith[8], DiracBlock *block,
int stride, int x, int y)
{
int i;
block->ref = pred_block_mode(block, stride, x, y, DIRAC_REF_MASK_REF1);
block->ref ^= dirac_get_arith_bit(arith, CTX_PMODE_REF1);
if (s->num_refs =... | vuln | Vulnerable | C/C++ |
private StarSystem findBestGatherpoint(ShipFleet fleet)
{
Galaxy gal = galaxy();
StarSystem best = null;
float bestScore = 0.0f;
List<StarSystem> mySystemsInShipRange = empire.systemsInShipRange(empire);
List<StarSystem> otherSystemsInShipRange = new ArrayList<>();
fo... | vuln | Vulnerable | Java |
/* mqtt_client.c
*
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfMQTT.
*
* wolfMQTT 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... | vuln | Vulnerable | C/C++ |
snd_seq_oss_synth_make_info(struct seq_oss_devinfo *dp, int dev, struct synth_info *inf)
{
struct seq_oss_synth *rec;
if (dev < 0 || dev >= dp->max_synthdev)
return -ENXIO;
if (dp->synths[dev].is_midi) {
struct midi_info minf;
snd_seq_oss_midi_make_info(dp, dp->synths[dev].midi_mapped, &minf);
inf->synth_t... | vuln | Safe | Unknown |
static void
virtio_ipu_deinit(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
{
struct virtio_ipu *ipu;
ipu = (struct virtio_ipu *)dev->arg;
if (!ipu) {
IPRINTF(LDBG, "is NULL!\n");
return;
}
if (ipu->vbs_k.ipu_kstatus == VIRTIO_DEV_STARTED) {
IPRINTF(LDBG, "deinitializing\n");
virtio_ipu_k_stop(ip... | vuln | Vulnerable | C/C++ |
public static void onRenderTooltip(MatrixStack matrixStack, List<? extends OrderedText> tooltip, int toolTipX, int toolTipY, int toolTipW, int toolTipH)
{
// When matrixStack or tooltip is null an unknown exception occurs.
if (matrixStack == null || tooltip == null)
{
return;
}
MinecraftClient mc = Minec... | vuln | Vulnerable | Java |
static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size)
{
VP56RangeCoder *c = &s->c;
int part1_size, hscale, vscale, i, j, ret;
int width = s->avctx->width;
int height = s->avctx->height;
s->profile = (buf[0]>>1) & 7;
if (s->profile > 1) {
avpriv_request_s... | vuln | Safe | C/C++ |
@RequestMapping(value = "/api/auth/{username}/{password}", method = RequestMethod.GET)
public ResponseEntity<String> setAuthentication(@PathVariable("username") String username, @PathVariable("password") String password, HttpServletRequest request) {
LOG.info("/api/auth/{username}/{password} username:" + username);
... | vuln | Vulnerable | Java |
static av_always_inline int rv40_loop_filter_strength(uint8_t *src,
int step, ptrdiff_t stride,
int beta, int beta2,
int edge,
... | vuln | Safe | C/C++ |
private void pack() {
final byte[] keyBytes = getKey().getBytes();
final byte[] generatorBytes = getGenerators().getBytes();
try (final UnsafeByteBufferOutput output = new UnsafeByteBufferOutput(
Integer.BYTES +
keyBytes.length +
I... | vuln | Vulnerable | Java |
public function write($sessionId, $data)
{
$maxlifetime = (int) ini_get('session.gc_maxlifetime');
try {
// We use a single MERGE SQL query when supported by the database.
$mergeStmt = $this->getMergeStatement($sessionId, $data, $maxlifetime);
if (null !== $merge... | vuln | Safe | JavaScript |
/*
* 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 file to You under the Apache License, Version 2.0
* (the "License"); you may n... | vuln | Vulnerable | Java |
static void cirrus_bitblt_cputovideo_next(CirrusVGAState * s)
{
int copy_count;
uint8_t *end_ptr;
if (s->cirrus_srccounter > 0) {
if (s->cirrus_blt_mode & CIRRUS_BLTMODE_PATTERNCOPY) {
cirrus_bitblt_common_patterncopy(s, s->cirrus_bltbuf);
the_end:
s->cirrus_srccount... | vuln | Safe | Unknown |
int expand_downwards(struct vm_area_struct *vma,
unsigned long address)
{
struct mm_struct *mm = vma->vm_mm;
int error;
address &= PAGE_MASK;
error = security_mmap_addr(address);
if (error)
return error;
/* We must make sure the anon_vma is allocated. */
if (unlikely(anon_vma_prepare(vma)))
return -... | vuln | Vulnerable | Unknown |
@Override public ItemStack[] getDefaultInventory(NBTTagCompound aNBT) {return new ItemStack[mDisplay.length];} | vuln | Safe | Java |
GF_Err cat_multiple_files(GF_ISOFile *dest, char *fileName, u32 import_flags, Double force_fps, u32 frames_per_sample, char *tmp_dir, Bool force_cat, Bool align_timelines, Bool allow_add_in_command)
{
CATEnum cat_enum;
char *sep;
cat_enum.dest = dest;
cat_enum.import_flags = import_flags;
cat_enum.force_fps = for... | vuln | Safe | C/C++ |
func CreatePayloadFromItems(items []types.MessageItem, title string, colors [types.MessageLevelCount]uint, omitted int) (WebhookPayload, error) {
metaCount := 1
if omitted < 1 && len(title) < 1 {
metaCount = 0
}
itemCount := util.Min(9, len(items))
embeds := make([]embedItem, metaCount, itemCount+metaCount)
... | vuln | Vulnerable | Go |
TPMI_ALG_SYM_Unmarshal(TPMI_ALG_SYM *target, BYTE **buffer, INT32 *size, BOOL allowNull)
{
TPM_RC rc = TPM_RC_SUCCESS;
if (rc == TPM_RC_SUCCESS) {
rc = TPM_ALG_ID_Unmarshal(target, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
switch (*target) {
#if ALG_AES
case TPM_ALG_AES:
#endif
#if ALG_SM4
... | vuln | Vulnerable | Unknown |
static int dwc3_qcom_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
struct device *dev = &pdev->dev;
struct dwc3_qcom *qcom;
struct resource *res, *parent_res = NULL;
int ret, i;
bool ignore_pipe_clk;
qcom = devm_kzalloc(&pdev->dev, sizeof(*qcom), GFP_KERNEL);
if (!qcom... | vuln | Vulnerable | C/C++ |
txString fxConcatStringC(txMachine* the, txSlot* a, txString b)
{
txSize aSize = c_strlen(a->value.string);
txSize bSize = c_strlen(b);
txSize resultSize = fxAddChunkSizes(the, fxAddChunkSizes(the, aSize, bSize), 1);
txString result = C_NULL;
if (a->kind == XS_STRING_KIND)
result = (txString)fxRenewChunk(the, a-... | vuln | Safe | C/C++ |
int context_init(SERVICE_OPTIONS *section) { /* init TLS context */
/* create TLS context */
#if OPENSSL_VERSION_NUMBER>=0x10100000L
if(section->option.client)
section->ctx=SSL_CTX_new(TLS_client_method());
else /* server mode */
section->ctx=SSL_CTX_new(TLS_server_method());
if(!SSL_CTX... | vuln | Vulnerable | Unknown |
static ssize_t phys_device_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct memory_block *mem = to_memory_block(dev);
return sprintf(buf, "%d\n", mem->phys_device);
} | vuln | Vulnerable | Unknown |
void Compute(OpKernelContext* context) override {
const Tensor& x = context->input(0);
const Tensor& y = context->input(1);
const float min_x = context->input(2).flat<float>()(0);
const float max_x = context->input(3).flat<float>()(0);
const float min_y = context->input(4).flat<float>()(0);
cons... | vuln | Safe | Unknown |
package com.salesmanager.shop.model.catalog.product.product.definition;
import com.salesmanager.shop.model.entity.Entity;
/**
* Applies to product version 2 management
* @author carlsamson
*
*/
public class ProductDefinition extends Entity {
/**
*
*/
private static final long serialVersionUID = 1L;
priva... | vuln | Vulnerable | Java |
static int parse_exports_table(long long *table_start)
{
int res;
int indexes = SQUASHFS_LOOKUP_BLOCKS(sBlk.s.inodes);
long long export_index_table[indexes];
res = read_fs_bytes(fd, sBlk.s.lookup_table_start,
SQUASHFS_LOOKUP_BLOCK_BYTES(sBlk.s.inodes), export_index_table);
if(res == FALSE) {
ERROR("parse_expo... | vuln | Vulnerable | C/C++ |
public static function updatePassword(Db $zdb, $id_adh, $pass)
{
try {
$cpass = password_hash($pass, PASSWORD_BCRYPT);
$update = $zdb->update(self::TABLE);
$update->set(
array('mdp_adh' => $cpass)
)->where([self::PK => $id_adh]);
$... | vuln | Safe | PHP |
l2tp_proto_ver_print(netdissect_options *ndo, const uint16_t *dat)
{
ND_PRINT((ndo, "%u.%u", (EXTRACT_16BITS(dat) >> 8),
(EXTRACT_16BITS(dat) & 0xff)));
} | vuln | Vulnerable | C/C++ |
static ssize_t nc_sendv_compat(NetClientState *nc, const struct iovec *iov,
int iovcnt, unsigned flags)
{
uint8_t *buf = NULL;
uint8_t *buffer;
size_t offset;
ssize_t ret;
if (iovcnt == 1) {
buffer = iov[0].iov_base;
offset = iov[0].iov_len;
} else ... | vuln | Vulnerable | C/C++ |
static int rdma_add_block(RDMAContext *rdma, const char *block_name,
void *host_addr,
ram_addr_t block_offset, uint64_t length)
{
RDMALocalBlocks *local = &rdma->local_ram_blocks;
RDMALocalBlock *block;
RDMALocalBlock *old = local->block;
local->block = ... | vuln | Safe | C/C++ |
static void ZRLE_ENCODE (int x, int y, int w, int h,
zrleOutStream* os, void* buf
EXTRA_ARGS
)
{
int ty;
for (ty = y; ty < y+h; ty += rfbZRLETileHeight) {
int tx, th = rfbZRLETileHeight;
if (th > y+h-ty) th = y+h-ty;
for (tx = x; tx < x+w; tx += rfbZRLETileWidth) ... | vuln | Safe | Unknown |
recv_password_packet(Port *port)
{
StringInfoData buf;
pq_startmsgread();
if (PG_PROTOCOL_MAJOR(port->proto) >= 3)
{
/* Expect 'p' message type */
int mtype;
mtype = pq_getbyte();
if (mtype != 'p')
{
/*
* If the client just disconnects without offering a password,
* don't make a log entry. ... | vuln | Safe | Unknown |
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code distributions
* retain the above co... | vuln | Safe | C/C++ |
/* radare - LGPL - Copyright 2020 - mrmacete */
#include <r_types.h>
#include <r_util.h>
#include <r_hash.h>
#include "coresymbolication.h"
#define R_CS_EL_OFF_SEGS 0x58
#define R_CS_EL_SIZE_SEG 0x20
#define R_CS_EL_SIZE_SECT_64 0x18
#define R_CS_EL_SIZE_SECT_32 0x10
#define R_CS_EL_SIZE_SYM 0x18
#define R_CS_EL_SIZE... | vuln | Vulnerable | C/C++ |
static void copy_peercred(struct sock *sk, struct sock *peersk)
{
const struct cred *old_cred;
struct pid *old_pid;
if (sk < peersk) {
spin_lock(&sk->sk_peer_lock);
spin_lock_nested(&peersk->sk_peer_lock, SINGLE_DEPTH_NESTING);
} else {
spin_lock(&peersk->sk_peer_lock);
spin_lock_nested(&sk->sk_peer_lock, ... | vuln | Safe | Unknown |
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2012-2019 mutschler, jkrehm, cervinko, janeczku, OzzieIsaacs, csitko
# ok11, issmirnov, idalin
#
# This program is free software: you can redistribute it and/or modif... | vuln | Safe | Python |
static void flush_packet(AVFormatContext *ctx, int stream_index,
int64_t pts, int64_t dts, int64_t scr)
{
MpegMuxContext *s = ctx->priv_data;
StreamInfo *stream = ctx->streams[stream_index]->priv_data;
uint8_t *buf_ptr;
int size, payload_size, startcode, id, len, stuffing_size,... | vuln | Vulnerable | C/C++ |
def get_value(doctype, fieldname, filters=None, as_dict=True, debug=False, parent=None):
'''Returns a value form a document
:param doctype: DocType to be queried
:param fieldname: Field to be returned (default `name`)
:param filters: dict or string for identifying the record'''
if frappe.is_table(doctype):
chec... | vuln | Vulnerable | Python |
int mbedtls_ecdsa_sign_det( mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s,
const mbedtls_mpi *d, const unsigned char *buf, size_t blen,
mbedtls_md_type_t md_alg )
{
int ret;
mbedtls_hmac_drbg_context rng_ctx;
unsigned char data[2 * MBEDTLS_ECP_MAX_BYTES];
... | vuln | Vulnerable | C/C++ |
void *hashtable_get(hashtable_t *hashtable, const char *key)
{
pair_t *pair;
size_t hash;
bucket_t *bucket;
hash = hash_str(key);
bucket = &hashtable->buckets[hash & hashmask(hashtable->order)];
pair = hashtable_find_pair(hashtable, bucket, key, hash);
if(!pair)
return NULL;
r... | vuln | Safe | Unknown |
ssize_t device_show_int(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct dev_ext_attribute *ea = to_ext_attr(attr);
return snprintf(buf, PAGE_SIZE, "%d\n", *(int *)(ea->var));
} | vuln | Vulnerable | Unknown |
static int nbd_co_send_request(BlockDriverState *bs,
NBDRequest *request,
QEMUIOVector *qiov)
{
NBDClientSession *s = nbd_get_client_session(bs);
int rc, ret, i;
qemu_co_mutex_lock(&s->send_mutex);
while (s->in_flight == MAX_NBD_REQUESTS) {
... | 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 | Safe | C/C++ |
$otherPublisherName = MAX_buildName($aOtherPublisher['publisher_id'], $aOtherPublisher['name']);
if ($aOtherPublisher['publisher_id'] != $affiliateid) {
$form .= "<option value='" . $aOtherPublisher['publisher_id'] . "'>" . htmlspecialchars($otherPublisherName) . "</option>";
}
... | vuln | Vulnerable | PHP |
function showUserAdmin (request)
{
if (request.readyState==4)
{
var jsonData = eval('('+request.responseText+')');
var result = '<form name="addUserrrr"><table width="800">';
result += '<tr><td colspan=3><h3>User list</h3></td></tr>';
for(i=0; i<jsonData.length; i++)
{
if(!(userlevel<5 && jsonData[... | vuln | Safe | JavaScript |
static int mp_pacl_removexattr(FsContext *ctx,
const char *path, const char *name)
{
int ret;
char *buffer;
buffer = rpath(ctx, path);
ret = lremovexattr(buffer, MAP_ACL_ACCESS);
if (ret == -1 && errno == ENODATA) {
errno = 0;
ret = 0;
}
... | vuln | Vulnerable | C/C++ |
package api
type Resource struct {
ID int `json:"id"`
// Standard fields
CreatorID int `json:"creatorId"`
CreatedTs int64 `json:"createdTs"`
UpdatedTs int64 `json:"updatedTs"`
// Domain specific fields
Filename string `json:"filename"`
Blob []byte `json:"-"`
Type string `json:"type"`
Size int... | vuln | Vulnerable | Go |
void PrintWebViewHelper::OnPrintPages() {
blink::WebLocalFrame* frame;
if (!GetPrintFrame(&frame))
return;
auto plugin = delegate_->GetPdfElement(frame);
Print(frame, plugin, false);
} | vuln | Vulnerable | C/C++ |
public static synchronized InitialContext getInitialContext() throws NamingException {
Logging.getLogger(GeoTools.class)
.severe(
"Please don't use GeoTools.getInitialContext(), perform lookups using GeoTools.jndiLookup(s) instead.");
return getJNDIContext();
... | vuln | Safe | Java |
/*
* Copyright (c) 2014-2015 Hisilicon Limited.
*
* 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 later version.
*/
#include <l... | vuln | Vulnerable | C/C++ |
static int con_initialise(struct XenDevice *xendev)
{
struct XenConsole *con = container_of(xendev, struct XenConsole, xendev);
int limit;
if (xenstore_read_int(con->console, "ring-ref", &con->ring_ref) == -1)
return -1;
if (xenstore_read_int(con->console, "port", &con->xendev.remote_port) == -1)
retu... | vuln | Vulnerable | C/C++ |
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache... | vuln | Vulnerable | Java |
function get_pie_chart(div, url) {
if($("#"+div).length == 0)
{
$('body').append('<div id="' + div + '" class="modal fade"><div class="modal-dialog"><div class="modal-content"></div></div></div>');
$("#"+div+" .modal-content").append('<div class="modal-header"><button type="button" class="close" data-dismi... | vuln | Vulnerable | JavaScript |
protected void loadPropertiesFromFile(File file) throws ConfigurationException {
try ( InputStream configFile = new FileInputStream(file); ) {
validateAgainstXSD(configFile);
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance("org.apache.xerces.jaxp.DocumentBuilderFac... | vuln | Safe | Java |
static int ghash_final(struct shash_desc *desc, u8 *dst)
{
struct ghash_desc_ctx *dctx = shash_desc_ctx(desc);
struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);
u8 *buf = dctx->buffer;
if (!ctx->gf128)
return -ENOKEY;
ghash_flush(ctx, dctx);
memcpy(dst, buf, GHASH_BLOCK_SIZE);
return 0;
} | vuln | Safe | C/C++ |
AP_DECLARE(int) ap_process_request_internal(request_rec *r)
{
int file_req = (r->main && r->filename);
int access_status;
core_dir_config *d;
/* Ignore embedded %2F's in path for proxy requests */
if (!r->proxyreq && r->parsed_uri.path) {
d = ap_get_core_module_config(r->per_dir_config);
... | vuln | Vulnerable | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.