code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
int main(int argc,
char **argv)
{
char *filein, *str, *tempfile, *prestring, *outprotos, *protostr;
const char *spacestr = " ";
char buf[L_BUF_SIZE];
l_uint8 *allheaders;
l_int32 i, maxindex, in_line, nflags, protos_added, firstfile, len, ret;
size_t nbytes;
L_BYTEA *ba, *... | vuln | Vulnerable | C/C++ |
package com.hccake.ballcat.codegen.exception;
/**
* 模板渲染失败异常
*
* @author hccake
*/
public class TemplateRenderException extends RuntimeException {
public TemplateRenderException(Exception e) {
super(e);
}
}
| vuln | Vulnerable | Java |
bool Browser::CanCloseContentsAt(int index) {
if (!CanCloseTab())
return false;
if (tab_handler_->GetTabStripModel()->count() > 1)
return true;
return CanCloseWithInProgressDownloads();
} | vuln | Vulnerable | C/C++ |
SPL_METHOD(Array, unserialize)
{
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
char *buf;
int buf_len;
const unsigned char *p, *s;
php_unserialize_data_t var_hash;
zval *pmembers, *pflags = NULL;
long flags;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_C... | vuln | Vulnerable | C/C++ |
int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p,
unsigned char *limit, int *al)
{
unsigned short type;
unsigned short size;
unsigned short len;
unsigned char *data = *p;
int renegotiate_seen = 0;
int sigalg_seen = 0;
s->servername_done = 0;
s-... | vuln | Vulnerable | Unknown |
public static void perform( PlayerEntity attacker, Hand hand, ItemModularHandheld item, ItemStack itemStack, int effectLevel, LivingEntity target) {
int currentAmplifier = Optional.ofNullable(target.getActivePotionEffect(PriedPotionEffect.instance))
.map(EffectInstance::getAmplifier)
... | vuln | Vulnerable | Java |
static int
lha_read_file_header_1(struct archive_read *a, struct lha *lha)
{
const unsigned char *p;
size_t extdsize;
int i, err, err2;
int namelen, padding;
unsigned char headersum, sum_calculated;
err = ARCHIVE_OK;
if ((p = __archive_read_ahead(a, H1_FIXED_SIZE, NULL)) == NULL)
return (truncated_error(a));... | vuln | Vulnerable | C/C++ |
package configstore
import (
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strings"
"sync"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/gorilla/mux"
"github.com/grafana/agent/pkg/metrics/cluster/configapi"
"github.com/grafana/agent/pkg/metrics/instance"
"github.com/prometheus/client_gola... | vuln | Safe | Go |
float SVGLayoutSupport::calculateScreenFontSizeScalingFactor(const LayoutObject* layoutObject)
{
ASSERT(layoutObject);
AffineTransform ctm = deprecatedCalculateTransformToLayer(layoutObject) * SubtreeContentTransformScope::currentContentTransformation();
ctm.scale(layoutObject->document().frameHost()->de... | vuln | Vulnerable | C/C++ |
Prism.languages.markup={comment:/<!--(?:(?!<!--)[\s\S])*?-->/,prolog:/<\?[\s\S]+?\?>/,doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,... | vuln | Safe | JavaScript |
def generate_tree(playbook, root_path, expand_key=None):
nodes = [{
"name": playbook.name,
"title": playbook.name,
"id": 'root',
"isParent": True,
"open": True,
"pId": '',
"temp": False
}]
for path, dirs, files i... | vuln | Vulnerable | Python |
static int
fpAcc(TIFF* tif, uint8* cp0, tmsize_t cc)
{
tmsize_t stride = PredictorState(tif)->stride;
uint32 bps = tif->tif_dir.td_bitspersample / 8;
tmsize_t wc = cc / bps;
tmsize_t count = cc;
uint8 *cp = (uint8 *) cp0;
uint8 *tmp;
if(cc%(bps*stride)!=0)
{
TIFFErrorExt(tif->tif_clientdata, "fpA... | vuln | Safe | C/C++ |
int qcow2_grow_l1_table(BlockDriverState *bs, int min_size)
{
BDRVQcowState *s = bs->opaque;
int new_l1_size, new_l1_size2, ret, i;
uint64_t *new_l1_table;
int64_t new_l1_table_offset;
uint8_t data[12];
new_l1_size = s->l1_size;
if (min_size <= new_l1_size)
return 0;
if (new_l1_s... | vuln | Vulnerable | C/C++ |
static inline abi_long host_to_target_sockaddr(abi_ulong target_addr,
struct sockaddr *addr,
socklen_t len)
{
struct target_sockaddr *target_saddr;
if (len == 0) {
return 0;
}
target_saddr = lock_user(V... | vuln | Vulnerable | C/C++ |
u32toutf8 (wc, s)
u_bits32_t wc;
char *s;
{
int l;
if (wc < 0x0080)
{
s[0] = (char)wc;
l = 1;
}
else if (wc < 0x0800)
{
s[0] = (wc >> 6) | 0xc0;
s[1] = (wc & 0x3f) | 0x80;
l = 2;
}
else if (wc < 0x10000)
{
s[0] = (wc >> 12) | 0xe0;
s[1] = ... | vuln | Vulnerable | Unknown |
apr_status_t h2_conn_run(conn_rec *c)
{
apr_status_t status;
int mpm_state = 0;
h2_session *session = h2_ctx_get_session(c);
ap_assert(session);
do {
if (c->cs) {
c->cs->sense = CONN_SENSE_DEFAULT;
c->cs->state = CONN_STATE_HANDLER;
}
status ... | vuln | Vulnerable | Unknown |
def addKey(client):
"""Adds a new key with the specified name and contents.
Returns an error if a key with the specified name already exists.
"""
global BAD_REQUEST
global CREATED
validateClient(client)
client_pub_key = loadClientRSAKey(client)
token_data = decodeRequestToken(request.data, client_pub_key)
va... | vuln | Vulnerable | Python |
void ep2_map_dst(ep2_t p, const uint8_t *msg, size_t len, const uint8_t *dst,
size_t dst_len) {
/* enough space for two field elements plus extra bytes for uniformity */
const int lpe = (FP_PRIME + ep_param_level() + 7) / 8;
uint8_t *pseudo_random_bytes = RLC_ALLOCA(uint8_t, 4 * lpe);
RLC_TRY {
/* XXX(rsw) See... | vuln | Safe | C/C++ |
protected void engage() {
final SectorEntityToken entity = dialog.getInteractionTarget();
final MemoryAPI memory = getEntityMemory(memoryMap);
final MemoryAPI memoryMarket = memoryMap.get(MemKeys.MARKET);
final CampaignFleetAPI primary = getInteractionTargetForFIDPI();
dialog.setInteractionTarget(primary)... | vuln | Vulnerable | Java |
static void cmd_parse_status(struct ImapData *idata, char *s)
{
char *value = NULL;
struct Buffy *inc = NULL;
struct ImapMbox mx;
struct ImapStatus *status = NULL;
unsigned int olduv, oldun;
unsigned int litlen;
short new = 0;
short new_msg_count = 0;
char *mailbox = imap_next_word(s);
/* We need ... | vuln | Safe | C/C++ |
int LUKS2_config_get_requirements(struct crypt_device *cd, struct luks2_hdr *hdr, uint32_t *reqs)
{
json_object *jobj_config, *jobj_requirements, *jobj_mandatory, *jobj;
int i, len;
uint32_t req;
assert(hdr);
if (!hdr || !reqs)
return -EINVAL;
*reqs = 0;
if (!json_object_object_get_ex(hdr->jobj, "config", &... | vuln | Vulnerable | Unknown |
public void addBox(ProjectInfo info, Identifiable<?> parent, Project.Part.Box box, boolean isUserInput)
{
if(isUserInput && !getCanEdit())
{
WindowPopup.popup(workspace, 0.4D, 140, w -> {}, I18n.format("system.notEditor", Minecraft.getInstance().getSession().getUsername()));
... | vuln | Vulnerable | Java |
static av_cold int libgsm_close(AVCodecContext *avctx) {
av_freep(&avctx->coded_frame);
gsm_destroy(avctx->priv_data);
avctx->priv_data = NULL;
return 0;
} | vuln | Safe | C/C++ |
function updateLabel()
{
label.innerHTML = '';
label.style.cursor = 'pointer';
label.style.whiteSpace = 'nowrap';
label.style.textOverflow = 'ellipsis';
mxUtils.write(label, (entry.title != null && entry.title.length > 0) ?
entry.title : mxResources.get('untitled'));
... | vuln | Vulnerable | JavaScript |
public IBakedModel getModelVariant(ICasingMaterial casing, IBeddingMaterial bedding, Direction facing) {
if (casing == null) { casing = DoggyBedMaterials.OAK_PLANKS.get(); }
if (bedding == null) { bedding = DoggyBedMaterials.WHITE_WOOL.get(); }
if (facing == null) { facing = Direction.NORTH; }
... | vuln | Vulnerable | Java |
/**********************************************************************
regcomp.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2019 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and... | vuln | Vulnerable | C/C++ |
public void refresh()
{
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(_context);
layout = layoutId_of_string(prefs.getString("layout", "system"));
subValueDist = prefs.getFloat("sub_value_dist", subValueDist);
vibrateEnabled = prefs.getBoolean("vibrate_enabled", vibrateEnabled);... | vuln | Safe | Java |
static uint32_t pcie_mmcfg_data_read(PCIBus *s, uint32_t addr, int len)
{
PCIDevice *pci_dev = pcie_dev_find_by_mmcfg_addr(s, addr);
if (!pci_dev) {
return ~0x0;
}
return pci_host_config_read_common(pci_dev, PCIE_MMCFG_CONFOFFSET(addr),
pci_config_size(pci_... | vuln | Vulnerable | C/C++ |
find_file (const char *currpath, grub_fshelp_node_t currroot,
grub_fshelp_node_t *currfound,
struct grub_fshelp_find_file_closure *c)
{
char *fpath = grub_malloc (grub_strlen (currpath) + 1);
char *name = fpath;
char *next;
enum grub_fshelp_filetype type = GRUB_FSHELP_DIR;
grub_fshelp_node_t currnode =... | vuln | Safe | C/C++ |
static int fuse_flush(struct file *file, fl_owner_t id)
{
struct inode *inode = file_inode(file);
struct fuse_mount *fm = get_fuse_mount(inode);
struct fuse_file *ff = file->private_data;
struct fuse_flush_in inarg;
FUSE_ARGS(args);
int err;
if (fuse_is_bad(inode))
return -EIO;
err = write_inode_now(inode, ... | vuln | Safe | Unknown |
void
vrrp_print_stats(void)
{
FILE *file;
file = fopen (stats_file, "w");
if (!file) {
log_message(LOG_INFO, "Can't open %s (%d: %s)",
stats_file, errno, strerror(errno));
return;
}
list l = vrrp_data->vrrp;
element e;
vrrp_t *vrrp;
for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
vrrp = ELEMENT_DATA(e)... | vuln | Vulnerable | C/C++ |
static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
char
buffer[MaxTextExtent],
name[MaxTextExtent];
Image
*image;
MagickBooleanType
status;
register IndexPacket
*indexes;
register ssize_t
i,
x;
register PixelPacket
*q;
register unsigned... | vuln | Vulnerable | C/C++ |
public int getTier(ItemStack testItem, List<String> list) {
if (testItem.getItem() instanceof IRadiationSuit)
return ((IRadiationSuit) testItem.getItem()).getArmorTier();
for (String line : list) {
if(line.length() == 0 || !line.contains(":"))
continue;
if (line.substring(0, line.lastIndexOf(':')).equ... | vuln | Safe | Java |
package server
import (
"github.com/labstack/echo/v4"
"github.com/usememos/memos/api"
"github.com/usememos/memos/common"
)
type response struct {
Data interface{} `json:"data"`
}
func composeResponse(data interface{}) response {
return response{
Data: data,
}
}
func (server *Server) DefaultAuthSkipper(c ech... | vuln | Vulnerable | Go |
# -*- coding: utf-8 -*-
# rdiffweb, A web interface to rdiff-backup repositories
# Copyright (C) 2012-2021 rdiffweb contributors
#
# 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 ... | vuln | Vulnerable | Python |
bool DoResolveRelativeHost(const char* base_url,
const url_parse::Parsed& base_parsed,
const CHAR* relative_url,
const url_parse::Component& relative_component,
CharsetConverter* query_converter,
... | vuln | Vulnerable | C/C++ |
static int h264_handle_packet(AVFormatContext *ctx,
PayloadContext *data,
AVStream *st,
AVPacket * pkt,
uint32_t * timestamp,
const uint8_t * buf,
... | vuln | Vulnerable | C/C++ |
private static void addToArchiveCompression(TarArchiveOutputStream out, File file, String dir)
throws IOException {
if (file.isFile()){
String archivePath = "." + dir;
LOGGER.info("archivePath = " + archivePath);
out.putArchiveEntry(new TarArchiveEntry(file, archivePath));
try (FileInp... | vuln | Vulnerable | Java |
function p(H,F,J,R,W){function O(Q,P,T){var X=document.createElement("li");X.className="geCommentAction";var ba=document.createElement("a");ba.className=
"geCommentActionLnk";mxUtils.write(ba,Q);X.appendChild(ba);mxEvent.addListener(ba,"click",function(ja){P(ja,H);ja.preventDefault();mxEvent.consume(ja)});S.appendChild... | vuln | Vulnerable | JavaScript |
static ssize_t _hostsock_sendmsg(
oe_fd_t* sock_,
const struct oe_msghdr* msg,
int flags)
{
ssize_t ret = -1;
sock_t* sock = _cast_sock(sock_);
void* buf = NULL;
size_t buf_size = 0;
oe_errno = 0;
/* Check the parameters. */
if (!sock || !msg || (msg->msg_iovlen && !msg->msg_io... | vuln | Vulnerable | Unknown |
METHODDEF(JDIMENSION)
get_8bit_row(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
/* This version is for reading 8-bit colormap indexes */
{
bmp_source_ptr source = (bmp_source_ptr)sinfo;
register JSAMPARRAY colormap = source->colormap;
int cmaplen = source->cmap_length;
JSAMPARRAY image_ptr;
register int... | vuln | Safe | C/C++ |
package com.salesmanager.shop.admin.controller.tax;
import com.salesmanager.core.business.services.tax.TaxService;
import com.salesmanager.core.model.merchant.MerchantStore;
import com.salesmanager.core.model.tax.TaxConfiguration;
import com.salesmanager.shop.admin.model.web.Menu;
import com.salesmanager.shop.constant... | vuln | Vulnerable | Java |
/******************************************************************************
*
* Back-end of the driver for virtual block devices. This portion of the
* driver exports a 'unified' block-device interface that can be accessed
* by any operating system that implements a compatible front end. A
* reference front-en... | vuln | Vulnerable | C/C++ |
static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
bgp_size_t length)
{
uint8_t *end;
struct capability_mp_data mpc;
struct capability_header *hdr;
uint8_t action;
iana_afi_t pkt_afi;
afi_t afi;
iana_safi_t pkt_safi;
safi_t safi;
end = pnt + length;
while (pnt < end) {
/* We need... | vuln | Safe | C/C++ |
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#in... | vuln | Vulnerable | C/C++ |
static int oidc_check_userid_openidc(request_rec *r, oidc_cfg *c) {
if (c->redirect_uri == NULL) {
oidc_error(r,
"configuration error: the authentication type is set to \"openid-connect\" but OIDCRedirectURI has not been set");
return HTTP_INTERNAL_SERVER_ERROR;
}
/* check if this is a sub-request or an in... | vuln | Safe | Unknown |
fb_mmap(struct file *file, struct vm_area_struct * vma)
{
struct fb_info *info = file_fb_info(file);
struct fb_ops *fb;
unsigned long off;
unsigned long start;
u32 len;
if (!info)
return -ENODEV;
if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
return -EINVAL;
off = vma->vm_pgoff << PAGE_SHIFT;
fb = info->fbops;... | vuln | Vulnerable | C/C++ |
int tcp_v4_rcv(struct sk_buff *skb)
{
struct net *net = dev_net(skb->dev);
const struct iphdr *iph;
const struct tcphdr *th;
bool refcounted;
struct sock *sk;
int ret;
if (skb->pkt_type != PACKET_HOST)
goto discard_it;
/* Count it even if it's bad */
__TCP_INC_STATS(net, TCP_MIB_INSEGS);
if (!pskb_may_pu... | vuln | Safe | C/C++ |
@SubscribeEvent
public void onStackClick(SlotClickEvent event) {
if (event.clickedButton != 0 && event.clickedButton != 1 && event.clickedButton != 2) return;
int slotIdMod = (event.slotId - 10) % 9;
if (event.slotId >= 10 && event.slotId <= 43 && slotIdMod >= 0 && slotIdMod <= 6 &&
Minecraft.getMinecraft().... | vuln | Safe | Java |
static void type_initialize(TypeImpl *ti)
{
TypeImpl *parent;
if (ti->class) {
return;
}
ti->class_size = type_class_get_size(ti);
ti->instance_size = type_object_get_size(ti);
ti->class = g_malloc0(ti->class_size);
parent = type_get_parent(ti);
if (parent) {
type_initial... | vuln | Vulnerable | C/C++ |
#include "common/http/path_utility.h"
#include "common/common/logger.h"
#include "common/http/legacy_path_canonicalizer.h"
#include "common/runtime/runtime_features.h"
#include "absl/strings/str_join.h"
#include "absl/strings/str_split.h"
#include "absl/types/optional.h"
#include "url/url_canon.h"
#include "url/url_c... | vuln | Safe | C/C++ |
def patch(self, request, **kwargs):
playbook_id = kwargs.get('pk')
playbook = get_object_or_404(Playbook, id=playbook_id)
work_path = playbook.work_dir
file_key = request.data.get('key', '')
new_name = request.data.get('new_name', '')
if file_key in self.protected_files... | vuln | Vulnerable | Python |
QPDFOutlineObjectHelper::getCount()
{
int count = 0;
if (this->oh.hasKey("/Count"))
{
count = this->oh.getKey("/Count").getIntValue();
}
return count;
} | vuln | Vulnerable | Unknown |
static __inline__ int scm_check_creds(struct ucred *creds)
{
const struct cred *cred = current_cred();
kuid_t uid = make_kuid(cred->user_ns, creds->uid);
kgid_t gid = make_kgid(cred->user_ns, creds->gid);
if (!uid_valid(uid) || !gid_valid(gid))
return -EINVAL;
if ((creds->pid == task_tgid_vnr(current) ||
... | vuln | Safe | C/C++ |
static PyObject *__pyx_f_17clickhouse_driver_14bufferedreader___pyx_unpickle_CompressedBufferedReader__set_state(struct __pyx_obj_17clickhouse_driver_14bufferedreader_CompressedBufferedReader *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__p... | vuln | Vulnerable | C/C++ |
def __init__(
self,
database: DatabasePool,
db_conn: LoggingDatabaseConnection,
hs: "HomeServer",
):
self._instance_name = hs.get_instance_name()
self._receipts_id_gen: AbstractStreamIdTracker
if isinstance(database.engine, PostgresEngine):
self._... | vuln | Safe | Python |
static int cac_get_serial_nr_from_CUID(sc_card_t* card, sc_serial_number_t* serial)
{
cac_private_data_t * priv = CAC_DATA(card);
SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_NORMAL);
if (card->serialnr.len) {
*serial = card->serialnr;
SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL... | vuln | Safe | Unknown |
ssize_t slirp_send(struct socket *so, const void *buf, size_t len, int flags)
{
if (so->s == -1 && so->extra) {
qemu_chr_fe_write_all(so->extra, buf, len);
return len;
}
return send(so->s, buf, len, flags);
} | vuln | Safe | C/C++ |
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.frame_close && viewUtil.isClickEnabled()) {
performHapticClick();
finish();
} else if (id == R.id.button_set && viewUtil.isClickEnabled()) {
try {
wallpaperPickerLauncher.launch(
new Intent(Wal... | vuln | Safe | Java |
errno_t sssctl_cache_expire(struct sss_cmdline *cmdline,
struct sss_tool_ctx *tool_ctx,
void *pvt)
{
errno_t ret;
char *cmd_args = NULL;
const char *cachecmd = SSS_CACHE;
char *cmd = NULL;
int i;
if (cmdline->argc == 0) {
ret = sss... | vuln | Vulnerable | Unknown |
static jclass
getClassAt(JNIEnv *env, jobject constantPoolOop, jint cpIndex, UDATA resolveFlags)
{
jclass returnValue = NULL;
J9VMThread *vmThread = (J9VMThread *) env;
J9InternalVMFunctions *vmFunctions = vmThread->javaVM->internalVMFunctions;
SunReflectCPResult result = NULL_POINTER_EXCEPTION;
if (NULL != const... | vuln | Safe | C/C++ |
@Override
public void onVisibilityChanged(boolean visible) {
if (visible && mAutoHideController != null) {
// If the button will actually become visible and the navbar is about
// to hide, tell the statusbar to keep it around for longer... | vuln | Safe | Java |
@Override
public RedisResponse executeCommand(Command command,
ExecutionHandlerContext context) {
List<byte[]> commandElems = command.getProcessedCommand();
String cursorString = bytesToString(commandElems.get(2));
int cursor;
Pattern matchPattern;
String globPattern = null;
int count ... | vuln | Vulnerable | Java |
private Path runMigration(Migration migration, Path migrationInputRoot) throws IOException {
final Path tmpOutputDir = Files.createDirectories(migrateRoot.resolve(migration.getVersion()));
// create a map of each input resource path to the input stream.
final Map<ResourceId, Stream<JsonNode>> inputData = c... | vuln | Vulnerable | Java |
public Entity getProximateDamageSource() {
return super.getTrueSource();
} | vuln | Vulnerable | Java |
bool AES_GCM_DecryptContext::Decrypt(
const void *pEncryptedDataAndTag, size_t cbEncryptedDataAndTag,
const void *pIV,
void *pPlaintextData, uint32 *pcbPlaintextData,
const void *pAdditionalAuthenticationData, size_t cbAuthenticationData
) {
// Make sure caller's buffer is big enough to hold the result
if ( cbEnc... | vuln | Safe | C/C++ |
static int sanitize_ptr_alu(struct bpf_verifier_env *env,
struct bpf_insn *insn,
const struct bpf_reg_state *ptr_reg,
const struct bpf_reg_state *off_reg,
struct bpf_reg_state *dst_reg,
struct bpf_sanitize_info *info,
const bool commit_window)
{
struct bpf_insn_aux_data *aux =... | vuln | Safe | C/C++ |
/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2002-2014 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
*
* OpenNMS(... | vuln | Vulnerable | Java |
protected void updateAlpha() {
getDrawable().setAlpha(calculateAlpha());
} | vuln | Vulnerable | Java |
public static int getPartNumber(String variable){
if(variable.matches("^.*_[0-9]+$")){
return Integer.parseInt(variable.substring(variable.lastIndexOf('_') + 1)) - 1;
}else{
return -1;
}
} | vuln | Safe | Java |
/*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef GIT_WINHTTP
#include "git2.h"
#include "http_parser.h"
#include "buffer.h"
#include "netops.h"
#... | vuln | Safe | C/C++ |
static void timerfd_setup_cancel(struct timerfd_ctx *ctx, int flags)
{
if ((ctx->clockid == CLOCK_REALTIME ||
ctx->clockid == CLOCK_REALTIME_ALARM) &&
(flags & TFD_TIMER_ABSTIME) && (flags & TFD_TIMER_CANCEL_ON_SET)) {
if (!ctx->might_cancel) {
ctx->might_cancel = true;
spin_lock(&cancel_lock);
l... | vuln | Vulnerable | Unknown |
/* -=- sraRegion.c
* Copyright (c) 2001 James "Wez" Weatherall, Johannes E. Schindelin
*
* A general purpose region clipping library
* Only deals with rectangular regions, though.
*/
#include <rfb/rfb.h>
#include <rfb/rfbregion.h>
/* -=- Internal Span structure */
struct sraRegion;
typedef struct sraSpan {
s... | vuln | Vulnerable | C/C++ |
tiff_document_render (EvDocument *document,
EvRenderContext *rc)
{
TiffDocument *tiff_document = TIFF_DOCUMENT (document);
int width, height;
int scaled_width, scaled_height;
float x_res, y_res;
gint rowstride, bytes;
guchar *pixels = NULL;
guchar *p;
int orientation;
cairo_surface_t *surface;
ca... | vuln | Safe | C/C++ |
#!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import argparse
import json
import logging
import os
import platform
import shutil
import subprocess
import sys
import tempfile
import time
import uuid
import zipfile
from datetime import datetime, timedelta
from typing im... | vuln | Vulnerable | Python |
def historical_metrics_data(self):
"""Returns cluster activity historical metrics."""
start_date = _safe_parse_datetime(request.args.get("start_date"))
end_date = _safe_parse_datetime(request.args.get("end_date"))
with create_session() as session:
# DagRuns
dag_ru... | vuln | Vulnerable | Python |
int LUKS2_config_set_requirements(struct crypt_device *cd, struct luks2_hdr *hdr, uint32_t reqs, bool commit)
{
json_object *jobj_config, *jobj_requirements, *jobj_mandatory, *jobj;
int i, r = -EINVAL;
const struct requirement_flag *req;
uint32_t req_id;
if (!hdr)
return -EINVAL;
jobj_mandatory = json_object_... | vuln | Safe | Unknown |
/*
Source File : PDFParser.cpp
Copyright 2011 Gal Kahana PDFWriter
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 requ... | vuln | Vulnerable | JavaScript |
def fulltext_search_title(query):
query_string = """
SELECT id, ts_headline('english', title, query), ts_rank_cd(to_tsvector('english', title), query, 32) AS rank
FROM pub_2018, plainto_tsquery('english', '{}') query -- or try plainto_tsquery, phraseto_tsquery, to_tsquery
WHERE to_tsvector('e... | vuln | Vulnerable | Python |
@Override
public Response updateProfile(String profileID, ProfileData profileData) {
String method = "ProfileService.updateProfile";
String msg = "";
if (profileID == null) {
auditConfigTokenGeneral(ILogger.FAILURE, method, null,
"Profile id is null.");
... | vuln | Safe | Java |
// Copyright 2014 beego Author. 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 applica... | vuln | Safe | Go |
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 | Safe | Go |
private void provision(final OnmsMinion minion,
final String prevLocation,
final String nextLocation) {
// Return fast if automatic provisioning is disabled
if (!PROVISIONING) {
return;
}
// Return fast until the provisio... | vuln | Safe | Java |
async def login(cls, username: str, password: str) -> t.Optional[int]:
"""
Make sure the user exists and the password is valid. If so, the
``last_login`` value is updated in the database.
:returns:
The id of the user if a match is found, otherwise ``None``.
"""
... | vuln | Safe | Python |
static unsigned int
sudoers_lookup_pseudo(struct sudo_nss_list *snl, struct sudoers_context *ctx,
time_t now, sudoers_lookup_callback_fn_t callback, void *cb_data,
int pwflag)
{
char *saved_runchroot;
struct passwd *root_pw = NULL;
struct sudo_nss *nss;
struct cmndspec *cs;
struct privilege ... | vuln | Vulnerable | C/C++ |
static long ioctl_file_dedupe_range(struct file *file, void __user *arg)
{
struct file_dedupe_range __user *argp = arg;
struct file_dedupe_range *same = NULL;
int ret;
unsigned long size;
u16 count;
if (get_user(count, &argp->dest_count)) {
ret = -EFAULT;
goto out;
}
size = offsetof(struct file_dedupe_ran... | vuln | Safe | C/C++ |
static int asink_query_formats(AVFilterContext *ctx)
{
BufferSinkContext *buf = ctx->priv;
AVFilterFormats *formats = NULL;
AVFilterChannelLayouts *layouts = NULL;
unsigned i;
int ret;
CHECK_LIST_SIZE(sample_fmts)
CHECK_LIST_SIZE(sample_rates)
CHECK_LIST_SIZE(channel_layouts)
CHECK_L... | vuln | Vulnerable | C/C++ |
static int ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile,
AVCodecContext *avctx)
{
int mbn, blk, num_blocks, num_coeffs, blk_size, scan_pos, run, val,
pos, is_intra, mc_type = 0, mv_x, mv_y, col_mask;
uint8_t col_flags[8];
int3... | vuln | Vulnerable | C/C++ |
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <utility>
#include <vector>
#include "Emscripten/Emscripten.h"
#include "IR/Module.h"
#include "IR/Operators.h"
#include "IR/Types.h"
#include "IR/Validate.h"
#include "IR/Value.h"
#include "Inline/BasicTypes.h"
#include "Inline/C... | vuln | Vulnerable | C/C++ |
import logging
import os
from os.path import join
import shutil
import sys
import time
from mlflow.entities.model_registry import (
RegisteredModel,
ModelVersion,
RegisteredModelTag,
ModelVersionTag,
)
from mlflow.entities.model_registry.model_version_stages import (
get_canonical_stage,
ALL_ST... | vuln | Vulnerable | Python |
int CLASS parse_tiff_ifd(int base)
{
unsigned entries, tag, type, len, plen = 16, save;
int ifd, use_cm = 0, cfa, i, j, c, ima_len = 0;
char *cbuf, *cp;
uchar cfa_pat[16], cfa_pc[] = {0, 1, 2, 3}, tab[256];
double fm[3][4], cc[4][4], cm[4][3], cam_xyz[4][3], num;
double ab[] = {1, 1, 1, 1}, asn[] = {0, 0, 0... | vuln | Safe | C/C++ |
public String buildServiceDocument() throws ODataRenderException {
LOG.info("Building service(root) document");
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream(BUFFER_SIZE)) {
XMLStreamWriter writer = startServiceDocument(outputStream);
writeEntitySets(writer... | vuln | Vulnerable | Java |
static int mmu_translate_asc(CPUS390XState *env, target_ulong vaddr,
uint64_t asc, target_ulong *raddr, int *flags,
int rw, bool exc)
{
uint64_t asce = 0;
int level;
int r;
switch (asc) {
case PSW_ASC_PRIMARY:
PTE_DPRINTF("%s: asc=pri... | vuln | Vulnerable | C/C++ |
static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup)
{
pkt->data = NULL;
pkt->side_data = NULL;
pkt->side_data_elems = 0;
if (pkt->buf) {
AVBufferRef *ref = av_buffer_ref(src->buf);
if (!ref)
return AVERROR(ENOMEM);
pkt->buf = ref;
pk... | vuln | Safe | C/C++ |
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case MSG_LOG_WATCH_START: {
SomeArgs args = (SomeArgs) msg.obj;
String packageName = (String) args.arg1;
long watchStartTime = (long) args.arg2;
... | vuln | Safe | Java |
int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t len, int flags)
{
int noblock = flags & MSG_DONTWAIT;
struct sock *sk = sock->sk;
struct sk_buff *skb;
size_t copied;
int err;
BT_DBG("sock %p sk %p len %zu", sock, sk, len);
if (flags & (MSG_OOB))
return -EOPNOTSUPP;... | vuln | Safe | Unknown |
execute_arith_for_command (arith_for_command)
ARITH_FOR_COM *arith_for_command;
{
intmax_t expresult;
int expok, body_status, arith_lineno, save_lineno;
body_status = EXECUTION_SUCCESS;
loop_level++;
save_lineno = line_number;
if (arith_for_command->flags & CMD_IGNORE_RETURN)
arith_for_command->a... | vuln | Vulnerable | Unknown |
GF_EXPORT
GF_Err gf_hinter_finalize(GF_ISOFile *file, GF_SDP_IODProfile IOD_Profile, u32 bandwidth)
{
u32 i, sceneT, odT, descIndex, size, size64;
GF_InitialObjectDescriptor *iod;
GF_SLConfig slc;
GF_ISOSample *samp;
Bool remove_ocr;
u8 *buffer;
char buf64[5000], sdpLine[5100];
gf_isom_sdp_clean(file);
if (... | vuln | Safe | C/C++ |
public StatResponse buildResponse(List<String> months) {
final String cacheKey = months.toString();
final StatResponse cachedResponse = responseCache.getIfPresent(cacheKey);
if (cachedResponse != null) {
if (log.isTraceEnabled()) {
log.trace("Get stat response from ca... | vuln | Safe | Java |
static void pci_add_option_rom(PCIDevice *pdev, bool is_default_rom,
Error **errp)
{
int size;
char *path;
void *ptr;
char name[32];
const VMStateDescription *vmsd;
if (!pdev->romfile)
return;
if (strlen(pdev->romfile) == 0)
return;
if (!pde... | vuln | Safe | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.