code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
int fpm_request_is_idle(struct fpm_child_s *child) /* {{{ */
{
struct fpm_scoreboard_proc_s *proc;
/* no need in atomicity here */
proc = fpm_scoreboard_proc_get_from_child(child);
if (!proc) {
return 0;
}
return proc->request_stage == FPM_REQUEST_ACCEPTING;
} | vuln | Safe | Unknown |
/*
Copyright 2021 The Fluid 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 in writing, softw... | vuln | Vulnerable | Go |
#include "webcc/url.h"
#include <algorithm>
#include <cctype>
#include <functional>
#include "boost/algorithm/string/trim.hpp"
#include "webcc/string.h"
#include "webcc/utility.h"
namespace webcc {
// -----------------------------------------------------------------------------
namespace {
// Convert a hex chara... | vuln | Safe | C/C++ |
static bool w2p(char *ip, char *op) {
FILE *fp = openr(ip);
if(!fp) return 1;
bool openwdone = 0;
uint8_t *x = 0, *b = 0;
png_struct *p = 0;
png_info *n = 0;
uint8_t i[12];
char *k[] = {"Out of memory", "Broken config, file a bug report",
"Invalid WebP", "???", "???", "???", "I/O error"};
// unsup... | vuln | Safe | C/C++ |
void
bufferedReadPixels (InputFile::Data* ifd, int scanLine1, int scanLine2)
{
//
// bufferedReadPixels reads each row of tiles that intersect the
// scan-line range (scanLine1 to scanLine2). The previous row of
// tiles is cached in order to prevent redundent tile reads when
// accessing scanlines ... | vuln | Safe | C/C++ |
static int virtio_net_load(QEMUFile *f, void *opaque, int version_id)
{
VirtIONet *n = opaque;
VirtIODevice *vdev = VIRTIO_DEVICE(n);
int ret, i, link_down;
if (version_id < 2 || version_id > VIRTIO_NET_VM_VERSION)
return -EINVAL;
ret = virtio_load(vdev, f);
if (ret) {
return r... | vuln | Safe | Unknown |
package org.mozilla.jss.nss;
import java.util.ArrayList;
import org.mozilla.jss.crypto.X509Certificate;
import org.mozilla.jss.pkcs11.PK11Cert;
import org.mozilla.jss.ssl.SSLAlertEvent;
import org.mozilla.jss.util.GlobalRefProxy;
public class SSLFDProxy extends PRFDProxy {
public PK11Cert clientCert;
public ... | vuln | Safe | Java |
package com.salesmanager.core.business.services.merchant;
import java.util.List;
import java.util.Optional;
import javax.inject.Inject;
import org.jsoup.helper.Validate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.c... | vuln | Vulnerable | Java |
ProcShmCreatePixmap(client)
register ClientPtr client;
{
PixmapPtr pMap;
DrawablePtr pDraw;
DepthPtr pDepth;
register int i, rc;
ShmDescPtr shmdesc;
REQUEST(xShmCreatePixmapReq);
unsigned int width, height, depth;
unsigned long size;
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
... | vuln | Vulnerable | Unknown |
void initializeFilter(HeaderMode mode, bool inject_route_config_headers) {
config_helper_.addConfigModifier(
[&](envoy::extensions::filters::network::http_connection_manager::v3::HttpConnectionManager&
hcm) {
// Overwrite default config with our own.
TestUtility::loadFrom... | vuln | Safe | Unknown |
static int coroutine_fn copy_sectors(BlockDriverState *bs,
uint64_t start_sect,
uint64_t cluster_offset,
int n_start, int n_end)
{
BDRVQcowState *s = bs->opaque;
QEMUIOVector qiov;
struct iovec iov... | vuln | Safe | C/C++ |
static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid)
{
XHCIState *xhci = epctx->xhci;
XHCIStreamContext *stctx;
XHCITransfer *xfer;
XHCIRing *ring;
USBEndpoint *ep = NULL;
uint64_t mfindex;
int length;
int i;
trace_usb_xhci_ep_kick(epctx->slotid, epctx->epid, str... | vuln | Safe | Unknown |
ews_connection_constructed (GObject *object)
{
EEwsConnection *cnc = E_EWS_CONNECTION (object);
gint log_level;
/* Chain up to parent's method. */
G_OBJECT_CLASS (e_ews_connection_parent_class)->constructed (object);
cnc->priv->soup_thread = g_thread_new (NULL, e_ews_soup_thread, cnc);
cnc->priv->soup_session ... | vuln | Vulnerable | Unknown |
static void blkverify_refresh_filename(BlockDriverState *bs, QDict *options)
{
BDRVBlkverifyState *s = bs->opaque;
bdrv_refresh_filename(s->test_file->bs);
if (bs->file->bs->full_open_options
&& s->test_file->bs->full_open_options)
{
QDict *opts = qdict_new();
qdict_put_str(... | vuln | Vulnerable | C/C++ |
void ahci_uninit(AHCIState *s)
{
int i, j;
for (i = 0; i < s->ports; i++) {
AHCIDevice *ad = &s->dev[i];
for (j = 0; j < 2; j++) {
IDEState *s = &ad->port.ifs[j];
ide_exit(s);
}
}
g_free(s->dev);
} | vuln | Vulnerable | C/C++ |
static void integratorcp_init(ram_addr_t ram_size,
const char *boot_device,
const char *kernel_filename, const char *kernel_cmdline,
const char *initrd_filename, const char *cpu_model)
{
CPUState *env;
ram_addr_t ram_offset;
qemu_irq pic[32];
... | vuln | Vulnerable | C/C++ |
public void addAuthorizationsForNewProcessDefinition(Process process, ProcessDefinitionEntity processDefinition) {
CommandContext commandContext = Context.getCommandContext();
if (process != null) {
addAuthorizationsFromIterator(commandContext, process.getCandidateStarterUsers(), processDefinition, Exp... | vuln | Safe | Java |
static int img_map(int argc, char **argv)
{
int c;
OutputFormat output_format = OFORMAT_HUMAN;
BlockBackend *blk;
BlockDriverState *bs;
const char *filename, *fmt, *output;
int64_t length;
MapEntry curr = { .length = 0 }, next;
int ret = 0;
bool image_opts = false;
fmt = NULL;
... | vuln | Vulnerable | C/C++ |
parse_encoding( T1_Face face,
T1_Loader loader )
{
T1_Parser parser = &loader->parser;
FT_Byte* cur;
FT_Byte* limit = parser->root.limit;
PSAux_Service psaux = (PSAux_Service)face->psaux;
T1_Skip_Spaces( parser );
cur = parser->root.cursor;
if ( cur >= limit... | vuln | Safe | C/C++ |
package graph
import (
"errors"
"fmt"
"github.com/rs/zerolog"
"github.com/authzed/spicedb/internal/sharederrors"
)
// ErrRequestCanceled occurs when a request has been canceled.
type ErrRequestCanceled struct {
error
}
// NewRequestCanceledErr constructs a new request was canceled error.
func NewRequestCancel... | vuln | Safe | Go |
getln(int fd, char *buf, size_t bufsiz, int feedback,
enum tgetpass_errval *errval)
{
size_t left = bufsiz;
ssize_t nr = -1;
char *cp = buf;
char c = '\0';
debug_decl(getln, SUDO_DEBUG_CONV);
*errval = TGP_ERRVAL_NOERROR;
if (left == 0) {
*errval = TGP_ERRVAL_READERROR;
errno = EINVA... | vuln | Vulnerable | C/C++ |
function gce_ajax_list() {
$nonce = $_POST['gce_nonce'];
// check to see if the submitted nonce matches with the
// generated nonce we created earlier
if ( ! wp_verify_nonce( $nonce, 'gce_ajax_nonce' ) ) {
die ( 'Request has failed.');
}
$grouped = esc_html( $_POST['gce_grouped'] ... | vuln | Safe | PHP |
private Set<File> exportPackage(UPackage unrealPackage) throws IOException, InterruptedException {
File unrealMapCopy = null;
File u1Batch = null;
Set<File> exportedFiles = new HashSet<>();
boolean noDelete = false;
try {
logger.log(Level.INFO, "Exporting " + unrealPackage.getFileContainer(mapConverter)... | vuln | Vulnerable | Java |
bool AsyncPixelTransfersCompletedQuery::End(
base::subtle::Atomic32 submit_count) {
AsyncMemoryParams mem_params;
Buffer buffer = manager()->decoder()->GetSharedMemoryBuffer(shm_id());
if (!buffer.shared_memory)
return false;
mem_params.shared_memory = buffer.shared_memory;
mem_params.shm_size = buff... | vuln | Safe | C/C++ |
def is_in_or_equal(path_1: str | Path, path_2: str | Path):
"""
True if path_1 is a descendant (i.e. located within) path_2 or if the paths are the
same, returns False otherwise.
Parameters:
path_1: str or Path (must be a file)
path_2: str or Path (can be a file or directory)
"""
... | vuln | Safe | Python |
void * gdImageWBMPPtr (gdImagePtr im, int *size, int fg)
{
void *rv;
gdIOCtx *out = gdNewDynamicCtx(2048, NULL);
gdImageWBMPCtx(im, fg, out);
rv = gdDPExtractData(out, size);
out->gd_free(out);
return rv;
} | vuln | Vulnerable | C/C++ |
ins_compl_add_infercase(
char_u *str_arg,
int len,
int icase,
char_u *fname,
int dir,
int cont_s_ipos) // next ^X<> will set initial_pos
{
char_u *str = str_arg;
char_u *p;
int actual_len; // Take multi-byte characters
int actual_compl_length; // into account.
int mi... | vuln | Vulnerable | Unknown |
public int findIndexOfEditorByFile (File file) {
if (file == null) {
return -1;
}
for (int i = 0; i < this.mFiles.size (); i++) {
final var opened = mFiles.get (i);
if (opened.file.equals (file)) {
return i;
}
}
... | vuln | Safe | Java |
hivex_open (const char *filename, int flags)
{
hive_h *h = NULL;
assert (sizeof (struct ntreg_header) == 0x1000);
assert (offsetof (struct ntreg_header, csum) == 0x1fc);
h = calloc (1, sizeof *h);
if (h == NULL)
goto error;
h->msglvl = flags & HIVEX_OPEN_MSGLVL_MASK;
const char *debug = getenv ("H... | vuln | Safe | C/C++ |
private ServiceResponse executeDeleteEntitySet(ServiceRequest request, ServiceResponse response, ResourcePath path) {
PersistenceManager pm = null;
try {
PathElementEntitySet mainEntity = (PathElementEntitySet) path.getMainElement();
if (mainEntity != path.getLastElement()) {
... | vuln | Safe | Java |
static int rm_assemble_video_frame(AVFormatContext *s, RMContext *rm, AVPacket *pkt, int len)
{
ByteIOContext *pb = &s->pb;
int hdr, seq, pic_num, len2, pos;
int type;
int ssize;
hdr = get_byte(pb); len--;
type = hdr >> 6;
switch(type){
case 0:
case 2:
seq = get_byte(pb); l... | vuln | Safe | C/C++ |
static int snd_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
struct snd_pcm_runtime *runtime;
int err, usecs;
unsigned int bits;
snd_pcm_uframes_t frames;
if (PCM_RUNTIME_CHECK(substream))
return -ENXIO;
runtime = substream->runtime;
snd_pcm_stream_lock_irq(sub... | vuln | Vulnerable | Unknown |
package com.salesmanager.shop.admin.controller.products;
import com.salesmanager.core.business.services.catalog.product.ProductService;
import com.salesmanager.core.business.services.catalog.product.attribute.ProductAttributeService;
import com.salesmanager.core.business.services.catalog.product.attribute.ProductOptio... | vuln | Safe | Java |
#include "extensions/common/wasm/wasm.h"
#include <stdio.h>
#include <limits>
#include <memory>
#include <string>
#include "envoy/common/exception.h"
#include "envoy/config/wasm/v2/wasm.pb.validate.h"
#include "envoy/grpc/status.h"
#include "envoy/http/codes.h"
#include "envoy/local_info/local_info.h"
#include "envo... | vuln | Vulnerable | C/C++ |
public void renderIcon(double x, double y, double z, double a, double size) {
MB.begin(null, DrawMode.Triangles, VertexFormats.POSITION_TEXTURE_COLOR);
int preA = color.a;
color.a *= a;
MB.pos(x, y, z).texture(0, 0).color(color).endVertex();
MB.pos(x + size, y, z).texture(1, 0)... | vuln | Vulnerable | Java |
addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
const XML_Char *uri, BINDING **bindingsPtr) {
static const XML_Char xmlNamespace[]
= {ASCII_h, ASCII_t, ASCII_t, ASCII_p, ASCII_COLON,
ASCII_SLASH, ASCII_SLASH, ASCII_w, ASCII_w, ASCII_w,
... | vuln | Safe | C/C++ |
void net_checksum_calculate(uint8_t *data, int length)
{
int hlen, plen, proto, csum_offset;
uint16_t csum;
if ((data[14] & 0xf0) != 0x40)
return; /* not IPv4 */
hlen = (data[14] & 0x0f) * 4;
csum_offset = 16;
break;
case PROTO_UDP:
csum_offset = 6;
break;
default:
return;
... | vuln | Vulnerable | C/C++ |
static bool scsi_target_emulate_inquiry(SCSITargetReq *r)
{
assert(r->req.dev->lun != r->req.lun);
scsi_target_alloc_buf(&r->req, SCSI_INQUIRY_LEN);
if (r->req.cmd.buf[1] & 0x2) {
return false;
}
if (r->req.cmd.buf[1] & 0x1) {
uint8_t page_code = r->req.cmd.buf[2];
... | vuln | Safe | C/C++ |
static int vsock_dgram_sendmsg(struct socket *sock, struct msghdr *msg,
size_t len)
{
int err;
struct sock *sk;
struct vsock_sock *vsk;
struct sockaddr_vm *remote_addr;
const struct vsock_transport *transport;
if (msg->msg_flags & MSG_OOB)
return -EOPNOTSUPP;
/* For now, MSG_DONTWAIT is always assu... | vuln | Safe | Unknown |
@GetMapping("/search")
public String search(@RequestParam(defaultValue = "1") Integer pageNo, @RequestParam String keyword, Model model) {
model.addAttribute("pageNo", pageNo);
model.addAttribute("keyword", SecurityUtil.sanitizeInput(keyword));
return render("search");
} | vuln | Safe | Java |
Graph.prototype.getTooltipForCell=function(a){var b="";if(mxUtils.isNode(a.value)){var f=null;Graph.translateDiagram&&null!=Graph.diagramLanguage&&(f=a.value.getAttribute("tooltip_"+Graph.diagramLanguage));null==f&&(f=a.value.getAttribute("tooltip"));if(null!=f)null!=f&&this.isReplacePlaceholders(a)&&(f=this.replacePla... | vuln | Vulnerable | JavaScript |
v=Math.max(0,Math.min(c,mxUtils.getValue(this.state.style,"arrowSize",$a.prototype.arrowSize)));return new mxPoint(x.x+(1-v)*x.width,x.y+(1-p)*x.height/2)},function(x,p){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(x.y+x.height/2-p.y)/x.height*2));this.state.style.arrowSize=Math.max(0,Math.min(c,(x.x+x.wi... | vuln | Safe | JavaScript |
/*
* Copyright (C) 2004, 2005, 2006 Joe Walnes.
* Copyright (C) 2006, 2007, 2008, 2009, 2011, 2018, 2021 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
* style license a copy of which has been included with this distribution in
* the LICENSE.tx... | vuln | Safe | Java |
public void setDownloadLocations(String[] downloadLocations) {
this.downloadLocations = downloadLocations != null ?
downloadLocations.clone() : null;
} | vuln | Safe | Java |
#
# Copyright (c) 2014 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of... | vuln | Vulnerable | Python |
monitor_apply_keystate(struct monitor *pmonitor)
{
struct ssh *ssh = active_state; /* XXX */
struct kex *kex;
int r;
debug3("%s: packet_set_state", __func__);
if ((r = ssh_packet_set_state(ssh, child_state)) != 0)
fatal("%s: packet_set_state: %s", __func__, ssh_err(r));
sshbuf_free(child_state);
... | vuln | Vulnerable | C/C++ |
public static void finish(List<Option> options) {
ConfigSpec spec = new ConfigSpec();
for (Option o : options) {
spec.define(o.getName(), o.getDefaultValue());
}
CommentedFileConfig configData = read(Paths.get("config", Constants.MODID + "-mixin.toml"));
for (Option o... | vuln | Vulnerable | Java |
String HHVM_FUNCTION(ldap_escape,
const String& value,
const String& ignores /* = "" */,
int flags /* = 0 */) {
char esc[256] = {};
if (flags & k_LDAP_ESCAPE_FILTER) { // llvm.org/bugs/show_bug.cgi?id=18389
esc['*'*1u] = esc['('*1u] = esc[')'*1u] =... | vuln | Safe | C/C++ |
private final void writeCloseTag(String uncanonElementName)
throws IOException {
if (!open) { throw new IllegalStateException(); }
String elementName = HtmlLexer.canonicalElementName(uncanonElementName);
if (!isValidHtmlName(elementName)) {
error("Invalid element name", elementName);
retur... | vuln | Vulnerable | Java |
constructor(autoSingletons, debug) {
this.debugEnabled = (typeof debug === 'boolean' && debug === true);
this.autoInitSingletons = (typeof autoSingletons === 'boolean' && autoSingletons === false);
this.plugins = {};
this.listeners = {};
this.foundBaseUrl = null;
this.rea... | vuln | Safe | JavaScript |
gplotGenCommandFile(GPLOT *gplot)
{
char buf[L_BUF_SIZE];
char *cmdstr, *plottitle, *dataname;
l_int32 i, plotstyle, nplots;
FILE *fp;
PROCNAME("gplotGenCommandFile");
if (!gplot)
return ERROR_INT("gplot not defined", procName, 1);
/* Remove any previous command data */
sarray... | 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 | Safe | Java |
int wolfSSH_SFTP_RecvOpen(WOLFSSH* ssh, int reqId, byte* data, word32 maxSz)
#ifndef USE_WINDOWS_API
{
WS_SFTP_FILEATRB atr;
WFD fd;
word32 sz;
char* dir;
word32 reason;
word32 idx = 0;
int m = 0;
int ret = WS_SUCCESS;
word32 outSz = sizeof(WFD) + UINT32_SZ + WOLFSSH_SFTP_HEADER... | vuln | Safe | Unknown |
var http = require('http');
var fs = require('fs');
fs.exists = fs.exists || require('path').exists;
var SERVER_PORT = 8080;
var FILE_TYPE_GZIP = 1;
var FILE_EXT_GZIP = '.gz';
var FILE_EXT_CSS = '.css';
var FILE_EXT_JS = '.js';
// GZIP text/plain required to get Chrome XHR to decompress file.
var MIME_TYPE_GZIP = ... | vuln | Vulnerable | JavaScript |
static inline void Process_v9_data(exporter_v9_domain_t *exporter, void *data_flowset, FlowSource_t *fs, input_translation_t *table ){
uint64_t start_time, end_time, sampling_rate;
uint32_t size_left;
uint8_t *in, *out;
int i;
char *string;
size_left = GET_FLOWSET_LENGTH(data_flowset) - 4; // -4 for dat... | vuln | Vulnerable | Unknown |
int VP8LBuildHuffmanTable(HuffmanCode* const root_table, int root_bits,
const int code_lengths[], int code_lengths_size) {
int total_size;
assert(code_lengths_size <= MAX_CODE_LENGTHS_SIZE);
if (root_table == NULL) {
total_size = BuildHuffmanTable(NULL, root_bits,
... | vuln | Vulnerable | C/C++ |
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 |
it "should be created correctly" do
invite = Fabricate(:invite, email: 'walter.white@email.com')
user = InviteRedeemer.create_user_from_invite(invite: invite, email: invite.email, username: 'walter', name: 'Walter White')
expect(user.username).to eq('walter')
expect(user.name).to eq('Walter Whit... | vuln | Vulnerable | Ruby |
void OPPROTO op_srl_T0_T1 (void)
{
T0 = (uint32_t)T0 >> T1;
RETURN();
} | vuln | Safe | C/C++ |
/*
* Copyright (c) 2006-2020, JGraph Ltd
*
* This provides an indirection to make sure the mxClient.js
* loads before the dependent classes below are loaded. This
* is used for development mode where the JS is in separate
* files and the mxClient.js loads other files.
*/
if (!mxIsElectron && location.protocol !... | vuln | Safe | JavaScript |
parse_tag_3_packet(struct ecryptfs_crypt_stat *crypt_stat,
unsigned char *data, struct list_head *auth_tok_list,
struct ecryptfs_auth_tok **new_auth_tok,
size_t *packet_size, size_t max_packet_size)
{
size_t body_size;
struct ecryptfs_auth_tok_list_item *auth_tok_list_item;
size_t length_size;
int rc... | vuln | Vulnerable | Unknown |
window.OME.handleChgrp = function(webindex, staticurl) {
webindex_url = webindex;
static_url = staticurl;
// gid, gname, oid
$chgrpform.dialog({"title": "Move to Group",
height: 450,
width: 400});
$chgrpform.dialog('open');
$chgrpform.empty();
... | vuln | Vulnerable | JavaScript |
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator p... | vuln | Safe | Java |
static int picolcd_raw_event(struct hid_device *hdev,
struct hid_report *report, u8 *raw_data, int size)
{
struct picolcd_data *data = hid_get_drvdata(hdev);
unsigned long flags;
int ret = 0;
if (!data)
return 1;
if (report->id == REPORT_KEY_STATE) {
if (data->input_keys)
ret = picolcd_raw_keypad(... | vuln | Vulnerable | C/C++ |
private static String[] removeTracksFromDatabase(Context context, long[] ids) {
ContentResolver resolver = context.getContentResolver();
StringBuilder builder = new StringBuilder();
builder.append(AudioColumns._ID + " IN (");
for (int i = 0; i < ids.length; i++) {
builder.app... | vuln | Vulnerable | Java |
public void save() {
final String text = editor.getText().toString();
final boolean wrote = FileIOUtils.writeFileFromString(mFile, text);
notifySaved(wrote, text);
isModified = false;
} | vuln | Vulnerable | Java |
static pj_status_t decode_errcode_attr(pj_pool_t *pool,
const pj_uint8_t *buf,
const pj_stun_msg_hdr *msghdr,
void **p_attr)
{
pj_stun_errcode_attr *attr;
pj_str_t value;
PJ_UNUSED_ARG(msghdr);
/* Create the attribute */
attr = PJ_POOL_ZALLOC_T(pool, pj_stun_errc... | vuln | Safe | Unknown |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Vulnerable | C/C++ |
int tls1_mac(SSL *ssl, unsigned char *md, int send)
{
SSL3_RECORD *rec;
unsigned char *mac_sec,*seq;
const EVP_MD *hash;
size_t md_size;
int i;
HMAC_CTX hmac;
unsigned char header[13];
if (send)
{
rec= &(ssl->s3->wrec);
mac_sec= &(ssl->s3->write_mac_secret[0]);
seq= &(ssl->s3->write_sequence[0]);
ha... | vuln | Vulnerable | Unknown |
static int ioreq_map(struct ioreq *ioreq)
{
XenGnttab gnt = ioreq->blkdev->xendev.gnttabdev;
uint32_t domids[BLKIF_MAX_SEGMENTS_PER_REQUEST];
uint32_t refs[BLKIF_MAX_SEGMENTS_PER_REQUEST];
void *page[BLKIF_MAX_SEGMENTS_PER_REQUEST];
int i, j, new_maps = 0;
PersistentGrant *grant;
PersistentR... | vuln | Safe | C/C++ |
static void* OGRExpatRealloc( void *ptr, size_t size )
{
if( CanAlloc(size) )
return realloc(ptr, size);
return nullptr;
} | vuln | Safe | C/C++ |
static function testLDAPConnection($auths_id, $replicate_id = -1) {
$config_ldap = new self();
$res = $config_ldap->getFromDB($auths_id);
// we prevent some delay...
if (!$res) {
return false;
}
//Test connection to a replicate
if ($replicate_id != -1) {
... | vuln | Safe | PHP |
static void versatile_init(MachineState *machine, int board_id)
{
ObjectClass *cpu_oc;
Object *cpuobj;
ARMCPU *cpu;
MemoryRegion *sysmem = get_system_memory();
MemoryRegion *ram = g_new(MemoryRegion, 1);
qemu_irq pic[32];
qemu_irq sic[32];
DeviceState *dev, *sysctl;
SysBusDevice *bus... | vuln | Safe | C/C++ |
if(!self.define){const e=e=>{"require"!==e&&(e+=".js");let r=Promise.resolve();return i[e]||(r=new Promise((async r=>{if("document"in self){const i=document.createElement("script");i.src=e,document.head.appendChild(i),i.onload=r}else importScripts(e),r()}))),r.then((()=>{if(!i[e])throw new Error(`Module ${e} didn’t reg... | vuln | Vulnerable | Java |
function sendTestEmail(){var s=[];$.each($("#headersTable").DataTable().rows().data(),function(e,a){s.push({key:unescapeHtml(a[0]),value:unescapeHtml(a[1])})});var e={template:{},first_name:$("input[name=to_first_name]").val(),last_name:$("input[name=to_last_name]").val(),email:$("input[name=to_email]").val(),position:... | vuln | Safe | JavaScript |
long kernel_wait4(pid_t upid, int __user *stat_addr, int options,
struct rusage *ru)
{
struct wait_opts wo;
struct pid *pid = NULL;
enum pid_type type;
long ret;
if (options & ~(WNOHANG|WUNTRACED|WCONTINUED|
__WNOTHREAD|__WCLONE|__WALL))
return -EINVAL;
/* -INT_MIN is not defined */
if (upid == INT... | vuln | Safe | C/C++ |
static inline void gen_neon_mull(TCGv_i64 dest, TCGv a, TCGv b, int size, int u)
{
TCGv_i64 tmp;
switch ((size << 1) | u) {
case 0: gen_helper_neon_mull_s8(dest, a, b); break;
case 1: gen_helper_neon_mull_u8(dest, a, b); break;
case 2: gen_helper_neon_mull_s16(dest, a, b); break;
case 3: gen_hel... | vuln | Vulnerable | C/C++ |
def get(self, email):
""" Fetch data for admin with the corresponding email """
return database_utilities.execute_query(f"""select * from admins where email = '{email}'""") | vuln | Vulnerable | Python |
static void generate_offset_lut(DiracGolombLUT *lut, int off)
{
int idx;
for (idx = 0; idx < LUT_SIZE; idx++) {
DiracGolombLUT *l = &lut[idx];
INIT_RESIDUE(res);
SET_RESIDUE(res, idx, LUT_BITS);
l->preamble = CONVERT_TO_RESIDUE(res >> (RSIZE_BITS - off), off);
l->pre... | vuln | Vulnerable | C/C++ |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite/handler/oauth2 (interfaces: CoreStrategy)
// Package internal is a generated GoMock package.
package internal
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
fosite "github.com/ory/fosite"
)
// MockC... | vuln | Vulnerable | Go |
@Override
public void run() {
Voice.LOGGER.info("Start ping");
while(!this.socketUDP.isClosed()) {
try {
this.socketUDP.checkTimeout();
Thread.sleep(1000L);
} catch (InterruptedException ignored) {}
}
} | vuln | Vulnerable | Java |
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 (session->key.totp.last_result == 0) {
int64_t t;
memcpy(session->key.initial_stek, key->data, key->size)... | vuln | Vulnerable | Unknown |
@Inject(at=@At("RETURN"), method = "load(Ljava/io/InputStream;)Lcom/mojang/blaze3d/platform/NativeImage;")
private void load(InputStream stream, CallbackInfoReturnable<NativeImage> ci) {
EarsLog.debug("Platform:Inject", "Process player skin");
NativeImage cur = ci.getReturnValue();
if (cur != null) {
earsFeat... | vuln | Safe | Java |
@EventHandler(priority = EventPriority.HIGH)
public void archeryListener(EntityDamageByEntityEvent event) {
if (OptionL.isEnabled(Skills.ARCHERY)) {
if (!event.isCancelled()) {
if (event.getDamager() instanceof Arrow) {
Arrow arrow = (Arrow) event.getDamager()... | vuln | Vulnerable | Java |
protected void flushPlans(Seq<BuildPlan> plans, boolean freeze, boolean force, boolean removeFrozen){
var configLogic = Core.settings.getBool("processorconfigs");
var temp = new BuildPlan[plans.size + plans.count(plan -> plan.block == Blocks.waterExtractor) * 3]; // Cursed but works good enough for me
... | vuln | Vulnerable | Java |
/*
* 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 | Safe | Java |
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
String pkg = (String) args[0];
int userId = VUserHandle.myUserId();
VActivityManager.get().killAppByPkg(pkg, userId);
return 0;
} | vuln | Vulnerable | Java |
@Override
boolean verify(char[] guess, Charset hashCharset) throws InvalidKeyException {
try {
return Arrays.equals(digest, digestOf(algorithm, salt, guess, hashCharset));
} catch (NoSuchAlgorithmException e) {
throw log.invalidKeyNoSuchMessageDigestAlgorithm(algorithm);
... | vuln | Vulnerable | Java |
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 | Safe | C/C++ |
int ext4_xattr_ibody_find(struct inode *inode, struct ext4_xattr_info *i,
struct ext4_xattr_ibody_find *is)
{
struct ext4_xattr_ibody_header *header;
struct ext4_inode *raw_inode;
int error;
if (!EXT4_INODE_HAS_XATTR_SPACE(inode))
return 0;
raw_inode = ext4_raw_inode(&is->iloc);
header = IHDR(inode, raw_... | vuln | Safe | C/C++ |
static void spapr_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
Error **errp)
{
PCDIMMDevice *dimm = PC_DIMM(dev);
PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm);
MemoryRegion *mr = ddc->get_memory_region(dimm);
uint64_t size = memory_region_size(mr);... | vuln | Vulnerable | C/C++ |
plpgsql_validator(PG_FUNCTION_ARGS)
{
Oid funcoid = PG_GETARG_OID(0);
HeapTuple tuple;
Form_pg_proc proc;
char functyptype;
int numargs;
Oid *argtypes;
char **argnames;
char *argmodes;
bool is_dml_trigger = false;
bool is_event_trigger = false;
int i;
if (!CheckFunctionValidatorAccess(fci... | vuln | Safe | Unknown |
static void cc_destroy_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem) {
channel_data *chand = elem->channel_data;
if (chand->resolver != NULL) {
grpc_resolver_shutdown(exec_ctx, chand->resolver);
GRPC_RESOLVER_UNREF(exec_ctx, chand->resolver, "channel")... | vuln | Vulnerable | C/C++ |
static uint16_t nvme_map_addr(NvmeCtrl *n, NvmeSg *sg, hwaddr addr, size_t len)
{
bool cmb = false, pmr = false;
if (!len) {
return NVME_SUCCESS;
}
trace_pci_nvme_map_addr(addr, len);
if (nvme_addr_is_iomem(n, addr)) {
return NVME_DATA_TRAS_ERROR;
}
if (nvme_addr_is_cmb(n... | vuln | Safe | Unknown |
main (int argc, char * argv [])
{ const char *progname, *infilename, *outfilename ;
SNDFILE *infile = NULL, *outfile = NULL ;
SF_INFO sfinfo ;
int k, outfilemajor, outfileminor = 0, infileminor ;
int override_sample_rate = 0 ; /* assume no sample rate override. */
int endian = SF_ENDIAN_FILE, normalize = S... | vuln | Vulnerable | Unknown |
static HashTable* wsdl_message(sdlCtx *ctx, xmlChar* message_name)
{
xmlNodePtr trav, part, message = NULL, tmp;
HashTable* parameters = NULL;
char *ctype;
ctype = strrchr((char*)message_name,':');
if (ctype == NULL) {
ctype = (char*)message_name;
} else {
++ctype;
}
if ((tmp = zend_hash_str_find_ptr(&ctx-... | vuln | Vulnerable | Unknown |
const crypto = require('crypto')
module.exports = {
/**
* Generate unique hash from page
*/
generateHash(assetPath) {
return crypto.createHash('sha1').update(assetPath).digest('hex')
}
}
| vuln | Vulnerable | JavaScript |
parse_signature (IOBUF inp, int pkttype, unsigned long pktlen,
PKT_signature * sig)
{
int md5_len = 0;
unsigned n;
int is_v4 = 0;
int rc = 0;
int i, ndata;
if (pktlen < 16)
{
log_error ("packet(%d) too short\n", pkttype);
if (list_mode)
es_fputs (":signature packet: [too short]\n... | vuln | Vulnerable | Unknown |
static int png_write_row(PNGContext *s, const uint8_t *data, int size)
{
int ret;
s->zstream.avail_in = size;
s->zstream.next_in = (uint8_t *)data;
while (s->zstream.avail_in > 0) {
ret = deflate(&s->zstream, Z_NO_FLUSH);
if (ret != Z_OK)
return -1;
if (s->zstream.ava... | vuln | Safe | C/C++ |
function getValue(req, keyName) {
if (req.params && req.params[keyName] !== undefined) {
return req.params[keyName];
} else if (req.body && req.body[keyName] !== undefined) {
return req.body[keyName];
} else if (req.query && req.query[keyName] !== undefined) {
return req.query[keyName];
} else {
... | vuln | Vulnerable | JavaScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.