code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
/*
* Based on arch/arm/mm/fault.c
*
* Copyright (C) 1995 Linus Torvalds
* Copyright (C) 1995-2004 Russell King
* Copyright (C) 2012 ARM Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Soft... | cwe | CWE-19 | C/C++ |
def get_by_name(self, name, project):
return (
Person.query.filter(Person.name == name)
.filter(Project.id == project.id)
.one()
) | cwe | CWE-863 | Python |
void UrlParser::parse(char ch)
{
switch(_state)
{
case state_0:
if (ch == '=')
_state = state_value;
else if (ch == '&')
;
else if (ch == '%')
_state = state_keyesc;
else
{
_key = ch;
_state = state_key;
}
... | cwe | CWE-399 | C/C++ |
int dd_chown(struct dump_dir *dd, uid_t new_uid)
{
if (!dd->locked)
error_msg_and_die("dump_dir is not opened"); /* bug */
struct stat statbuf;
if (!(stat(dd->dd_dirname, &statbuf) == 0 && S_ISDIR(statbuf.st_mode)))
{
perror_msg("stat('%s')", dd->dd_dirname);
return 1;
}
... | cwe | CWE-20 | Unknown |
mrb_vm_exec(mrb_state *mrb, const struct RProc *proc, const mrb_code *pc)
{
/* mrb_assert(MRB_PROC_CFUNC_P(proc)) */
const mrb_irep *irep = proc->body.irep;
const mrb_pool_value *pool = irep->pool;
const mrb_sym *syms = irep->syms;
mrb_code insn;
int ai = mrb_gc_arena_save(mrb);
struct mrb_jmpbuf *prev_jm... | cwe | CWE-703 | C/C++ |
function u(P,Q,S,Y,ba){function da(Ca){N.stop();var oa=document.createElement("table");oa.className="odFileListGrid";for(var Ba=null,Ea=0,Ka=0;null!=Ca&&Ka<Ca.length;Ka++){var Fa=Ca[Ka];if(1!=ja||!Fa.webUrl||0<Fa.webUrl.indexOf("sharepoint.com/sites/")||
0>Fa.webUrl.indexOf("sharepoint.com/")){var Ha=Fa.displayName||Fa... | cwe | CWE-94 | JavaScript |
static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table)
{
size_t length;
int tag, format, components;
char *value_ptr, tagname[64], cbuf[32], *outside=NULL;
size_t byte_count,... | cwe | CWE-125 | Unknown |
//
// [](http://godoc.org/github.com/crewjam/saml)
//
// [](https://travis-ci.org/crewjam/saml)
//
// Package saml contains a partial implementation of the SAML standard in golang.
// SAML is... | cwe | CWE-287 | Go |
int callback_glewlwyd_user_auth (const struct _u_request * request, struct _u_response * response, void * user_data) {
struct config_elements * config = (struct config_elements *)user_data;
json_t * j_param = ulfius_get_json_body_request(request, NULL), * j_result = NULL;
const char * ip_source = get_ip_source(re... | cwe | CWE-287 | 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 ... | cwe | CWE-352 | Python |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-200 | C/C++ |
$scope.reset = function() {
bootbox.confirm('Are you sure you want to reset the foreign source definition to the default ?', function(ok) {
if (ok) {
RequisitionsService.startTiming();
RequisitionsService.deleteForeignSourceDefinition($scope.foreignSource).then(
function() ... | cwe | CWE-79 | JavaScript |
Pl_ASCII85Decoder::flush()
{
if (this->pos == 0)
{
QTC::TC("libtests", "Pl_ASCII85Decoder no-op flush");
return;
}
unsigned long lval = 0;
for (int i = 0; i < 5; ++i)
{
lval *= 85;
lval += (this->inbuf[i] - 33U);
}
unsigned char outbuf[4];
memset(outbuf, 0, 4);
for (int i = ... | cwe | CWE-787 | C/C++ |
bool Server::MatchViewOrStatic(const std::string& method,
const std::string& url, bool* stream) {
if (Router::MatchView(method, url, stream)) {
return true;
}
// Try to match a static file.
if (method == methods::kGet && !doc_root_.empty()) {
fs::path path = doc_root_ / u... | cwe | CWE-22 | C/C++ |
/**
* A simple, static http GET server.
*
* (C) 2015 TekMonks. All rights reserved.
* License: See enclosed file.
*/
const extensions = [];
const fs = require("fs");
const zlib = require("zlib");
const path = require("path");
const http = require("http");
const https = require("https");
let access; let error;
... | cwe | CWE-116 | JavaScript |
function setter (obj, pointer, value) {
var part
var hasNextPart
if (pointer[1] === 'constructor' && pointer[2] === 'prototype') return obj
if (pointer[1] === '__proto__') return obj
for (var p = 1, len = pointer.length; p < len;) {
part = untilde(pointer[p++])
hasNextPart = len > p
if (typeof ... | cwe | CWE-843 | JavaScript |
int ia32_setup_frame(int sig, struct k_sigaction *ka,
compat_sigset_t *set, struct pt_regs *regs)
{
struct sigframe __user *frame;
void __user *restorer;
int err = 0;
/* copy_to_user optimizes that into a single 8 byte store */
static const struct {
u16 poplmovl;
u32 val;
u16 int80;
u16 pad;
} __a... | cwe | CWE-399 | Unknown |
static GF_Err av1dmx_parse_flush_sample(GF_Filter *filter, GF_AV1DmxCtx *ctx)
{
u32 pck_size;
GF_FilterPacket *pck;
u8 *output;
gf_bs_get_content_no_truncate(ctx->state.bs, &ctx->state.frame_obus, &pck_size, &ctx->state.frame_obus_alloc);
if (!pck_size) {
GF_LOG(GF_LOG_DEBUG, GF_LOG_CONTAINER, ("[AV1Dmx] no fr... | cwe | CWE-787 | C/C++ |
/**
* $Id: ProxyServlet.java,v 1.4 2013/12/13 13:18:11 david Exp $
* Copyright (c) 2011-2012, JGraph Ltd
*/
package com.mxgraph.online;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.... | cwe | CWE-918 | Java |
static Image *ReadCALSImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
char
filename[MaxTextExtent],
header[129],
message[MaxTextExtent];
FILE
*file;
Image
*image;
ImageInfo
*read_info;
int
c,
unique_file;
MagickBooleanType
status;
register ssize_t... | cwe | CWE-252 | C/C++ |
parse_command_modifiers(
exarg_T *eap,
char **errormsg,
cmdmod_T *cmod,
int skip_only)
{
char_u *cmd_start = NULL;
char_u *p;
int starts_with_colon = FALSE;
int vim9script = in_vim9script();
int has_visual_range = FALSE;
CLEAR_POINTER(cmod);
cmod->cmod_flags... | cwe | CWE-787 | C/C++ |
void WebGL2RenderingContextBase::deleteVertexArray(
WebGLVertexArrayObject* vertex_array) {
if (isContextLost() || !vertex_array)
return;
if (!vertex_array->IsDefaultObject() &&
vertex_array == bound_vertex_array_object_)
SetBoundVertexArrayObject(nullptr);
vertex_array->DeleteObject(Conte... | cwe | CWE-787 | C/C++ |
ProcXSendExtensionEvent(ClientPtr client)
{
int ret;
DeviceIntPtr dev;
xEvent *first;
XEventClass *list;
struct tmask tmp[EMASKSIZE];
REQUEST(xSendExtensionEventReq);
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
if (stuff->length !=
bytes_to_int32(sizeof(xSendExtensionEve... | cwe | CWE-119 | Unknown |
package samlsp
import (
"encoding/base64"
"fmt"
"net/http"
"strings"
"time"
"github.com/crewjam/saml"
)
var _ RequestTracker = CookieRequestTracker{}
// CookieRequestTracker tracks requests by setting a uniquely named
// cookie for each request.
type CookieRequestTracker struct {
ServiceProvider *saml.Servic... | cwe | CWE-287 | Go |
bool matches(const Http::RequestHeaderMap& headers) const override {
if (BaseMatcherImpl::matchRoute(headers)) {
const Http::HeaderString& path = headers.Path()->value();
const absl::string_view query_string = Http::Utility::findQueryStringStart(path);
absl::string_view path_view = path.getStringV... | cwe | CWE-703 | Unknown |
public function render()
{
$languageService = $this->getLanguageService();
$options = $this->data['renderData']['fieldControlOptions'];
$title = $options['title'] ?? 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.edit';
$parameterArray = $this->data['parameterAr... | cwe | CWE-327 | PHP |
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-704 | Unknown |
pci_emul_add_msixcap(struct pci_vdev *dev, int msgnum, int barnum)
{
uint32_t tab_size;
struct msixcap msixcap;
assert(msgnum >= 1 && msgnum <= MAX_MSIX_TABLE_ENTRIES);
assert(barnum >= 0 && barnum <= PCIR_MAX_BAR_0);
tab_size = msgnum * MSIX_TABLE_ENTRY_SIZE;
/* Align table size to nearest 4K */
tab_size = r... | cwe | CWE-703 | Unknown |
2)?O.substring(45,O.lastIndexOf("%26ex")):O.substring(2);this.showError(g,x,mxResources.get("openInNewWindow"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+O);this.handleError(d,g,k,l,p)}),L,mxResources.get("changeUser"),mxUtils.bind(this,function(){function u(){G.innerHTM... | cwe | CWE-94 | JavaScript |
def html_postprocess(_field, html)
helper = ContentTextHelpers.new
helper.sanitize(helper.auto_link(html))
end | cwe | CWE-94 | Ruby |
import authDataManager from '../Adapters/Auth';
import { ParseServerOptions } from '../Options';
import { loadAdapter } from '../Adapters/AdapterLoader';
import defaults from '../defaults';
import url from 'url';
// Controllers
import { LoggerController } from './LoggerController';
import { FilesController } from './Fi... | cwe | CWE-74 | JavaScript |
static zend_bool php_auto_globals_create_server(const char *name, uint name_len TSRMLS_DC)
{
if (PG(variables_order) && (strchr(PG(variables_order),'S') || strchr(PG(variables_order),'s'))) {
php_register_server_variables(TSRMLS_C);
if (PG(register_argc_argv)) {
if (SG(request_info).argc) {
zval **argc, **... | cwe | CWE-601 | Unknown |
public function upload() {
if (!AuthUser::hasPermission('file_manager_upload')) {
Flash::set('error', __('You do not have sufficient permissions to upload a file.'));
redirect(get_url('plugin/file_manager/browse/'));
}
// CSRF checks
if (isset($_POST['csr... | cwe | CWE-20 | PHP |
public function pageToContainedHtml(Page $page)
{
$page->html = (new PageContent($page))->render();
$pageHtml = view('pages.export', [
'page' => $page,
'format' => 'html',
])->render();
return $this->containHtml($pageHtml);
} | cwe | CWE-79 | PHP |
let random = bytes => {
fillPool(bytes)
return pool.subarray(poolOffset - bytes, poolOffset)
} | cwe | CWE-704 | JavaScript |
XParseColor (
register Display *dpy,
Colormap cmap,
_Xconst char *spec,
XColor *def)
{
register int n, i;
int r, g, b;
char c;
XcmsCCC ccc;
XcmsColor cmsColor;
if (!spec) return(0);
n = (int) strlen (spec);
if (*spec == '#') {
/*
* RGB
*/
spec++;
n--;
if (n != ... | cwe | CWE-120 | Unknown |
import base64
import datetime
import json
import logging
import re
from typing import Dict, List, Set, Tuple
from flask import g, session, url_for
from flask_babel import lazy_gettext as _
from flask_jwt_extended import current_user as current_user_jwt
from flask_jwt_extended import JWTManager
from flask_login import ... | cwe | CWE-203 | Python |
static int closeVirtualHostDirective(MaState *state, cchar *key, cchar *value)
{
HttpEndpoint *endpoint;
char *address, *ip, *addresses, *tok;
int port;
if (state->enabled) {
if (state->endpoints && *state->endpoints) {
addresses = state->endpoints;
... | cwe | CWE-476 | C/C++ |
int l2tp_packet_send(int sock, struct l2tp_packet_t *pack)
{
uint8_t *buf = mempool_alloc(buf_pool);
struct l2tp_avp_t *avp;
struct l2tp_attr_t *attr;
uint8_t *ptr;
int n;
int len = sizeof(pack->hdr);
if (!buf) {
log_emerg("l2tp: out of memory\n");
return -1;
}
memset(buf, 0, L2TP_MAX_PACKET_SIZE);
ptr... | cwe | CWE-119 | C/C++ |
public function addTab($array)
{
if (!$array) {
$this->setAPIResponse('error', 'no data was sent', 422);
return null;
}
$array = $this->checkKeys($this->getTableColumnsFormatted('tabs'), $array);
$array['group_id'] = ($array['group_id']) ?? $this->getDefaultGroupId();
$array['category_id'] = ($array['c... | cwe | CWE-79 | PHP |
/* NetHack 3.6 topten.c $NHDT-Date: 1450451497 2015/12/18 15:11:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.44 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
#inclu... | cwe | CWE-120 | C/C++ |
void ExtensionDevToolsClientHost::AgentHostClosed(
DevToolsAgentHost* agent_host) {
DCHECK(agent_host == agent_host_.get());
SendDetachedEvent();
delete this;
} | cwe | CWE-20 | C/C++ |
bool Helper::getPartitionSizeInfo(const QString &partDevice, qint64 *used, qint64 *free, int *blockSize)
{
QProcess process;
QStringList env_list = QProcess::systemEnvironment();
env_list.append("LANG=C");
process.setEnvironment(env_list);
if (Helper::isMounted(partDevice)) {
process.start... | cwe | CWE-362 | C/C++ |
WandExport double *DrawGetStrokeDashArray(const DrawingWand *wand,
size_t *number_elements)
{
double
*dasharray;
register const double
*p;
register double
*q;
register ssize_t
i;
size_t
n;
assert(wand != (const DrawingWand *) NULL);
assert(wand->signature == MagickWandSignature)... | cwe | CWE-476 | C/C++ |
apr_status_t h2_conn_run(conn_rec *c)
{
apr_status_t status;
int mpm_state = 0;
h2_session *session = h2_ctx_get_session(c);
ap_assert(session);
do {
if (c->cs) {
c->cs->sense = CONN_SENSE_DEFAULT;
c->cs->state = CONN_STATE_HANDLER;
}
status ... | cwe | CWE-770 | Unknown |
void SM_io_parser<Decorator_>::read()
{
if ( !check_sep("Sphere_map_2") )
CGAL_error_msg("SM_io_parser::read: no embedded_PM header.");
if ( !(check_sep("vertices") && (in >> vn)) )
CGAL_error_msg("SM_io_parser::read: wrong vertex line.");
if ( !(check_sep("edges") && (in >> en) && (en%2==0)) )
CGAL_e... | cwe | CWE-269 | Unknown |
# -*- 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 |
DecodeIPV6ExtHdrs(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, uint8_t *pkt, uint16_t len, PacketQueue *pq)
{
SCEnter();
uint8_t *orig_pkt = pkt;
uint8_t nh = 0; /* careful, 0 is actually a real type */
uint16_t hdrextlen = 0;
uint16_t plen;
char dstopts = 0;
char exthdr_fh_done ... | cwe | CWE-20 | C/C++ |
int main(int argc, char** argv) {
char userInput[50] = {0};
U32 timestamp = FUZ_GetMilliStart();
U32 seed=0;
int seedset=0;
int argNb;
int nbTests = NB_ATTEMPTS;
int testNb = 0;
int proba = FUZ_COMPRESSIBILITY_DEFAULT;
// Check command line
programName = argv[0];
for(argNb=1... | cwe | CWE-20 | Unknown |
void PrintPreviewUI::OnReusePreviewData(int preview_request_id) {
base::StringValue ui_identifier(preview_ui_addr_str_);
base::FundamentalValue ui_preview_request_id(preview_request_id);
web_ui()->CallJavascriptFunction("reloadPreviewPages", ui_identifier,
ui_preview_request_... | cwe | CWE-200 | C/C++ |
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum 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 3 of the License... | cwe | CWE-682 | Go |
INST_HANDLER (sts) { // STS k, Rr
int r = ((buf[0] >> 4) & 0xf) | ((buf[1] & 0x1) << 4);
int k = (buf[3] << 8) | buf[2];
op->ptr = k;
ESIL_A ("r%d,", r);
__generic_ld_st (op, "ram", 0, 1, 0, k, 1);
op->cycles = 2;
} | cwe | CWE-125 | C/C++ |
// Copyright (c) Jeevanandam M. (https://github.com/jeevatkm)
// Source code and usage is governed by a MIT style
// license that can be found in the LICENSE file.
package aah
// Version no. of aah framework
const Version = "0.12.3"
| cwe | CWE-22 | Go |
isoent_gen_joliet_identifier(struct archive_write *a, struct isoent *isoent,
struct idr *idr)
{
struct iso9660 *iso9660;
struct isoent *np;
unsigned char *p;
size_t l;
int r;
int ffmax, parent_len;
static const struct archive_rb_tree_ops rb_ops = {
isoent_cmp_node_joliet, isoent_cmp_key_joliet
};
... | cwe | CWE-190 | C/C++ |
int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb)
{
MpegEncContext *s = &ctx->m;
unsigned startcode, v;
int ret;
int vol = 0;
/* search next start code */
align_get_bits(gb);
// If we have not switched to studio profile than we also did not switch bps
// that ... | cwe | CWE-617 | Unknown |
package com.salesmanager.shop.filter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import org.springframework.web.util.HtmlUtils;
/**
* Cross Site Scripting filter enforcing html encoding of request parameters
* @author carlsamson
*
*/
public class XssHttpSer... | cwe | CWE-79 | Java |
/*
* Copyright 2017-2019 original 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 agre... | cwe | CWE-444 | Java |
static bool getCoverageFormat4(vector<uint32_t>& coverage, const uint8_t* data, size_t size) {
const size_t kSegCountOffset = 6;
const size_t kEndCountOffset = 14;
const size_t kHeaderSize = 16;
const size_t kSegmentSize = 8; // total size of array elements for one segment
if (kEndCountOffset > size) {
re... | cwe | CWE-20 | C/C++ |
R_API RBinJavaAttrInfo *r_bin_java_annotation_default_attr_new(RBinJavaObj *bin, ut8 *buffer, ut64 sz, ut64 buf_offset) {
ut64 offset = 0;
RBinJavaAttrInfo *attr = NULL;
attr = r_bin_java_default_attr_new (bin, buffer, sz, buf_offset);
offset += 6;
if (attr && sz >= offset) {
attr->type = R_BIN_JAVA_ATTR_TYPE_AN... | cwe | CWE-119 | C/C++ |
public static void skip(TProtocol prot, byte type, int maxDepth)
throws TException {
if (maxDepth <= 0) {
throw new TException("Maximum skip depth exceeded");
}
switch (type) {
case TType.BOOL:
{
prot.readBool();
break;
}
case TType.BYTE:
{
prot.read... | cwe | CWE-834 | Java |
function renderSimpleTemplateWithValidators(formElement, template) {
var validators, validatorsCountWithoutRequired, validatorsTemplateContent;
assert('object' === $.type(formElement), 'Invalid parameter "formElement"', 1479035674);
renderSimpleTemplate(formElement, template);
validatorsTempla... | cwe | CWE-79 | JavaScript |
def process
# We don't want any tracking back in the fs. Unlikely, but there
# you go.
client = self.host.gsub("..",".")
dir = File.join(Puppet[:reportdir], client)
if ! FileTest.exists?(dir)
FileUtils.mkdir_p(dir)
FileUtils.chmod_R(0750, dir)
end
# Now store the report.
... | cwe | CWE-22 | Ruby |
function editEvent($selected_events, $queue, $comments)
{
global $database_ged;
// get all needed infos into variables
$value_parts = explode(":", $selected_events);
$id = $value_parts[0];
$ged_type = $value_parts[1];
// format comment string to avoid errors
$comments = str_replace("'", "\'", $comments);
$com... | cwe | CWE-78 | PHP |
def delete(self, req, image_id):
self._enforce(req, 'delete_image')
image = self._get_image(req.context, image_id)
if image['protected']:
msg = _("Unable to delete as image %(image_id)s is protected"
% locals())
raise webob.exc.HTTPForbidden(explanati... | cwe | CWE-264 | Python |
void sqlite3CreateView(
Parse *pParse, /* The parsing context */
Token *pBegin, /* The CREATE token that begins the statement */
Token *pName1, /* The token that holds the name of the view */
Token *pName2, /* The token that holds the name of the view */
ExprList *pCNames, /* Optional list of ... | cwe | CWE-787 | Unknown |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-125 | Python |
package com.salesmanager.shop.admin.controller.customers;
import com.salesmanager.core.business.services.customer.CustomerService;
import com.salesmanager.core.business.services.customer.attribute.CustomerAttributeService;
import com.salesmanager.core.business.services.customer.attribute.CustomerOptionService;
import ... | cwe | CWE-639 | Java |
# Copyright 2018 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 |
package io.hawt;
import java.util.Objects;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import io.hawt.jmx.About;
import io.hawt.jmx.JMXSecurity;
import io.hawt.jmx.JmxTreeWatcher;
import io.hawt.jmx.PluginRegistry;
import io.hawt.jmx.QuartzFacade;
import io.hawt.jmx.RBACReg... | cwe | CWE-918 | Java |
package org.platformlambda.automation.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class Housekeeper extends Thread {
private static final Logger log = LoggerFactory.getLogger(Housekeeper.class);
private static ... | cwe | CWE-611 | Java |
static int tsc210x_load(QEMUFile *f, void *opaque, int version_id)
{
TSC210xState *s = (TSC210xState *) opaque;
int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
int i;
s->x = qemu_get_be16(f);
s->y = qemu_get_be16(f);
s->pressure = qemu_get_byte(f);
s->state = qemu_get_byte(f);
s->... | cwe | CWE-119 | C/C++ |
def piped_category_name(category_id)
return "-" unless category_id
category = Category.find_by(id: category_id)
return "#{category_id}" unless category
categories = [category.name]
while category.parent_category_id && category = category.parent_category
categories << category.name
... | cwe | CWE-200 | Ruby |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2020
* All rights reserved
*
* This file is part of GPAC / ISO Media File Format sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU ... | cwe | CWE-476 | C/C++ |
def self.get_tmpl_folder
tmpl_folder = Folder.where("folders.name='#{TMPL_ROOT}'").first
if tmpl_folder.nil?
ary = self.setup_tmpl_folder
unless ary.nil? or ary.empty?
tmpl_folder = ary[0]
tmpl_system_folder = ary[1]
tmpl_workflows_folder = ary[2]
tmpl_local_folde... | cwe | CWE-89 | Ruby |
function getExifEl() {
var el = getEl('fittr-exif-dislay');
if (!el) {
el = createEl('div');
el.id = 'fittr-exif-dislay';
el.innerHTML = '<i>Loading</i>';
link.parentNode.parentNode.insertBefore(el, link.parentNode.nextSibling);
api.makeApiRequest(api.RequestType.GET_EXIF, {photo_... | cwe | CWE-79 | JavaScript |
static int dccp_v6_send_response(const struct sock *sk, struct request_sock *req)
{
struct inet_request_sock *ireq = inet_rsk(req);
struct ipv6_pinfo *np = inet6_sk(sk);
struct sk_buff *skb;
struct in6_addr *final_p, final;
struct flowi6 fl6;
int err = -1;
struct dst_entry *dst;
memset(&fl6, 0, sizeof(fl6));
... | cwe | CWE-416 | Unknown |
onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
OnigErrorInfo* einfo)
{
#define COMPILE_INIT_SIZE 20
int r, init_size;
Node* root;
ScanEnv scan_env;
#ifdef USE_CALL
UnsetAddrList uslist;
#endif
root = 0;
if (IS_NOT_NULL(einfo)) einfo->par = (UChar* )NULL;
#ifde... | cwe | CWE-476 | C/C++ |
// mkerrors.sh -Wall -Werror -static -I/tmp/include
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build mips64,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
package unix
import "syscall"
const (
B1000000 ... | cwe | CWE-287 | Go |
HandleCoRREBPP (rfbClient* client, int rx, int ry, int rw, int rh)
{
rfbRREHeader hdr;
int i;
CARDBPP pix;
uint8_t *ptr;
int x, y, w, h;
if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbRREHeader))
return FALSE;
hdr.nSubrects = rfbClientSwap32IfLE(hdr.nSubrects);
if (!ReadFromRFBSe... | cwe | CWE-787 | C/C++ |
OMX_ERRORTYPE SoftGSM::internalGetParameter(
OMX_INDEXTYPE index, OMX_PTR params) {
switch (index) {
case OMX_IndexParamAudioPcm:
{
OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams =
(OMX_AUDIO_PARAM_PCMMODETYPE *)params;
if (pcmParams->nPortIndex > 1) {
r... | cwe | CWE-119 | C/C++ |
lldp_private_8021_print(netdissect_options *ndo,
const u_char *tptr, u_int tlv_len)
{
int subtype, hexdump = FALSE;
u_int sublen;
u_int tval;
uint8_t i;
if (tlv_len < 4) {
return hexdump;
}
subtype = *(tptr+3);
ND_PRINT((ndo, "\n\t %s Subtype (%u)",
... | cwe | CWE-835 | Unknown |
package com.salesmanager.shop.admin.model.customer.attribute;
import java.util.List;
public class CustomerAttributes {
private List<CustomerOption> customerOptions;
public List<CustomerOption> getCustomerOptions() {
return customerOptions;
}
public void setCustomerOptions(List<CustomerOption> customerOptio... | cwe | CWE-639 | Java |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-119 | C/C++ |
int dtls1_get_record(SSL *s)
{
int ssl_major,ssl_minor;
int i,n;
SSL3_RECORD *rr;
unsigned char *p = NULL;
unsigned short version;
DTLS1_BITMAP *bitmap;
unsigned int is_next_epoch;
rr= &(s->s3->rrec);
/* The epoch may have changed. If so, process all the
* pending records. This is a non-blocking operati... | cwe | CWE-119 | Unknown |
v9fs_vfs_getattr(const struct path *path, struct kstat *stat,
u32 request_mask, unsigned int flags)
{
struct dentry *dentry = path->dentry;
struct v9fs_session_info *v9ses;
struct p9_fid *fid;
struct p9_wstat *st;
p9_debug(P9_DEBUG_VFS, "dentry: %p\n", dentry);
v9ses = v9fs_dentry2v9ses(dentry);
if (v9ses->c... | cwe | CWE-835 | Unknown |
EXTRACTOR_dvi_extract_method (struct EXTRACTOR_ExtractContext *ec)
{
unsigned int klen;
uint32_t pos;
uint32_t opos;
unsigned int len;
unsigned int pageCount;
char pages[16];
void *buf;
unsigned char *data;
uint64_t size;
uint64_t off;
ssize_t iret;
if (40 >= (iret = ec->read (ec->cls, &buf, ... | cwe | CWE-125 | Unknown |
/* radare - LGPL - Copyright 2009-2020 - pancake, maijin */
#include <r_core.h>
static const char *help_msg_a[] = {
"Usage:", "a", "[abdefFghoprxstc] [...]",
"a", "", "alias for aai - analysis information",
"a*", "", "same as afl*;ah*;ax*",
"aa", "[?]", "analyze all (fcns + bbs) (aa0 to avoid sub renaming)",
"a8... | cwe | CWE-908 | C/C++ |
GF_Err url_box_read(GF_Box *s, GF_BitStream *bs)
{
GF_DataEntryURLBox *ptr = (GF_DataEntryURLBox *)s;
if (ptr->size) {
ptr->location = (char*)gf_malloc((u32) ptr->size);
if (! ptr->location) return GF_OUT_OF_MEM;
gf_bs_read_data(bs, ptr->location, (u32)ptr->size);
}
return GF_OK;
} | cwe | CWE-787 | Unknown |
static int hi3660_stub_clk_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct resource *res;
unsigned int i;
int ret;
/* Use mailbox client without blocking */
stub_clk_chan.cl.dev = dev;
stub_clk_chan.cl.tx_done = NULL;
stub_clk_chan.cl.tx_block = false;
stub_clk_chan.cl.knows_txdo... | cwe | CWE-476 | C/C++ |
package com.salesmanager.shop.model.catalog.product.attribute;
public class ReadableProductOptionValue extends ProductOptionValue {
/**
*
*/
private static final long serialVersionUID = 1L;
private String price;
private String image;
private String name;
public String getName() {
return name;
}
pu... | cwe | CWE-639 | Java |
void Compute(OpKernelContext* ctx) override {
const Tensor& input = ctx->input(0);
OP_REQUIRES(
ctx, (axis_ == -1 || axis_ < input.shape().dims()),
errors::InvalidArgument("Shape must be at least rank ", axis_ + 1,
" but is rank ", input.shape().dims()));
cons... | cwe | CWE-787 | C/C++ |
static ssize_t wakeup_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
return sprintf(buf, "%s\n", device_can_wakeup(dev)
? (device_may_wakeup(dev) ? _enabled : _disabled)
: "");
} | cwe | CWE-787 | Unknown |
function iterateMustacheNode (node) {
const list = $(node).contents().toArray()
list.forEach(item => {
if (item.type === 'text') {
const rawText = $(item).text()
if (rawText.indexOf('{{') >= 0 && rawText.indexOf('}}') > 1) {
$(item).parent().attr('v-pre', true)
... | cwe | CWE-79 | JavaScript |
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: https://www.espocrm.com
*
* EspoCRM is free software: you can redistribute i... | cwe | CWE-79 | JavaScript |
package api
import (
"fmt"
)
// Role is the type of a role.
type Role string
const (
// Host is the HOST role.
Host Role = "HOST"
// Admin is the ADMIN role.
Admin Role = "ADMIN"
// NormalUser is the USER role.
NormalUser Role = "USER"
)
func (e Role) String() string {
switch e {
case Host:
return "HOST"... | cwe | CWE-285 | Go |
static void task_done(h2_mplx *m, h2_task *task)
{
h2_stream *stream;
ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c,
"h2_mplx(%ld): task(%s) done", m->id, task->id);
out_close(m, task);
task->worker_done = 1;
task->done_at = apr_time_now();
ap_log_cerror(APLOG_MARK,... | cwe | CWE-770 | Unknown |
static int do_hidp_sock_ioctl(struct socket *sock, unsigned int cmd, void __user *argp)
{
struct hidp_connadd_req ca;
struct hidp_conndel_req cd;
struct hidp_connlist_req cl;
struct hidp_conninfo ci;
struct socket *csock;
struct socket *isock;
int err;
BT_DBG("cmd %x arg %p", cmd, argp);
switch (cmd) {
case... | cwe | CWE-77 | Unknown |
CAMLprim value caml_alloc_dummy_float (value size)
{
mlsize_t wosize = Int_val(size) * Double_wosize;
if (wosize == 0) return Atom(0);
return caml_alloc (wosize, 0);
} | cwe | CWE-200 | C/C++ |
int ssl3_send_client_key_exchange(SSL *s)
{
unsigned char *p;
int n;
unsigned long alg_k;
#ifndef OPENSSL_NO_RSA
unsigned char *q;
EVP_PKEY *pkey = NULL;
#endif
#ifndef OPENSSL_NO_KRB5
KSSL_ERR kssl_err;
#endif /* OPENSSL_NO_KRB5 */
#ifndef OPENSSL_NO_ECDH
EC_KEY *cl... | cwe | CWE-310 | Unknown |
function peg$parsebodies() {
var s0, s1, s2, s3, s4, s5, s6, s7;
peg$silentFails++;
s0 = peg$currPos;
s1 = [];
s2 = peg$currPos;
s3 = peg$parseld();
if (s3 !== peg$FAILED) {
if (input.charCodeAt(peg$currPos) === 58) {
s4 = peg$c16;
peg$currPos++;
... | cwe | CWE-1321 | JavaScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.