code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
bool WebGLImageConversion::ExtractTextureData(unsigned width,
unsigned height,
GLenum format,
GLenum type,
unsigned unpack_alignment,
... | cwe | CWE-119 | C/C++ |
generate_dnskey_prefetch(struct module_qstate* qstate,
struct iter_qstate* iq, int id)
{
struct module_qstate* subq;
log_assert(iq->dp);
/* is this query the same as the prefetch? */
if(qstate->qinfo.qtype == LDNS_RR_TYPE_DNSKEY &&
query_dname_compare(iq->dp->name, qstate->qinfo.qname)==0 &&
(qstate->query_f... | vuln | Vulnerable | Unknown |
// Copyright (c) 2022 Target Brands, Inc. All rights reserved.
//
// Use of this source code is governed by the LICENSE file in this repository.
package api
import (
"encoding/base64"
"fmt"
"net/http"
"strconv"
"strings"
"github.com/gin-gonic/gin"
"github.com/go-vela/server/database"
"github.com/go-vela/serv... | vuln | Vulnerable | Go |
return txt.replace(/[&<>]/gm, (str) => {
if (str === "&") return "&";
if (str === "<") return "<";
if (str === ">") return ">";
}); | cwe | CWE-79 | JavaScript |
static int au1200fb_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
{
unsigned int len;
unsigned long start=0, off;
struct au1200fb_device *fbdev = info->par;
if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) {
return -EINVAL;
}
start = fbdev->fb_phys & PAGE_MASK;
len = PAGE_ALIGN((start & ~PAGE_MASK) + ... | cwe | CWE-119 | C/C++ |
static void debugcon_ioport_write(void *opaque, hwaddr addr, uint64_t val,
unsigned width)
{
DebugconState *s = opaque;
unsigned char ch = val;
#ifdef DEBUG_DEBUGCON
printf(" [debugcon: write addr=0x%04" HWADDR_PRIx " val=0x%02" PRIx64 "]\n", addr, val);
#endif
qemu_chr... | vuln | Vulnerable | C/C++ |
package logic
import (
"errors"
"time"
"github.com/golang-jwt/jwt/v4"
"github.com/gravitl/netmaker/models"
"github.com/gravitl/netmaker/servercfg"
)
var jwtSecretKey = []byte("(BytesOverTheWire)")
// CreateJWT func will used to create the JWT while signing in and signing out
func CreateJWT(uuid string, macAddr... | cwe | CWE-798 | Go |
@Override
public String getName() {
String result = "";
if (label.length() == 0) {
result = piece.getName();
}
else {
nameFormat.setProperty(PIECE_NAME, piece.getName());
//
// Bug 9483
// Don't evaluate the label while reporting an infinite loop
// Can cause furth... | vuln | Vulnerable | Java |
'use strict';
function clone(value) {
if (typeof value === 'object' && value !== null) {
return _merge(Array.isArray(value) ? [] : {}, value);
}
return value;
}
function isObjectOrArrayOrFunction(value) {
return (
typeof value === 'function' ||
Array.isArray(value) ||
Object.prototype.toString... | vuln | Vulnerable | JavaScript |
static void gf_m2ts_process_pat(GF_M2TS_Demuxer *ts, GF_M2TS_SECTION_ES *ses, GF_List *sections, u8 table_id, u16 ex_table_id, u8 version_number, u8 last_section_number, u32 status)
{
GF_M2TS_Program *prog;
GF_M2TS_SECTION_ES *pmt;
u32 i, nb_progs, evt_type;
u32 nb_sections;
u32 data_size;
unsigned char *data;
G... | cwe | CWE-416 | C/C++ |
#!/usr/bin/env node
'use strict';
process.title = 'pengu';
const { server: WebSocketServer } = require('websocket');
const http = require('http');
const path = require('path');
const express = require('express');
const pg = require('pg');
const poly = require('./poly');
const { Line, Point } = poly;
const pengu = req... | vuln | Safe | JavaScript |
package server
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"time"
"github.com/pkg/errors"
"github.com/usememos/memos/api"
"github.com/usememos/memos/common"
metric "github.com/usememos/memos/plugin/metrics"
"github.com/labstack/echo/v4"
)
const (
// The max file size is 32MB.
ma... | cwe | CWE-79 | Go |
@Override
protected void onDestroy() {
super.onDestroy();
playerBuilder.unBindService();
if (playerDialog != null)
playerDialog.dismiss();
if (queueDialog != null)
queueDialog.dismiss();
} | vuln | Vulnerable | Java |
static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t *ctx,
const uint8_t *data,
unsigned int data_sz,
void *user_priv,
long deadline)
{
vpx_codec_err_t res = VPX_CODEC_OK;
unsigned int resolution_change = 0;
unsigned int w, h;
if (!ctx->fragments.enabled && (data == NULL && data... | cwe | CWE-20 | C/C++ |
static bool reconstruct_chained_fixup(struct MACH0_(obj_t) *bin) {
if (!bin->dyld_info) {
return false;
}
if (!bin->nsegs) {
return false;
}
bin->chained_starts = R_NEWS0 (struct r_dyld_chained_starts_in_segment *, bin->nsegs);
if (!bin->chained_starts) {
return false;
}
size_t wordsize = get_word_size (b... | cwe | CWE-125 | Unknown |
def find(uuid, options = {})
if uuid.nil? || uuid.to_s.empty?
raise NotFound, "can't find a record with nil identifier"
end
begin
from_response API.get(member_path(uuid), {}, options)
rescue API::NotFound => e
raise NotFound, e.description
end
... | vuln | Safe | Ruby |
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException
{
// GAE can't serve dot prefixed folders
String uri = request.getRequestURI().replace("/.", "/");
if (uri.toLowerCase().contains(".json"))
{
response.setCont... | cwe | CWE-22 | Java |
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 '../.... | cwe | CWE-1236 | JavaScript |
/*
* Copyright (C) 2022 neocotic
*
* 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, modify, merge, publish, d... | vuln | Safe | JavaScript |
package main
import (
"context"
"fmt"
"net"
"os"
"os/signal"
"runtime/debug"
"strconv"
"sync"
"time"
"github.com/gravitl/netmaker/auth"
controller "github.com/gravitl/netmaker/controllers"
"github.com/gravitl/netmaker/database"
"github.com/gravitl/netmaker/functions"
nodepb "github.com/gravitl/netmaker/... | cwe | CWE-798 | Go |
PJ_DEF(pj_status_t) pjmedia_rtcp_fb_build_sli(
pjmedia_rtcp_session *session,
void *buf,
pj_size_t *length,
unsigned sli_cnt,
const pjmedia_rtcp_fb_sli sli[])
{
pjmedia_rtcp_common *hdr;
pj_uint8_t *p;
unsigned len, i;
PJ_ASSERT_RETURN(session && buf && length && sli_cnt && sl... | cwe | CWE-787 | C/C++ |
/* Copyright 2019 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... | cwe | CWE-787 | C/C++ |
Utf8DecoderBase::Utf8DecoderBase()
: unbuffered_start_(NULL),
unbuffered_length_(0),
utf16_length_(0),
last_byte_of_buffer_unused_(false) {} | vuln | Safe | Unknown |
/**
* Copyright (c) 2006-2012, JGraph Ltd
*/
/**
* Constructs a new graph editor
*/
EditorUi = function(editor, container, lightbox)
{
mxEventSource.call(this);
this.destroyFunctions = [];
this.editor = editor || new Editor();
this.container = container || document.body;
var graph = this.editor.graph;
gra... | cwe | CWE-94 | JavaScript |
static int _open_and_activate_luks2(struct crypt_device *cd,
int keyslot,
const char *name,
const char *passphrase,
size_t passphrase_size,
uint32_t flags)
{
crypt_reencrypt_info ri;
int r;
struct luks2_hdr *hdr = &cd->u.luks2.hdr;
ri = LUKS2_reencrypt_status(hdr);
if (ri == CRYPT_REENCRYPT_INVALID)
return... | cwe | CWE-345 | Unknown |
function merge(dst, ...sources) {
for (src of sources) {
for (let key in src) {
let s = src[key], d = dst[key]
if (Object(s) == s && Object(d) === d) {
dst[key] = merge(d, s)
continue
}
dst[key] = src[key]
}
}
return dst
} | cwe | CWE-1321 | JavaScript |
void llc_conn_handler(struct llc_sap *sap, struct sk_buff *skb)
{
struct llc_addr saddr, daddr;
struct sock *sk;
llc_pdu_decode_sa(skb, saddr.mac);
llc_pdu_decode_ssap(skb, &saddr.lsap);
llc_pdu_decode_da(skb, daddr.mac);
llc_pdu_decode_dsap(skb, &daddr.lsap);
sk = __llc_lookup(sap, &saddr, &daddr);
if (!sk)
... | vuln | Safe | C/C++ |
static void format_expand_code(const char **format, GString *out, int *flags)
{
int set;
if (flags == NULL) {
/* flags are being ignored - skip the code */
while (**format != ']')
(*format)++;
return;
}
set = TRUE;
(*format)++;
while (**format != ']' && **format != '\0') {
if (**format == '+')
set... | cwe | CWE-476 | Unknown |
static bool objc_build_refs(RCoreObjc *objc) {
ut64 off;
if (!objc->_const || !objc->_selrefs) {
return false;
}
const ut64 va_const = objc->_const->vaddr;
size_t ss_const = objc->_const->vsize;
const ut64 va_selrefs = objc->_selrefs->vaddr;
size_t ss_selrefs = objc->_selrefs->vsize;
// TODO: check if ss_con... | vuln | Safe | C/C++ |
func (proj AppProject) IsLiveResourcePermitted(un *unstructured.Unstructured, server string, name string) bool {
if !proj.IsGroupKindPermitted(un.GroupVersionKind().GroupKind(), un.GetNamespace() != "") {
return false
}
if un.GetNamespace() != "" {
return proj.IsDestinationPermitted(ApplicationDestination{Server... | vuln | Vulnerable | Go |
constructor(options: PacketAssemblerOptions) {
super();
this._stack = [];
this.expectedLength = 0;
this.currentLength = 0;
this.readMessageFunc = options.readMessageFunc;
this.minimumSizeInBytes = options.minimumSizeInBytes || 8;
assert(typeof this.readMessageFunc... | vuln | Vulnerable | JavaScript |
size_t http_parser_execute (http_parser *parser,
const http_parser_settings *settings,
const char *data,
size_t len)
{
char c, ch;
int8_t unhex_val;
const char *p = data;
const char *header_field_mark = 0;
const char *header_v... | cwe | CWE-444 | Unknown |
private void onFilterStatus(int status) {
synchronized (mCallbackLock) {
if (mCallback != null && mExecutor != null) {
mExecutor.execute(() -> mCallback.onFilterStatusChanged(this, status));
}
}
} | vuln | Safe | Java |
nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd3_readdirargs *args)
{
p = decode_fh(p, &args->fh);
if (!p)
return 0;
p = xdr_decode_hyper(p, &args->cookie);
args->verf = p; p += 2;
args->dircount = ~0;
args->count = ntohl(*p++);
args->count = min_t(u32, args->count, PAGE_... | cwe | CWE-404 | C/C++ |
static void reloadModules() {
modules.clear();
Plugin plugin = AnarchyExploitFixes.getInstance();
plugin.getServer().getScheduler().cancelTasks(plugin);
if (Bukkit.getPluginManager().isPluginEnabled("ProtocolLib"))
ProtocolLibrary.getProtocolManager().removePacketListeners(pl... | vuln | Safe | Java |
function l(t,e,n){return(e=g(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t} | cwe | CWE-79 | JavaScript |
function e(U,
Y,n){F.innerHTML="";var D=k.model.getDescendants(k.model.getRoot()),I=q.value.toLowerCase(),S=A.checked?new RegExp(I):null,Q=null;z=null;m!=I&&(m=I,p=null,x=!1);var P=null==p;if(0<I.length){if(x){x=!1;for(var T,X=0;X<b.pages.length;X++)if(b.currentPage==b.pages[X]){T=X;break}U=(T+1)%b.pages.length;p=null;... | vuln | Vulnerable | JavaScript |
std::vector<Option> get_rgw_options() {
return std::vector<Option>({
Option("rgw_acl_grants_max_num", Option::TYPE_INT, Option::LEVEL_ADVANCED)
.set_default(100)
.set_description("Max number of ACL grants in a single request"),
Option("rgw_rados_tracing", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
... | cwe | CWE-770 | Unknown |
/*
* uriparser - RFC 3986 URI parsing library
*
* Copyright (C) 2007, Weijia Song <songweijia@gmail.com>
* Copyright (C) 2007, Sebastian Pipping <sebastian@pipping.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the... | vuln | Vulnerable | C/C++ |
int tls1_setup_key_block(SSL *s)
{
unsigned char *p;
const EVP_CIPHER *c;
const EVP_MD *hash;
int num;
SSL_COMP *comp;
int mac_type = NID_undef, mac_secret_size = 0;
int ret = 0;
if (s->s3->tmp.key_block_length != 0)
return (1);
if (!ssl_cipher_get_evp
(s->sessio... | cwe | CWE-20 | C/C++ |
function groupChatMsg(chatsIds) {
const tokenValidation = AuthTokenValidation.findOne({ connectionId: this.connection.id });
if (!tokenValidation || tokenValidation.validationStatus !== ValidationStates.VALIDATED) {
Logger.warn(`Publishing GroupChatMsg was requested by unauth connection ${this.connection.id}`)... | vuln | Vulnerable | JavaScript |
static struct ucounts *get_ucounts(struct user_namespace *ns, kuid_t uid)
{
struct hlist_head *hashent = ucounts_hashentry(ns, uid);
struct ucounts *ucounts, *new;
spin_lock_irq(&ucounts_lock);
ucounts = find_ucounts(ns, uid, hashent);
if (!ucounts) {
spin_unlock_irq(&ucounts_lock);
new = kzalloc(sizeof(*new... | vuln | Safe | C/C++ |
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2020 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under ... | cwe | CWE-22 | C/C++ |
static MagickBooleanType SetGrayscaleImage(Image *image,
ExceptionInfo *exception)
{
CacheView
*image_view;
MagickBooleanType
status;
PixelInfo
*colormap;
register ssize_t
i;
ssize_t
*colormap_index,
j,
y;
assert(image != (Image *) NULL);
assert(image->signature == Magic... | cwe | CWE-772 | Unknown |
static OPJ_BOOL opj_pi_next_pcrl(opj_pi_iterator_t * pi)
{
opj_pi_comp_t *comp = NULL;
opj_pi_resolution_t *res = NULL;
OPJ_UINT32 index = 0;
if (pi->poc.compno0 >= pi->numcomps ||
pi->poc.compno1 >= pi->numcomps + 1) {
opj_event_msg(pi->manager, EVT_ERROR,
"op... | cwe | CWE-125 | Unknown |
public static String encodeURL(String strUrl) {
try {
URL url = new URL(strUrl);
return StringUtils.encodeURL(url);
}
catch(Exception e) {
return strUrl;
}
} | vuln | Vulnerable | Java |
bool OSExchangeDataProviderAuraX11::GetURLAndTitle(
OSExchangeData::FilenameToURLPolicy policy,
GURL* url,
base::string16* title) const {
std::vector< ::Atom> url_atoms = ui::GetURLAtomsFrom(&atom_cache_);
std::vector< ::Atom> requested_types;
ui::GetAtomIntersection(url_atoms, GetTargets(), &reque... | vuln | Safe | C/C++ |
/*
* Cantata
*
* Copyright (c) 2011-2018 Craig Drummond <craig.p.drummond@gmail.com>
*
* ----
*
* 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 2 of the License, or
* (a... | cwe | CWE-20 | C/C++ |
int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
const void *bits, int bits_wrap, int bits_size,
const void *codes, int codes_wrap, int codes_size,
const void *symbols, int symbols_wrap, int symbols_size,
int flags)
{
VLCcode *buf;
int i, j, ret;
... | vuln | Vulnerable | C/C++ |
/*
* The Python Imaging Library.
* $Id: //modules/pil/libImaging/TiffDecode.c#1 $
*
* LibTiff-based Group3 and Group4 decoder
*
*
* started modding to use non-private tiff functions to port to libtiff 4.x
* eds 3/12/12
*
*/
#include "Imaging.h"
#ifdef HAVE_LIBTIFF
#ifndef uint
#define uint uint32
#endif
#... | vuln | Safe | Python |
/** @odoo-module **/
import { registry } from "@web/core/registry";
import {
Many2OneAvatarUserField,
KanbanMany2OneAvatarUserField,
many2OneAvatarUserField,
kanbanMany2OneAvatarUserField,
} from "@mail/web/fields/many2one_avatar_user_field/many2one_avatar_user_field";
export class Many2OneAvatarEmplo... | vuln | Safe | JavaScript |
void ImmutableConstantOp::Compute(OpKernelContext* ctx) {
std::unique_ptr<MemmappedTensorAllocator> allocator(
new MemmappedTensorAllocator());
OP_REQUIRES_OK(ctx,
allocator->InitializeFromRegion(region_name_, ctx->env()));
ctx->set_output(0, Tensor(allocator.get(), dtype_, shape_));
OP_... | vuln | Vulnerable | Unknown |
DeletionConfirmationDlg(QWidget *parent, const int &size, const QString &name, bool defaultDeleteFiles): QDialog(parent) {
setupUi(this);
if (size == 1)
label->setText(tr("Are you sure you want to delete '%1' from the transfer list?", "Are you sure you want to delete 'ubuntu-linux-iso' from the transfer l... | cwe | CWE-79 | C/C++ |
private void requireStrongAuthIfAllLockedOut() {
final boolean faceLock =
(mFaceLockedOutPermanent || !shouldListenForFace()) && !getIsFaceAuthenticated();
final boolean fpLock =
mFingerprintLockedOutPermanent || !shouldListenForFingerprint(isUdfpsEnrolled());
if... | vuln | Safe | Java |
mwifiex_cmd_append_vsie_tlv(struct mwifiex_private *priv,
u16 vsie_mask, u8 **buffer)
{
int id, ret_len = 0;
struct mwifiex_ie_types_vendor_param_set *vs_param_set;
if (!buffer)
return 0;
if (!(*buffer))
return 0;
/*
* Traverse through the saved vendor specific IE array and append
* the selected(s... | vuln | Vulnerable | C/C++ |
public function install(array $options = null, &$status=null)
{
parent::install($options);
parent::setup($options);
//check if ssl is enabled
$this->appcontext->run('v-list-web-domain', [$this->appcontext->user(), $this->domain, 'json'], $status);
$sslEnabled = ($status->json[$this->domain]['SSL']... | cwe | CWE-78 | PHP |
delegpt_from_message(struct dns_msg* msg, struct regional* region)
{
struct ub_packed_rrset_key* ns_rrset = NULL;
struct delegpt* dp;
size_t i;
/* look for NS records in the authority section... */
ns_rrset = find_NS(msg->rep, msg->rep->an_numrrsets,
msg->rep->an_numrrsets+msg->rep->ns_numrrsets);
/* In some ... | cwe | CWE-400 | Unknown |
archive_acl_from_text_l(struct archive_acl *acl, const char *text,
int want_type, struct archive_string_conv *sc)
{
struct {
const char *start;
const char *end;
} field[6], name;
const char *s, *st;
int numfields, fields, n, r, sol, ret;
int type, types, tag, permset, id;
size_t len;
char sep;
switch ... | cwe | CWE-476 | C/C++ |
# -*- 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 |
static int
read_data_section (Bit_Chain *sec_dat, Bit_Chain *dat,
r2007_section *restrict sections_map,
r2007_page *restrict pages_map, Dwg_Section_Type sec_type)
{
r2007_section *section;
r2007_page *page;
uint64_t max_decomp_size;
BITCODE_RC *decomp, *decomp_end;
int er... | 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,... | cwe | CWE-287 | Java |
# confire.conf
# A simple configuration module for Confire
#
# Author: Benjamin Bengfort <ben@cobrain.com>
# Created: Tue May 20 22:19:11 2014 -0400
#
# Copyright (C) 2013 Cobrain Company
# For license information, see LICENSE.txt
#
# ID: conf.py [] ben@cobrain.com $
"""
Confire class for specifying Confire specifi... | cwe | CWE-77 | Python |
int ffurl_read(URLContext *h, unsigned char *buf, int size)
{
if (!(h->flags & AVIO_FLAG_READ))
return AVERROR(EIO);
return retry_transfer_wrapper(h, buf, size, 1, h->prot->url_read);
} | vuln | Safe | C/C++ |
int ssl23_get_client_hello(SSL *s)
{
char buf_space[11]; /* Request this many bytes in initial read.
* We can detect SSL 3.0/TLS 1.0 Client Hellos
* ('type == 3') correctly only when the following
* is in a single record, which is not guaranteed by
... | vuln | Vulnerable | C/C++ |
static int fuse_permission(struct inode *inode, int mask)
{
struct fuse_conn *fc = get_fuse_conn(inode);
bool refreshed = false;
int err = 0;
if (!fuse_allow_current_process(fc))
return -EACCES;
/*
* If attributes are needed, refresh them before proceeding
*/
if (fc->default_permissions ||
((mask & M... | vuln | Vulnerable | Unknown |
status_t BnDrm::onTransact(
uint32_t code, const Parcel &data, Parcel *reply, uint32_t flags) {
switch (code) {
case INIT_CHECK:
{
CHECK_INTERFACE(IDrm, data, reply);
reply->writeInt32(initCheck());
return OK;
}
case IS_CRYPTO_SUPPORTED:
{
CHECK_INTERFACE(IDrm, data, reply);... | cwe | CWE-264 | C/C++ |
static inline int checkSettingSecurity(lua_State* L, const std::string &name)
{
if (ScriptApiSecurity::isSecure(L) && name.compare(0, 7, "secure.") == 0)
throw LuaError("Attempted to set secure setting.");
bool is_mainmenu = false;
#ifndef SERVER
is_mainmenu = ModApiBase::getGuiEngine(L) != nullptr;
#endif
if (!... | vuln | Safe | C/C++ |
private void setBanner(@Nullable View view) {
mBanner = view;
if (view != null) {
setupAndAddBanner();
setBannerOutline();
}
} | 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,... | cwe | CWE-287 | Java |
xmlBufResize(xmlBufPtr buf, size_t size)
{
unsigned int newSize;
xmlChar* rebuf = NULL;
size_t start_buf;
if ((buf == NULL) || (buf->error))
return(0);
CHECK_COMPAT(buf)
if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return(0);
if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) {
/... | cwe | CWE-190 | Unknown |
static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define ThrowPCXException(severity,tag) \
{ \
if (scanline != (unsigned char *) NULL) \
scanline=(unsigned char *) RelinquishMagickMemory(scanline); \
if (pixel_info != (MemoryInfo *) NULL) \
pixel_info=RelinquishVirtualMemor... | vuln | Safe | Unknown |
"""Limits API."""
from django.contrib.contenttypes.models import ContentType
from rest_framework import mixins, viewsets
from rest_framework.permissions import DjangoModelPermissions, IsAuthenticated
from modoboa.core import models as core_models
from . import serializers
class ResourcesViewSet(
mixins.Ret... | cwe | CWE-305 | Python |
void qmp_memchar_write(const char *device, int64_t size,
const char *data, bool has_format,
enum DataFormat format,
Error **errp)
{
CharDriverState *chr;
guchar *write_data;
int ret;
gsize write_count;
chr = qemu_chr_find(device);
... | vuln | Vulnerable | C/C++ |
const got = require('@/utils/got');
const cheerio = require('cheerio');
const iconv = require('iconv-lite');
const timezone = require('@/utils/timezone');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const site = ctx.params[0] ?? 'www';
let category = ctx.params[1] ?? ... | cwe | CWE-918 | JavaScript |
stringprep (char *in,
size_t maxlen,
Stringprep_profile_flags flags,
const Stringprep_profile * profile)
{
int rc;
char *utf8 = NULL;
uint32_t *ucs4 = NULL;
size_t ucs4len, maxucs4len, adducs4len = 50;
do
{
uint32_t *newp;
free (ucs4);
ucs4 = stringprep_utf8_to_ucs4 (... | cwe | CWE-119 | C/C++ |
public PBEWithSHA256AESCBC192()
{
super(new CBCBlockCipher(new AESFastEngine()), PKCS12, SHA256, 192, 16);
} | vuln | Vulnerable | Java |
virNodeDeviceGetMdevTypesCaps(const char *sysfspath,
virMediatedDeviceTypePtr **mdev_types,
size_t *nmdev_types)
{
virMediatedDeviceTypePtr *types = NULL;
size_t ntypes = 0;
size_t i;
/* this could be a refresh, so clear out the old data */
... | vuln | Safe | C/C++ |
pcap_ng_check_header(const uint8_t *magic, FILE *fp, u_int precision,
char *errbuf, int *err)
{
bpf_u_int32 magic_int;
size_t amt_read;
bpf_u_int32 total_length;
bpf_u_int32 byte_order_magic;
struct block_header *bhdrp;
struct section_header_block *shbp;
pcap_t *p;
int swapped = 0;
struct pcap_ng_sf *ps;
... | 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 | Safe | Java |
static pj_status_t dlg_create_request_throw( pjsip_dialog *dlg,
const pjsip_method *method,
int cseq,
pjsip_tx_data **p_tdata )
{
pjsip_tx_data *tdata;
pjsip_contact_hdr *contact;
pjsip_route_hdr *route, *end_list;
pj_status_t status;
/* Contact Header field.
* Co... | cwe | CWE-295 | Unknown |
PHP_FUNCTION(imagepsencodefont)
{
zval *fnt;
char *enc, **enc_vector;
int enc_len, *f_ind;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &fnt, &enc, &enc_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(f_ind, int *, &fnt, -1, "Type 1 font", le_ps_font);
if ((enc_vector = T1_LoadEncoding(enc)) ... | cwe | CWE-20 | Unknown |
/* $Id$ */
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission ... | cwe | CWE-119 | C/C++ |
int udf_get_filename(struct super_block *sb, uint8_t *sname, uint8_t *dname,
int udf_get_filename(struct super_block *sb, uint8_t *sname, int slen,
uint8_t *dname, int dlen)
{
struct ustr *filename, *unifilename;
int len = 0;
filename = kmalloc(sizeof(struct ustr), GFP_NOFS);
if (!filename)
return 0;
... | vuln | Safe | C/C++ |
int main(int argc, char *argv[])
{
opj_dinfo_t* dinfo;
opj_event_mgr_t event_mgr; /* event manager */
int tnum;
unsigned int snum;
opj_mj2_t *movie;
mj2_tk_t *track;
mj2_sample_t *sample;
unsigned char* frame_codestream;
FILE *file, *outfile;
char outfilename[50];
mj2_dp... | cwe | CWE-119 | C/C++ |
int
dlt_radiotap_80211_l2len(tcpeditdlt_t *ctx, const u_char *packet, const int pktlen)
{
int radiolen, res;
u_char *data;
radiolen = dlt_radiotap_l2len(ctx, packet, pktlen);
if (radiolen == -1)
return TCPEDIT_ERROR;
data = dlt_radiotap_get_80211(ctx, packet, pktlen, radiolen);
res... | vuln | Safe | C/C++ |
chdlc_print(netdissect_options *ndo, register const u_char *p, u_int length)
{
u_int proto;
const u_char *bp = p;
if (length < CHDLC_HDRLEN)
goto trunc;
ND_TCHECK2(*p, CHDLC_HDRLEN);
proto = EXTRACT_16BITS(&p[2]);
if (ndo->ndo_eflag) {
ND_PRINT((ndo, "%s, ethertype %s (0x%04x), length %u: ",
... | cwe | CWE-125 | C/C++ |
protected function _save($fp, $dir, $name, $stat)
{
//TODO optionally encrypt $fp before uploading if mime is not already encrypted type
$path = $this->_joinPath($dir, $name);
return $this->connect->put($path, $fp)
? $path
: false;
} | cwe | CWE-918 | PHP |
static void *arm_coherent_dma_alloc(struct device *dev, size_t size,
dma_addr_t *handle, gfp_t gfp, struct dma_attrs *attrs)
{
pgprot_t prot = __get_dma_pgprot(attrs, PAGE_KERNEL);
void *memory;
if (dma_alloc_from_coherent(dev, size, handle, &memory))
return memory;
return __dma_alloc(dev, size, handle, gfp, p... | vuln | Safe | C/C++ |
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, mobconf = require('./routes/mobileconfig')
, http = require('http')
, path = require('path');
var cookieParser = require('cookie-parser')
var app = express();
// all environments
app.set('port', process.env.... | cwe | CWE-79 | JavaScript |
gss_verify_mic_iov(OM_uint32 *minor_status, gss_ctx_id_t context_handle,
gss_qop_t *qop_state, gss_iov_buffer_desc *iov,
int iov_count)
{
OM_uint32 status;
gss_union_ctx_id_t ctx;
gss_mechanism mech;
status = val_unwrap_iov_args(minor_status, context_handle, NULL,
qop_state, iov, iov_cou... | vuln | Safe | C/C++ |
static bool acl_group_override(connection_struct *conn,
gid_t prim_gid,
const char *fname)
{
SMB_STRUCT_STAT sbuf;
if ((errno != EPERM) && (errno != EACCES)) {
return false;
}
/* file primary group == user primary or supplementary group */
if (lp_acl_group_control(SNUM(conn)) &&
current_user_in_grou... | cwe | CWE-264 | C/C++ |
static int get_next_block(bunzip_data *bd)
{
struct group_data *hufGroup;
int dbufCount, dbufSize, groupCount, *base, *limit, selector,
i, j, runPos, symCount, symTotal, nSelectors, byteCount[256];
int runCnt = runCnt; /* for compiler */
uint8_t uc, symToByte[256], mtfSymbol[256], *selectors;
uint32_t *dbuf;... | cwe | CWE-190 | Unknown |
public Controller execute(FolderComponent folderComponent, UserRequest ureq, WindowControl wControl, Translator translator) {
VFSContainer currentContainer = folderComponent.getCurrentContainer();
VFSContainer rootContainer = folderComponent.getRootContainer();
if (!VFSManager.exists(currentContainer)) {
stat... | cwe | CWE-22 | Java |
void DH_Server::build(SSL& ssl)
{
DiffieHellman& dhServer = ssl.useCrypto().use_dh();
int pSz, gSz, pubSz;
dhServer.set_sizes(pSz, gSz, pubSz);
dhServer.get_parms(parms_.alloc_p(pSz), parms_.alloc_g(gSz),
parms_.alloc_pub(pubSz));
short sigSz = 0;
mySTL::auto_ptr<Auth> a... | vuln | Safe | Unknown |
horDiff32(TIFF* tif, uint8* cp0, tmsize_t cc)
{
TIFFPredictorState* sp = PredictorState(tif);
tmsize_t stride = sp->stride;
uint32 *wp = (uint32*) cp0;
tmsize_t wc = cc/4;
assert((cc%(4*stride))==0);
if (wc > stride) {
wc -= stride;
wp += wc - 1;
do {
REPEAT4(stride, wp[stride] -= wp[0]; wp--)
wc -=... | cwe | CWE-119 | C/C++ |
def sensitive_config_values(self) -> Set[tuple[str, str]]: # noqa: UP006
if self.configuration_description is None:
return (
_get_empty_set_for_configuration()
) # we can't use set() here because set is defined below # ¯\_(ツ)_/¯
flattened = {
(s, k):... | vuln | Safe | Python |
static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
{
struct svcxprt_rdma *listen_rdma;
struct svcxprt_rdma *newxprt = NULL;
struct rdma_conn_param conn_param;
struct rpcrdma_connect_private pmsg;
struct ib_qp_init_attr qp_attr;
struct ib_device *dev;
struct sockaddr *sap;
unsigned int i;
int ret = ... | cwe | CWE-404 | C/C++ |
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* Print Virtual Channel
*
* Copyright 2010-2011 Vic Lee
* Copyright 2015 Thincast Technologies GmbH
* Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com>
* Copyright 2016 Armin Novak <armin.novak@gmail.com>
* Copyright 2016 David PHAM... | cwe | CWE-125 | C/C++ |
function handleLoginInOtherBrowserTab() {
const currentUser = debiki2.ReactStore.getMe();
const sessionId = getSetCookie('dwCoSid');
if (currentUser.isLoggedIn) {
if (sessionId) {
// Session id example: (parts: hash, user id, name, login time, random value)
// 'Y1pBlH7vY4JW9A.11.Magnus.13162661027... | cwe | CWE-613 | Scala |
static MagickBooleanType WriteUILImage(const ImageInfo *image_info,Image *image,
ExceptionInfo *exception)
{
#define MaxCixels 92
char
basename[MagickPathExtent],
buffer[MagickPathExtent],
name[MagickPathExtent],
*symbol;
int
j;
MagickBooleanType
status,
transparent;
MagickSiz... | vuln | Safe | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.