code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
def _convert_states_v46_dict_to_v47_dict(cls, states_dict): """Converts from version 46 to 47. Version 52 deprecates oppia-noninteractive-svgdiagram tag and converts existing occurences of it to oppia-noninteractive-image tag. Args: states_dict: dict. A dict where each key-v...
vuln
Safe
Python
static struct htx_sl *h2_prepare_htx_reqline(uint32_t fields, struct ist *phdr, struct htx *htx, unsigned int *msgf) { struct ist uri, meth_sl; unsigned int flags = HTX_SL_F_NONE; struct htx_sl *sl; size_t i; if ((fields & H2_PHDR_FND_METH) && isteq(phdr[H2_PHDR_IDX_METH], ist("CONNECT"))) { if (fields & H2_PHD...
vuln
Safe
Unknown
@Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { if (minLeftEdgeDistance == -1) { // if not initialized initEdgeDistance(); } if (mMarkAsReadWhileScrollingEnabled && e1.getX() > minLeftE...
vuln
Vulnerable
Java
InsertValidationResponse insertRows(Iterable<Map<String, Object>> rows, String offsetToken) { float rowSize = 0F; if (this.fields.isEmpty()) { throw new SFException(ErrorCode.INTERNAL_ERROR, "Empty column fields"); } InsertValidationResponse response = new InsertValidationResponse(); this.flu...
vuln
Vulnerable
Java
static int parse_status(const char *value) { int ret = 0; char *c; /* skip a header line */ c = strchr(value, '\n'); if (!c) return -1; c++; while (*c != '\0') { int port, status, speed, devid; int sockfd; char lbusid[SYSFS_BUS_ID_SIZE]; struct usbip_imported_device *idev; char hub[3]; ret = ssc...
vuln
Safe
Unknown
bool inode_owner_or_capable(const struct inode *inode) { if (uid_eq(current_fsuid(), inode->i_uid)) return true; if (inode_capable(inode, CAP_FOWNER)) return true; return false; }
vuln
Vulnerable
C/C++
/* * Copyright 2002-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by ap...
vuln
Vulnerable
Java
av_cold int vp56_free(AVCodecContext *avctx) { VP56Context *s = avctx->priv_data; int pt; av_freep(&s->qscale_table); av_freep(&s->above_blocks); av_freep(&s->macroblocks); av_freep(&s->edge_emu_buffer_alloc); if (s->framep[VP56_FRAME_GOLDEN]->data[0]) avctx->release_buffer(avctx, s-...
vuln
Safe
C/C++
@Override protected void onCreate(Bundle savedInstanceState) { ApplicationLoader.postInitApplication(); requestWindowFeature(Window.FEATURE_NO_TITLE); setTheme(R.style.Theme_TMessages); getWindow().setBackgroundDrawableResource(R.drawable.transparent); if (SharedConfig.passc...
vuln
Safe
Java
static CharDriverState *qmp_chardev_open_udp(ChardevUdp *udp, Error **errp) { int fd; fd = socket_dgram(udp->remote, udp->local, errp); if (fd < 0) { return NULL; } return qemu_chr_open_udp_fd(fd); }
vuln
Safe
C/C++
static int check_symlinks(struct archive_write_disk *a) { #if !defined(HAVE_LSTAT) /* Platform doesn't have lstat, so we can't look for symlinks. */ (void)a; /* UNUSED */ return (ARCHIVE_OK); #else char *pn; char c; int r; struct stat st; /* * Guard against symlink tricks. Reject any archive entry whose *...
vuln
Vulnerable
C/C++
package schema import ( "strings" "github.com/answerdev/answer/internal/base/reason" "github.com/answerdev/answer/internal/base/validator" "github.com/answerdev/answer/pkg/converter" "github.com/segmentfault/pacman/errors" ) // SearchTagLikeReq get tag list all request type SearchTagLikeReq struct { // tag Ta...
vuln
Vulnerable
Go
static int ipvideo_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; IpvideoContext *s = avctx->priv_data; AVFrame *frame = data; int ret; ...
vuln
Safe
C/C++
generic_file_splice_write_nolock(struct pipe_inode_info *pipe, struct file *out, loff_t *ppos, size_t len, unsigned int flags) { struct address_space *mapping = out->f_mapping; struct inode *inode = mapping->host; ssize_t ret; int err; err = remove_suid(out->f_dentry); if (unlikely(err)) return err; ret...
vuln
Safe
Unknown
static void copyTrespass( short * /* dst */, const int *[FLACParser::kMaxChannels] /* src */, unsigned /* nSamples */, unsigned /* nChannels */) { TRESPASS(); }
vuln
Safe
C/C++
CString CZNC::FixupEncoding(const CString& sEncoding) const { if (sEncoding.empty() && m_uiForceEncoding) { return "UTF-8"; } return sEncoding; }
vuln
Vulnerable
C/C++
static int coroutine_fn bdrv_driver_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) { BlockDriver *drv = bs->drv; int64_t sector_num; unsigned int nb_sectors; if (drv->bdrv_...
vuln
Vulnerable
C/C++
void bm_fillcircle(Bitmap *b, int x0, int y0, int r) { int x = -r; int y = 0; int err = 2 - 2 * r; do { int i; for(i = x0 + x; i <= x0 - x; i++) { /* Maybe the clipping can be more effective... */ int yp = y0 + y; if(i >= b->clip.x0 && i < b->clip.x1 &...
vuln
Vulnerable
C/C++
static int img_bench(int argc, char **argv) { int c, ret = 0; const char *fmt = NULL, *filename; bool quiet = false; bool image_opts = false; bool is_write = false; int count = 75000; int depth = 64; int64_t offset = 0; size_t bufsize = 4096; int pattern = 0; size_t step = 0;...
vuln
Safe
C/C++
static int ffm2_read_header(AVFormatContext *s) { FFMContext *ffm = s->priv_data; AVStream *st; AVIOContext *pb = s->pb; AVCodecContext *codec; const AVCodecDescriptor *codec_desc; int ret, i; int f_main = 0, f_cprv = -1, f_stvi = -1, f_stau = -1; AVCodec *enc; char *buffer; ffm-...
vuln
Vulnerable
C/C++
static unsigned uv__utf8_decode1_slow(const char** p, const char* pe, unsigned a) { unsigned b; unsigned c; unsigned d; unsigned min; if (a > 0xF7) return -1; switch (*p - pe) { default: if (a > 0xEF) { min = 0x100...
vuln
Vulnerable
Unknown
void inode_init_owner(struct inode *inode, const struct inode *dir, umode_t mode) { inode->i_uid = current_fsuid(); if (dir && dir->i_mode & S_ISGID) { inode->i_gid = dir->i_gid; /* Directories are special, and always inherit S_ISGID */ if (S_ISDIR(mode)) mode |= S_ISGID; else if ((mode & (S_ISGID...
vuln
Safe
C/C++
GF_EXPORT GF_Err gf_media_split_hevc_tiles(GF_ISOFile *file, u32 signal_mode) { #if defined(GPAC_DISABLE_HEVC) || defined(GPAC_DISABLE_AV_PARSERS) return GF_NOT_SUPPORTED; #else u32 i, j, cur_tile, count, stype, track, nb_tiles, di, nalu_size_length, tx, ty, tw, th; s32 pps_idx=-1, sps_idx=-1, ret; GF_Err e = GF_OK...
vuln
Vulnerable
C/C++
static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size) { struct xlx_ethlite *s = qemu_get_nic_opaque(nc); unsigned int rxbase = s->rxbuf * (0x800 / 4); /* DA filter. */ if (!(buf[0] & 0x80) && memcmp(&s->conf.macaddr.a[0], buf, 6)) return size; if (s->regs[rxbase + R_R...
vuln
Safe
Unknown
static ssize_t removable_show(struct device *dev, struct device_attribute *attr, char *buf) { return sprintf(buf, "%d\n", (int)IS_ENABLED(CONFIG_MEMORY_HOTREMOVE)); }
vuln
Vulnerable
Unknown
func testThatLegalHoldStatusIsEnabled_AfterAcceptingRequest() { // GIVEN let selfUser = ZMUser.selfUser(in: uiMOC) createSelfClient(onMOC: uiMOC) let conversation = createConversation(in: uiMOC) conversation.addParticipantAndUpdateConversationState(user: selfUser, role: nil) ...
vuln
Safe
Swift
# -*- 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
Safe
Python
void CoordinatorImpl::GetVmRegionsForHeapProfiler( const std::vector<base::ProcessId>& pids, GetVmRegionsForHeapProfilerCallback callback) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); uint64_t dump_guid = ++next_dump_id_; std::unique_ptr<QueuedVmRegionRequest> request = std::make_unique<QueuedV...
vuln
Vulnerable
C/C++
const bootbox = require('bootbox'); require('../services/Requisitions'); /** * @author Alejandro Galue <agalue@opennms.org> * @copyright 2014 The OpenNMS Group, Inc. */ (function() { 'use strict'; const policyView = require('../../views/policy.html'); const moveView = require('../../views/move.html'); cons...
vuln
Safe
Java
/* * linux/fs/ext4/xattr.c * * Copyright (C) 2001-2003 Andreas Gruenbacher, <agruen@suse.de> * * Fix by Harrison Xing <harrison@mountainviewdata.com>. * Ext4 code with a lot of help from Eric Jarman <ejarman@acm.org>. * Extended attributes for symlinks and special files added per * suggestion of Luka Renko <lu...
vuln
Vulnerable
C/C++
@Override public void appendResponse(String response) { super.appendResponse(response); if (StringUtils.startsWithIgnoreCase(response, "[MSG:INFO: Sending")) { setOk(true); setDone(true); } else { throw new RuntimeException("Unknown response: " + response...
vuln
Vulnerable
Java
document.createElement("span");y.style["float"]="right";y.style.cursor="pointer";y.style.userSelect="none";y.style.marginTop="-4px";y.appendChild(n);mxUtils.write(y,mxResources.get("showStartScreen"));mxEvent.addListener(y,"click",function(F){mxEvent.getSource(F)!=n&&(n.checked=!n.checked)});header=y}var K=localStorage...
vuln
Vulnerable
JavaScript
static boolean parse_identifier( const char **pcur, char *ret ) { const char *cur = *pcur; int i = 0; if (is_alpha_underscore( cur )) { ret[i++] = *cur++; while (is_alpha_underscore( cur ) || is_digit( cur )) ret[i++] = *cur++; ret[i++] = '\0'; *pcur = cur; retur...
vuln
Vulnerable
Unknown
LoadWatcher(ScriptContext* context, LoadWatcher(content::RenderFrame* frame, const base::Callback<void(bool)>& callback) : content::RenderFrameObserver(frame), callback_(callback) {} void DidCreateDocumentElement() override { // The callback must be run as soon as the root element is availa...
vuln
Safe
C/C++
def yaml_msg_str(type_, yaml_str, filename=None): """ Load single message from YAML dictionary representation. @param type_: Message class @type type_: class (Message subclass) @param filename: Name of YAML file @type filename: str """ import yaml if yaml_str.strip() == '': ...
vuln
Safe
Python
def _convert_states_v47_dict_to_v48_dict(cls, states_dict): """Converts from version 47 to 48. Version 48 fixes encoding issues in HTML fields. Args: states_dict: dict. A dict where each key-value pair represents, respectively, a state name and a dict used to initial...
vuln
Safe
Python
TPM_RC TPM2B_Unmarshal(TPM2B *target, UINT16 targetSize, BYTE **buffer, INT32 *size) { TPM_RC rc = TPM_RC_SUCCESS; if (rc == TPM_RC_SUCCESS) { rc = UINT16_Unmarshal(&target->size, buffer, size); } if (rc == TPM_RC_SUCCESS) { if (target->size > targetSize) { rc = TPM_RC_SIZE; target->size = ...
vuln
Safe
C/C++
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
vuln
Vulnerable
Python
int tls1_enc(SSL *s, int send) { SSL3_RECORD *rec; EVP_CIPHER_CTX *ds; unsigned long l; int bs,i,j,k,pad=0,ret,mac_size=0; int n; const EVP_CIPHER *enc; if (send) { if (EVP_MD_CTX_md(s->write_hash)) { n=EVP_MD_CTX_size(s->write_hash); OPENSSL_assert(n >= 0); } ds=s->enc_write_ctx; rec= &(s-...
vuln
Vulnerable
Unknown
static int local_mkdir(FsContext *fs_ctx, V9fsPath *dir_path, const char *name, FsCred *credp) { int err = -1; int dirfd; if (fs_ctx->export_flags & V9FS_SM_MAPPED_FILE && local_is_mapped_file_metadata(fs_ctx, name)) { errno = EINVAL; return -1; } dir...
vuln
Safe
Unknown
/* 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++
_libssh2_channel_flush(LIBSSH2_CHANNEL *channel, int streamid) { if(channel->flush_state == libssh2_NB_state_idle) { LIBSSH2_PACKET *packet = _libssh2_list_first(&channel->session->packets); channel->flush_refund_bytes = 0; channel->flush_flush_bytes = 0; while(packet) {...
vuln
Vulnerable
Unknown
void ASessionDescription::getFormatType( size_t index, unsigned long *PT, AString *desc, AString *params) const { AString format; getFormat(index, &format); const char *lastSpacePos = strrchr(format.c_str(), ' '); CHECK(lastSpacePos != NULL); char *end; unsigned long x = strtoul(lastSpacePos + 1, &end, ...
vuln
Vulnerable
C/C++
int ldb_handler_fold(struct ldb_context *ldb, void *mem_ctx, const struct ldb_val *in, struct ldb_val *out) { char *s, *t; size_t l; if (!in || !out || !(in->data)) { return -1; } out->data = (uint8_t *)ldb_casefold(ldb, mem_ctx, (const char *)(in->data), in->length); if (out->data == NULL) { ldb_deb...
vuln
Vulnerable
C/C++
def _process_measurement_list(agentAttestState, lines, hash_alg, lists=None, m2w=None, pcrval=None, ima_keyrings=None, boot_aggregates=None): failure = Failure(Component.IMA) running_hash = agentAttestState.get_pcr_state(config.IMA_PCR, hash_alg) found_pcr = (pcrval is None) ...
vuln
Safe
Python
import { loginPage, projectsPage } from "../../support/page_objects/navigation"; import { mainPage } from "../../support/page_objects/mainPage"; import { isPostgres, isXcdb, roles, staticProjects, } from "../../support/page_objects/projectConstants"; import { isTestSuiteActive } from "../../support/page...
vuln
Vulnerable
JavaScript
int Reverb_setParameter (ReverbContext *pContext, void *pParam, void *pValue){ int status = 0; int16_t level; int16_t ratio; uint32_t time; t_reverb_settings *pProperties; int32_t *pParamTemp = (int32_t *)pParam; int32_t param = *pParamTemp++; if (pContext->preset) { if (param != REVERB_PARAM_P...
vuln
Vulnerable
C/C++
TfLiteStatus SigmoidEval(TfLiteContext* context, TfLiteNode* node) { OpData* data = reinterpret_cast<OpData*>(node->user_data); const TfLiteTensor* input = GetInput(context, node, 0); TfLiteTensor* output = GetOutput(context, node, 0); switch (input->type) { case kTfLiteFloat32: { if (kernel_type == ...
vuln
Vulnerable
C/C++
xmlTextReaderConstValue(xmlTextReaderPtr reader) { xmlNodePtr node; if (reader == NULL) return(NULL); if (reader->node == NULL) return(NULL); if (reader->curnode != NULL) node = reader->curnode; else node = reader->node; switch (node->type) { case XML_NAMESPACE_DECL: return(((x...
vuln
Vulnerable
Unknown
int qemu_fdt_setprop_sized_cells_from_array(void *fdt, const char *node_path, const char *property, int numvalues, uint64_t *values) { uint3...
vuln
Safe
C/C++
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
changePassword: function(newPassword) { var d = $q.defer(), loginCookie = readLoginCookie(); $http({ method: 'POST', url: '/SOGo/so/changePassword', data: { userName: loginCookie[0], password: loginCookie[1], ...
vuln
Vulnerable
Objective-C
int rose_rx_call_request(struct sk_buff *skb, struct net_device *dev, struct rose_neigh *neigh, unsigned int lci) { struct sock *sk; struct sock *make; struct rose_sock *make_rose; struct rose_facilities_struct facilities; int n; skb->sk = NULL; /* Initially we don't know who it's for */ /* * skb->data poin...
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 bootstrap from 'bootstrap' import { i18nReady, t } from '../../utils/i18n.js' import Timecards from '../../api...
vuln
Vulnerable
JavaScript
@Override public void setAppEnabled(String packageName, boolean enabled) throws RemoteException { enforceManager("setAppEnabled"); mAppManager.setEnabled(packageName, enabled); mEnabledAppCache = null; if (AppConstants.ANDROID.equals(packageName)) return; // system server itself ...
vuln
Safe
Java
public void removeRollingFileAppender(String taskId) { rollingFileAppenderMap.computeIfPresent(taskId, (k, v) -> { org.apache.logging.log4j.core.Logger coreLogger = (org.apache.logging.log4j.core.Logger) logger; RollingFileAppender appender = rollingFileAppenderMap.get(k); appender.stop(); appender.getMan...
vuln
Safe
Java
def copy(self, src_data, src_path, dst_data, dst_path, job_id=None): credentials = '' if src_data is None: # Local src = src_path else: credentials += self._formatCredentials(src_data, name='src') src = 'src:{}'.format(src_path) if dst_data is None: ...
vuln
Vulnerable
Python
package com.salesmanager.shop.admin.controller.user; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import javax.inject.Inject; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.validat...
vuln
Safe
Java
int mainloop(CLIENT *client) { struct nbd_request request; struct nbd_reply reply; gboolean go_on=TRUE; #ifdef DODBG int i = 0; #endif negotiate(client); DEBUG("Entering request loop!\n"); reply.magic = htonl(NBD_REPLY_MAGIC); reply.error = 0; while (go_on) { char buf[BUFSIZE]; size_t len; #ifdef DODBG i...
vuln
Safe
C/C++
HttpHeaderEntry::parse(const char *field_start, const char *field_end, const http_hdr_owner_type msgType) { /* note: name_start == field_start */ const char *name_end = (const char *)memchr(field_start, ':', field_end - field_start); int name_len = name_end ? name_end - field_start :0; const char *value...
vuln
Safe
Unknown
int jffs2_set_acl(struct inode *inode, struct posix_acl *acl, int type) { int rc, xprefix; switch (type) { case ACL_TYPE_ACCESS: xprefix = JFFS2_XPREFIX_ACL_ACCESS; if (acl) { umode_t mode; rc = posix_acl_update_mode(inode, &mode, &acl); if (rc) return rc; if (inode->i_mode != mode) { struc...
vuln
Safe
C/C++
static gint conv_euctojis(gchar *outbuf, gint outlen, const gchar *inbuf) { const guchar *in = inbuf; guchar *out = outbuf; JISState state = JIS_ASCII; while (*in != '\0') { if (IS_ASCII(*in)) { K_OUT(); *out++ = *in++; } else if (iseuckanji(*in)) { if (iseuckanji(*(in + 1))) { K_IN(); *out++ ...
vuln
Vulnerable
Unknown
@Override public void setEnableRedirection(boolean enableRedirection) { this.enableRedirection = enableRedirection; if (this.enableRedirection) { deviceIdToEndpoint = new ConcurrentHashMap<>(); } for (ISession session : queue) { session.setEnableRedirection(enableRedirection); } fo...
vuln
Safe
Java
WORD32 ih264d_parse_bslice(dec_struct_t * ps_dec, UWORD16 u2_first_mb_in_slice) { dec_pic_params_t * ps_pps = ps_dec->ps_cur_pps; dec_slice_params_t * ps_slice = ps_dec->ps_cur_slice; dec_bit_stream_t * ps_bitstrm = ps_dec->ps_bitstrm; UWORD8 u1_ref_idx_re_flag_lx; UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_...
vuln
Vulnerable
C/C++
@Override protected void onCreate(Bundle savedInstanceState) { this.warnReboot = false; this.moduleCache = new File(this.getCacheDir(), "installer"); if (!this.moduleCache.exists() && !this.moduleCache.mkdirs()) Log.e(TAG, "Failed to mkdir module cache dir!"); super.onCre...
vuln
Vulnerable
Java
void Polygon::Insert( sal_uInt16 nPos, const Point& rPt ) { ImplMakeUnique(); if( nPos >= mpImplPolygon->mnPoints ) nPos = mpImplPolygon->mnPoints; mpImplPolygon->ImplSplit( nPos, 1 ); mpImplPolygon->mpPointAry[ nPos ] = rPt; }
vuln
Vulnerable
C/C++
static int virtio_ccw_hcall_notify(const uint64_t *args) { uint64_t subch_id = args[0]; uint64_t queue = args[1]; SubchDev *sch; int cssid, ssid, schid, m; if (ioinst_disassemble_sch_ident(subch_id, &m, &cssid, &ssid, &schid)) { return -EINVAL; } sch = css_find_subch(m, cssid, ssid, ...
vuln
Safe
C/C++
public void handleNotes() { if (mNote != null) { try { if (sNotzUtils.validBackup(Encryption.decrypt(mNote))) { mNewNote = Encryption.decrypt(mNote); } else if (sNotzUtils.validBackup(mNote)) { mNewNote = mNote; ...
vuln
Safe
Java
static int save_dev(blkid_dev dev, FILE *file) { struct list_head *p; if (!dev || dev->bid_name[0] != '/') return 0; DBG(SAVE, ul_debug("device %s, type %s", dev->bid_name, dev->bid_type ? dev->bid_type : "(null)")); fprintf(file, "<device DEVNO=\"0x%04lx\" TIME=\"%ld.%ld\"", (unsigned long) dev->bid_d...
vuln
Vulnerable
Unknown
TfLiteStatus EvalImpl(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteDepthwiseConvParams*>(node->builtin_data); OpData* data = reinterpret_cast<OpData*>(node->user_data); TfLiteTensor* output; TF_LITE_ENSURE_OK(context, GetOutputSafe(context, node, k...
vuln
Safe
C/C++
static void cmv_decode_intra(CmvContext * s, const uint8_t *buf, const uint8_t *buf_end){ unsigned char *dst = s->frame.data[0]; int i; for (i=0; i < s->avctx->height && buf+s->avctx->width<=buf_end; i++) { memcpy(dst, buf, s->avctx->width); dst += s->frame.linesize[0]; buf += s->avc...
vuln
Vulnerable
C/C++
jas_image_t *jp2_decode(jas_stream_t *in, char *optstr) { jp2_box_t *box; int found; jas_image_t *image; jp2_dec_t *dec; bool samedtype; int dtype; unsigned int i; jp2_cmap_t *cmapd; jp2_pclr_t *pclrd; jp2_cdef_t *cdefd; unsigned int channo; int newcmptno; int_fast32_t *lutents; #if 0 jp2_cdefchan_t *cdef...
vuln
Safe
Unknown
/* * File operations used by nfsd. Some of these have been ripped from * other parts of the kernel because they weren't exported, others * are partial duplicates with added or changed functionality. * * Note that several functions dget() the dentry upon which they want * to act, most notably those that create dir...
vuln
Safe
C/C++
GF_Err hdlr_dump(GF_Box *a, FILE * trace) { GF_HandlerBox *p = (GF_HandlerBox *)a; gf_isom_box_dump_start(a, "HandlerBox", trace); if (p->nameUTF8 && (u32) p->nameUTF8[0] == strlen(p->nameUTF8+1)) { fprintf(trace, "hdlrType=\"%s\" Name=\"%s\" ", gf_4cc_to_str(p->handlerType), p->nameUTF8+1); } else { fpri...
vuln
Vulnerable
C/C++
'use strict'; const xml2js = require('xml2js'); const DEFAULT_TYPES = ['*/xml', '+xml']; module.exports = function (bodyParser) { if (bodyParser.xml) { // We already setup the XML parser. // End early. return; } function xml(options) { options = options || {}; options.type = options.type ...
vuln
Vulnerable
JavaScript
gss_get_mic_iov_length(OM_uint32 *minor_status, gss_ctx_id_t context_handle, gss_qop_t qop_req, gss_iov_buffer_desc *iov, int iov_count) { OM_uint32 status; gss_union_ctx_id_t ctx; gss_mechanism mech; status = val_wrap_iov_args(minor_status, context_handle, 0, qop_req, NULL, ...
vuln
Vulnerable
C/C++
bit_catenate(VarBit *arg1, VarBit *arg2) { VarBit *result; int bitlen1, bitlen2, bytelen, bit1pad, bit2shift; bits8 *pr, *pa; bitlen1 = VARBITLEN(arg1); bitlen2 = VARBITLEN(arg2); bytelen = VARBITTOTALLEN(bitlen1 + bitlen2); result = (VarBit *) palloc(bytelen); SET_VARSIZE...
vuln
Vulnerable
C/C++
if ($current_realm_id == -1 || is_realm_allowed($current_realm_id) || !isset($user_auth_realm_filenames{basename($item_url)})) { /* draw normal (non sub-item) menu item */ $item_url = $config['url_path'] . $item_url; if (is_menu_pick_active($item_url)) { print "<li><a role='menuitem' class='pic...
vuln
Safe
PHP
static int crypto_skcipher_init_tfm(struct crypto_tfm *tfm) { struct crypto_skcipher *skcipher = __crypto_skcipher_cast(tfm); struct skcipher_alg *alg = crypto_skcipher_alg(skcipher); if (tfm->__crt_alg->cra_type == &crypto_blkcipher_type) return crypto_init_skcipher_ops_blkcipher(tfm); if (tfm->__crt_alg->cra_...
vuln
Vulnerable
C/C++
private void setQuote(@NonNull MessageRecord current, @NonNull Optional<MessageRecord> previous, @NonNull Optional<MessageRecord> next, boolean isGroupThread, @NonNull ChatColors chatColors) { boolean startOfCluster = isStartOfMessageCluster(current, previous, isGroupThread); if (current.isMms() && !current.isM...
vuln
Vulnerable
Java
@Override public void configured(Unit builder, Object value) { super.configured(builder, value); if (value instanceof byte[] && Core.settings.getBool("attemwarfare") && ClientUtilsKt.io()) { Player player = builder.isPlayer() ? builder.playerNonNull() : ...
vuln
Vulnerable
Java
void visit_end_implicit_struct(Visitor *v, Error **errp) { assert(!error_is_set(errp)); if (v->end_implicit_struct) { v->end_implicit_struct(v, errp); } }
vuln
Vulnerable
C/C++
int_x509_param_set_hosts(X509_VERIFY_PARAM_ID *id, int mode, const char *name, size_t namelen) { char *copy; /* * Refuse names with embedded NUL bytes. * XXX: Do we need to push an error onto the error stack? */ if (name && memchr(name, '\0', namelen)) return 0; if (mode == SET_HOST && id->hosts...
vuln
Vulnerable
Unknown
@Redirect(method = "insertItem", at = @At( value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isEmpty()Z", ordinal = 1 ) ) // redirect "if (!itemStack.isEmpty() && ItemStack.canCombine(stack, itemStack))" -> "if (!canNotI...
vuln
Vulnerable
Java
public static String getDesc(String name) { switch (name) { case "Import": return "add custom imports"; case "onActivityResult": return "onActivityResult"; case "initializeLogic": return "initializeLogic"; case "o...
vuln
Safe
Java
package version import ( "strconv" "strings" ) // Version is the service current released version. // Semantic versioning: https://semver.org/ var Version = "0.9.1" // DevVersion is the service current development version. var DevVersion = "0.9.1" func GetCurrentVersion(mode string) string { if mode == "dev" { ...
vuln
Vulnerable
Go
@web.authenticated def get(self, value): if not self.is_admin(): raise web.HTTPError(404) self.set_header('Content-Type', 'text/html') self.write("<pre>") try: server_log_path = os.path.join(options.contest_dir, "server_log.txt") with open(server_l...
vuln
Vulnerable
Python
# -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe, json, math from frappe.model.document import Document from frappe import _ from frappe.utils import cstr from frappe.data_migration...
vuln
Safe
Python
private void handleAutoInsert(char c) { if (getEditorLanguage() instanceof LanguageXML) { if (c != '>' && c != '/') { return; } boolean full = c == '>'; DOMDocument document = DOMParser.getInstance().parse(getText().toString(), "", null); ...
vuln
Vulnerable
Java
get_matching_model_microcode(int cpu, unsigned long start, void *data, size_t size, struct mc_saved_data *mc_saved_data, unsigned long *mc_saved_in_initrd, struct ucode_cpu_info *uci) { u8 *ucode_ptr = data; unsigned int leftover = size; enum ucode_state state = UCODE_OK; unsigned in...
vuln
Safe
C/C++
static inline void ext4_truncate_failed_write(struct inode *inode) { truncate_inode_pages(inode->i_mapping, inode->i_size); ext4_truncate(inode); }
vuln
Vulnerable
Unknown
public void setIsLeader(boolean isLeader) { dataManager.set(IS_LEADER, isLeader); if(isLeader) { targetTasks.addTask(0, targetRivalLeader); tasks.removeTask(followLeader); tasks.addTask(0, wanderAbout); tasks.addTask(1, attackLeader); //tasks.addTask(1, aiAvoidFollowers); } else { targetTasks....
vuln
Vulnerable
Java
int ff_h263_decode_picture_header(MpegEncContext *s) { int format, width, height, i; uint32_t startcode; align_get_bits(&s->gb); startcode= get_bits(&s->gb, 22-8); for(i= get_bits_left(&s->gb); i>24; i-=8) { startcode = ((startcode << 8) | get_bits(&s->gb, 8)) & 0x003FFFFF; if...
vuln
Vulnerable
C/C++
PlainPasswd::PlainPasswd(int len) : CharArray(len) { }
vuln
Vulnerable
C/C++
/* * Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy,...
vuln
Vulnerable
Java
# 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 applica...
vuln
Vulnerable
Python
public void beforeScenario(Scenario scenario) { long threadId = Thread.currentThread().getId(); TestExecutionContext testExecutionContext = Runner.getTestExecutionContext(threadId); LOGGER.info("ThreadId : " + threadId + " In RunCukes - Before: " + scenario.getName()); LOGGER.info("Run...
vuln
Vulnerable
Java
private List<ApplicationBasicInfo> getAuthorizedApplicationBasicInfo( ApplicationBasicInfo[] applicationBasicInfos, String userName) throws IdentityApplicationManagementException { boolean validateRoles = ApplicationMgtUtil.validateRoles(); if (!validateRoles) { if (...
vuln
Safe
Java
/* Copyright 2018 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
static int mcryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb, struct mcryptd_queue *queue) { struct hashd_instance_ctx *ctx; struct ahash_instance *inst; struct hash_alg_common *halg; struct crypto_alg *alg; u32 type = 0; u32 mask = 0; int err; if (!mcryptd_check_internal(tb, &type,...
vuln
Safe
C/C++