code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
struct msghdr *msg, size_t len)
{
struct sock_iocb *siocb = kiocb_to_siocb(kiocb);
struct sock *sk = sock->sk;
struct sock *other = NULL;
struct sockaddr_un *sunaddr=msg->msg_name;
int err,size;
struct sk_buff *skb;
int sent=0;
s... | cwe | CWE-399 | Unknown |
@Override
protected void init() {
super.init();
this.nameWidget = this.addButton(new TextFieldWidget(font, this.guiLeft + 21, this.guiTop + 29, 98, 12, new TranslationTextComponent("gui.vampirism.minion_appearance.name")));
this.nameWidget.setText(entity.getMinionData().map(MinionData::getNa... | vuln | Safe | Java |
n)for(v=0;v<n.length;v++)n[v].node.style.visibility=c?"visible":"hidden"};var f=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){f.call(this);var c=this.guidesArrVer,m=this.guidesArrHor;if(null!=c){for(var n=0;n<c.length;n++)c[n].destroy();this.guidesArrVer=null}if(null!=m){for(n=0;n<m.length;n++)m[n].des... | cwe | CWE-20 | JavaScript |
// SPDX-License-Identifier: GPL-2.0+
/*
* linux/fs/jbd2/transaction.c
*
* Written by Stephen C. Tweedie <sct@redhat.com>, 1998
*
* Copyright 1998 Red Hat corp --- All Rights Reserved
*
* Generic filesystem transaction handling code; part of the ext2fs
* journaling system.
*
* This file manages transactions (c... | cwe | CWE-416 | C/C++ |
var profiles = []
// Attempts to send a test email by POSTing to /campaigns/
function sendTestEmail() {
var headers = [];
$.each($("#headersTable").DataTable().rows().data(), function (i, header) {
headers.push({
key: unescapeHtml(header[0]),
value: unescapeHtml(header[1]),
... | cwe | CWE-79 | Go |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2020 University of Dundee & Open Microscopy Environment.
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software... | cwe | CWE-601 | Python |
// Copyright 2022 PingCAP, 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 i... | cwe | CWE-134 | Go |
int vp8_decode_frame(VP8D_COMP *pbi) {
vp8_reader *const bc = &pbi->mbc[8];
VP8_COMMON *const pc = &pbi->common;
MACROBLOCKD *const xd = &pbi->mb;
const unsigned char *data = pbi->fragments.ptrs[0];
const unsigned int data_sz = pbi->fragments.sizes[0];
const unsigned char *data_end = data + data_sz;
ptrdi... | cwe | CWE-125 | C/C++ |
def instantiate variant, mac=nil
# Filenames must end in a hex representation of a mac address but only if mac is not empty
log_halt 403, "Invalid MAC address: #{mac}" unless valid_mac?(mac) || mac.nil?
log_halt 403, "Unrecognized pxeboot config type: #{variant}" unless VARIANTS... | vuln | Safe | Ruby |
public function remove(History $hist, $transaction = true)
{
global $emitter;
try {
if ($transaction) {
$this->zdb->connection->beginTransaction();
}
//remove associated contributions if needeed
if ($this->getDispatchedAmount() > 0) {... | vuln | Safe | PHP |
static long ext4_zero_range(struct file *file, loff_t offset,
loff_t len, int mode)
{
struct inode *inode = file_inode(file);
handle_t *handle = NULL;
unsigned int max_blocks;
loff_t new_size = 0;
int ret = 0;
int flags;
int credits;
int partial_begin, partial_end;
loff_t start, end;
ext4_lblk_t lblk;
... | cwe | CWE-362 | C/C++ |
/*
* asn1.c: ASN.1 decoding functions (DER)
*
* Copyright (C) 2001, 2002 Juha Yrjölä <juha.yrjola@iki.fi>
*
* 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 o... | cwe | CWE-119 | C/C++ |
public final function setAction($strAction) {
$this->strAction = $strAction;
} | vuln | Vulnerable | PHP |
private void resetServerPreference() {
PreferenceUtil.getInstance(context).setServerId(null);
PreferenceUtil.getInstance(context).setServer(null);
PreferenceUtil.getInstance(context).setUser(null);
PreferenceUtil.getInstance(context).setPassword(null);
Prefere... | vuln | Safe | Java |
nfssvc_decode_readargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd_readargs *args)
{
unsigned int len;
int v;
p = decode_fh(p, &args->fh);
if (!p)
return 0;
args->offset = ntohl(*p++);
len = args->count = ntohl(*p++);
p++; /* totalcount - unused */
if (!xdr_argsize_check(rqstp, p))
retur... | vuln | Safe | 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 |
@Inject(
method = "update(Lnet/minecraft/world/World;)Z",
at = @At("HEAD"),
cancellable = true
)
private void customRunNext(World world, CallbackInfoReturnable<Boolean> cir) {
Direction[] directions = BlockUpdateUtils.blockUpdateDirections.apply(this.pos);
Blo... | vuln | Vulnerable | Java |
/*
* . .o8 oooo
* .o8 "888 `888
* .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo
* 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P'
* 888 888 888 888 8... | vuln | Safe | JavaScript |
mrb_proc_copy(mrb_state *mrb, struct RProc *a, struct RProc *b)
{
if (a->body.irep) {
/* already initialized proc */
return;
}
a->flags = b->flags;
a->body = b->body;
a->upper = b->upper;
if (!MRB_PROC_CFUNC_P(a) && a->body.irep) {
mrb_irep_incref(mrb, (mrb_irep*)a->body.irep);
}
a->e.env = ... | cwe | CWE-122 | C/C++ |
package oci
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"net"
"os"
"os/exec"
"path/filepath"
"strconv"
"syscall"
"time"
"github.com/containernetworking/plugins/pkg/ns"
conmonconfig "github.com/containers/conmon/runner/config"
"github.com/containers/storage/pkg/pools"
"github.com/cri-o/cri-o/internal/config... | cwe | CWE-400 | Go |
xmlParseEntityRef(xmlParserCtxtPtr ctxt) {
const xmlChar *name;
xmlEntityPtr ent = NULL;
GROW;
if (ctxt->instate == XML_PARSER_EOF)
return(NULL);
if (RAW != '&')
return(NULL);
NEXT;
name = xmlParseName(ctxt);
if (name == NULL) {
xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIR... | vuln | Safe | Unknown |
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unl... | cwe | CWE-23 | Java |
public static void addDimensionalSpacing(final WorldEvent.Load event) {
if (event.getWorld() instanceof ServerWorld) {
ServerWorld serverWorld = (ServerWorld) event.getWorld();
ServerChunkProvider chunkProvider = serverWorld.getChunkProvider();
try {
if (GETCODEC_METHOD == null)GETCODEC_METHOD = Obfu... | vuln | Safe | Java |
static int cac_read_binary(sc_card_t *card, unsigned int idx,
unsigned char *buf, size_t count, unsigned long flags)
{
cac_private_data_t * priv = CAC_DATA(card);
int r = 0;
u8 *tl = NULL, *val = NULL;
u8 *tl_ptr, *val_ptr, *tlv_ptr, *tl_start;
u8 *cert_ptr;
size_t tl_len, val_len, tlv_len;
size_t len, tl_head... | vuln | Vulnerable | C/C++ |
void SoftAVC::drainOneOutputBuffer(int32_t picId, uint8_t* data) {
List<BufferInfo *> &outQueue = getPortQueue(kOutputPortIndex);
BufferInfo *outInfo = *outQueue.begin();
outQueue.erase(outQueue.begin());
OMX_BUFFERHEADERTYPE *outHeader = outInfo->mHeader;
OMX_BUFFERHEADERTYPE *header = mPicToHe... | cwe | CWE-20 | C/C++ |
RCMS *r_pkcs7_parse_cms (const ut8 *buffer, ut32 length) {
RASN1Object *object;
RCMS *container;
if (!buffer || !length) {
return NULL;
}
container = R_NEW0 (RCMS);
if (!container) {
return NULL;
}
object = r_asn1_create_object (buffer, length);
if (!object || object->list.length != 2 || !object->list.o... | cwe | CWE-476 | C/C++ |
static void qmp_input_check_struct(Visitor *v, Error **errp)
{
QmpInputVisitor *qiv = to_qiv(v);
StackObject *tos = &qiv->stack[qiv->nb_stack - 1];
assert(qiv->nb_stack > 0);
if (qiv->strict) {
GHashTable *const top_ht = tos->h;
if (top_ht) {
GHashTableIter iter;
... | vuln | Safe | C/C++ |
static int samldb_group_type_change(struct samldb_ctx *ac)
{
struct ldb_context *ldb = ldb_module_get_ctx(ac->module);
uint32_t group_type, old_group_type, account_type;
struct ldb_message_element *el;
struct ldb_message *tmp_msg;
int ret;
struct ldb_result *res;
const char * const attrs[] = { "groupType", NULL ... | vuln | Vulnerable | Unknown |
Label: Core.Language.Translate("Close this dialog"),
Class: 'Primary',
Function: function () {
Core.UI.Dialog.CloseDialog($('#SupportBundleOptionsDialog'));
}
}... | cwe | CWE-20 | JavaScript |
static int read_request(int fd, debugger_request_t* out_request) {
ucred cr;
socklen_t len = sizeof(cr);
int status = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &len);
if (status != 0) {
ALOGE("cannot get credentials");
return -1;
}
ALOGV("reading tid");
fcntl(fd, F_SETFL, O_NONBLOCK);
pollfd po... | cwe | CWE-264 | 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,... | cwe | CWE-287 | Java |
/*
Copyright The Helm 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, software
distrib... | cwe | CWE-20 | Go |
def output_versions output, versions
versions.each do |gem_name, matching_tuples|
matching_tuples = matching_tuples.sort_by { |n,_| n.version }.reverse
platforms = Hash.new { |h,version| h[version] = [] }
matching_tuples.each do |n, _|
platforms[n.version] << n.platform if n.platform
... | cwe | CWE-94 | Ruby |
static BlockAIOCB *inject_error(BlockDriverState *bs,
BlockCompletionFunc *cb, void *opaque, BlkdebugRule *rule)
{
BDRVBlkdebugState *s = bs->opaque;
int error = rule->options.inject.error;
struct BlkdebugAIOCB *acb;
QEMUBH *bh;
bool immediately = rule->options.inject.immediately;
if (rule->... | vuln | Safe | C/C++ |
e_ews_autodiscover_ws_url (ESource *source,
CamelEwsSettings *settings,
const gchar *email_address,
const gchar *password,
GCancellable *cancellable,
GAsyncReadyCallback callback,
... | vuln | Safe | Unknown |
int wolfSSH_SFTP_RecvLSTAT(WOLFSSH* ssh, int reqId, byte* data, word32 maxSz)
{
WS_SFTP_FILEATRB atr;
char* name = NULL;
int ret = WS_SUCCESS;
word32 sz;
word32 idx = 0;
byte* out = NULL;
word32 outSz = 0;
if (ssh == NULL) {
return WS_BAD_ARGUMENT;
}
WLOG(WS_LOG_SF... | vuln | Safe | C/C++ |
def main(srcfile, dump_module=False):
argv0 = sys.argv[0]
components = argv0.split(os.sep)
argv0 = os.sep.join(components[-2:])
auto_gen_msg = common_msg % argv0
mod = asdl.parse(srcfile)
if dump_module:
print('Parsed Module:')
print(mod)
if not asdl.check(mod):
sys.e... | cwe | CWE-125 | C/C++ |
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholi... | vuln | Vulnerable | C/C++ |
/*
* Copyright 2022 Thoughtworks, 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 agr... | vuln | Safe | Java |
function deepExtend (a, b) {
// TODO: add support for Arrays to deepExtend
if (Array.isArray(b)) {
throw new TypeError('Arrays are not supported by deepExtend')
}
for (const prop in b) {
if (hasOwnProperty(b, prop)) {
if (b[prop] && b[prop].constructor === Object) {
if (a[prop] === undefi... | cwe | CWE-1321 | JavaScript |
RecVolumes5::RecVolumes5(bool TestOnly)
{
RealBuf=NULL;
RealReadBuffer=NULL;
DataCount=0;
RecCount=0;
TotalCount=0;
RecBufferSize=0;
for (uint I=0;I<ASIZE(ThreadData);I++)
{
ThreadData[I].RecRSPtr=this;
ThreadData[I].RS=NULL;
}
if (TestOnly)
{
#ifdef RAR_SMP
RecThreadPool=NULL;
#end... | vuln | Vulnerable | C/C++ |
/**
* 2011 Peter 'Pita' Martischka
*
* 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... | cwe | CWE-697 | JavaScript |
static void rtl_p2p_action_ie(struct ieee80211_hw *hw, void *data,
unsigned int len)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct ieee80211_mgmt *mgmt = data;
struct rtl_p2p_ps_info *p2pinfo = &(rtlpriv->psc.p2p_ps_info);
u8 noa_num, index , i , noa_index = 0;
u8 *pos, *end, *ie;
u16 noa_len;
stati... | cwe | CWE-120 | 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 | Safe | C/C++ |
static int bpf_map_do_batch(const union bpf_attr *attr,
union bpf_attr __user *uattr,
int cmd)
{
bool has_read = cmd == BPF_MAP_LOOKUP_BATCH ||
cmd == BPF_MAP_LOOKUP_AND_DELETE_BATCH;
bool has_write = cmd != BPF_MAP_LOOKUP_BATCH;
struct bpf_map *map;
int err, ufd;
struct fd f;
if (CHECK_ATTR(B... | vuln | Safe | Unknown |
public function jsonError(Exception $exception) {
$message = $exception->getMessage();
$code = $this->getHttpStatusCode($exception);
return new JSONResponse(
[
'message' => $message . ' (' . $code . ')',
'success' => false
],
$code
);
} | cwe | CWE-79 | PHP |
psutil_proc_memory_maps(PyObject *self, PyObject *args) {
int pid;
int fd = -1;
char path[1000];
char perms[10];
const char *name;
struct stat st;
pstatus_t status;
prxmap_t *xmap = NULL, *p;
off_t size;
size_t nread;
int nmap;
uintptr_t pr_addr_sz;
uintptr_t stk_bas... | cwe | CWE-415 | Unknown |
SockParse(Sock *sockPtr)
{
const Tcl_DString *bufPtr;
const Driver *drvPtr;
Request *reqPtr;
char save;
SockState result;
NS_NONNULL_ASSERT(sockPtr != NULL);
drvPtr = sockPtr->drvPtr;
NsUpdateProgress((Ns_Sock *) sockPtr);
reqPtr = sockPt... | vuln | Vulnerable | C/C++ |
void mysql_read_default_options(struct st_mysql_options *options,
const char *filename,const char *group)
{
int argc;
char *argv_buff[1],**argv;
const char *groups[3];
DBUG_ENTER("mysql_read_default_options");
DBUG_PRINT("enter",("file: %s group: %s",filename,group ? group :"NULL"));
compile_time_asse... | cwe | CWE-319 | Unknown |
App.Actions.DB.update_db_username_hint = function(elm, hint) {
if (hint.trim() == '') {
$(elm).parent().find('.hint').html('');
}
$(elm).parent().find('.hint').text(GLOBAL.DB_USER_PREFIX + hint);
} | cwe | CWE-79 | JavaScript |
static int get_packet(URLContext *s, int for_header)
{
RTMPContext *rt = s->priv_data;
int ret;
uint8_t *p;
const uint8_t *next;
uint32_t data_size;
uint32_t ts, cts, pts=0;
if (rt->state == STATE_STOPPED)
return AVERROR_EOF;
for (;;) {
RTMPPacket rpkt = { 0 };
if... | vuln | Vulnerable | C/C++ |
static void xio3130_downstream_realize(PCIDevice *d, Error **errp)
{
PCIEPort *p = PCIE_PORT(d);
PCIESlot *s = PCIE_SLOT(d);
int rc;
pci_bridge_initfn(d, TYPE_PCIE_BUS);
pcie_port_init_reg(d);
rc = msi_init(d, XIO3130_MSI_OFFSET, XIO3130_MSI_NR_VECTOR,
XIO3130_MSI_SUPPORTED_FLA... | vuln | Vulnerable | C/C++ |
void hmp_info_memdev(Monitor *mon, const QDict *qdict)
{
Error *err = NULL;
MemdevList *memdev_list = qmp_query_memdev(&err);
MemdevList *m = memdev_list;
StringOutputVisitor *ov;
char *str;
int i = 0;
while (m) {
ov = string_output_visitor_new(false);
visit_type_uint16List(s... | vuln | Vulnerable | C/C++ |
static void gd_set_keycode_type(GtkDisplayState *s)
{
#ifdef GDK_WINDOWING_X11
GdkDisplay *display = gtk_widget_get_display(s->window);
if (GDK_IS_X11_DISPLAY(display)) {
Display *x11_display = gdk_x11_display_get_xdisplay(display);
XkbDescPtr desc = XkbGetKeyboard(x11_display, XkbGBN_AllCompone... | vuln | Safe | C/C++ |
public void render() {
if(!VoiceClient.isConnected()) {
return;
}
final Player player = client.player;
final Gui inGameHud = client.gui;
final PoseStack matrixStack = new PoseStack();
if (player == null) return;
if(VoiceClient.socketUDP.ping.timedOu... | vuln | Vulnerable | 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... | cwe | CWE-79 | Java |
static Image *ReadSCRImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
char zxscr[6144];
char zxattr[768];
int octetnr;
int octetline;
int zoneline;
int zonenr;
int octet_val;
int attr_nr;
int pix;
int piy;
int binar[8];
int attrbin[8];
int *pbin;
int ... | cwe | CWE-120 | C/C++ |
/**
* This file is part of alf.io.
*
* alf.io 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 3 of the License, or
* (at your option) any later version.
*
* alf.io is distributed in the ... | cwe | CWE-79 | Java |
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* 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.apach... | vuln | Vulnerable | Java |
#ifndef JSI_LITE_ONLY
#ifndef JSI_AMALGAMATION
#include "jsiInt.h"
#endif
#if JSI__MUSL==1 || defined(__FreeBSD__)
#define NO_QSORT_R 1
#endif
static Jsi_RC jsi_ArrayPushCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
Jsi_Obj *obj;
if (_this->vt != JSI... | cwe | CWE-190 | C/C++ |
def extract_ip_or_domain(url):
# Decode the URL to handle percent-encoded characters
_url = remove_credentials_from_url(unquote(url))
ip_regex = re.compile("^(?:http://|https://)(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})")
domain_regex = re.compile("^(?:http://|https://)([a-zA-Z0-9.-]+)")
match =... | vuln | Safe | Python |
static int add_push_report_sideband_pkt(git_push *push, git_pkt_data *data_pkt, git_buf *data_pkt_buf)
{
git_pkt *pkt;
const char *line, *line_end;
size_t line_len;
int error;
int reading_from_buf = data_pkt_buf->size > 0;
if (reading_from_buf) {
/* We had an existing partial packet, so add the new
* packet... | cwe | CWE-476 | C/C++ |
addtok (token t)
{
if (MB_CUR_MAX > 1 && t == MBCSET)
{
bool need_or = false;
struct mb_char_classes *work_mbc = &dfa->mbcsets[dfa->nmbcsets - 1];
/* Extract wide characters into alternations for better performance.
This does not require UTF-8. */
if (!work_mbc->invert)
... | vuln | Safe | Unknown |
/*
* 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... | cwe | CWE-732 | Java |
function(J){k=J};this.setAutoScroll=function(J){m=J};this.setOpenFill=function(J){q=J};this.setStopClickEnabled=function(J){A=J};this.setSelectInserted=function(J){z=J};this.setSmoothing=function(J){l=J};this.setPerfectFreehandMode=function(J){M=J};this.setBrushSize=function(J){L.size=J};this.getBrushSize=function(){re... | cwe | CWE-20 | JavaScript |
var jwt = require('jsonwebtoken');
var UnauthorizedError = require('./errors/UnauthorizedError');
var unless = require('express-unless');
var async = require('async');
var set = require('lodash.set');
var DEFAULT_REVOKED_FUNCTION = function(_, __, cb) { return cb(null, false); };
function isFunction(object) {
retur... | vuln | Vulnerable | JavaScript |
/*
* linux/ipc/shm.c
* Copyright (C) 1992, 1993 Krishna Balasubramanian
* Many improvements/fixes by Bruno Haible.
* Replaced `struct shm_desc' by `struct vm_area_struct', July 1994.
* Fixed the shm swap deallocation (shm_unuse()), August 1998 Andrea Arcangeli.
*
* /proc/sysvipc/shm support (c) 1999 Dragos Acos... | vuln | Vulnerable | C/C++ |
@SuppressWarnings("unchecked")
public void addDefaultGeneralType(EClass generalizationEClass, String... superTypeNames) {
Class<? extends Generalization> kind = (Class<? extends Generalization>)generalizationEClass.getInstanceClass();
TypeImpl type = (TypeImpl)getTarget();
TypeUtil.removeEmptyGeneralTypesFor(typ... | vuln | Safe | Java |
str_iconveha (const char *src,
const char *from_codeset, const char *to_codeset,
bool transliterate,
enum iconv_ilseq_handler handler)
{
if (*src == '\0' || c_strcasecmp (from_codeset, to_codeset) == 0)
{
char *result = strdup (src);
if (result == NULL)
... | cwe | CWE-476 | C/C++ |
public void loadRemoteData() {
synchronized (this) {
if (isLoading) {
return;
}
isLoading = true;
}
App.getOkHttpClient().newCall(new Request.Builder()
.url("https://modules.lsposed.org/modules.json")
.build()).e... | vuln | Vulnerable | Java |
parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
guint32 str_tbl, guint8 *level,
guint8 *codepage_stag, guint8 *codepage_attr)
{
guint32 tvb_len = tvb_reported_length (tvb);
guint32 off = offset;
guint32 len;
guint str_len;
guint32 ent;
guin... | cwe | CWE-399 | Unknown |
static int sbr_hf_calc_npatches(AACContext *ac, SpectralBandReplication *sbr)
{
int i, k, sb = 0;
int msb = sbr->k[0];
int usb = sbr->kx[1];
int goal_sb = ((1000 << 11) + (sbr->sample_rate >> 1)) / sbr->sample_rate;
sbr->num_patches = 0;
if (goal_sb < sbr->kx[1] + sbr->m[1]) {
for (k = 0... | vuln | Vulnerable | C/C++ |
int inotify_rm_wd(struct inotify_handle *ih, u32 wd)
{
struct inotify_watch *watch;
struct inode *inode;
mutex_lock(&ih->mutex);
watch = idr_find(&ih->idr, wd);
if (unlikely(!watch)) {
mutex_unlock(&ih->mutex);
return -EINVAL;
}
get_inotify_watch(watch);
inode = watch->inode;
mutex_unlock(&ih->mutex);
m... | cwe | CWE-362 | Unknown |
public function deleteCommentAction(ProjectComment $comment)
{
$projectId = $comment->getProject()->getId();
try {
$this->repository->deleteComment($comment);
} catch (\Exception $ex) {
$this->flashDeleteException($ex);
}
return $this->redirectToRout... | cwe | CWE-352 | PHP |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import json
from django.http.response import HttpResponse, HttpRes... | cwe | CWE-79 | Python |
/*
* 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 |
void XMLHttpRequest::didFail(const ResourceError& error)
{
if (m_error)
return;
if (error.isCancellation()) {
m_exceptionCode = AbortError;
abortError();
return;
}
if (error.isTimeout()) {
didTimeout();
return;
}
if (error.domain() ... | cwe | CWE-399 | C/C++ |
protected function _afterLoad()
{
if ($this->_addUrlRewrite) {
$this->_addUrlRewrite($this->_urlRewriteCategory);
}
if (count($this) > 0) {
Mage::dispatchEvent('catalog_product_collection_load_after', array('collection' => $this));
}
foreach ($this a... | cwe | CWE-502 | PHP |
int ieee80211_radiotap_iterator_init(
struct ieee80211_radiotap_iterator *iterator,
struct ieee80211_radiotap_header *radiotap_header,
int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns)
{
/* Linux only supports version 0 radiotap format */
if (radiotap_header->it_version)
return -EINVA... | vuln | Vulnerable | C/C++ |
void putString(Context context, String key, String value) {
SharedPreferences sharedPreferences = getSharedPreferences(context);
if (sharedPreferences != null) {
try {
sharedPreferences
.edit()
.putString(key, value)
... | vuln | Safe | Java |
static int cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t *buf_end)
{
int pal_start, pal_count, i, ret, fps;
if(buf_end - buf < 16) {
av_log(s->avctx, AV_LOG_WARNING, "truncated header\n");
return AVERROR_INVALIDDATA;
}
s->width = AV_RL16(&buf[4]);
s->height =... | vuln | Vulnerable | Unknown |
int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki)
{
EVP_PKEY *pkey;
ASN1_IA5STRING *chal;
ASN1_OBJECT *spkioid;
int i, n;
char *s;
BIO_printf(out, "Netscape SPKI:\n");
X509_PUBKEY_get0_param(&spkioid, NULL, NULL, NULL, spki->spkac->pubkey);
i = OBJ_obj2nid(spkioid);
BIO_printf(o... | vuln | Vulnerable | Unknown |
void ourWriteOut(CURL *curl, struct OutStruct *outs, const char *writeinfo)
{
FILE *stream = stdout;
const char *ptr = writeinfo;
char *stringp = NULL;
long longinfo;
double doubleinfo;
while(ptr && *ptr) {
if('%' == *ptr) {
if('%' == ptr[1]) {
/* an escaped %-letter */
fputc('%',... | cwe | CWE-200 | C/C++ |
cJSON *cJSON_GetObjectItem( cJSON *object, const char *string ) | vuln | Safe | C/C++ |
static void uhci_process_frame(UHCIState *s)
{
uint32_t frame_addr, link, old_td_ctrl, val, int_mask;
uint32_t curr_qh, td_count = 0;
int cnt, ret;
UHCI_TD td;
UHCI_QH qh;
QhDb qhdb;
frame_addr = s->fl_base_addr + ((s->frnum & 0x3ff) << 2);
pci_dma_read(&s->dev, frame_addr, &link, 4);
... | vuln | Vulnerable | C/C++ |
exsltFuncFunctionComp (xsltStylesheetPtr style, xmlNodePtr inst) {
xmlChar *name, *prefix;
xmlNsPtr ns;
xmlHashTablePtr data;
exsltFuncFunctionData *func;
if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
{
xmlChar *qname;
qname = xmlGetProp(inst, (const xm... | cwe | CWE-119 | C/C++ |
rsa_compute_root(const struct rsa_private_key *key,
mpz_t x, const mpz_t m)
{
mpz_t xp; /* modulo p */
mpz_t xq; /* modulo q */
mpz_init(xp); mpz_init(xq);
/* Compute xq = m^d % q = (m%q)^b % q */
mpz_fdiv_r(xq, m, key->q);
mpz_powm(xq, xq, key->b, key->q);
/* Compute xp = m^d % p = (m%p)^a % p ... | cwe | CWE-203 | Unknown |
int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, ASN1_BIT_STRING *signature,
void *asn, EVP_PKEY *pkey)
{
EVP_MD_CTX ctx;
const EVP_MD *type;
unsigned char *buf_in=NULL;
int ret= -1,i,inl;
if (!pkey)
{
ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ERR_R_PASSED_NULL_PARAMETER);
return -1;
}
EVP_MD_CTX_... | vuln | Vulnerable | Unknown |
package providers
import (
"encoding/json"
"errors"
"github.com/TykTechnologies/tyk-identity-broker/constants"
"github.com/TykTechnologies/tyk-identity-broker/tap"
identityHandlers "github.com/TykTechnologies/tyk-identity-broker/tap/identity-handlers"
"github.com/TykTechnologies/tyk-identity-broker/tyk-api"
"g... | cwe | CWE-287 | Go |
window.ocJSON=function(json){var jsonString=parse(json);return JSON.parse(jsonString);};}(window); | cwe | CWE-79 | JavaScript |
MagickExport Image *ShadowImage(const Image *image,const double opacity,
const double sigma,const ssize_t x_offset,const ssize_t y_offset,
ExceptionInfo *exception)
{
#define ShadowImageTag "Shadow/Image"
CacheView
*image_view;
Image
*border_image,
*clone_image,
*shadow_image;
MagickBoolea... | vuln | Safe | C/C++ |
MagickExport MemoryInfo *RelinquishVirtualMemory(MemoryInfo *memory_info)
{
assert(memory_info != (MemoryInfo *) NULL);
assert(memory_info->signature == MagickSignature);
if (memory_info->blob != (void *) NULL)
switch (memory_info->type)
{
case AlignedVirtualMemory:
{
memory_info->blob... | cwe | CWE-189 | Unknown |
static void do_busid_cmd(ESPState *s, uint8_t busid)
{
uint32_t cmdlen;
int32_t datalen;
int lun;
SCSIDevice *current_lun;
uint8_t buf[ESP_CMDFIFO_SZ];
trace_esp_do_busid_cmd(busid);
lun = busid & 7;
cmdlen = fifo8_num_used(&s->cmdfifo);
esp_fifo_pop_buf(&s->cmdfifo, buf, cmdlen);
... | cwe | CWE-476 | Unknown |
def write_data_table(self, report, report_data, has_totals=True):
self.data.append([c["title"] for c in report.schema])
for datum in report_data:
datum = report.read_datum(datum)
self.data.append([format_data(data, format_iso_dates=True) for data in datum])
if has_totals... | cwe | CWE-1236 | Python |
BlockDeviceInfo *bdrv_block_device_info(BlockDriverState *bs, Error **errp)
{
ImageInfo **p_image_info;
BlockDriverState *bs0;
BlockDeviceInfo *info = g_malloc0(sizeof(*info));
info->file = g_strdup(bs->filename);
info->ro = bs->read_only;
info->drv ... | vuln | Safe | C/C++ |
struct ldb_message *ldb_msg_copy_shallow(TALLOC_CTX *mem_ctx,
const struct ldb_message *msg)
{
struct ldb_message *msg2;
unsigned int i;
msg2 = talloc(mem_ctx, struct ldb_message);
if (msg2 == NULL) return NULL;
*msg2 = *msg;
msg2->elements = talloc_array(msg2, struct ldb_message_element,
msg2-... | cwe | CWE-200 | Unknown |
dbd_st_fetch(SV *sth, imp_sth_t* imp_sth)
{
dTHX;
int num_fields, ChopBlanks, i, rc;
unsigned long *lengths;
AV *av;
int av_length, av_readonly;
MYSQL_ROW cols;
D_imp_dbh_from_sth;
MYSQL* svsock= imp_dbh->pmysql;
imp_sth_fbh_t *fbh;
D_imp_xxh(sth);
#if MYSQL_VERSION_ID >=SERVER_PREPARE_VERSION
MYS... | cwe | CWE-416 | C/C++ |
static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
{
u32 intr_info = vmcs_read32(VM_EXIT_INTR_INFO);
struct vcpu_vmx *vmx = to_vmx(vcpu);
struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
u32 exit_reason = vmx->exit_reason;
if (vmx->nested.nested_run_pending)
return 0;
if (unlikely(vmx->fail)) {
pr_info_rat... | cwe | CWE-20 | C/C++ |
int cgroup1_parse_param(struct fs_context *fc, struct fs_parameter *param)
{
struct cgroup_fs_context *ctx = cgroup_fc2context(fc);
struct cgroup_subsys *ss;
struct fs_parse_result result;
int opt, i;
opt = fs_parse(fc, cgroup1_fs_parameters, param, &result);
if (opt == -ENOPARAM) {
int ret;
ret = vfs_parse... | cwe | CWE-269 | Unknown |
static int wav_read_header(AVFormatContext *s)
{
int64_t size, av_uninit(data_size);
int64_t sample_count = 0;
int rf64 = 0;
char start_code[32];
uint32_t tag;
AVIOContext *pb = s->pb;
AVStream *st = NULL;
WAVDemuxContext *wav = s->priv_data;
int ret, got_fmt = 0;
in... | vuln | Vulnerable | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.