code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
struct pxa2xx_mmci_s *pxa2xx_mmci_init(target_phys_addr_t base,
qemu_irq irq, void *dma)
{
int iomemtype;
struct pxa2xx_mmci_s *s;
s = (struct pxa2xx_mmci_s *) qemu_mallocz(sizeof(struct pxa2xx_mmci_s));
s->base = base;
s->irq = irq;
s->dma = dma;
iomemtype = cpu_register_io_... | vuln | Vulnerable | C/C++ |
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.... | 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 void seek_subtitle(AVStream *st, AVStream *st2, int64_t timestamp)
{
AVIStream *ast2 = st2->priv_data;
int64_t ts2 = av_rescale_q(timestamp, st->time_base, st2->time_base);
av_packet_unref(&ast2->sub_pkt);
if (avformat_seek_file(ast2->sub_ctx, 0, INT64_MIN, ts2, ts2, 0) >= 0 ||
avform... | vuln | Safe | Unknown |
double qdict_get_double(const QDict *qdict, const char *key)
{
QObject *obj = qdict_get(qdict, key);
assert(obj);
switch (qobject_type(obj)) {
case QTYPE_QFLOAT:
return qfloat_get_double(qobject_to_qfloat(obj));
case QTYPE_QINT:
return qint_get_int(qobject_to_qint(obj));
default:... | vuln | Safe | C/C++ |
asmlinkage long sys_oabi_semtimedop(int semid,
struct oabi_sembuf __user *tsops,
unsigned nsops,
const struct timespec __user *timeout)
{
struct sembuf *sops;
struct timespec local_timeout;
long err;
int i;
if (nsops < 1 || nsops > SEMOPM)
return -EINVAL;
if (!access_ok(VERIFY_READ, tso... | vuln | Safe | Unknown |
static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
KmvcContext *const ctx = avctx->priv_data;
uint8_t *out, *src;
int i;
int header;
int blocksize;
const uint8_t *pal = av_packet_get... | vuln | Vulnerable | C/C++ |
static int read_high_coeffs(AVCodecContext *avctx, uint8_t *src, int16_t *dst, int size,
int c, int a, int d,
int width, ptrdiff_t stride)
{
PixletContext *ctx = avctx->priv_data;
GetBitContext *b = &ctx->gbit;
unsigned cnt1, shbits, rlen, nbits, lengt... | vuln | Vulnerable | C/C++ |
void pl050_init(uint32_t base, qemu_irq irq, int is_mouse)
{
int iomemtype;
pl050_state *s;
s = (pl050_state *)qemu_mallocz(sizeof(pl050_state));
iomemtype = cpu_register_io_memory(0, pl050_readfn,
pl050_writefn, s);
cpu_register_physical_memory(base, 0x00000ff... | vuln | Vulnerable | C/C++ |
def safe_eval(expr, locals={}, include_exceptions=False):
'''
this is intended for allowing things like:
with_items: a_list_variable
where Jinja2 would return a string
but we do not want to allow it to call functions (outside of Jinja2, where
the env is constrained)
Based on:
http://sta... | vuln | Safe | Python |
def populate_obj(self, userobj):
try:
token = userobj.add_access_token(self.name.data, self.expiration.data)
userobj.commit()
flash(
_(
"Your new personal access token has been created.\n"
"Make sure to save it - you won... | vuln | Safe | Python |
$scope.reset = function() {
bootbox.confirm('Are you sure you want to reset the foreign source definition to the default ?', function(ok) {
if (ok) {
RequisitionsService.startTiming();
RequisitionsService.deleteForeignSourceDefinition($scope.foreignSource).then(
function() ... | vuln | Vulnerable | JavaScript |
int
dlt_hdlc_encode(tcpeditdlt_t *ctx, u_char *packet, int pktlen, _U_ tcpr_dir_t dir)
{
cisco_hdlc_t *hdlc;
hdlc_config_t *config = NULL;
hdlc_extra_t *extra = NULL;
tcpeditdlt_plugin_t *plugin = NULL;
u_char tmpbuff[MAXPACKET];
int newpktlen;
assert(ctx);
assert(packet);
if ((si... | vuln | Safe | C/C++ |
void *ff_png_zalloc(void *opaque, unsigned int items, unsigned int size)
{
return av_mallocz_array(items, size);
} | vuln | Safe | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Vulnerable | C/C++ |
static INLINE INT32 planar_skip_plane_rle(const BYTE* pSrcData, UINT32 SrcSize, UINT32 nWidth,
UINT32 nHeight)
{
UINT32 x, y;
BYTE controlByte;
const BYTE* pRLE = pSrcData;
const BYTE* pEnd = &pSrcData[SrcSize];
for (y = 0; y < nHeight; y++)
{
for (x = 0; x < nWidth;)
... | vuln | Vulnerable | C/C++ |
public static Double parseDouble(final String value) {
if (value != null && !value.isEmpty()) {
try {
return Double.parseDouble(value);
} catch (NumberFormatException e) {
LOGGER.warn("Failed to parse double number: {}", value, e);
}
}
... | vuln | Vulnerable | Java |
struct clock_source *dce110_clock_source_create(
struct dc_context *ctx,
struct dc_bios *bios,
enum clock_source_id id,
const struct dce110_clk_src_regs *regs,
bool dp_clk_src)
{
struct dce110_clk_src *clk_src =
kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL);
if (!clk_src)
return NULL;
if (dce110_clk_... | vuln | Vulnerable | C/C++ |
unsigned int
sudoers_lookup(struct sudo_nss_list *snl, struct sudoers_context *ctx,
time_t now, sudoers_lookup_callback_fn_t callback, void *cb_data,
int *cmnd_status, int pwflag)
{
struct defaults_list *defs = NULL;
struct sudoers_parse_tree *parse_tree = NULL;
struct cmndspec *cs = NULL;
struc... | vuln | Vulnerable | C/C++ |
tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_t tile){
uint16 edge=0;
tsize_t written=0;
unsigned char* buffer=NULL;
tsize_t bufferoffset=0;
unsigned char* samplebuffer=NULL;
tsize_t samplebufferoffset=0;
tsize_t read=0;
uint16 i=0;
ttile_t tilecount=0;
/* tsize_t tilesize=0... | vuln | Safe | Unknown |
static void coroutine_fn v9fs_link(void *opaque)
{
V9fsPDU *pdu = opaque;
int32_t dfid, oldfid;
V9fsFidState *dfidp, *oldfidp;
V9fsString name;
size_t offset = 7;
int err = 0;
v9fs_string_init(&name);
err = pdu_unmarshal(pdu, offset, "dds", &dfid, &oldfid, &name);
if (err < 0) {
... | vuln | Safe | C/C++ |
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2009-2014 DreamWorks Animation LLC.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
// * ... | vuln | Safe | C/C++ |
/* packet-eap.c
* Routines for EAP Extensible Authentication Protocol dissection
* RFC 2284, RFC 3748
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config.h"
#include <stdio.h> /* f... | vuln | Safe | C/C++ |
""" html parser to clean up incoming text from unknown sources """
from html.parser import HTMLParser
class InputHtmlParser(HTMLParser): # pylint: disable=abstract-method
"""Removes any html that isn't allowed_tagsed from a block"""
def __init__(self):
HTMLParser.__init__(self)
self.allowed_... | vuln | Vulnerable | Python |
public static void onActionMenuItemSelected(
final RedditPreparedPost post,
final BaseActivity activity,
final Action action) {
switch(action) {
case UPVOTE:
post.action(activity, RedditAPI.ACTION_UPVOTE);
break;
case DOWNVOTE:
post.action(activity, RedditAPI.ACTION_DOWNVOTE);
break;... | vuln | Safe | Java |
private void updateMirroring() {
if (isCurrentlyMirroring() && (mLastHasContent
|| mDisplay.getState() == Display.STATE_OFF)) {
ProtoLog.v(WM_DEBUG_LAYER_MIRRORING,
"Display %d has content (%b) so disable layer mirroring", mDisplayId,
mLastHasC... | vuln | Safe | Java |
static void srt_to_ass(AVCodecContext *avctx, AVBPrint *dst,
const char *in, int x1, int y1, int x2, int y2)
{
if (x1 >= 0 && y1 >= 0) {
if (x2 >= 0 && y2 >= 0 && (x2 != x1 || y2 != y1) && x2 >= x1 && y2 >= y1) {
const int cx = x1 + (x2 - x1)/2;
... | vuln | Vulnerable | C/C++ |
static int sol_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
int ret;
if (s->pb->eof_reached)
return AVERROR(EIO);
ret= av_get_packet(s->pb, pkt, MAX_SIZE);
if (ret < 0)
return ret;
pkt->stream_index = 0;
pkt->size = ret;
return 0;
} | vuln | Safe | C/C++ |
void qemu_send_packet(VLANClientState *vc, const uint8_t *buf, int size)
{
VLANState *vlan = vc->vlan;
VLANPacket *packet;
if (vc->link_down)
return;
#ifdef DEBUG_NET
printf("vlan %d send:\n", vlan->id);
hex_dump(stdout, buf, size);
#endif
if (vlan->delivering) {
packet = qemu_ma... | vuln | Safe | C/C++ |
rsvg_marker_parse (const RsvgDefs * defs, const char *str)
{
char *name;
name = rsvg_get_url_string (str);
if (name) {
RsvgNode *val;
val = rsvg_defs_lookup (defs, name);
g_free (name);
if (val && (!strcmp (val->type->str, "marker")))
return val;
}
retur... | vuln | Vulnerable | Unknown |
static int64_t nfs_client_open(NFSClient *client, const char *filename,
int flags, Error **errp)
{
int ret = -EINVAL, i;
struct stat st;
URI *uri;
QueryParams *qp = NULL;
char *file = NULL, *strp = NULL;
uri = uri_parse(filename);
if (!uri) {
error_setg... | vuln | Safe | C/C++ |
private static void addPathsForEntity(OADoc document, int level, Map<String, OAPath> paths, String base, EntityType entityType, GeneratorContext options) {
if (options.isAddEntityProperties()) {
addPathsForEntityProperties(entityType, paths, base, options);
}
for (NavigationProperty ... | vuln | Safe | Java |
void BaseRenderingContext2D::drawImage(ScriptState* script_state,
CanvasImageSource* image_source,
double sx,
double sy,
double sw,
... | vuln | Safe | C/C++ |
public static void requestBlacklistsUpdate() {
if(INSTANCE != null) {
INSTANCE.mBlacklistsUpdateRequested = true;
// Wake the update thread to run the blacklist thread
INSTANCE.mPendingUpdates.offer(new Pair<>(new ConnectionDescriptor[0], new ConnectionUpdate[0]));
}... | vuln | Safe | Java |
status_t NuPlayer::GenericSource::setBuffers(
bool audio, Vector<MediaBuffer *> &buffers) {
if (mIsSecure && !audio && mVideoTrack.mSource != NULL) {
return mVideoTrack.mSource->setBuffers(buffers);
}
return INVALID_OPERATION;
} | vuln | Safe | Unknown |
def snoozeNotifications(): Action[JsValue] = PostJsonAction(RateLimits.ConfigUser,
maxBytes = 200) { request => | vuln | Safe | Scala |
long SegmentInfo::Parse() {
assert(m_pMuxingAppAsUTF8 == NULL);
assert(m_pWritingAppAsUTF8 == NULL);
assert(m_pTitleAsUTF8 == NULL);
IMkvReader* const pReader = m_pSegment->m_pReader;
long long pos = m_start;
const long long stop = m_start + m_size;
m_timecodeScale = 1000000;
m_duration = -1;
while (p... | vuln | Safe | C/C++ |
void libxsmm_sparse_csr_reader( libxsmm_generated_code* io_generated_code,
const char* i_csr_file_in,
unsigned int** o_row_idx,
unsigned int** o_column_idx,
doubl... | vuln | Safe | Unknown |
static int cdrom_ioctl_select_disc(struct cdrom_device_info *cdi,
unsigned long arg)
{
cd_dbg(CD_DO_IOCTL, "entering CDROM_SELECT_DISC\n");
if (!CDROM_CAN(CDC_SELECT_DISC))
return -ENOSYS;
if (arg != CDSL_CURRENT && arg != CDSL_NONE) {
if ((int)arg >= cdi->capacity)
return -EINVAL;
}
/*
* ->sel... | vuln | Vulnerable | C/C++ |
@Override
public CallbackType doVehicleInteraction(EntityVehicleF_Physics vehicle, APart part, BoundingBox hitBox, WrapperPlayer player, PlayerOwnerState ownerState, boolean rightClick){
switch(definition.item.type){
case WRENCH : {
if(!vehicle.world.isClient()){
//If the player isn't the owner of the ve... | vuln | Safe | Java |
@Override
public StructureTemplate.StructureBlockInfo processBlock(LevelReader worldReader, BlockPos pos, BlockPos pos2, StructureTemplate.StructureBlockInfo infoIn1, StructureTemplate.StructureBlockInfo infoIn2, StructurePlaceSettings settings) {
ChunkPos currentChunkPos = new ChunkPos(infoIn2.pos);
... | vuln | Safe | Java |
/* Copyright 2017 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 | C/C++ |
static BOOL drive_file_remove_dir(const WCHAR* path)
{
WIN32_FIND_DATAW findFileData = { 0 };
BOOL ret = TRUE;
HANDLE dir = INVALID_HANDLE_VALUE;
WCHAR* fullpath = NULL;
WCHAR* path_slash = NULL;
size_t base_path_length = 0;
if (!path)
return FALSE;
base_path_length = _wcslen(path);
path_slash = (WCHAR*)ca... | vuln | Safe | C/C++ |
QPDF::generateHintStream(std::map<int, QPDFXRefEntry> const& xref,
std::map<int, qpdf_offset_t> const& lengths,
std::map<int, int> const& obj_renumber,
PointerHolder<Buffer>& hint_buffer,
int& S, int& O)
{
// Populate actual hint table values
calculateHPageOffset(xref, lengths, obj_renumber);
... | vuln | Vulnerable | Unknown |
private void setOptions() {
if (!getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
return;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
ActivityManager am = Helper.getSystemService(getContext(), ActivityManager.class);
... | vuln | Safe | Java |
static int local_link(FsContext *ctx, V9fsPath *oldpath,
V9fsPath *dirpath, const char *name)
{
int ret;
V9fsString newpath;
char *buffer, *buffer1;
int serrno;
v9fs_string_init(&newpath);
v9fs_string_sprintf(&newpath, "%s/%s", dirpath->data, name);
buffer = rpath(ctx, ... | vuln | Vulnerable | C/C++ |
NavigationPolicy EffectiveNavigationPolicy(NavigationPolicy policy,
const WebInputEvent* current_event,
const WebWindowFeatures& features) {
if (policy == kNavigationPolicyIgnore)
return GetNavigationPolicy(current_event, featur... | vuln | Vulnerable | C/C++ |
includeFile(FileInfo *nested, CharsString *includedFile,
CharacterClass **characterClasses,
TranslationTableCharacterAttributes *characterClassAttribute,
short opcodeLengths[], TranslationTableOffset *newRuleOffset,
TranslationTableRule **newRule, RuleName **ruleNames,
TranslationTableHeader **table) {
int k... | vuln | Vulnerable | Unknown |
static int unpack_parse_unit(DiracParseUnit *pu, DiracParseContext *pc,
int offset)
{
uint8_t *start = pc->buffer + offset;
uint8_t *end = pc->buffer + pc->index;
if (start < pc->buffer || (start + 13 > end))
return 0;
pu->pu_type = start[4];
pu->next_pu_offset... | vuln | Vulnerable | C/C++ |
int ssl3_get_server_hello(SSL *s)
{
STACK_OF(SSL_CIPHER) *sk;
const SSL_CIPHER *c;
unsigned char *p,*d;
int i,al,ok;
unsigned int j;
long n;
#ifndef OPENSSL_NO_COMP
SSL_COMP *comp;
#endif
n=s->method->ssl_get_message(s,
SSL3_ST_CR_SRVR_HELLO_A,
SSL3_ST_CR_SRVR_HELLO_B,
-1,
20000, /* ?? */
&ok);
if... | vuln | Safe | Unknown |
def decode_and_calc_og(
body: bytes, media_uri: str, request_encoding: Optional[str] = None
) -> Dict[str, Optional[str]]:
"""
Calculate metadata for an HTML document.
This uses lxml to parse the HTML document into the OG response. If errors
occur during processing of the document, an empty respons... | vuln | Safe | Python |
long WebPImage::getHeaderOffset(byte* data, long data_size, byte* header, long header_size)
{
if (data_size < header_size) { return -1; }
long pos = -1;
for (long i=0; i < data_size - header_size; i++) {
if (memcmp(header, &data[i], header_size) == 0) {
pos = i;
... | vuln | Safe | C/C++ |
read_yin_leaf(struct lys_module *module, struct lys_node *parent, struct lyxml_elem *yin, int options,
struct unres_schema *unres)
{
struct ly_ctx *ctx = module->ctx;
struct lys_node *retval;
struct lys_node_leaf *leaf;
struct lyxml_elem *sub, *next;
const char *value;
int r, has_t... | vuln | Safe | Unknown |
private UploadImage createUploadImage(File file) throws IOException {
BufferedImage bimg = ImageIO.read(file);
int width = bimg.getWidth();
int height = bimg.getHeight();
String filePartialPath = "uploads" + fileSeparator + file.getName();
return new UploadImage(file.getName(), filePartialPath, width, height... | vuln | Vulnerable | Java |
static void
sysObjectID_handler(snmp_varbind_t *varbind, uint32_t *oid)
{
OID(sysObjectID_oid, 1, 3, 6, 1, 4, 1, 54352);
snmp_api_set_oid(varbind, oid, sysObjectID_oid);
} | vuln | Vulnerable | C/C++ |
static inline bool rom_order_compare(Rom *rom, Rom *item)
{
return ((uintptr_t)(void *)rom->as > (uintptr_t)(void *)item->as) ||
(rom->as == item->as && rom->addr >= item->addr);
} | vuln | Safe | C/C++ |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# wger
from wger.settings_global import *
# Third Party
import environ
env = environ.Env(
# set casting, default value
DJANGO_DEBUG=(bool, False)
)
# Use 'DEBUG = True' to get more details for server errors
DEBUG = env("DJANGO_DEBUG")
ADMINS = (
('Your nam... | vuln | Vulnerable | Python |
static void url_stream_start (auth_client *auth_user)
{
char *mount, *server;
ice_config_t *config = config_get_config ();
mount_proxy *mountinfo = config_find_mount (config, auth_user->mount, MOUNT_TYPE_NORMAL);
auth_t *auth = mountinfo->auth;
auth_url *url = auth->state;
char *stream_start_url... | vuln | Vulnerable | Unknown |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Vulnerable | C/C++ |
static int ast_probe(AVProbeData *p)
{
if (AV_RL32(p->buf) != MKTAG('S','T','R','M'))
return 0;
if (!AV_RB16(p->buf + 10) ||
!AV_RB16(p->buf + 12) || AV_RB16(p->buf + 12) > 256 ||
!AV_RB32(p->buf + 16) || AV_RB32(p->buf + 16) > 8*48000)
return 1;
return AVPROBE_SCORE_MAX / 3 ... | vuln | Safe | C/C++ |
void hide() {
if (!isShowing()) {
return;
}
mIsShowing = false;
mWindowManager.removeView(this);
setOnApplyWindowInsetsListener(null);
setSystemGestureExclusion();
} | vuln | Vulnerable | Java |
def post(self, *args, **kwargs):
api_key = None
username = sickbeard.WEB_USERNAME
password = sickbeard.WEB_PASSWORD
if self.get_argument('username', '') == username and self.get_argument('password', '') == password:
api_key = sickbeard.API_KEY
notifiers.notify_log... | vuln | Vulnerable | Python |
'use strict';
/*
* Request
*
* Copyright(c) 2014 Francois-Guillaume Ribreau <npm@fgribreau.com>
* MIT Licensed
*
*/
var extend = require('extend');
var request = require('request');
var RetryStrategies = require('./strategies');
var _ = require('lodash');
var url = require('url');
var querystring = require("quer... | vuln | Safe | JavaScript |
package io.onedev.server.plugin.executor.serverdocker;
import static io.onedev.agent.DockerExecutorUtils.cleanDirAsRoot;
import static io.onedev.agent.DockerExecutorUtils.createNetwork;
import static io.onedev.agent.DockerExecutorUtils.deleteNetwork;
import static io.onedev.agent.DockerExecutorUtils.isUseProcessIsolat... | vuln | Vulnerable | Java |
import random
import string
from .constants import DEFAULT_BACKUP_DIRECTORY
def make_password(length=16):
"""Create a random password."""
return "".join(
random.SystemRandom().choice(
string.ascii_letters + string.digits) for _ in range(length))
# Validators should return a tuple bool, ... | vuln | Safe | Python |
int mp_unpack_full(lua_State *L, int limit, int offset) {
size_t len;
const char *s;
mp_cur c;
int cnt; /* Number of objects unpacked */
int decode_all = (!limit && !offset);
s = luaL_checklstring(L,1,&len); /* if no match, exits */
if (offset < 0 || limit < 0) /* requesting negative off o... | vuln | Vulnerable | C/C++ |
bgp_attr_print(netdissect_options *ndo,
u_int atype, const u_char *pptr, u_int len, const unsigned attr_set_level)
{
int i;
uint16_t af;
uint8_t safi, snpa, nhlen;
union { /* copy buffer for bandwidth values */
float f;
uint32_t i;
} bw;
int advance;
u_int ... | vuln | Safe | C/C++ |
private boolean isServiceVulnerable(NetworkService networkService) {
for (String dir : COMMON_DIRECTORIES) {
if (checkUrlWithCommonDirectory(networkService, dir)) {
return true;
}
}
return false;
} | vuln | Safe | Java |
# -*- 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 |
MqttClient.prototype._setupStream = function () {
var connectPacket
var that = this
var writable = new Writable()
var parser = mqttPacket.parser(this.options)
var completeParse = null
var packets = []
this._clearReconnect()
this.stream = this.streamBuilder(this)
parser.on('packet', function (packet... | vuln | Vulnerable | JavaScript |
static void exitErrorHandler(jpeg_common_struct *error) {
j_decompress_ptr cinfo = (j_decompress_ptr)error;
str_src_mgr * src = (struct str_src_mgr *)cinfo->src;
longjmp(src->setjmp_buffer, 1);
} | vuln | Safe | C/C++ |
exif_mnote_data_canon_load (ExifMnoteData *ne,
const unsigned char *buf, unsigned int buf_size)
{
ExifMnoteDataCanon *n = (ExifMnoteDataCanon *) ne;
ExifShort c;
size_t i, tcount, o, datao;
if (!n || !buf || !buf_size) {
exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
"ExifMnoteCanon", "Short MakerNote");
... | vuln | Vulnerable | C/C++ |
public void forEachActor(Level world, BiConsumer<MovementBehaviour, MovementContext> callBack) {
for (MutablePair<StructureBlockInfo, MovementContext> pair : actors) {
MovementBehaviour behaviour = AllMovementBehaviours.getBehaviour(pair.getLeft().state);
if (behaviour == null)
continue;
callBack.accept(... | vuln | Safe | Java |
rfbBool rfbSendRectEncodingZRLE(rfbClientPtr cl, int x, int y, int w, int h)
{
zrleOutStream* zos;
rfbFramebufferUpdateRectHeader rect;
rfbZRLEHeader hdr;
int i;
char *zrleBeforeBuf;
if (cl->zrleBeforeBuf == NULL) {
cl->zrleBeforeBuf = (char *) malloc(rfbZRLETileWidth * rfbZRLETileHeight * 4 + 4);
}
z... | vuln | Safe | Unknown |
ProcessInterrupts(void)
{
/* OK to accept interrupt now? */
if (InterruptHoldoffCount != 0 || CritSectionCount != 0)
return;
InterruptPending = false;
if (ProcDiePending)
{
ProcDiePending = false;
QueryCancelPending = false; /* ProcDie trumps QueryCancel */
ImmediateInterruptOK = false; /* not idle anymor... | vuln | Vulnerable | Unknown |
static BlockAIOCB *blkverify_aio_flush(BlockDriverState *bs,
BlockCompletionFunc *cb,
void *opaque)
{
BDRVBlkverifyState *s = bs->opaque;
return bdrv_aio_flush(s->test_file->bs, cb, opaque);
} | vuln | Vulnerable | C/C++ |
static bool tcp_collapse_retrans(struct sock *sk, struct sk_buff *skb)
{
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *next_skb = skb_rb_next(skb);
int next_skb_size;
next_skb_size = next_skb->len;
BUG_ON(tcp_skb_pcount(skb) != 1 || tcp_skb_pcount(next_skb) != 1);
if (next_skb_size) {
if (next_skb_size <... | vuln | Safe | Unknown |
static Image *ReadDOTImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
char
command[MaxTextExtent];
const char
*option;
graph_t
*graph;
Image
*image;
ImageInfo
*read_info;
MagickBooleanType
status;
/*
Open image file.
*/
assert(image_info != (const ImageIn... | vuln | Vulnerable | C/C++ |
ImagingSgiRleDecode(Imaging im, ImagingCodecState state,
UINT8* buf, Py_ssize_t bytes)
{
UINT8 *ptr;
SGISTATE *c;
int err = 0;
/* Get all data from File descriptor */
c = (SGISTATE*)state->context;
_imaging_seek_pyFd(state->fd, 0L, SEEK_END);
c->bufsize = _imaging_tell_pyFd(state->fd)... | vuln | Vulnerable | Unknown |
static int ext4_init_block_bitmap(struct super_block *sb,
struct buffer_head *bh,
ext4_group_t block_group,
struct ext4_group_desc *gdp)
{
unsigned int bit, bit_max;
struct ext4_sb_info *sbi = EXT4_SB(sb);
ext4_fsblk_t start, tmp;
J_ASSERT_BH(bh, buffer_locked(bh));
/* If checksum is bad mar... | vuln | Safe | C/C++ |
public static IPermissionNode makeNode(ResourceLocation registryName, int level) {
PermissionNode<Boolean> node = new PermissionNode<>(registryName, PermissionTypes.BOOLEAN, (player, uuid, contexts) -> true, TARGET, PLAYER, BLOCK_POS, BLOCK_STATE, FACING);
IPermissionNode nodeImpl = new PermissionNodeBu... | vuln | Vulnerable | Java |
#include "Python.h"
/* snprintf() wrappers. If the platform has vsnprintf, we use it, else we
emulate it in a half-hearted way. Even if the platform has it, we wrap
it because platforms differ in what vsnprintf does in case the buffer
is too small: C99 behavior is to return the number of characters that
... | vuln | Vulnerable | Python |
void
tcpdump_close(tcpdump_t *tcpdump)
{
if (! tcpdump)
return;
if (tcpdump->pid <= 0)
return;
dbgx(2, "[parent] killing tcpdump pid: %d", tcpdump->pid);
kill(tcpdump->pid, SIGKILL);
close(PARENT_READ_FD);
close(PARENT_WRITE_FD);
if (waitpid(tcpdump->pid, NULL, 0) != tcpd... | vuln | Safe | C/C++ |
TPM_SE_Unmarshal(TPM_SE *target, BYTE **buffer, INT32 *size)
{
TPM_RC rc = TPM_RC_SUCCESS;
if (rc == TPM_RC_SUCCESS) {
rc = UINT8_Unmarshal(target, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
switch (*target) {
case TPM_SE_HMAC:
case TPM_SE_POLICY:
case TPM_SE_TRIAL:
break;
defaul... | vuln | Vulnerable | Unknown |
SWFShape_setLeftFillStyle(SWFShape shape, SWFFillStyle fill)
{
ShapeRecord record;
int idx;
if ( shape->isEnded || shape->isMorph )
return;
if(fill == NOFILL)
{
record = addStyleRecord(shape);
record.record.stateChange->leftFill = 0;
record.record.stateChange->flags |= SWF_SHAPE_FILLSTYLE0FLAG;
return... | vuln | Safe | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Vulnerable | C/C++ |
void cgit_print_blob(const char *hex, char *path, const char *head, int file_only)
{
unsigned char sha1[20];
enum object_type type;
char *buf;
unsigned long size;
struct commit *commit;
struct pathspec_item path_items = {
.match = path,
.len = path ? strlen(path) : 0
};
struct pathspec paths = {
.nr = 1,
... | vuln | Vulnerable | Unknown |
private boolean isFileWithinDirectory(
final File dir,
final File file
) throws IOException {
final File dir_ = dir.getAbsoluteFile();
if (dir_.isDirectory()) {
final File fl = new File(dir_, file.getPath());
if (fl.isFile()) {
if (fl.g... | vuln | Safe | Java |
@Override
public SoundEvent getAudio(@Nonnull ItemStack stack) {
Item item = stack.getItem();
if (!(item instanceof MusicDiscItem)) {
return null;
}
return ((MusicDiscItemAccessor) item).getSound();
} | vuln | Safe | Java |
static struct o2nm_cluster *to_o2nm_cluster_from_node(struct o2nm_node *node)
{
/* through the first node_set .parent
* mycluster/nodes/mynode == o2nm_cluster->o2nm_node_group->o2nm_node */
return to_o2nm_cluster(node->nd_item.ci_parent->ci_parent);
} | vuln | Vulnerable | C/C++ |
l2tp_q931_cc_print(netdissect_options *ndo, const u_char *dat, u_int length)
{
if (length < 3) {
ND_PRINT((ndo, "AVP too short"));
return;
}
print_16bits_val(ndo, (const uint16_t *)dat);
ND_PRINT((ndo, ", %02x", dat[2]));
dat += 3;
length -= 3;
if (length != 0) {
ND_PRINT((ndo, " "));
print_string(ndo, d... | vuln | Safe | C/C++ |
/*
* This library 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 the License, or (at your option) any later version.
*
* This library is distributed in the hope that it wi... | vuln | Vulnerable | C/C++ |
boolean processBinaryPackets(ByteBuffer applicationData) {
boolean requiresWriteOperation = false;
boolean hasMessage = false;
try {
while (isConnected()
&& ((expectPacket && (applicationData.remaining() > incomingCipherLength)) || (expectedBytes > 0 && applicationData
.hasRemaining())) && !requ... | vuln | Safe | Java |
mp_join_print(netdissect_options *ndo,
const u_char *opt, u_int opt_len, u_char flags)
{
const struct mp_join *mpj = (const struct mp_join *) opt;
if (!(opt_len == 12 && (flags & TH_SYN)) &&
!(opt_len == 16 && (flags & (TH_SYN | TH_ACK)) == (TH_SYN | TH_ACK)) &&
!(... | vuln | Safe | Unknown |
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
import { saveAs } from 'file-saver'
import { FlowRouter } from 'meteor/ostrio:flow-router-extra'
import { NullXlsx } from '@neovici/nullxlsx'
import './periodtimetable.html'
import './pagination.js'
import './limitpicker.js'
import { i18nReady, t } from '../.... | vuln | Safe | JavaScript |
@Override
protected void onDestroy() {
if (service != null) {
unbindService(serviceConnection);
}
unsetInstallFinishedListener();
super.onDestroy();
} | vuln | Safe | Java |
inline Status SparseTensor::Split(const SparseTensor& input_tensor,
const int split_dim, const int num_split,
std::vector<SparseTensor>* result) {
std::vector<Tensor> output_indices;
std::vector<Tensor> output_values;
std::vector<TensorShape> out... | vuln | Safe | C/C++ |
evbuffer_add(struct evbuffer *buf, const void *data_in, size_t datlen)
{
struct evbuffer_chain *chain, *tmp;
const unsigned char *data = data_in;
size_t remain, to_alloc;
int result = -1;
EVBUFFER_LOCK(buf);
if (buf->freeze_end) {
goto done;
}
chain = buf->last;
/* If there are no chains allocated for th... | vuln | Vulnerable | C/C++ |
COMPAT_SYSCALL_DEFINE5(waitid,
int, which, compat_pid_t, pid,
struct compat_siginfo __user *, infop, int, options,
struct compat_rusage __user *, uru)
{
struct rusage ru;
struct waitid_info info = {.status = 0};
long err = kernel_waitid(which, pid, &info, options, uru ? &ru : NULL);
int signo = 0;
if (err > ... | vuln | Vulnerable | Unknown |
static int pix_norm1_altivec(uint8_t *pix, int line_size)
{
int i, s = 0;
const vector unsigned int zero =
(const vector unsigned int) vec_splat_u32(0);
vector unsigned int sv = (vector unsigned int) vec_splat_u32(0);
vector signed int sum;
for (i = 0; i < 16; i++) {
... | vuln | Safe | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.