code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static void t1_check_unusual_charstring(void)
{
char *p = strstr(t1_line_array, charstringname) + strlen(charstringname);
int i;
/* if no number follows "/CharStrings", let's read the next line */
if (sscanf(p, "%i", &i) != 1) {
/* pdftex_warn("no number found after `%s', I assume it's on the ne... | vuln | Vulnerable | C/C++ |
import graphene
import jwt
from django.conf import settings
from django.contrib.auth import password_validation
from django.core.exceptions import ValidationError
from django.db import transaction
from ....account import events as account_events
from ....account import models, notifications, search, utils
from ....acc... | vuln | Vulnerable | Python |
def _proc_pax(self, tarfile):
"""Process an extended or global header as described in
POSIX.1-2008.
"""
# Read the header information.
buf = tarfile.fileobj.read(self._block(self.size))
# A pax header stores supplemental information for either
# the following ... | vuln | Vulnerable | Python |
const commentReactionSchema = new SimpleSchema({
reactionCodepoint: {
type: String,
optional: false,
max: 9, // max length of reaction code
custom() {
if (!this.value.match(/^&#\d{4,6};$/)) { // regex for only valid reactions
return "incorrectReactionCode";
}
},
},
userIds:... | vuln | Safe | JavaScript |
/**
* Copyright (c) 2006-2017, JGraph Ltd
* Copyright (c) 2006-2017, Gaudenz Alder
*/
(function()
{
if (typeof html4 !== 'undefined')
{
/**
* Enables paste from Lucidchart
*/
html4.ATTRIBS['span::data-lucid-content'] = 0;
html4.ATTRIBS['span::data-lucid-type'] = 0;
/**
* Enables custom fonts in... | vuln | Safe | JavaScript |
@Override
public Void visitConstant(Declaration.Constant constant, Declaration parent) {
if (!constants.add(constant.name())) {
//skip
return null;
}
Class<?> clazz = getJavaType(constant.type());
if (clazz == null) {
warn("skipping " + constant.n... | vuln | Safe | Java |
FpPort *fp_port_alloc(Rocker *r, char *sw_name,
MACAddr *start_mac, unsigned int index,
NICPeers *peers)
{
FpPort *port = g_malloc0(sizeof(FpPort));
if (!port) {
return NULL;
}
port->r = r;
port->index = index;
port->pport = index + 1;
... | vuln | Vulnerable | C/C++ |
static ssize_t runtime_status_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
const char *p;
if (dev->power.runtime_error) {
p = "error\n";
} else if (dev->power.disable_depth) {
p = "unsupported\n";
} else {
switch (dev->power.runtime_status) {
case RPM_SUSPENDED:
p = "suspende... | vuln | Vulnerable | Unknown |
public static void sendMessageToClient(Component component) {
if (player() == null) {
WynntilsMod.error(
"Tried to send message to client: \"" + component.getString() + "\", but player was null.");
return;
}
player().sendMessage(component, Util.NIL_UUI... | vuln | Safe | Java |
query_io (struct query *z, iopause_fd *x, struct taia *deadline)
{
qmerge_io (z->qm, x, deadline);
} | vuln | Safe | Unknown |
public void loadSceneEnvironments()
{
// loop through all Areas, check Rects of each Area. if any
// coordinates overlap scene coordinates, add them to a list.
// then loop through all Environments, checking to see if any
// of their Areas match any of the ones in the current scene.
// if so, add them to a l... | vuln | Safe | Java |
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* th... | vuln | Vulnerable | Java |
static int em_sysenter(struct x86_emulate_ctxt *ctxt)
{
const struct x86_emulate_ops *ops = ctxt->ops;
struct desc_struct cs, ss;
u64 msr_data;
u16 cs_sel, ss_sel;
u64 efer = 0;
ops->get_msr(ctxt, MSR_EFER, &efer);
/* inject #GP if in real mode */
if (ctxt->mode == X86EMUL_MODE_REAL)
return emulate_gp(ctxt, ... | vuln | Safe | C/C++ |
long long mkvparser::ReadUInt(IMkvReader* pReader, long long pos, long& len) {
long long ReadUInt(IMkvReader* pReader, long long pos, long& len) {
if (!pReader || pos < 0)
return E_FILE_FORMAT_INVALID;
len = 1;
unsigned char b;
int status = pReader->Read(pos, 1, &b);
if (status < 0) // error or un... | vuln | Safe | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Safe | C/C++ |
user : $('<input type="text"/>'),
pass : $('<input type="password"/>')
},
opts = {
title : fm.i18n('netMountDialogTitle'),
resizable : false,
modal : true,
destroyOnClose : true,
close : function() {
delete self.dialog;
... | vuln | Vulnerable | JavaScript |
send_results(struct iperf_test *test)
{
int r = 0;
cJSON *j;
cJSON *j_streams;
struct iperf_stream *sp;
cJSON *j_stream;
int sender_has_retransmits;
iperf_size_t bytes_transferred;
int retransmits;
j = cJSON_CreateObject();
if (j == NULL) {
i_errno = IEPACKAGERESULTS;
r = -1;
... | vuln | Vulnerable | Unknown |
void put_busid_priv(struct bus_id_priv *bid)
{
spin_unlock(&bid->busid_lock);
} | vuln | Vulnerable | C/C++ |
static int64_t get_bit_rate(AVCodecContext *ctx)
{
int64_t bit_rate;
int bits_per_sample;
switch (ctx->codec_type) {
case AVMEDIA_TYPE_VIDEO:
case AVMEDIA_TYPE_DATA:
case AVMEDIA_TYPE_SUBTITLE:
case AVMEDIA_TYPE_ATTACHMENT:
bit_rate = ctx->bit_rate;
break;
case AVMEDIA_TY... | vuln | Vulnerable | C/C++ |
GF_Err adts_dmx_process(GF_Filter *filter)
{
GF_ADTSDmxCtx *ctx = gf_filter_get_udta(filter);
GF_FilterPacket *pck, *dst_pck;
u8 *data, *output;
u8 *start;
u32 pck_size, remain, prev_pck_size;
u64 cts = GF_FILTER_NO_TS;
//always reparse duration
if (!ctx->duration.num)
adts_dmx_check_dur(filter, ctx);
if (... | vuln | Vulnerable | C/C++ |
int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
uint8_t *data, size_t size)
{
AVPacketSideData *tmp;
int elems = pkt->side_data_elems;
if ((unsigned)elems + 1 > INT_MAX / sizeof(*pkt->side_data))
return AVERROR(ERANGE);
tmp = av_realloc(pkt-... | vuln | Safe | C/C++ |
rsvg_new_circle (void)
{
RsvgNodeCircle *circle;
circle = g_new (RsvgNodeCircle, 1);
_rsvg_node_init (&circle->super);
circle->super.draw = _rsvg_node_circle_draw;
circle->super.set_atts = _rsvg_node_circle_set_atts;
circle->cx = circle->cy = circle->r = _rsvg_css_parse_length ("0");
return ... | vuln | Vulnerable | Unknown |
private void handleEnsureBound() {
if (handleIsBound() || mConnecting) return;
if (mVerbose) Slog.v(mTag, "ensureBound()");
mConnecting = true;
final int flags = Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE
| Context.BIND_INCLUDE_CAPABILITIES | mBindingFla... | vuln | Safe | Java |
static js_Ast *expression(js_State *J, int notin)
{
js_Ast *a = assignment(J, notin);
SAVEREC();
while (jsP_accept(J, ',')) {
INCREC();
a = EXP2(COMMA, a, assignment(J, notin));
}
POPREC();
return a;
} | vuln | Safe | Unknown |
public String[] getOssNicknames() {
return ossNicknames;
} | vuln | Vulnerable | Java |
package captcha
import (
"context"
"fmt"
"time"
"github.com/answerdev/answer/internal/base/data"
"github.com/answerdev/answer/internal/base/reason"
"github.com/answerdev/answer/internal/service/action"
"github.com/segmentfault/pacman/errors"
"github.com/segmentfault/pacman/log"
)
// captchaRepo captcha repos... | vuln | Vulnerable | Go |
static void ExpandRotateKernelInfo(KernelInfo *kernel, const double angle)
{
KernelInfo
*clone_info,
*last;
last=kernel;
DisableMSCWarning(4127)
while (1) {
RestoreMSCWarning
clone_info=CloneKernelInfo(last);
if (clone_info == (KernelInfo *) NULL)
break;
RotateKernelInfo(clone_info,angl... | vuln | Safe | C/C++ |
module.exports = function(RED) {
var ui = require('../ui')(RED);
function ToastNode(config) {
RED.nodes.createNode(this, config);
if (config.hasOwnProperty("displayTime") && (config.displayTime.length > 0)) {
try { this.displayTime = parseFloat(config.displayTime) * 1000; }
... | vuln | Safe | JavaScript |
package graph
import (
"context"
"fmt"
v0 "github.com/authzed/authzed-go/proto/authzed/api/v0"
v1_proto "github.com/authzed/authzed-go/proto/authzed/api/v1"
"github.com/rs/zerolog/log"
"github.com/shopspring/decimal"
"github.com/authzed/spicedb/internal/datastore"
"github.com/authzed/spicedb/internal/datasto... | vuln | Vulnerable | Go |
static int coroutine_fn bdrv_aligned_pwritev(BdrvChild *child,
BdrvTrackedRequest *req, int64_t offset, unsigned int bytes,
int64_t align, QEMUIOVector *qiov, int flags)
{
BlockDriverState *bs = child->bs;
BlockDriver *drv = bs->drv;
bool waited;
int ret;
int64_t end_sector = DIV_ROUND_UP(of... | vuln | Safe | C/C++ |
av_cold void ff_snow_common_end(SnowContext *s)
{
int plane_index, level, orientation, i;
av_freep(&s->spatial_dwt_buffer);
av_freep(&s->temp_dwt_buffer);
av_freep(&s->spatial_idwt_buffer);
av_freep(&s->temp_idwt_buffer);
av_freep(&s->run_buffer);
s->m.me.temp= NULL;
av_freep(&s->m.me.sc... | vuln | Safe | C/C++ |
void CNB::SetupLSO(virtio_net_hdr_basic *VirtioHeader, PVOID IpHeader, ULONG EthPayloadLength) const
{
PopulateIPLength(reinterpret_cast<IPv4Header*>(IpHeader), static_cast<USHORT>(EthPayloadLength));
tTcpIpPacketParsingResult packetReview;
packetReview = ParaNdis_CheckSumVerifyFlat(reinterpret_cast<IPv4He... | vuln | Safe | Unknown |
require ('hazardous') // makes this module work when it's unpacked from the app.asar package when the app is packed with electron-build
// it overloads path.join to change asar.app to asar.app.unpacked
const path = require('path')
const { exec, execSync } = require('child_process')
const JSON5 = require('json5')
// T... | vuln | Vulnerable | JavaScript |
func ParseMPLSLabelStack(buf string) (*MPLSLabelStack, error) {
elems := strings.Split(buf, "/")
labels := make([]uint32, 0, len(elems))
if len(elems) == 0 {
goto ERR
}
for _, elem := range elems {
i, err := strconv.Atoi(elem)
if err != nil {
goto ERR
}
if i < 0 || i > ((1<<20)-1) {
goto ERR
}
... | vuln | Vulnerable | Go |
// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "shell/browser/api/electron_api_web_contents.h"
#include <limits>
#include <memory>
#include <set>
#include <string>
#include <unordered_set>
#include <utility>
#include <vec... | vuln | Vulnerable | JavaScript |
static av_always_inline int mvd_decode(HEVCContext *s)
{
int ret = 2;
int k = 1;
while (k < CABAC_MAX_BIN && get_cabac_bypass(&s->HEVClc->cc)) {
ret += 1U << k;
k++;
}
if (k == CABAC_MAX_BIN) {
av_log(s->avctx, AV_LOG_ERROR, "CABAC_MAX_BIN : %d\n", k);
return 0;
}... | vuln | Safe | C/C++ |
private JsonObject getServerData() {
// Minecraft specific data
int playerAmount = ServerLifecycleHooks.getCurrentServer().getPlayerList().getPlayerCount();
int onlineMode = ServerLifecycleHooks.getCurrentServer().usesAuthentication() ? 1 : 0;
String bukkitVersion = SharedConstants.getCu... | vuln | Safe | Java |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | vuln | Vulnerable | Python |
@Override
@VisibleForTesting
public void updateScrimController() {
Trace.beginSection("CentralSurfaces#updateScrimController");
boolean unlocking = mKeyguardStateController.isShowing() && (
mBiometricUnlockController.isWakeAndUnlock()
|| mKeyguardStateCon... | vuln | Safe | Java |
static int log_radix(unsigned int radix) {
int l = 0;
while (radix > 0) {
radix = radix / 2;
l++;
}
return --l;
} | vuln | Safe | C/C++ |
RAMBlock *qemu_ram_alloc_from_ptr(struct uc_struct *uc, ram_addr_t size, void *host,
MemoryRegion *mr)
{
RAMBlock *new_block;
ram_addr_t max_size = size;
size = HOST_PAGE_ALIGN(uc, size);
max_size = HOST_PAGE_ALIGN(uc, max_size);
new_block = g_malloc0(sizeof(*new_... | vuln | Safe | Unknown |
read_rle_pixel(tga_source_ptr sinfo)
/* Read one Targa pixel from the input file, expanding RLE data as needed */
{
register int i;
/* Duplicate previously read pixel? */
if (sinfo->dup_pixel_count > 0) {
sinfo->dup_pixel_count--;
return;
}
/* Time to read RLE block header? */
if (--sinfo->block_c... | vuln | Safe | Unknown |
"""
django-helpdesk - A Django powered ticket tracker for small enterprise.
(c) Copyright 2008 Jutda. All Rights Reserved. See LICENSE for details.
models.py - Model (and hence database) definitions. This is the core of the
helpdesk structure.
"""
from django.contrib.auth.models import Permission
from dj... | vuln | Vulnerable | Python |
/* import-globals-from ../src/jsmime.jsm */
/* globals define, module */
(function(root, fn) {
if (typeof define === "function" && define.amd) {
define(fn);
} else if (typeof module !== "undefined" && module.exports) {
module.exports = fn();
} else {
root.jsmime = fn();
}
})(this, function() {
va... | vuln | Vulnerable | JavaScript |
void qmp_dump_guest_memory(bool paging, const char *file, bool has_begin,
int64_t begin, bool has_length,
int64_t length, bool has_format,
DumpGuestMemoryFormat format, Error **errp)
{
const char *p;
int fd = -1;
DumpState *s;
... | vuln | Safe | C/C++ |
@InvokedViaInstrumentation(record = TaintMethodRecord.GET_ARG_WRAPPER_GENERIC)
public Object getArgWrapper(int idx, Object actual) {
if(actual instanceof Object[]){
return getArgWrapper(idx, (Object[]) actual);
}
if (actual == null || !actual.getClass().isArray()) {
r... | vuln | Safe | Java |
static av_cold int xvid_encode_init(AVCodecContext *avctx)
{
int xerr, i, ret = -1;
int xvid_flags = avctx->flags;
struct xvid_context *x = avctx->priv_data;
uint16_t *intra, *inter;
int fd;
xvid_plugin_single_t single = { 0 };
struct xvid_ff_pass1 rc2pass1 = { 0 };... | vuln | Safe | C/C++ |
GF_EXPORT
GF_Err gf_svg_parse_attribute(GF_Node *n, GF_FieldInfo *info, char *attribute_content, u8 anim_value_type)
{
GF_Err e = GF_OK;
/* for all attributes, except strings, apply some sort of white space normalization*/
if (info->fieldType != DOM_String_datatype && strlen(attribute_content)) {
u32 i, len;
/*r... | vuln | Vulnerable | C/C++ |
static int sclp_ctl_ioctl_sccb(void __user *user_area)
{
struct sclp_ctl_sccb ctl_sccb;
struct sccb_header *sccb;
unsigned long copied;
int rc;
if (copy_from_user(&ctl_sccb, user_area, sizeof(ctl_sccb)))
return -EFAULT;
if (!sclp_ctl_cmdw_supported(ctl_sccb.cmdw))
return -EOPNOTSUPP;
sccb = (void *) ... | vuln | Safe | C/C++ |
(v.style.display="none");q.appendChild(v);b.editor.cancelFirst?(q.appendChild(k),q.appendChild(g),q.appendChild(m)):(q.appendChild(g),q.appendChild(m),q.appendChild(k));t.appendChild(q);this.container=t},CropImageDialog=function(b,f,l,d){function u(){var B=z.checked,F=L.checked,G=v.geometry,N=e.width,J=e.height,E=(300-... | vuln | Vulnerable | JavaScript |
cp.execFile('curl', [url, '-F', 'media=@', file], function(e, sout, serr){
if (e) return cb(e)
try {
var d = JSON.parse(sout)
} catch(e) {
return cb(e)
}
if (d.errcode) {
return cb(new Error(
d.errcode + ': ' + d.errmsg
))
}
cb(null, d)... | vuln | Safe | JavaScript |
int main(int argc, char **argv)
{
int opt;
uid_t uid = geteuid();
gid_t gid = getgid();
mode_t mode = 0;
struct passwd *pw = NULL;
struct group *gr = NULL;
inode_t type = inode_unknown;
int retval = EXIT_SUCCESS;
bool trunc = false;
bool chowner = false;
bool symlinks = false;
bool writable = false;
bool s... | vuln | Vulnerable | C/C++ |
size_t multipart_extract(zckDL *dl, char *b, size_t l) {
ALLOCD_BOOL(NULL, dl);
VALIDATE_BOOL(dl->zck);
if(dl->mp == NULL)
return 0;
zckMP *mp = dl->mp;
char *buf = b;
bool alloc_buf = false;
/* Add new data to stored buffer */
if(mp->buffer) {
buf = zrealloc(mp->buffe... | vuln | Vulnerable | C/C++ |
@Override
public void close() {
synchronized (lock) {
if (isClosed) {
return;
}
LOG.info("Shutting down the network environment and its components.");
// terminate all network connections
try {
LOG.debug("Shutting ... | vuln | Safe | Java |
main_get_appheader (xd3_stream *stream, main_file *ifile,
main_file *output, main_file *sfile)
{
uint8_t *apphead;
usize_t appheadsz;
int ret;
/* The user may disable the application header. Once the appheader
* is set, this disables setting it again. */
if (! option_use_appheader) { return; }
r... | vuln | Vulnerable | Unknown |
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unl... | vuln | Vulnerable | Java |
ngx_mail_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
{
ngx_mail_core_srv_conf_t *prev = parent;
ngx_mail_core_srv_conf_t *conf = child;
ngx_conf_merge_msec_value(conf->timeout, prev->timeout, 60000);
ngx_conf_merge_msec_value(conf->resolver_timeout, prev->resolver_timeout,
... | vuln | Vulnerable | Unknown |
static int crypto_ccm_auth(struct aead_request *req, struct scatterlist *plain,
unsigned int cryptlen)
{
struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req);
struct crypto_aead *aead = crypto_aead_reqtfm(req);
struct crypto_ccm_ctx *ctx = crypto_aead_ctx(aead);
AHASH_REQUEST_ON_STACK(ahreq, ctx->mac... | vuln | Vulnerable | C/C++ |
public static ChestAnimationProgress getAnimationProgress(BlockEntity blockEntity, float tickDelta) {
ChestAnimationProgress chest = (ChestAnimationProgress)blockEntity;
BlockState state = blockEntity.getCachedState();
if (state.get(ChestBlock.CHEST_TYPE) != ChestType.SINGLE) {
Bloc... | vuln | Vulnerable | Java |
static void put_crypt_info(struct fscrypt_info *ci)
{
if (!ci)
return;
crypto_free_skcipher(ci->ci_ctfm);
kmem_cache_free(fscrypt_info_cachep, ci);
} | vuln | Safe | Unknown |
@handler.unsupported_on_local_server
@handler.get(handler.HTML)
def get(self):
"""Handle a get request."""
dest = self.request.get('dest')
base_handler.check_redirect_url(dest)
self.render(
'login.html', {
'apiKey': local_config.ProjectConfig().get('firebase.api_key'),
... | vuln | Safe | Python |
@Override
public void actionPerformed(ActionEvent evt) {
final Configurable child = importConfigurable();
if (child != null) {
try {
child.build(null);
if (child.getConfigurer() != null) {
final PropertiesWindow w = new PropertiesWindow((Frame) Swing... | vuln | Vulnerable | Java |
static void qtrle_decode_16bpp(QtrleContext *s, int stream_ptr, int row_ptr, int lines_to_change)
{
int rle_code;
int pixel_ptr;
int row_inc = s->frame.linesize[0];
unsigned short rgb16;
unsigned char *rgb = s->frame.data[0];
int pixel_limit = s->frame.linesize[0] * s->avctx->height;
while (... | vuln | Vulnerable | C/C++ |
# -*- coding: utf_8 -*-
from django.shortcuts import render
from django.conf import settings
from django.template.defaulttags import register
from django.http import HttpResponseRedirect, HttpResponse
from django.utils.html import escape
from StaticAnalyzer.models import StaticAnalyzerAndroid
from pyWebProxy.pywebprox... | vuln | Safe | Python |
static void ehci_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
EHCIPCIInfo *i = data;
k->init = usb_ehci_pci_initfn;
k->vendor_id = i->vendor_id;
k->device_id = i->device_id;
k->revision = i->revision;
k->... | vuln | Safe | C/C++ |
@Override
public void onButtonClicked(@NotNull final Button button)
{
switch (button.getID())
{
case BUTTON_CURRENTLEVEL:
final int row = levelList.getListElementIndexByPane(button);
if (row != miner.current && row >= 0 && row < levelsInfo.size())
... | vuln | Vulnerable | Java |
int cmark_inline_parser_in_bracket(cmark_inline_parser *parser, int image) {
bracket *b = parser->last_bracket;
if (!b) {
return 0;
}
if (image != 0) {
return b->in_bracket_image1;
} else {
return b->in_bracket_image0;
}
} | vuln | Safe | C/C++ |
std::string HttpConnection::eraseConfidentialInfo(const std::string& request)
{
std::istringstream istr(request);
std::string result;
std::string line;
while (getline(istr, line)) {
if (util::istartsWith(line, "Authorization: ")) {
result += "Authorization: <snip>\n";
}
else if (util::istartsW... | vuln | Safe | Unknown |
static OPCODE_DESC* avr_op_analyze(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len, CPU_MODEL *cpu) {
OPCODE_DESC *opcode_desc;
ut16 ins = (buf[1] << 8) | buf[0];
int fail;
char *t;
memset (op, 0, sizeof (RAnalOp));
op->ptr = UT64_MAX;
op->val = UT64_MAX;
op->jump = UT64_MAX;
r_strbuf_init (&... | vuln | Vulnerable | C/C++ |
static int RsaPrivateDecryptEx(byte* in, word32 inLen, byte* out,
word32 outLen, byte** outPtr, RsaKey* key,
int rsa_type, byte pad_value, int pad_type,
enum wc_HashType hash, int mgf,
byte* label, word32 lab... | vuln | Vulnerable | C/C++ |
private static void obfuscateAnnotation(AnnotationNode annotationNode, boolean defaultRemap) {
boolean remap = getRemap(annotationNode, defaultRemap);
for (int i = 0; i < annotationNode.values.size(); i += 2) {
if (annotationNode.values.get(i + 1) instanceof AnnotationNode subAnnotationNode)... | vuln | Safe | Java |
int bdrv_open(BlockDriverState *bs, const char *filename, int snapshot)
{
int fd;
int64_t size;
struct cow_header_v2 cow_header;
#ifndef _WIN32
char template[] = "/tmp/vl.XXXXXX";
int cow_fd;
struct stat st;
#endif
bs->read_only = 0;
bs->fd = -1;
bs->cow_fd = -1;
bs->cow_bitmap =... | vuln | Safe | C/C++ |
u32 __skb_get_hash_symmetric(const struct sk_buff *skb)
{
struct flow_keys keys;
__flow_hash_secret_init();
memset(&keys, 0, sizeof(keys));
__skb_flow_dissect(NULL, skb, &flow_keys_dissector_symmetric,
&keys, NULL, 0, 0, 0,
FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL);
return __flow_hash_from_keys(&keys, &h... | vuln | Safe | Unknown |
static int writev_f(int argc, char **argv)
{
struct timeval t1, t2;
int Cflag = 0, qflag = 0;
int c, cnt;
char *buf;
int64_t offset;
int total = 0;
int nr_iov;
int pattern = 0xcd;
QEMUIOVector qiov;
while ((c = getopt(argc, argv, "CqP:")) != EOF) {
switch (c) {
... | vuln | Vulnerable | C/C++ |
static int hso_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{
int mux, i, if_num, port_spec;
unsigned char port_mask;
struct hso_device *hso_dev = NULL;
struct hso_shared_int *shared_int;
struct hso_device *tmp_dev = NULL;
if (interface->cur_altsetting->desc.bInterfaceClass != 0x... | vuln | Safe | Unknown |
@NonNull
public Builder setRatType(@Annotation.NetworkType int ratType) {
if (!CollectionUtils.contains(TelephonyManager.getAllNetworkTypes(), ratType)
&& ratType != TelephonyManager.NETWORK_TYPE_UNKNOWN) {
throw new IllegalArgumentException("Invalid ratType " + r... | vuln | Vulnerable | Java |
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound
from models import Record,Store
from django.db import connection
from recordstoreapp.forms import RecordForm,StoreForm
from django.shortcuts import redirect
from django.core.urlresolvers import reverse
... | vuln | Safe | Python |
i_alloc_struct_array_immovable(gs_memory_t * mem, uint num_elements,
gs_memory_type_ptr_t pstype, client_name_t cname)
{
gs_ref_memory_t * const imem = (gs_ref_memory_t *)mem;
obj_header_t *obj;
#ifdef MEMENTO
if (Memento_failThisEvent())
return NULL;
#endif
ALLOC_CH... | vuln | Vulnerable | Unknown |
void nfs4_close_state(struct path *path, struct nfs4_state *state, mode_t mode)
{
__nfs4_close(path, state, mode, 0);
} | vuln | Vulnerable | C/C++ |
var nunjucks = require('nunjucks'); //package
var express = require('express');
var path = require('path');
//var request = require('request');
var mysql = require('mysql');
var async = require('async');
var bodyparser = require('body-parser'); // request body to hash;detect name attribute in html file
var app = expres... | vuln | Vulnerable | JavaScript |
int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert,
struct vm_area_struct *expand)
{
struct mm_struct *mm = vma->vm_mm;
struct vm_area_struct *next = vma->vm_next, *orig_vma = vma;
struct address_space *mapping = NULL;
struct rb_root *... | vuln | Safe | Unknown |
(function(window) {
"use strict";
window.ls.container.get("view").add({
selector: "data-forms-code",
controller: function(element, alerts) {
let lang = element.dataset["formsCode"] || "json";
let div = document.createElement("div");
let pre = document.createElement("pre");
let code ... | vuln | Vulnerable | JavaScript |
"use strict";
var exec = require("child_process").exec;
var fs = require("fs");
var flag = process.argv[2] || "--exists";
// Normally |pkg-config opencv ...| could report either OpenCV 2.x or OpenCV 3.y
// depending on what is installed. To enable both 2.x and 3.y to co-exist on
// the same machine, the opencv.pc fo... | vuln | Vulnerable | JavaScript |
public List<ProcessorResult> handleWrite() throws ODataException {
LOG.info("Handling transactional operations per each odata request.");
List<ProcessorResult> resultList = new ArrayList<>();
try {
for (ChangeSetEntity changeSetEntity : changeSetEntities) {
ODataRequ... | vuln | Vulnerable | Java |
static void get_sensor_reading(IPMIBmcSim *ibs,
uint8_t *cmd, unsigned int cmd_len,
uint8_t *rsp, unsigned int *rsp_len,
unsigned int max_rsp_len)
{
IPMISensor *sens;
IPMI_CHECK_CMD_LEN(3);
if ((cmd[2] > MAX_SENSORS... | vuln | Vulnerable | C/C++ |
//
// 数据库驱动::PHP
// 支持数据库:mysql,mssql,oracle,informix
//
const LANG = antSword['language']['database'];
const LANG_T = antSword['language']['toastr'];
const dialog = antSword.remote.dialog;
const fs = require('fs');
const Decodes = antSword.Decodes;
class PHP {
constructor(opt) {
this.opt = opt;
this.core ... | vuln | Safe | JavaScript |
foreach ($mergedPermissions as $mergedPermission => $value) {
// Strip the '*' off the beginning of the permission.
$checkPermission = substr($permission, 1);
// We will make sure that the merged permission does not
// exactly match our pe... | vuln | Safe | PHP |
inline bool loadModule(const char* filename, IR::Module& outModule)
{
// Read the specified file into an array.
std::vector<U8> fileBytes;
if(!loadFile(filename, fileBytes)) { return false; }
// If the file starts with the WASM binary magic number, load it as a binary irModule.
if(fileBytes.size() >= 4 && *(U32*)... | vuln | Safe | C/C++ |
static gboolean
is_link_trusted (NautilusFile *file,
gboolean is_launcher)
{
GFile *location;
gboolean res;
g_autofree gchar* trusted = NULL;
if (!is_launcher)
{
return TRUE;
}
trusted = nautilus_file_get_metadata (file,
... | vuln | Safe | C/C++ |
protected OidcClientConfiguration internalBuild(final OidcJsonConfiguration oidcJsonConfiguration) {
if (oidcJsonConfiguration.getAuthServerUrl() != null && oidcJsonConfiguration.getRealm() == null) {
throw log.keycloakRealmMissing();
}
if (oidcJsonConfiguration.getRealm() != null) {... | vuln | Safe | Java |
xfs_fs_nr_cached_objects(
struct super_block *sb,
struct shrink_control *sc)
{
/* Paranoia: catch incorrect calls during mount setup or teardown */
if (WARN_ON_ONCE(!sb->s_fs_info))
return 0;
return xfs_reclaim_inodes_count(XFS_M(sb));
} | vuln | Safe | Unknown |
protected boolean checkKeyIntent(int authUid, Bundle bundle) {
if (!checkKeyIntentParceledCorrectly(bundle)) {
EventLog.writeEvent(0x534e4554, "250588548", authUid, "");
return false;
}
Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT, Inte... | vuln | Vulnerable | Java |
def create_virtualenv(force_venv_setup: bool) -> RunCommandResult:
K8S_CLUSTERS_PATH.mkdir(parents=True, exist_ok=True)
if not force_venv_setup and not _requirements_changed():
try:
python_command_result = run_command(
[str(PYTHON_BIN_PATH), "--version"],
chec... | vuln | Vulnerable | Python |
public void refreshAuthenticationCredentials() {
AuthenticationState authState = this.originalAuthState != null ? originalAuthState : this.authState;
if (authState == null) {
// Authentication is disabled or there's no local state to refresh
return;
} else if (getState()... | vuln | Vulnerable | Java |
def build_task_instance_run_id(task_id, execution_date, try_number):
return str(
uuid.uuid3(
uuid.NAMESPACE_URL,
f"{_DAG_NAMESPACE}.{task_id}.{execution_date}.{try_number}",
)
) | vuln | Vulnerable | Python |
rfbSendFramebufferUpdate(rfbClientPtr cl,
sraRegionPtr givenUpdateRegion)
{
sraRectangleIterator* i=NULL;
sraRect rect;
int nUpdateRegionRects;
rfbFramebufferUpdateMsg *fu = (rfbFramebufferUpdateMsg *)cl->updateBuf;
sraRegionPtr updateRegion, updateCopyRegion, tmpRegion, cur... | vuln | Vulnerable | Unknown |
function shave(target, maxHeight) {
var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
if (!maxHeight) throw Error('maxHeight is required');
var els = typeof target === 'string' ? document.querySelectorAll(target) : target;
if (!els) return;
var character = opts.character || '…... | vuln | Safe | JavaScript |
int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_type, char *sig, int sig_len, char *fname, char **signature, int *signature_len, char **error) /* {{{ */
{
int read_size, len;
zend_off_t read_len;
unsigned char buf[1024];
php_stream_rewind(fp);
switch (sig_type) {
case PHAR_SIG_OPEN... | vuln | Safe | C/C++ |
static float64 addFloat64Sigs( float64 a, float64 b, flag zSign STATUS_PARAM )
{
int16 aExp, bExp, zExp;
uint64_t aSig, bSig, zSig;
int16 expDiff;
aSig = extractFloat64Frac( a );
aExp = extractFloat64Exp( a );
bSig = extractFloat64Frac( b );
bExp = extractFloat64Exp( b );
expDiff = aExp ... | vuln | Vulnerable | C/C++ |
static void* swoole_unserialize_arr(void *buffer, zval *zvalue, uint32_t nNumOfElements, long flag)
{
//Initialize zend array
zend_ulong h, nIndex, max_index = 0;
uint32_t size = cp_zend_hash_check_size(nNumOfElements);
if (!size)
{
return NULL;
}
if (!buffer)
{
php_error... | vuln | Vulnerable | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.