code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
int ff_vaapi_render_picture(struct vaapi_context *vactx, VASurfaceID surface)
{
VABufferID va_buffers[3];
unsigned int n_va_buffers = 0;
vaUnmapBuffer(vactx->display, vactx->pic_param_buf_id);
va_buffers[n_va_buffers++] = vactx->pic_param_buf_id;
if (vactx->iq_matrix_buf_id) {
vaUnmapBuffer(... | vuln | Vulnerable | C/C++ |
static int nft_dynset_init(const struct nft_ctx *ctx,
const struct nft_expr *expr,
const struct nlattr * const tb[])
{
struct nftables_pernet *nft_net = nft_pernet(ctx->net);
struct nft_dynset *priv = nft_expr_priv(expr);
u8 genmask = nft_genmask_next(ctx->net);
struct nft_set *set;
u64 timeout;
int e... | vuln | Safe | C/C++ |
public function prepare( $query, $args ) {
if ( is_null( $query ) )
return;
// This is not meant to be foolproof -- but it will catch obviously incorrect usage.
if ( strpos( $query, '%' ) === false ) {
wp_load_translations_early();
_doing_it_wrong( 'wpdb::prepare', sprintf( __( 'The query argument of %s... | vuln | Vulnerable | PHP |
static int emulator_read_write_onepage(unsigned long addr, void *val,
unsigned int bytes,
struct x86_exception *exception,
struct kvm_vcpu *vcpu,
struct read_write_emulator_ops *ops)
{
gpa_t gpa;
int handled, ret;
bool write = ops->write;
if (ops->read_write_prepare &&
... | vuln | Vulnerable | Unknown |
isis_print_is_reach_subtlv(netdissect_options *ndo,
const uint8_t *tptr, u_int subt, u_int subl,
const char *ident)
{
u_int te_class,priority_level,gmpls_switch_cap;
union { /* int to float conversion buffer for several subTLVs */
float f... | vuln | Vulnerable | C/C++ |
IMPEG2D_ERROR_CODES_T impeg2d_dec_seq_hdr(dec_state_t *ps_dec)
{
stream_t *ps_stream;
ps_stream = &ps_dec->s_bit_stream;
UWORD16 u2_height;
UWORD16 u2_width;
if (impeg2d_bit_stream_nxt(ps_stream,START_CODE_LEN) != SEQUENCE_HEADER_CODE)
{
impeg2d_bit_stream_flush(ps_stream,START_CODE_LEN);
retur... | vuln | Vulnerable | C/C++ |
static void multiwrite_cb(void *opaque, int ret)
{
MultiwriteCB *mcb = opaque;
if (ret < 0) {
mcb->error = ret;
multiwrite_user_cb(mcb);
}
mcb->num_requests--;
if (mcb->num_requests == 0) {
if (mcb->error == 0) {
multiwrite_user_cb(mcb);
}
qemu_fre... | vuln | Vulnerable | C/C++ |
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
switch (requestCode) {
case PermissionHelper.PERMISSIONS_REQUEST_ACCESS_BLUETOOTH: {
boolean allGranted = true;
for (int result : grantResults) {
... | vuln | Safe | Java |
public static FilterButtonPacket decode(PacketBuffer buf)
{
FilterButtonPacket pkt = new FilterButtonPacket(buf.readInt(), buf.readInt(), buf.readString(), buf.readInt());
return pkt;
} | vuln | Vulnerable | Java |
# -*- coding: utf-8 -*-
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, get_object_or_404
from django.urls import reverse
from spirit.core.utils.http import safe_redirect
from spirit.core.utils.views import is_post, post_data, is_ajax
from spirit.core.utils import json_r... | vuln | Safe | Python |
int main(int argc, char *argv[])
{
char buff[1024];
int fd, nr, nw;
if (argc < 2) {
fprintf(stderr,
"usage: %s output-filename\n"
" %s |output-command\n"
" %s :host:port\n", argv[0], argv[0], argv[0]);
return 1;
}
fd = open_... | vuln | Safe | C/C++ |
static DeviceState *sun4c_intctl_init(target_phys_addr_t addr,
qemu_irq *parent_irq)
{
DeviceState *dev;
SysBusDevice *s;
unsigned int i;
dev = qdev_create(NULL, "sun4c_intctl");
qdev_init_nofail(dev);
s = sysbus_from_qdev(dev);
for (i = 0; i < MAX_PILS;... | vuln | Safe | C/C++ |
public List<ValidationNotice> getValidationNotices() {
return validationNotices;
} | vuln | Vulnerable | Java |
private DriverDescriptor importDriver(
DBRProgressMonitor monitor,
Element driverElement,
ZipFile zipFile,
Map<String, String> libMap,
Map<String, String> driverMap) throws IOException, DBException
{
String providerId = driverElement.getAttribute(RegistryConstants.ATT... | vuln | Safe | Java |
def getGameCountInSeriesSoFar(submission):
database = sqlite3.connect('database.db')
cursor = database.cursor()
return cursor.execute("SELECT COUNT(*) FROM ChallengeRankings WHERE SeriesTitle = '" + getTitle(submission) + "' AND Date <= '" + getSubmissionDateFromDatabase(submission) + "'").fetchone()[0]
... | vuln | Vulnerable | Python |
xfs_bmap_extents_to_btree(
xfs_trans_t *tp, /* transaction pointer */
xfs_inode_t *ip, /* incore inode pointer */
xfs_fsblock_t *firstblock, /* first-block-allocated */
struct xfs_defer_ops *dfops, /* blocks freed in xaction */
xfs_btree_cur_t **curp, /* cursor returned to caller */
int wasdel, /* conv... | vuln | Vulnerable | Unknown |
get_tag(const uint8_t *asn1, size_t len, taginfo *tag_out,
const uint8_t **contents_out, size_t *clen_out,
const uint8_t **remainder_out, size_t *rlen_out, int recursion)
{
krb5_error_code ret;
uint8_t o;
const uint8_t *c, *p, *tag_start = asn1;
size_t clen, llen, i;
taginfo t;
... | vuln | Safe | C/C++ |
static int vmdk_snapshot_create(const char *filename, const char *backing_file)
{
int snp_fd, p_fd;
int ret;
uint32_t p_cid;
char *p_name, *gd_buf, *rgd_buf;
const char *real_filename, *temp_str;
VMDK4Header header;
uint32_t gde_entries, gd_size;
int64_t gd_offset, rgd_offset, capacity, ... | vuln | Safe | C/C++ |
'use strict';
/*!
* Module dependencies.
*/
const StrictModeError = require('./error/strict');
const Types = require('./schema/index');
const castTextSearch = require('./schema/operators/text');
const get = require('./helpers/get');
const util = require('util');
const utils = require('./utils');
const ALLOWED_GEOW... | vuln | Vulnerable | Java |
addProseMirrorPlugins() {
let shiftKey = false
return [
// Parse markdown unless Mod+Shift+V is pressed for text clipboard content
new Plugin({
key: new PluginKey('pasteEventHandler'),
props: {
handleDOMEvents: {
mouseup(_, event) {
shiftKey = event.shiftKey
return false
... | vuln | Safe | JavaScript |
static int l2cap_connect_create_rsp(struct l2cap_conn *conn,
struct l2cap_cmd_hdr *cmd, u16 cmd_len,
u8 *data)
{
struct l2cap_conn_rsp *rsp = (struct l2cap_conn_rsp *) data;
u16 scid, dcid, result, status;
struct l2cap_chan *chan;
u8 req[128];
int err;
if (cmd_len < sizeof(*rsp))
return -EPROTO... | vuln | Safe | Unknown |
/*!
* deps/forge.js - Forge Package Customization
*
* Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
*/
"use strict";
var forge = require("node-forge/lib/forge");
require("node-forge/lib/aes");
require("node-forge/lib/asn1");
require("node-forge/lib/cipher");
require("node-forge/lib/hmac");
require("nod... | vuln | Vulnerable | JavaScript |
static int ffmmal_fill_input_port(AVCodecContext *avctx)
{
MMALDecodeContext *ctx = avctx->priv_data;
while (ctx->waiting_buffers) {
MMAL_BUFFER_HEADER_T *mbuffer;
FFBufferEntry *buffer;
MMAL_STATUS_T status;
mbuffer = mmal_queue_get(ctx->pool_in->queue);
if (!mbuffer)
... | vuln | Safe | C/C++ |
static int ctdb_tcp_listen_automatic(struct ctdb_context *ctdb)
{
struct ctdb_tcp *ctcp = talloc_get_type(ctdb->private_data,
struct ctdb_tcp);
ctdb_sock_addr sock;
int lock_fd, i;
const char *lock_path = "/tmp/.ctdb_socket_lock";
struct f... | vuln | Vulnerable | Unknown |
static int kvm_client_sync_dirty_bitmap(struct CPUPhysMemoryClient *client,
target_phys_addr_t start_addr,
target_phys_addr_t end_addr)
{
return kvm_physical_sync_dirty_bitmap(start_addr, end_addr);
} | vuln | Vulnerable | C/C++ |
mp_err mp_init_size(mp_int *a, int size)
{
size = MP_MAX(MP_MIN_PREC, size);
/* alloc mem */
a->dp = (mp_digit *) MP_CALLOC((size_t)size, sizeof(mp_digit));
if (a->dp == NULL) {
return MP_MEM;
}
/* set the members */
a->used = 0;
a->alloc = size;
a->sign = MP_ZPOS;
return MP_OKA... | vuln | Vulnerable | C/C++ |
xmlDictCreateSub(xmlDictPtr sub) {
xmlDictPtr dict = xmlDictCreate();
if ((dict != NULL) && (sub != NULL)) {
#ifdef DICT_DEBUG_PATTERNS
fprintf(stderr, "R");
#endif
dict->subdict = sub;
xmlDictReference(dict->subdict);
}
return(dict);
} | vuln | Vulnerable | Unknown |
/**
* @file
* A Backbone Model for the state of an in-place editable entity in the DOM.
*/
(function (_, $, Backbone, Drupal) {
Drupal.quickedit.EntityModel = Drupal.quickedit.BaseModel.extend(
/** @lends Drupal.quickedit.EntityModel# */ {
/**
* @type {object}
*/
defaults: /** @lends... | vuln | Safe | Python |
mark_trusted_task_thread_func (GTask *task,
mark_desktop_file_executable_task_thread_func (GTask *task,
gpointer source_object,
gpointer task_data,
GCancel... | vuln | Safe | C/C++ |
public String getSHA(String password) {
try {
// Static getInstance method is called with hashing SHA
MessageDigest md = MessageDigest.getInstance("SHA-256");
// digest() method called
// to calculate message digest of an input
// and return array of byte
byte[] messageDigest = md.digest(password.... | vuln | Vulnerable | Java |
WORK_STATE ossl_statem_server_pre_work(SSL *s, WORK_STATE wst)
{
OSSL_STATEM *st = &s->statem;
switch (st->hand_state) {
case TLS_ST_SW_HELLO_REQ:
s->shutdown = 0;
if (SSL_IS_DTLS(s))
dtls1_clear_record_buffer(s);
break;
case DTLS_ST_SW_HELLO_VERIFY_REQUEST:
... | vuln | Vulnerable | C/C++ |
package io.swagger.client.api;
import io.swagger.client.ApiException;
import io.swagger.client.ApiClient;
import io.swagger.client.ApiResponse;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import javax.ws.rs.core.GenericType;
import io.swagger.client.model.Client;
import java.util.ArrayLis... | vuln | Safe | Java |
static int fastrpc_dma_buf_attach(struct dma_buf *dmabuf,
struct dma_buf_attachment *attachment)
{
struct fastrpc_dma_buf_attachment *a;
struct fastrpc_buf *buffer = dmabuf->priv;
int ret;
a = kzalloc(sizeof(*a), GFP_KERNEL);
if (!a)
return -ENOMEM;
ret = dma_get_sgtable(buffer->dev, &a->sgt, buffer->vi... | vuln | Safe | C/C++ |
bool SoftVPX::outputBuffers(bool flushDecoder, bool display, bool eos, bool *portWillReset) {
List<BufferInfo *> &outQueue = getPortQueue(1);
BufferInfo *outInfo = NULL;
OMX_BUFFERHEADERTYPE *outHeader = NULL;
vpx_codec_iter_t iter = NULL;
if (flushDecoder && mFrameParallelMode) {
if (vpx_codec_decode((vpx_co... | vuln | Vulnerable | C/C++ |
static int vty_getchars(VIOsPAPRDevice *sdev, uint8_t *buf, int max)
{
VIOsPAPRVTYDevice *dev = VIO_SPAPR_VTY_DEVICE(sdev);
int n = 0;
while ((n < max) && (dev->out != dev->in)) {
buf[n++] = dev->buf[dev->out++ % VTERM_BUFSIZE];
if (buf[n - 1] == '\r') {
if (n < max) {
... | vuln | Safe | C/C++ |
public HttpArgs toArgs(final QueryInput input, final Pair<String, String> auth) {
final var args = toArgs(input);
args.setAuth(auth);
return args;
} | vuln | Vulnerable | Java |
int ll_init(struct k_sem *sem_rx)
{
struct device *clk_k32;
struct device *clk_m16;
struct device *entropy;
u32_t err;
sem_recv = sem_rx;
clk_k32 = device_get_binding(DT_NORDIC_NRF_CLOCK_0_LABEL "_32K");
if (!clk_k32) {
return -ENODEV;
}
clock_control_on(clk_k32, (void *)CLOCK_CONTROL_NRF_K32SRC);
entro... | vuln | Vulnerable | C/C++ |
aa&&(la=pa[ca],null==la&&(la={},pa[ca]=la),ca=la[aa],null==ca&&(ca=[],la[aa]=ca),ca.push(na))}ia=ia.nextSibling}G(ya,fa,wa)}})}function I(ia){v&&(Aa.scrollTop=0,ea.innerText="",Ha.spin(ea),U=!1,V=!0,ha.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag")),ba=null,v(ua,function(){z(mxResources.get("cannotLoad"))... | vuln | Safe | JavaScript |
# -*- 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 |
/* 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 |
xmlParseChunk(xmlParserCtxtPtr ctxt, const char *chunk, int size,
int terminate) {
int end_in_lf = 0;
int remain = 0;
size_t old_avail = 0;
size_t avail = 0;
if (ctxt == NULL)
return(XML_ERR_INTERNAL_ERROR);
if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX == 1))
... | vuln | Vulnerable | Unknown |
void free_pipe_info(struct pipe_inode_info *pipe)
{
int i;
account_pipe_buffers(pipe, pipe->buffers, 0);
free_uid(pipe->user);
for (i = 0; i < pipe->buffers; i++) {
struct pipe_buffer *buf = pipe->bufs + i;
if (buf->ops)
buf->ops->release(pipe, buf);
}
if (pipe->tmp_page)
__free_page(pipe->tmp_pag... | vuln | Safe | C/C++ |
// Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package db
import (
"crypto/hmac"
"crypto/sha256"
"crypto/tls"
"encoding/hex"
"fmt"
"io/ioutil"
"strings"
"time"
jsoniter "github.com/json-iterator... | vuln | Safe | Go |
xmlEncodeSpecialChars(xmlDocPtr doc ATTRIBUTE_UNUSED, const xmlChar *input) {
const xmlChar *cur = input;
xmlChar *buffer = NULL;
xmlChar *out = NULL;
size_t buffer_size = 0;
if (input == NULL) return(NULL);
/*
* allocate an translation buffer.
*/
buffer_size = 1000;
buffer = ... | vuln | Safe | Unknown |
static u32 read_32(cdk_stream_t s)
{
byte buf[4];
size_t nread;
assert(s != NULL);
stream_read(s, buf, 4, &nread);
if (nread != 4)
return (u32) - 1;
return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
} | vuln | Vulnerable | Unknown |
function URLEscape( $string )
{
$string = preg_replace_callback(
// Match both decimal & hex code (although hex codes can contain a-f letters).
// Should be enough as the alphabet hex codes only have numbers.
"/(&#x?[0-9]+;?)/i",
function( $match ) {
if ( mb_substr( $match[1], -1 ) !== ';' )
{
// Fix... | vuln | Safe | PHP |
def label_from_instance(self, obj):
bits = []
for ancestor in (
obj.get_ancestors(inclusive=True).exclude(depth=1).specific(defer=True)
):
bits.append(ancestor.get_admin_display_title())
return mark_safe('<span class="icon icon-arrow-right"></span>'.join(bits)) | vuln | Vulnerable | Python |
ssize_t v9fs_list_xattr(FsContext *ctx, const char *path,
void *value, size_t vsize)
{
ssize_t size = 0;
void *ovalue = value;
XattrOperations *xops;
char *orig_value, *orig_value_start;
ssize_t xattr_len, parsed_len = 0, attr_len;
char *dirpath, *name;
int dirfd;
... | vuln | Vulnerable | C/C++ |
void qmp_guest_set_user_password(const char *username,
const char *password,
bool crypted,
Error **errp)
{
NET_API_STATUS nas;
char *rawpasswddata = NULL;
size_t rawpasswdlen;
wchar_t *user = NULL, *wpass ... | vuln | Safe | C/C++ |
def get(self, path):
return static_file(path, self.get_base_path()) | vuln | Vulnerable | Python |
public boolean canSwipe(){
return !getPhaseSwapping();
} | vuln | Safe | Java |
static void userfaultfd_event_wait_completion(struct userfaultfd_ctx *ctx,
struct userfaultfd_wait_queue *ewq)
{
struct userfaultfd_ctx *release_new_ctx;
if (WARN_ON_ONCE(current->flags & PF_EXITING))
goto out;
ewq->ctx = ctx;
init_waitqueue_entry(&ewq->wq, current);
release_new_ctx = NULL;
spin_l... | vuln | Safe | C/C++ |
token_continue(i_ctx_t *i_ctx_p, scanner_state * pstate, bool save)
{
os_ptr op = osp;
int code;
ref token;
/* Since we might free pstate below, and we're dealing with
* gc memory referenced by the stack, we need to explicitly
* remove the reference to pstate from the stack, otherwise
... | vuln | Safe | C/C++ |
int socket_create(uint16_t port)
{
int sfd = -1;
int yes = 1;
#ifdef WIN32
WSADATA wsa_data;
if (!wsa_init) {
if (WSAStartup(MAKEWORD(2,2), &wsa_data) != ERROR_SUCCESS) {
fprintf(stderr, "WSAStartup failed!\n");
ExitProcess(-1);
}
wsa_init = 1;
}
#endif
struct sockaddr_in saddr;
if (0 > (sfd = socke... | vuln | Vulnerable | C/C++ |
static int encode_plane(AVCodecContext *avctx, uint8_t *src,
uint8_t *dst, int stride,
int width, int height, PutByteContext *pb)
{
UtvideoContext *c = avctx->priv_data;
uint8_t lengths[256];
uint64_t counts[256] = { 0 };
HuffEntry he[256];
... | vuln | Safe | C/C++ |
public static void registerCompat() {
registerElement("iris_version", (_str) -> new StringSupplierElement(VERSION));
registerElement("iris_enabled", (_str) -> new BooleanSupplierElement(ENABLED));
registerElement("iris_shaderpack", (_str) -> new StringSupplierElement(SHADERPACK));
regis... | 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 | Safe | Python |
@Nullable
private static ComponentName convertToComponentName(@Nullable String flattenedString,
ServiceInfo serviceInfo) {
if (flattenedString == null) {
return null;
}
if (!flattenedString.contains("/")) {
return new ComponentName(serviceInfo.packageName... | vuln | Safe | Java |
ArgParser::checkCompletion()
{
// See if we're being invoked from bash completion.
std::string bash_point_env;
if (QUtil::get_env("COMP_LINE", &bash_line) &&
QUtil::get_env("COMP_POINT", &bash_point_env))
{
int p = QUtil::string_to_int(bash_point_env.c_str());
if ((p > 0) && (p <... | vuln | Vulnerable | Unknown |
static int ep_insert(struct eventpoll *ep, struct epoll_event *event,
struct file *tfile, int fd)
{
int error, revents, pwake = 0;
unsigned long flags;
long user_watches;
struct epitem *epi;
struct ep_pqueue epq;
user_watches = atomic_long_read(&ep->user->epoll_watches);
if (unlikely(user_watches >= max_... | vuln | Safe | Unknown |
@Override
public void complete(ScanRequest request, ScanResults results) throws MachinaException {
try {
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
if(request != null && results != null) {
mapp... | vuln | Vulnerable | Java |
static int mace_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
AVFrame *frame = data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
int16_t **samples;
MACEContext *ctx = avctx->priv_data;
int i, j, k, l, ret... | vuln | Safe | C/C++ |
/*-
* Copyright 2014 Square Inc.
*
* 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... | vuln | Safe | Go |
gst_vorbis_tag_add_coverart (GstTagList * tags, const gchar * img_data_base64,
gst_vorbis_tag_add_coverart (GstTagList * tags, gchar * img_data_base64,
gint base64_len)
{
GstBuffer *img;
gsize img_len;
guchar *out;
guint save = 0;
gint state = 0;
if (base64_len < 2)
goto not_enough_data;
... | vuln | Safe | C/C++ |
CAMLprim value caml_alloc_dummy_float (value size)
{
mlsize_t wosize = Long_val(size) * Double_wosize;
if (wosize == 0) return Atom(0);
return caml_alloc (wosize, 0);
} | vuln | Safe | C/C++ |
void f2fs_wait_discard_bios(struct f2fs_sb_info *sbi)
void f2fs_wait_discard_bios(struct f2fs_sb_info *sbi, bool umount)
{
__issue_discard_cmd(sbi, false);
__drop_discard_cmd(sbi);
__wait_discard_cmd(sbi, !umount);
} | vuln | Safe | Unknown |
dir_initialize(int argc, VALUE *argv, VALUE dir)
{
struct dir_data *dp;
rb_encoding *fsenc;
VALUE dirname, opt, orig;
static ID keyword_ids[1];
const char *path;
if (!keyword_ids[0]) {
keyword_ids[0] = rb_id_encoding();
}
fsenc = rb_filesystem_encoding();
rb_scan_args(argc, argv... | vuln | Safe | Unknown |
static uint32_t vmdk_read_cid(BlockDriverState *bs, int parent)
{
char desc[DESC_SIZE];
uint32_t cid;
const char *p_name, *cid_str;
size_t cid_str_size;
BDRVVmdkState *s = bs->opaque;
if (bdrv_pread(bs->file, s->desc_offset, desc, DESC_SIZE) != DESC_SIZE) {
return 0;
}
if (parent... | vuln | Vulnerable | C/C++ |
// Copyright Project Contour 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 applicable law or agreed to... | vuln | Safe | Go |
static void sas_eh_defer_cmd(struct scsi_cmnd *cmd) | vuln | Safe | C/C++ |
templateResult: function(item) {
// replace(/</g, '<') : prevent the code in the option’s value from being executed by the browser.
// split('\n') : break a select option item into multi lines
var selectionText = item.text.replace(/</g, '<').split('\n');
var returnString = $('<span></span>');
... | vuln | Safe | JavaScript |
static int exif_scan_thumbnail(image_info_type *ImageInfo)
{
uchar c, *data = (uchar*)ImageInfo->Thumbnail.data;
int n, marker;
size_t length=2, pos=0;
jpeg_sof_info sof_info;
if (!data || ImageInfo->Thumbnail.size < 4) {
return FALSE; /* nothing to do here */
}
if (memcmp(dat... | vuln | Safe | Unknown |
/**
* convict
* Configuration management with support for environmental variables, files,
* and validation.
*/
'use strict'
const fs = require('fs')
const parseArgs = require('yargs-parser')
const cloneDeep = require('lodash.clonedeep')
// Forbidden key paths, for protection against prototype pollution
const FORB... | vuln | Vulnerable | JavaScript |
bool BaseAudioContext::WouldTaintOrigin(const KURL& url) const { | vuln | Safe | C/C++ |
def get_file(recipe):
if not recipe.link:
recipe.link = Dropbox.get_share_link(recipe)
recipe.save()
response = requests.get(recipe.link.replace('www.dropbox.', 'dl.dropboxusercontent.'))
return io.BytesIO(response.content) | vuln | Vulnerable | Python |
xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
int what, xmlChar end, xmlChar end2, xmlChar end3) {
xmlChar *buffer = NULL;
size_t buffer_size = 0;
size_t nbchars = 0;
xmlChar *current = NULL;
xmlChar *rep = NULL;
const xmlChar *last;
xmlEntityPtr en... | vuln | Safe | Unknown |
/*
* Copyright 2017 Google Inc. 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 | JavaScript |
let crypto = require('crypto')
let { urlAlphabet } = require('./url-alphabet')
// It is best to make fewer, larger requests to the crypto module to
// avoid system call overhead. So, random numbers are generated in a
// pool. The pool is a Buffer that is larger than the initial random
// request size by this multipli... | vuln | Safe | JavaScript |
static void mysql_prune_stmt_list(MYSQL *mysql)
{
LIST *element= mysql->stmts;
LIST *pruned_list= 0;
for (; element; element= element->next)
{
MYSQL_STMT *stmt= (MYSQL_STMT *) element->data;
if (stmt->state != MYSQL_STMT_INIT_DONE)
{
stmt->mysql= 0;
stmt->last_errno= CR_SERVER_LOST;
... | vuln | Vulnerable | Unknown |
QPDF::resolve(int objid, int generation)
{
// Check object cache before checking xref table. This allows us
// to insert things into the object cache that don't actually
// exist in the file.
QPDFObjGen og(objid, generation);
if (this->resolving.count(og))
{
// This can happen if an obj... | vuln | Safe | C/C++ |
static void scsi_req_dequeue(SCSIRequest *req)
{
trace_scsi_req_dequeue(req->dev->id, req->lun, req->tag);
if (req->enqueued) {
QTAILQ_REMOVE(&req->dev->requests, req, next);
req->enqueued = false;
}
} | vuln | Vulnerable | C/C++ |
static void setup_format_params(int track)
{
int n;
int il;
int count;
int head_shift;
int track_shift;
struct fparm {
unsigned char track, head, sect, size;
} *here = (struct fparm *)floppy_track_buffer;
raw_cmd = &default_raw_cmd;
raw_cmd->track = track;
raw_cmd->flags = (FD_RAW_WRITE | FD_RAW_INTR | FD... | vuln | Vulnerable | C/C++ |
function(){n=I.name;v="";L()})));k.appendChild(H)})(G[N],N);100==G.length&&(k.appendChild(z),A=function(){k.scrollTop>=k.scrollHeight-k.offsetHeight&&C()},mxEvent.addListener(k,"scroll",A))}}),y)}),M=mxUtils.bind(this,function(u){null==u&&(k.innerHTML="",u=1);var D=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=10... | vuln | Vulnerable | JavaScript |
static int l2cap_sock_listen(struct socket *sock, int backlog)
{
struct sock *sk = sock->sk;
int err = 0;
BT_DBG("sk %p backlog %d", sk, backlog);
lock_sock(sk);
if (sk->sk_state != BT_BOUND || sock->type != SOCK_SEQPACKET) {
err = -EBADFD;
goto done;
}
switch (l2cap_pi(sk)->mode) {
case L2CAP_MODE_BASI... | vuln | Safe | C/C++ |
# -*- coding: utf-8 -*-
from threading import Lock
from ..utils.struct.lock import lock
from .browser import Browser
from .bucket import Bucket
from .cookie_jar import CookieJar
from .http.http_request import HTTPRequest
from .xdcc.request import XDCCRequest
DEFAULT_REQUEST = None
class RequestFactory:
def __i... | vuln | Safe | Python |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License") + yo... | vuln | Safe | Java |
static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
{
key_t key = params->key;
int shmflg = params->flg;
size_t size = params->u.size;
int error;
struct shmid_kernel *shp;
size_t numpages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
struct file *file;
char name[13];
int id;
vm_flags_t acctflag =... | vuln | Safe | C/C++ |
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11,
# andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh,
# falgh1, grunjol, csitk... | vuln | Safe | Python |
int _gnutls_initialize_session_ticket_key_rotation(gnutls_session_t session, const gnutls_datum_t *key)
{
if (unlikely(session == NULL || key == NULL))
return gnutls_assert_val(GNUTLS_E_INTERNAL_ERROR);
if (unlikely(session->key.totp.last_result != 0))
return GNUTLS_E_INVALID_REQUEST;
memcpy(session->key.initi... | vuln | Safe | Unknown |
static VALUE
ossl_cipher_set_key(VALUE self, VALUE key)
{
EVP_CIPHER_CTX *ctx;
int key_len;
StringValue(key);
GetCipher(self, ctx);
key_len = EVP_CIPHER_CTX_key_length(ctx);
if (RSTRING_LEN(key) != key_len)
ossl_raise(rb_eArgError, "key must be %d bytes", key_len);
if (EVP_CipherInit_ex(... | vuln | Safe | C/C++ |
static bigint *sig_verify(BI_CTX *ctx, const uint8_t *sig, int sig_len,
static bigint *sig_verify(BI_CTX *ctx, const uint8_t *sig, int sig_len, uint8_t sig_type,
bigint *modulus, bigint *pub_exp)
{
int i;
bigint *decrypted_bi, *dat_bi;
bigint *bir = NULL;
uint8_t *block = (uint8_t *)malloc(... | vuln | Safe | C/C++ |
static Image *ReadICONImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
IconFile
icon_file;
IconInfo
icon_info;
Image
*image;
MagickBooleanType
status;
MagickSizeType
extent;
register ssize_t
i,
x;
register Quantum
*q;
register unsigned char
*p;
... | vuln | Safe | C/C++ |
static inline int16_t mipsdsp_add_i16(int16_t a, int16_t b, CPUMIPSState *env)
{
int16_t tempI;
tempI = a + b;
if (MIPSDSP_OVERFLOW(a, b, tempI, 0x8000)) {
set_DSPControl_overflow_flag(1, 20, env);
}
return tempI;
} | vuln | Vulnerable | C/C++ |
@Override
public void resize(MinecraftClient mc, int width, int height) {
super.resize(mc, width, height);
masaModGuiList.setX(GuiUtils.getScaledWindowWidth() - 155);
} | vuln | Vulnerable | Java |
@Override
protected synchronized long prepare(String sql) throws SQLException {
return prepare_utf8(stringToUtf8ByteArray(sql));
} | vuln | Vulnerable | Java |
public String getCookie( HttpServletRequest request, String name ) throws ValidationException {
Cookie c = getFirstCookie( request, name );
SecurityConfiguration sc = ESAPI.securityConfiguration();
if ( c == null ) return null;
String value = c.getValue();
return ESAPI.validator().getValidIn... | vuln | Safe | Java |
public static XMLMemento createReadRoot(Reader reader, String baseDir) throws WorkbenchException {
String errorMessage = null;
Exception exception = null;
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder parser = factory.newDocumentBuilder();
InputSource sourc... | vuln | Vulnerable | Java |
export default function publishVote(pollId, pollAnswerId) {
const REDIS_CONFIG = Meteor.settings.private.redis;
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
const EVENT_NAME = 'RespondToPollReqMsg';
const { meetingId, requesterUserId } = extractCredentials(this.userId);
check(pollAnswerId, Number);
ch... | vuln | Safe | Scala |
int fbytes(unsigned char *buf, int num)
{
int ret;
BIGNUM *tmp = NULL;
if (fbytes_counter >= 8)
return 0;
tmp = BN_new();
if (!tmp)
return 0;
if (!BN_dec2bn(&tmp, numbers[fbytes_counter])) {
BN_free(tmp);
return 0;
}
fbytes_counter++;
if (num != BN_nu... | vuln | Vulnerable | Unknown |
static void event_nick_invalid(IRC_SERVER_REC *server, const char *data)
{
if (!server->connected)
server_disconnect((SERVER_REC *) server);
} | vuln | Vulnerable | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.