code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
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++ |
/*
* 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 |
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++ |
/*
* 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 |
"""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 |
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++ |
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 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++ |
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 |
/**
* 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 |
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 |
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++ |
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 |
def show
Log.add_info(request, params.inspect)
@group_id = params[:group_id]
official_title_id = params[:id]
unless official_title_id.nil? or official_title_id.empty?
@official_title = OfficialTitle.find(official_title_id)
end
render(:layout => (!request.xhr?))
end | cwe | CWE-89 | Ruby |
static RList *create_cache_bins(RBinFile *bf, RDyldCache *cache) {
RList *bins = r_list_newf ((RListFree)free_bin);
ut16 *depArray = NULL;
cache_imgxtr_t *extras = NULL;
if (!bins) {
return NULL;
}
char *target_libs = NULL;
RList *target_lib_names = NULL;
int *deps = NULL;
target_libs = r_sys_getenv ("R_DYL... | cwe | CWE-703 | Unknown |
/**
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
*
* The Apereo Foundation licenses this file to you under the Educational
* Community License, Version 2.0 (the ... | cwe | CWE-863 | Java |
static const char *check_secret(int module, const char *user, const char *group,
const char *challenge, const char *pass)
{
char line[1024];
char pass2[MAX_DIGEST_LEN*2];
const char *fname = lp_secrets_file(module);
STRUCT_STAT st;
int fd, ok = 1;
int user_len = strlen(user);
int group_len = group ? strlen(g... | cwe | CWE-20 | Unknown |
static int nc_dns(ASN1_IA5STRING *dns, ASN1_IA5STRING *base)
{
char *baseptr = (char *)base->data;
char *dnsptr = (char *)dns->data;
/* Empty matches everything */
if (!*baseptr)
return X509_V_OK;
/*
* Otherwise can add zero or more components on the left so compare RHS
* and if dn... | cwe | CWE-125 | Unknown |
public void resetForgottenPassword(TestUtils setup) throws Exception
{
setup.loginAsSuperAdmin();
String userName = "testUser" + RandomStringUtils.randomAlphanumeric(6);
String password = "password";
String newPassword = "newPassword";
// Create a user
setup.createU... | cwe | CWE-200 | Java |
writefile(const char *name, struct string *s)
{
FILE *f;
int ret;
f = fopen(name, "w");
if (!f) {
warn("open %s:", name);
return -1;
}
ret = 0;
if (fwrite(s->s, 1, s->n, f) != s->n || fflush(f) != 0) {
warn("write %s:", name);
ret = -1;
}
fclose(f);
return ret;
} | cwe | CWE-284 | C/C++ |
static size_t exif_convert_any_to_int(void *value, int format, int motorola_intel TSRMLS_DC)
{
int s_den;
unsigned u_den;
switch(format) {
case TAG_FMT_SBYTE: return *(signed char *)value;
case TAG_FMT_BYTE: return *(uchar *)value;
case TAG_FMT_USHORT: return php_ifd_get16u(value, motorola_int... | cwe | CWE-189 | C/C++ |
def show_article
auto_discovery_feed
respond_to do |format|
format.html do
@comment = Comment.new
@page_title = this_blog.article_title_template.to_title(@article, this_blog, params)
@description = this_blog.article_desc_template.to_title(@article, this_blog, params)
@keyw... | cwe | CWE-863 | Ruby |
bool MemoryManager::validate_user_read(const Process& process, VirtualAddress vaddr) const
{
auto* region = region_from_vaddr(process, vaddr);
return region && region->is_readable();
} | cwe | CWE-119 | C/C++ |
App.main=function(b,f){function l(k){mxUtils.getAll("1"!=urlParams.dev?[k]:[k,STYLE_PATH+"/default.xml"],function(m){function q(){var n=null!=f?f():new App(new Editor("0"==urlParams.chrome||"min"==uiTheme,null,null,null,"0"!=urlParams.chrome));if(null!=window.mxscript){if("function"===typeof window.DropboxClient&&null=... | cwe | CWE-20 | JavaScript |
function updateCommandCategorieInDB(){
global $pearDB;
$DBRESULT = $pearDB->query("UPDATE `command_categories` SET `category_name` = '".$_POST["category_name"]."' , `category_alias` = '".$_POST["category_alias"]."' , `category_order` = '".$_POST["category_order"]."' WHERE `cmd_category_id` = '".$_POST["cmd_categ... | cwe | CWE-89 | PHP |
void grubfs_free (GrubFS *gf) {
if (gf) {
if (gf->file && gf->file->device)
free (gf->file->device->disk);
free (gf->file);
free (gf);
}
} | cwe | CWE-119 | C/C++ |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | cwe | CWE-502 | Java |
/* Copyright 2017 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-125 | Python |
QPDF::lengthNextN(int first_object, int n,
std::list<std::string>& errors)
{
int length = 0;
for (int i = 0; i < n; ++i)
{
QPDFObjGen og(first_object + i, 0);
if (this->m->xref_table.count(og) == 0)
{
errors.push_back(
"no xref table entry for " +
QUtil::int_to_string(first_object + i) + " 0... | cwe | CWE-787 | Unknown |
"""
This contains a bunch of RFC7230 definitions and regular expressions that are
needed to properly parse HTTP messages.
"""
import re
from .compat import tobytes
WS = "[ \t]"
OWS = WS + "{0,}?"
RWS = WS + "{1,}?"
BWS = OWS
# RFC 7230 Section 3.2.6 "Field Value Components":
# tchar = "!" / "#" / "$" / "%"... | cwe | CWE-400 | Python |
status_t OMXNodeInstance::getParameter(
OMX_INDEXTYPE index, void *params, size_t /* size */) {
Mutex::Autolock autoLock(mLock);
OMX_ERRORTYPE err = OMX_GetParameter(mHandle, index, params);
OMX_INDEXEXTTYPE extIndex = (OMX_INDEXEXTTYPE)index;
if (err != OMX_ErrorNoMore) {
CLOG_IF_ERR... | cwe | CWE-200 | C/C++ |
struct mnt_namespace *copy_mnt_ns(unsigned long flags, struct mnt_namespace *ns,
struct user_namespace *user_ns, struct fs_struct *new_fs)
{
struct mnt_namespace *new_ns;
struct vfsmount *rootmnt = NULL, *pwdmnt = NULL;
struct mount *p, *q;
struct mount *old;
struct mount *new;
int copy_flags;
BUG_ON(!ns);
... | cwe | CWE-400 | C/C++ |
package auth
import (
"time"
"github.com/golang-jwt/jwt"
"github.com/sipcapture/homer-app/model"
"github.com/sipcapture/homer-app/utils/logger"
)
// jwt token claims which contains info regarding user
type JwtUserClaim struct {
UserName string `json:"username"`
UserAdmin bool `json:"useradmin"`
... | cwe | CWE-798 | Go |
function _init(index) {
i = keys[index];
path = prefix + i;
schemaType = docSchema.path(path);
// Should still work if not a model-level discriminator, but should not be
// necessary. This is *only* to catch the case where we queried using the
// base model and the discriminated model has a pro... | cwe | CWE-1321 | JavaScript |
static void hci_disconn_loglink_complete_evt(struct hci_dev *hdev,
struct sk_buff *skb)
{
struct hci_ev_disconn_logical_link_complete *ev = (void *) skb->data;
struct hci_chan *hchan;
BT_DBG("%s log handle 0x%4.4x status 0x%2.2x", hdev->name,
le16_to_cpu(ev->handle), ev->status);
if (ev->status)... | cwe | CWE-416 | Unknown |
TfLiteStatus EvalSimple(TfLiteContext* context, TfLiteNode* node,
const TfLiteTensor* lookup, const TfLiteTensor* value,
TfLiteTensor* output) {
const int row_size = SizeOfDimension(value, 0);
const int row_bytes = value->bytes / row_size;
char* output_raw = GetTen... | cwe | CWE-369 | C/C++ |
(function()
{
Sidebar.prototype.addInfographicPalette = function()
{
var w = 100;
var h = 100;
var s = 'whiteSpace=wrap;html=1;shape=mxgraph.infographic.';
var s2 = mxConstants.STYLE_VERTICAL_LABEL_POSITION + '=bottom;' + mxConstants.STYLE_VERTICAL_ALIGN + '=top;html=1;shape=mxgraph.infographic.';
var s3 = ... | cwe | CWE-79 | Java |
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-2016 Facebook, Inc. (http://www.facebook.com) |
| Copyrigh... | cwe | CWE-843 | C/C++ |
package runtime
import (
"archive/tar"
"compress/gzip"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"time"
"github.com/containers/image/types"
"github.com/pkg/errors"
)
func UnpackImage(src types.Image, target string) error {
ref := src.Reference()
unpackLayer, err := getLayerUnpacker(ref)
if err != nil {
... | cwe | CWE-22 | Go |
PJ_DEF(pj_status_t) pjmedia_wav_playlist_create(pj_pool_t *pool,
const pj_str_t *port_label,
const pj_str_t file_list[],
int file_count,
unsigned ptime,
unsigned options,
pj_ssize_t buff_size,
pjmedia_port **p_port)
{
struct playlist_port *fport;
pjmedia_audio_format_de... | cwe | CWE-835 | C/C++ |
public static Object instantiate(String classname, Properties info, boolean tryString,
@Nullable String stringarg)
throws ClassNotFoundException, SecurityException, NoSuchMethodException,
IllegalArgumentException, InstantiationException, IllegalAccessException,
InvocationTargetException ... | cwe | CWE-665 | Java |
def on_moved
Log.add_info(request, params.inspect)
location_id = params[:id]
if location_id.nil? or location_id.empty?
location = Location.get_for(@login_user)
if location.nil?
location = Location.new
location.user_id = @login_user.id
end
else
begin
loca... | cwe | CWE-89 | Ruby |
package com.salesmanager.shop.admin.controller.products;
import com.salesmanager.core.business.services.catalog.product.manufacturer.ManufacturerService;
import com.salesmanager.core.business.services.reference.language.LanguageService;
import com.salesmanager.core.business.utils.CoreConfiguration;
import com.salesman... | cwe | CWE-79 | Java |
_pickle_PicklerMemoProxy_copy_impl(PicklerMemoProxyObject *self)
/*[clinic end generated code: output=bb83a919d29225ef input=b73043485ac30b36]*/
{
Py_ssize_t i;
PyMemoTable *memo;
PyObject *new_memo = PyDict_New();
if (new_memo == NULL)
return NULL;
memo = self->pickler->memo;
for (i = ... | cwe | CWE-369 | Unknown |
void * CAPSTONE_API cs_winkernel_malloc(size_t size)
{
// Disallow zero length allocation because they waste pool header space and,
// in many cases, indicate a potential validation issue in the calling code.
NT_ASSERT(size);
// FP; a use of NonPagedPool is required for Windows 7 support
#pragma prefast(suppress :... | cwe | CWE-190 | Unknown |
dispose (GObject *object)
{
NMAGConfSettingsPrivate *priv = NMA_GCONF_SETTINGS_GET_PRIVATE (object);
if (priv->disposed)
return;
priv->disposed = TRUE;
g_hash_table_destroy (priv->pending_changes);
if (priv->read_connections_id) {
g_source_remove (priv->read_connections_id);
priv->read_connections_id = 0... | cwe | CWE-200 | Unknown |
static void ppp_cp_parse_cr(struct net_device *dev, u16 pid, u8 id,
unsigned int req_len, const u8 *data)
{
static u8 const valid_accm[6] = { LCP_OPTION_ACCM, 6, 0, 0, 0, 0 };
const u8 *opt;
u8 *out;
unsigned int len = req_len, nak_len = 0, rej_len = 0;
if (!(out = kmalloc(len, GFP_ATOMIC))) {
dev->stats... | cwe | CWE-20 | C/C++ |
/*
* Copyright (C) Igor Sysoev
* Copyright (C) NGINX, Inc.
*/
#include <njs_main.h>
static njs_int_t njs_vm_init(njs_vm_t *vm);
static njs_int_t njs_vm_handle_events(njs_vm_t *vm);
const njs_str_t njs_entry_main = njs_str("main");
const njs_str_t njs_entry_module = njs_str("module");
const... | cwe | CWE-416 | C/C++ |
bool SM_io_parser<Decorator_>::read_face(SFace_handle f)
{ // syntax: index { fclist, ivlist, loop, mark }
int n, ei, vi, li; Mark m;
if ( !(in >> n) || !check_sep("{") ) return false;
while (in >> ei) {
CGAL_assertion_msg(ei >= 0 && ei < en,
"wrong index in face cycle list.");
... | cwe | CWE-269 | Unknown |
# Copyright (C) 2016 Kristoffer Gronlund <kgronlund@suse.com>
# See COPYING for license information.
#
# Bootstrap:
#
# Supersedes and replaces both the init/add/remove cluster scripts,
# and the ha-cluster-bootstrap scripts.
#
# Implemented as a straight-forward set of python functions for
# simplicity and flexibility... | cwe | CWE-77 | Python |
def fetch(cls) -> "InstanceConfig":
entry = cls.get(get_instance_name())
if entry is None:
entry = cls()
entry.save()
return entry | cwe | CWE-863 | Python |
public function isLocal() {
$localhosts = array('::1', '127.0.0.1', '0.0.0.0');
return (
in_array(server::get('SERVER_ADDR'), $localhosts) ||
server::get('SERVER_NAME') == 'localhost' ||
str::endsWith(server::get('SERVER_NAME'), '.localhost') ||
str::endsWith(server::get('SERVER_NAME'), ... | cwe | CWE-346 | PHP |
protected function taskBackup()
{
if (!$this->authorizeTask('backup', ['admin.maintenance', 'admin.super'])) {
$this->admin->json_response = [
'status' => 'error',
'message' => $this->admin::translate('PLUGIN_ADMIN.INSUFFICIENT_PERMISSIONS_FOR_TASK')
... | cwe | CWE-79 | PHP |
# -*- 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 ... | cwe | CWE-770 | Python |
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distribute... | cwe | CWE-200 | 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... | cwe | CWE-269 | JavaScript |
void ExtensionsGuestViewMessageFilter::MimeHandlerViewGuestCreatedCallback(
int element_instance_id,
int embedder_render_process_id,
int embedder_render_frame_id,
int32_t plugin_frame_routing_id,
const gfx::Size& element_size,
mime_handler::BeforeUnloadControlPtrInfo before_unload_control,
b... | cwe | CWE-787 | C/C++ |
package bootstrap
import (
"context"
"crypto/sha256"
"encoding/base64"
"errors"
rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1"
"github.com/rancher/rancher/pkg/controllers/provisioningv2/rke2"
capicontrollers "github.com/rancher/rancher/pkg/generated/controllers/cluster.x-k8s.io/v1beta1"
rkecontr... | cwe | CWE-331 | Go |
export function setByKeyPath(obj, keyPath, value) {
if (!obj || keyPath === undefined) return;
if ('isFrozen' in Object && Object.isFrozen(obj)) return;
if (typeof keyPath !== 'string' && 'length' in keyPath) {
assert(typeof value !== 'string' && 'length' in value);
for (var i = 0, l = keyPa... | cwe | CWE-1321 | JavaScript |
static int fts3AllocateSegdirIdx(
Fts3Table *p,
int iLangid, /* Language id */
int iIndex, /* Index for p->aIndex */
int iLevel,
int *piIdx
){
int rc; /* Return Code */
sqlite3_stmt *pNextIdx; /* Query for next idx at level iLevel */... | cwe | CWE-787 | Unknown |
std::string GetDMToken() {
std::string dm_token = *GetTestingDMToken();
#if !defined(OS_CHROMEOS)
if (dm_token.empty() &&
policy::ChromeBrowserCloudManagementController::IsEnabled()) {
dm_token = policy::BrowserDMTokenStorage::Get()->RetrieveDMToken();
}
#endif
return dm_token;
} | cwe | CWE-20 | C/C++ |
public boolean isValid(Object value, ConstraintValidatorContext context) {
if (value != null && StringUtils.isNotEmpty(String.valueOf(value))) {
return true;
}
String errorMessage = String.format("Expected not empty value, got '%s'", value);
LOG.warn(errorMessage);
context.buildCo... | cwe | CWE-74 | Java |
static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t length)
{
size_t l1, l2=0;
if ((l1 = php_strnlen(buffer+2, length-2)) > 0) {
exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2);
if (length > 2+l1+1) {
l2 = php_strnlen(buffer+2+l1+1, len... | cwe | CWE-125 | Unknown |
void Compute(OpKernelContext* context) override {
// Checks what we're remapping and inverts the relevant remapping Tensors to
// be maps with key = old ID, value = new ID.
std::unordered_map<int64, int64> old_row_to_new_row_map;
std::vector<bool> row_id_present;
const Tensor* row_remapping_t;
O... | cwe | CWE-369 | C/C++ |
def store_metadata(self, session, key, mType, value):
if (self.idNormalizer is not None):
id = self.idNormalizer.process_string(session, id)
elif type(id) == unicode:
id = id.encode('utf-8')
else:
id = str(id)
self._openContainer(session)
query... | cwe | CWE-89 | Python |
protected TlsSecret safeDecryptPreMasterSecret(TlsCryptoParameters cryptoParams, PrivateKey rsaServerPrivateKey,
byte[] encryptedPreMasterSecret)
{
SecureRandom secureRandom = crypto.getSecureRandom();
/*
* RFC 5246 7.4.7.1.
*/
... | cwe | CWE-203 | Java |
int install_process_keyring_to_cred(struct cred *new)
{
struct key *keyring;
if (new->process_keyring)
return -EEXIST;
keyring = keyring_alloc("_pid", new->uid, new->gid, new,
KEY_POS_ALL | KEY_USR_VIEW,
KEY_ALLOC_QUOTA_OVERRUN,
NULL, NULL);
if (IS_ERR(keyring))
return PTR_ERR(keyring);
new->pro... | cwe | CWE-404 | Unknown |
// --- BEGIN COPYRIGHT BLOCK ---
// 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; version 2 of the License.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT... | cwe | CWE-79 | C/C++ |
/*
* This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license.
*
* Copyright(c) 2012 Intel Corporation. All rights reserved.
*
* GPL LICENSE SUMMARY
*
* This program is free software; you can redistribute it and/or modify
* it under the... | cwe | CWE-120 | Java |
struct ea_list *read_nttrans_ea_list(TALLOC_CTX *ctx, const char *pdata, size_t data_size)
{
struct ea_list *ea_list_head = NULL;
size_t offset = 0;
if (data_size < 4) {
return NULL;
}
while (offset + 4 <= data_size) {
size_t next_offset = IVAL(pdata,offset);
struct ea_list *eal = read_ea_list_entry(ctx, p... | cwe | CWE-189 | Unknown |
/*
*
* Copyright 2019 Asylo 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 agree... | cwe | CWE-787 | C/C++ |
/* Copyright 2017 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-369 | Python |
static void usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p,
uint8_t ep)
{
int status, len;
if (!dev->endpoint[EP2I(ep)].iso_started &&
!dev->endpoint[EP2I(ep)].iso_error) {
struct usb_redir_start_iso_stream_header start_iso = {
.en... | cwe | CWE-770 | Unknown |
void CLASS quicktake_100_load_raw()
{
uchar pixel[484][644];
static const short gstep[16] =
{ -89,-60,-44,-32,-22,-15,-8,-2,2,8,15,22,32,44,60,89 };
static const short rstep[6][4] =
{ { -3,-1,1,3 }, { -5,-1,1,5 }, { -8,-2,2,8 },
{ -13,-3,3,13 }, { -19,-4,4,19 }, { -28,-6,6,28 } };
static const sho... | cwe | CWE-369 | Unknown |
translate_hierarchy_event (ClutterBackendX11 *backend_x11,
ClutterDeviceManagerXI2 *manager_xi2,
XIHierarchyEvent *ev)
{
int i;
for (i = 0; i < ev->num_info; i++)
{
if (ev->info[i].flags & XIDeviceEnabled)
{
XIDeviceInfo... | cwe | CWE-264 | Unknown |
function doSearch(searchStr)
{
if (lastSearchStr == searchStr && isGetAll == lastGetAll) return;
deselectTempCat();
tempDlgContent.scrollTop = 0;
diagramsTiles.innerHTML = '';
diagramsListTitle.innerHTML = mxUtils.htmlEntities(mxResources.get('searchResults')) +
' "' + mxUtils.htmlEntities(sear... | cwe | CWE-94 | JavaScript |
DECLAREContigPutFunc(putagreytile)
{
int samplesperpixel = img->samplesperpixel;
uint32** BWmap = img->BWmap;
(void) y;
while (h-- > 0) {
for (x = w; x-- > 0;)
{
*cp++ = BWmap[*pp][0] & (*(pp+1) << 24 | ~A1);
pp += samplesperpixel;
}
cp += toskew;
pp += fromsk... | cwe | CWE-20 | Unknown |
delete_policy_2_svc(dpol_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg;
gss_buffer_desc client_name,
service_name;
OM_uint32 minor_stat;
kadm5_server_handle_t handle;
cons... | cwe | CWE-772 | C/C++ |
jsi_wscallback_websock(struct lws *wsi,
enum lws_callback_reasons reason,
void *user, void *in, size_t len)
{
struct lws_context *context = lws_get_context(wsi);
jsi_wsPss *pss = NULL;
jsi_wsCmdObj *cmdPtr = (jsi_wsCmdObj *)lws_context_user(context);
if (!cmdPtr) {
fprintf(stderr, "... | cwe | CWE-120 | C/C++ |
/*
Based on https://github.com/trevex/golem
Licensed under the Apache License, Version 2.0
http://www.apache.org/licenses/LICENSE-2.0.html
*/
package main
import (
"bytes"
"encoding/gob"
_ "expvar"
"fmt"
"io/ioutil"
"log"
"net/http"
"runtime"
"sync"
"time"
"github.com/gorilla/websocket"
//_ "github.com/mk... | cwe | CWE-352 | Go |
public boolean isValid(String value, ConstraintValidatorContext context) {
long longValue = 0;
boolean failed = false;
String errorMessage = "";
try {
longValue = Long.parseLong(value);
} catch (NumberFormatException ex) {
failed = true;
errorMessage = String.format... | cwe | CWE-74 | Java |
public function save($check_notify = false)
{
if (isset($_POST['email_recipients']) && is_array($_POST['email_recipients'])) {
$this->email_recipients = base64_encode(serialize($_POST['email_recipients']));
}
return parent::save($check_notify);
} | cwe | CWE-89 | PHP |
static Image *ReadTIMImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
typedef struct _TIMInfo
{
size_t
id,
flag;
} TIMInfo;
TIMInfo
tim_info;
Image
*image;
int
bits_per_pixel,
has_clut;
MagickBooleanType
status;
register IndexPacket
*indexes;
... | cwe | CWE-120 | C/C++ |
static av_always_inline void add_yblock(SnowContext *s, int sliced, slice_buffer *sb, IDWTELEM *dst, uint8_t *dst8, const uint8_t *obmc, int src_x, int src_y, int b_w, int b_h, int w, int h, int dst_stride, int src_stride, int obmc_stride, int b_x, int b_y, int add, int offset_dst, int plane_index){
const int b_wid... | cwe | CWE-703 | Unknown |
int main(int argc, char **argv, char **envp) {
int i;
int prog_index = -1; // index in argv where the program command starts
int lockfd_network = -1;
int lockfd_directory = -1;
int option_cgroup = 0;
int custom_profile = 0; // custom profile loaded
int arg_caps_cmdline = 0; // caps requested on command line... | cwe | CWE-94 | Unknown |
babel_print_v2(netdissect_options *ndo,
const u_char *cp, u_int length)
{
u_int i;
u_short bodylen;
u_char v4_prefix[16] =
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0, 0, 0, 0 };
u_char v6_prefix[16] = {0};
ND_TCHECK2(*cp, 4);
if (length < 4)
goto invalid;
bo... | cwe | CWE-125 | C/C++ |
png_info_init_3(png_infopp ptr_ptr, png_size_t png_info_struct_size)
{
png_infop info_ptr = *ptr_ptr;
png_debug(1, "in png_info_init_3");
if (info_ptr == NULL)
return;
if (png_sizeof(png_info) > png_info_struct_size)
{
png_destroy_struct(info_ptr);
info_ptr = (png_infop)png_create_... | cwe | CWE-120 | C/C++ |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | cwe | CWE-667 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.