code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
package com.salesmanager.shop.admin.controller.products;
import com.salesmanager.core.business.services.catalog.product.attribute.ProductOptionService;
import com.salesmanager.core.business.services.reference.language.LanguageService;
import com.salesmanager.core.business.utils.ajax.AjaxResponse;
import com.salesmanag... | cwe | CWE-639 | Java |
void jpc_qmfb_split_row(jpc_fix_t *a, int numcols, int parity)
{
int bufsize = JPC_CEILDIVPOW2(numcols, 1);
jpc_fix_t splitbuf[QMFB_SPLITBUFSIZE];
jpc_fix_t *buf = splitbuf;
register jpc_fix_t *srcptr;
register jpc_fix_t *dstptr;
register int n;
register int m;
int hstartcol;
/* Get a buffer. */
if (bufsize... | cwe | CWE-189 | Unknown |
package io.socket.parser;
import io.socket.hasbinary.HasBinary;
import org.json.JSONException;
import org.json.JSONTokener;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
final public class IOParser implements Parser {
... | cwe | CWE-476 | Java |
int ssh_bind_accept_fd(ssh_bind sshbind, ssh_session session, socket_t fd){
int i, rc;
if (session == NULL){
ssh_set_error(sshbind, SSH_FATAL,"session is null");
return SSH_ERROR;
}
session->server = 1;
session->version = 2;
/* copy options */
for (i = 0; i < 10; ++i) {
... | cwe | CWE-310 | Unknown |
/*
* This file Copyright (C) 2008-2014 Mnemosyne LLC
*
* It may be used under the GNU GPL versions 2 or 3
* or any future license endorsed by Mnemosyne LLC.
*
*/
#if defined(HAVE_USELOCALE) && (!defined(_XOPEN_SOURCE) || _XOPEN_SOURCE < 700)
#undef _XOPEN_SOURCE
#define _XOPEN_SOURCE 700
#endif
#if defined(HAVE... | cwe | CWE-416 | C/C++ |
function rt(t){var e=it(t);return 0===e||(!j(t)&&1===e&&t.innerHTML===nt||!(!N.all(t.childNodes,j)||""!==t.innerHTML))} | cwe | CWE-79 | JavaScript |
export default function semverRegex() {
return /(?<=^v?|\sv?)(?:(?:0|[1-9]\d*)\.){2}(?:0|[1-9]\d*)(?:-(?:0|[1-9]\d*|[\da-z-]*[a-z-][\da-z-]*)(?:\.(?:0|[1-9]\d*|[\da-z-]*[a-z-][\da-z-]*))*)?(?:\+[\da-z-]+(?:\.[\da-z-]+)*)?\b/gi;
} | cwe | CWE-1333 | JavaScript |
/* radare2 - LGPL - Copyright 2009-2020 - pancake */
#include <r_core.h>
#include <r_socket.h>
#include <config.h>
#include <r_util.h>
#if __UNIX__
#include <signal.h>
#endif
#define DB core->sdb
R_LIB_VERSION(r_core);
static ut64 letter_divs[R_CORE_ASMQJMPS_LEN_LETTERS - 1] = {
R_CORE_ASMQJMPS_LETTERS * R_CORE_AS... | cwe | CWE-415 | C/C++ |
broadcast: function(event, data) {
if (channel) {
channel.postMessage({name: event, data: serialize(data)});
} else {
set(event, to_json(data));
// clean up localstorage
setTimeout(function() {
remove(event);
... | cwe | CWE-346 | JavaScript |
const cheerio = require('cheerio');
const { puppeteerGet, renderDesc } = require('./utils');
const config = require('@/config').value;
module.exports = async (ctx) => {
const pub = ctx.params.pub;
const jrn = ctx.params.jrn;
const host = `https://${pub}.scitation.org`;
const jrnlUrl = `${host}/toc/${jr... | cwe | CWE-918 | JavaScript |
void OverlaySettings::save(QSettings* settings_ptr) {
OverlaySettings def;
SAVELOAD(bEnable, "enable");
SAVELOAD(osShow, "show");
SAVELOAD(bAlwaysSelf, "alwaysself");
SAVELOAD(uiActiveTime, "activetime");
SAVELOAD(osSort, "sort");
SAVELOAD(fX, "x");
SAVELOAD(fY, "y");
SAVELOAD(fZoom, "zoom");
SAVELOAD(uiCol... | cwe | CWE-310 | Unknown |
def self.from(stream)
header = stream.read 512
empty = (header == "\0" * 512)
fields = header.unpack UNPACK_FORMAT
new :name => fields.shift,
:mode => fields.shift.oct,
:uid => fields.shift.oct,
:gid => fields.shift.oct,
:size => fields.shift.oct,
... | cwe | CWE-835 | Ruby |
def group
Log.add_info(request, params.inspect)
date_s = params[:date]
if date_s.nil? or date_s.empty?
@date = Date.today
date_s = @date.strftime(Schedule::SYS_DATE_FORM)
else
@date = Date.parse date_s
end
if params[:display] == 'mine'
redirect_to(:action => 'month')
... | cwe | CWE-89 | Ruby |
TPMI_RH_HIERARCHY_Unmarshal(TPMI_RH_HIERARCHY *target, BYTE **buffer, INT32 *size, BOOL allowNull)
{
TPM_RC rc = TPM_RC_SUCCESS;
if (rc == TPM_RC_SUCCESS) {
rc = TPM_HANDLE_Unmarshal(target, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
switch (*target) {
case TPM_RH_OWNER:
case TPM_RH_PLATFOR... | cwe | CWE-787 | Unknown |
function updateConsent(database){
//Still need to grab emails from a sensitive data file
const emails = JSON.parse(fs.readFileSync('./tmp/consented-latest.json'))
const emailString = emails.consented.map(x => "'" + x + "'").toString();
const pool = new Pool({database});
const sql = `
INSERT INTO consented... | cwe | CWE-89 | JavaScript |
yaml_parser_save_simple_key(yaml_parser_t *parser)
{
/*
* A simple key is required at the current position if the scanner is in
* the block context and the current column coincides with the indentation
* level.
*/
int required = (!parser->flow_level
&& parser->indent == (ptrdiff... | cwe | CWE-20 | C/C++ |
static struct dir *squashfs_opendir(unsigned int block_start, unsigned int offset,
struct inode **i)
{
squashfs_dir_header_2 dirh;
char buffer[sizeof(squashfs_dir_entry_2) + SQUASHFS_NAME_LEN + 1]
__attribute__((aligned));
squashfs_dir_entry_2 *dire = (squashfs_dir_entry_2 *) buffer;
long long start;
int bytes;... | cwe | CWE-22 | Unknown |
import crypto from "crypto";
import { send as sendEmail } from "/imports/server/email.js";
const Url = Npm.require("url");
const V1_ROUNDS = 4096; // Selected to take ~5msec at creation time (2016) on a developer's laptop.
const V1_KEYSIZE = 32; // 256 bits / 8 bits/byte = 32 bytes
const V1_HASHFUNC = "sha512";
// ^... | cwe | CWE-287 | JavaScript |
static BOOL update_read_bitmap_data(rdpUpdate* update, wStream* s, BITMAP_DATA* bitmapData)
{
WINPR_UNUSED(update);
if (Stream_GetRemainingLength(s) < 18)
return FALSE;
Stream_Read_UINT16(s, bitmapData->destLeft);
Stream_Read_UINT16(s, bitmapData->destTop);
Stream_Read_UINT16(s, bitmapData->destRight);
Stream_... | cwe | CWE-125 | C/C++ |
xmlLoadEntityContent(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) {
xmlParserInputPtr input;
xmlBufferPtr buf;
int l, c;
int count = 0;
if ((ctxt == NULL) || (entity == NULL) ||
((entity->etype != XML_EXTERNAL_PARAMETER_ENTITY) &&
(entity->etype != XML_EXTERNAL_GENERAL_PARSED_ENTITY)) ||
... | cwe | CWE-119 | C/C++ |
private int
mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
size_t nbytes, size_t o, unsigned int cont_level, int mode, int text,
int flip, int recursion_level, int *printed_something,
int *need_separator, int *returnval)
{
uint32_t soffset, offset = ms->offset;
uint32_t count = m->str... | cwe | CWE-20 | Unknown |
static int dnxhd_find_frame_end(DNXHDParserContext *dctx,
const uint8_t *buf, int buf_size)
{
ParseContext *pc = &dctx->pc;
uint64_t state = pc->state64;
int pic_found = pc->frame_start_found;
int i = 0;
if (!pic_found) {
for (i = 0; i < buf_size; i++) {
... | cwe | CWE-476 | C/C++ |
int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a,
ASN1_BIT_STRING *signature, void *asn, EVP_PKEY *pkey)
{
EVP_MD_CTX ctx;
unsigned char *buf_in=NULL;
int ret= -1,inl;
int mdnid, pknid;
EVP_MD_CTX_init(&ctx);
/* Convert signature OID into digest and public key OIDs */
{
if... | cwe | CWE-310 | Unknown |
#include "common/http/http2/codec_impl.h"
#include <cstdint>
#include <memory>
#include <vector>
#include "envoy/event/dispatcher.h"
#include "envoy/http/codes.h"
#include "envoy/http/header_map.h"
#include "envoy/network/connection.h"
#include "envoy/stats/scope.h"
#include "common/common/assert.h"
#include "common... | cwe | CWE-400 | C/C++ |
void EventBindings::AttachFilteredEvent(
const v8::FunctionCallbackInfo<v8::Value>& args) {
CHECK_EQ(2, args.Length());
CHECK(args[0]->IsString());
CHECK(args[1]->IsObject());
std::string event_name = *v8::String::Utf8Value(args[0]);
if (!context()->HasAccessOrThrowError(event_name))
return;
std::... | cwe | CWE-416 | C/C++ |
static int on_part_data(
multipart_parser *parser, const char *at, size_t length)
{
multipart_parser_data_t *data = NULL;
ogs_assert(parser);
data = multipart_parser_get_data(parser);
ogs_assert(data);
if (at && length) {
SWITCH(data->part[data->num_of_part].content_type)
C... | cwe | CWE-476 | Unknown |
xmlParseCharData(xmlParserCtxtPtr ctxt, int cdata) {
const xmlChar *in;
int nbchar = 0;
int line = ctxt->input->line;
int col = ctxt->input->col;
int ccol;
SHRINK;
GROW;
/*
* Accelerated common case where input don't need to be
* modified before passing it to the handler.
... | cwe | CWE-119 | C/C++ |
/*
* Copyright (C) 2006 The Android Open Source Project
*
* 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 app... | cwe | CWE-276 | Java |
IMPEG2D_ERROR_CODES_T impeg2d_dec_pic_ext_data(dec_state_t *ps_dec)
{
stream_t *ps_stream;
UWORD32 u4_start_code;
IMPEG2D_ERROR_CODES_T e_error;
e_error = (IMPEG2D_ERROR_CODES_T)IVD_ERROR_NONE;
ps_stream = &ps_dec->s_bit_stream;
u4_start_code = impeg2d_bit_stream_nxt(ps_stream,START_... | cwe | CWE-254 | C/C++ |
package io.onedev.server.plugin.executor.kubernetes;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import javax.inject.Inj... | cwe | CWE-502 | Java |
function turn_textarea_switch(checkbox) {
var target, session;
var id = checkbox.id.replace(/hidden_value$/, "value");
var source = document.getElementById(id);
var $editorContainer = $('.editor-container');
if (checkbox.checked) {
target = '<input class="form-control" type="password" id="' + id + '" nam... | cwe | CWE-79 | JavaScript |
struct sk_buff *skb_segment(struct sk_buff *head_skb,
netdev_features_t features)
{
struct sk_buff *segs = NULL;
struct sk_buff *tail = NULL;
struct sk_buff *list_skb = skb_shinfo(head_skb)->frag_list;
skb_frag_t *frag = skb_shinfo(head_skb)->frags;
unsigned int mss = skb_shinfo(head_skb)->gso_size;
uns... | cwe | CWE-416 | C/C++ |
/**
* The contents of this file are subject to the OpenMRS Public License
* Version 1.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://license.openmrs.org
*
* Software distributed under the License is distributed on an "AS IS"
... | cwe | CWE-79 | Java |
import { FlowRouter } from 'meteor/ostrio:flow-router-extra'
import './projectAccessRights.html'
import { t, i18nReady } from '../../utils/i18n.js'
import {
validateEmail, getGlobalSetting, showToast,
} from '../../utils/frontend_helpers'
import Projects from '../../api/projects/projects.js'
Template.projectAccessRi... | cwe | CWE-79 | JavaScript |
int mutt_ssl_starttls (CONNECTION* conn)
{
sslsockdata* ssldata;
int maxbits;
long ssl_options = 0;
if (ssl_init())
goto bail;
ssldata = (sslsockdata*) safe_calloc (1, sizeof (sslsockdata));
/* the ssl_use_xxx protocol options don't apply. We must use TLS in TLS.
*
* However, we need to be able ... | cwe | CWE-74 | Unknown |
int svc_rdma_sendto(struct svc_rqst *rqstp)
{
struct svc_xprt *xprt = rqstp->rq_xprt;
struct svcxprt_rdma *rdma =
container_of(xprt, struct svcxprt_rdma, sc_xprt);
struct rpcrdma_msg *rdma_argp;
struct rpcrdma_msg *rdma_resp;
struct rpcrdma_write_array *wr_ary, *rp_ary;
int ret;
int inline_bytes;
struct ... | cwe | CWE-404 | C/C++ |
inlineTokens(src, tokens = [], inLink = false, inRawBlock = false) {
let token, lastToken;
// String with links masked to avoid interference with em and strong
let maskedSrc = src;
let match;
let keepPrevChar, prevChar;
// Mask out reflinks
if (this.tokens.links) {
const links = Obje... | cwe | CWE-400 | JavaScript |
function ame_ajax_set_linkvisibility( link_id ) {
var ame_sack = new sack( ajaxurl );
ame_sack.execute = 1;
ame_sack.method = 'POST';
ame_sack.setVar( "action", "ame_toggle_linkvisibility" );
ame_sack.setVar( "link_id", link_id );
ame_sack.onError = function() { alert('Ajax error on toggling link visibility') };
... | cwe | CWE-352 | JavaScript |
package com.salesmanager.shop.admin.controller.payments;
import com.salesmanager.core.business.modules.integration.IntegrationException;
import com.salesmanager.core.business.services.payments.PaymentService;
import com.salesmanager.core.model.merchant.MerchantStore;
import com.salesmanager.core.model.payments.Transac... | cwe | CWE-639 | Java |
*/
static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
{
/* OBJECTS_FIXME */
zval **ent, *fname, **varname;
zval *retval = NULL;
const char *key;
ulong idx;
char tmp_buf[WDDX_BUF_LEN];
HashTable *objhash, *sleephash;
TSRMLS_FETCH();
MAKE_STD_ZVAL(fname);
ZVAL_STRING(fname, "__sleep", 1);
/... | cwe | CWE-476 | Unknown |
import json
import logging
import os
import pathlib
import re
from typing import Dict, Mapping, NoReturn, Optional, Sequence
from vault_cli import client, exceptions
logger = logging.getLogger(__name__)
_replaced_by_underscore = re.compile(r"[/\- ]")
_allowed_named = re.compile(r"[A-Z0-9_]+")
def _normalize(name: ... | cwe | CWE-74 | Python |
/* pb_decode.c -- decode a protobuf using minimal resources
*
* 2011 Petteri Aimonen <jpa@kapsi.fi>
*/
/* Use the GCC warn_unused_result attribute to check that all return values
* are propagated correctly. On other compilers and gcc before 3.4.0 just
* ignore the annotation.
*/
#if !defined(__GNUC__) || ( __GNU... | cwe | CWE-125 | JavaScript |
inline int web_client_api_request_v1_data(RRDHOST *host, struct web_client *w, char *url) {
debug(D_WEB_CLIENT, "%llu: API v1 data with URL '%s'", w->id, url);
int ret = 400;
BUFFER *dimensions = NULL;
buffer_flush(w->response.data);
char *google_version = "0.6",
*google_reqId = "... | cwe | CWE-200 | C/C++ |
static void sm501_2d_operation(SM501State *s)
{
int cmd = (s->twoD_control >> 16) & 0x1F;
int rtl = s->twoD_control & BIT(27);
int format = (s->twoD_stretch >> 20) & 0x3;
int rop_mode = (s->twoD_control >> 15) & 0x1; /* 1 for rop2, else rop3 */
/* 1 if rop2 source is the pattern, otherwise the sourc... | cwe | CWE-190 | C/C++ |
check_exclusion_constraint(Relation heap, Relation index, IndexInfo *indexInfo,
ItemPointer tupleid, Datum *values, bool *isnull,
EState *estate, bool newIndex, bool errorOK)
{
Oid *constr_procs = indexInfo->ii_ExclusionProcs;
uint16 *constr_strats = indexInfo->ii_ExclusionStrats;
Oid *i... | cwe | CWE-209 | Unknown |
/*
* cryptoflex-tool.c: Tool for doing various Cryptoflex related stuff
*
* Copyright (C) 2001 Juha Yrjölä <juha.yrjola@iki.fi>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; e... | cwe | CWE-119 | C/C++ |
mono_gc_cleanup (void)
{
#ifdef DEBUG
g_message ("%s: cleaning up finalizer", __func__);
#endif
if (!gc_disabled) {
ResetEvent (shutdown_event);
finished = TRUE;
if (mono_thread_internal_current () != gc_thread) {
mono_gc_finalize_notify ();
/* Finishing the finalizer thread, so wait a little bit... */
... | cwe | CWE-264 | Unknown |
cJSON *cJSON_CreateObject( void )
{
cJSON *item = cJSON_New_Item();
if ( item )
item->type = cJSON_Object;
return item;
} | cwe | CWE-120 | C/C++ |
static ssize_t _hostfs_pwrite(
oe_fd_t* desc,
const void* buf,
size_t count,
oe_off_t offset)
{
ssize_t ret = -1;
file_t* file = _cast_file(desc);
if (!file)
OE_RAISE_ERRNO(OE_EINVAL);
if (oe_syscall_pwrite_ocall(&ret, file->host_fd, buf, count, offset) !=
OE_OK)
... | cwe | CWE-200 | Unknown |
static int ql_alloc_large_buffers(struct ql3_adapter *qdev)
{
int i;
struct ql_rcv_buf_cb *lrg_buf_cb;
struct sk_buff *skb;
dma_addr_t map;
int err;
for (i = 0; i < qdev->num_large_buffers; i++) {
skb = netdev_alloc_skb(qdev->ndev,
qdev->lrg_buffer_len);
if (unlikely(!skb)) {
/* Better luck nex... | cwe | CWE-401 | Unknown |
static int udp_send_skb(struct sk_buff *skb, struct flowi4 *fl4)
{
struct sock *sk = skb->sk;
struct inet_sock *inet = inet_sk(sk);
struct udphdr *uh;
int err = 0;
int is_udplite = IS_UDPLITE(sk);
int offset = skb_transport_offset(skb);
int len = skb->len - offset;
__wsum csum = 0;
/*
* Create a UDP header
... | cwe | CWE-362 | Unknown |
std::string get_wml_location(const std::string &filename, const std::string ¤t_dir)
{
DBG_FS << "Looking for '" << filename << "'." << std::endl;
assert(game_config::path.empty() == false);
std::string result;
if (filename.empty()) {
LOG_FS << " invalid filename" << std::endl;
return result;
}
if (... | cwe | CWE-200 | C/C++ |
error_t udpSendDatagram(Socket *socket, const SocketMsg *message, uint_t flags)
{
error_t error;
size_t offset;
NetBuffer *buffer;
NetTxAncillary ancillary;
//Allocate a memory buffer to hold the UDP datagram
buffer = udpAllocBuffer(0, &offset);
//Failed to allocate buffer?
if(buffer == NULL)
... | cwe | CWE-20 | C/C++ |
# -*- coding: utf-8 -*-
"""
Utility functions used systemwide.
"""
from __future__ import absolute_import
import binascii
import collections
import errno
import grp
import logging
import os
import pickle
import random
import re
import shutil
import smtplib
import stat
import string
import sys
import tempfile
import ... | cwe | CWE-74 | Python |
static void qemu_input_queue_process(void *opaque)
{
struct QemuInputEventQueueHead *queue = opaque;
QemuInputEventQueue *item;
g_assert(!QTAILQ_EMPTY(queue));
item = QTAILQ_FIRST(queue);
g_assert(item->type == QEMU_INPUT_QUEUE_DELAY);
QTAILQ_REMOVE(queue, item, node);
g_free(item);
wh... | cwe | CWE-772 | Unknown |
InputFile::setFrameBuffer (const FrameBuffer &frameBuffer)
{
if (_data->isTiled)
{
Lock lock (*_data);
//
// We must invalidate the cached buffer if the new frame
// buffer has a different set of channels than the old
// frame buffer, or if the type of a channel has changed.
//
const FrameBuffer... | cwe | CWE-770 | Unknown |
# coding:utf-8
"""
Django settings for MrDoc project.
Generated by 'django-admin startproject' using Django 2.1.3.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
... | cwe | CWE-502 | Python |
AP4_VisualSampleEntry::ReadFields(AP4_ByteStream& stream)
{
// sample entry
AP4_Result result = AP4_SampleEntry::ReadFields(stream);
if (result < 0) return result;
// read fields from this class
stream.ReadUI16(m_Predefined1);
stream.ReadUI16(m_Reserved2);
stream.Read(m_Predefined2, sizeof(... | cwe | CWE-843 | C/C++ |
/*
* Copyright (C) 2014 Daniel-Constantin Mierla (asipto.com)
*
* This file is part of kamailio, a free SIP server.
*
* Kamailio 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 L... | cwe | CWE-193 | C/C++ |
static ssize_t _hostsock_recvmsg(
oe_fd_t* sock_,
struct oe_msghdr* msg,
int flags)
{
ssize_t ret = -1;
sock_t* sock = _cast_sock(sock_);
oe_errno = 0;
void* buf = NULL;
size_t buf_size = 0;
/* Check the parameters. */
if (!sock || !msg || (msg->msg_iovlen && !msg->msg_iov))
... | cwe | CWE-200 | Unknown |
static int powermate_probe(struct usb_interface *intf, const struct usb_device_id *id)
{
struct usb_device *udev = interface_to_usbdev (intf);
struct usb_host_interface *interface;
struct usb_endpoint_descriptor *endpoint;
struct powermate_device *pm;
struct input_dev *input_dev;
int pipe, maxp;
int error = -EN... | cwe | CWE-703 | C/C++ |
evdev_device_create(struct libinput_seat *seat,
struct udev_device *udev_device)
{
struct libinput *libinput = seat->libinput;
struct evdev_device *device = NULL;
int rc;
int fd;
int unhandled_device = 0;
const char *devnode = udev_device_get_devnode(udev_device);
const char *sysname = udev_device_get_sysn... | cwe | CWE-134 | Unknown |
ftc_snode_load( FTC_SNode snode,
FTC_Manager manager,
FT_UInt gindex,
FT_ULong *asize )
{
FT_Error error;
FTC_GNode gnode = FTC_GNODE( snode );
FTC_Family family = gnode->family;
FT_Memory memory = manag... | cwe | CWE-119 | C/C++ |
from __future__ import annotations
from datetime import timedelta as td
from django import forms
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from hc.accounts.models import REPORT_CHOICES, Member
from hc.api.models import TokenBucket
from hc.lib.tz import all_timezones
c... | cwe | CWE-200 | Python |
function Ru(e){let t=document.createElement("template");return t.innerHTML=e,t.content.firstElementChild} | cwe | CWE-352 | JavaScript |
/*
BlueZ - Bluetooth protocol stack for Linux
Copyright (C) 2000-2001 Qualcomm Incorporated
Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
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 t... | cwe | CWE-362 | C/C++ |
Unix.files = function(paths, end) {
var self = this;
assertPaths('paths', paths);
assertFunction('end', end);
var files = {};
var queue = new Queue(1); // Concurrency yields no improvement with lsof.
queue.onData = function(paths, end) {
var escapedPaths = paths.map(
function(path) {
retur... | cwe | CWE-78 | JavaScript |
package com.salesmanager.shop.admin.model.customer.attribute;
import java.io.Serializable;
import com.salesmanager.shop.model.entity.ShopEntity;
public class CustomerOptionValue extends ShopEntity implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private String name;
p... | cwe | CWE-639 | Java |
// mkerrors.sh -Wall -Werror -static -I/tmp/include -fsigned-char
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build s390x,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char _const.go
package unix
import "syscall"
... | cwe | CWE-287 | Go |
int32_t cli_bcapi_extract_new(struct cli_bc_ctx *ctx, int32_t id)
{
cli_ctx *cctx;
int res = -1;
cli_event_count(EV, BCEV_EXTRACTED);
cli_dbgmsg("previous tempfile had %u bytes\n", ctx->written);
if (!ctx->written)
return 0;
if (ctx->ctx && cli_updatelimits(ctx->ctx, ctx->written))
return -1;... | cwe | CWE-189 | C/C++ |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
const TfLiteTensor* diag = GetInput(context, node, kDiagonalTensor);
FillDiagHelper(input, diag, output);
return kTfL... | cwe | CWE-787 | C/C++ |
inline TfLiteStatus EvalImpl(TfLiteContext* context, TfLiteNode* node,
std::function<T(T)> func,
TfLiteType expected_type) {
const TfLiteTensor* input = GetInput(context, node, 0);
TfLiteTensor* output = GetOutput(context, node, 0);
TF_LITE_ENSURE_TYPES_EQ... | cwe | CWE-125 | C/C++ |
// SPDX-License-Identifier: GPL-2.0-only
/*
* Xen event channels
*
* Xen models interrupts with abstract event channels. Because each
* domain gets 1024 event channels, but NR_IRQ is not that large, we
* must dynamically map irqs<->event channels. The event channels
* interface with the rest of the kernel by de... | cwe | CWE-476 | C/C++ |
void disassociate_ctty(int on_exit)
{
struct tty_struct *tty;
if (!current->signal->leader)
return;
tty = get_current_tty();
if (tty) {
if (on_exit && tty->driver->type != TTY_DRIVER_TYPE_PTY) {
tty_vhangup_session(tty);
} else {
struct pid *tty_pgrp = tty_get_pgrp(tty);
if (tty_pgrp) {
kill_pg... | cwe | CWE-416 | Unknown |
bool ParamTraits<AudioParameters>::Read(const Message* m,
PickleIterator* iter,
AudioParameters* r) {
int format, channel_layout, sample_rate, bits_per_sample,
frames_per_buffer, channels;
if (!m->ReadInt(iter, &format) ||
... | cwe | CWE-189 | C/C++ |
static Image *ReadWPGImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
typedef struct
{
size_t FileId;
MagickOffsetType DataOffset;
unsigned int ProductType;
unsigned int FileType;
unsigned char MajorVersion;
unsigned char MinorVersion;
unsigned int EncryptKey;
unsigne... | cwe | CWE-119 | C/C++ |
static Image *ReadMACImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
Image
*image;
MagickBooleanType
status;
register IndexPacket
*indexes;
register PixelPacket
*q;
register ssize_t
x;
register unsigned char
*p;
size_t
length;
ssize_t
offset,
y;
... | cwe | CWE-120 | C/C++ |
// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
//
// 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) 2018 Intel Corporation. All rights reserved.
//
// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
... | cwe | CWE-401 | C/C++ |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
OpData* op_data = reinterpret_cast<OpData*>(node->user_data);
int num_inputs = node->inputs->size;
// The number of outputs should be the same as number of inputs.
TF_LITE_ENSURE_EQ(context, node->outputs->size, num_inputs);
// Check subgraph i... | cwe | CWE-125 | C/C++ |
/*
* Copyright (c) 2018. Abstrium SAS <team (at) pydio.com>
* This file is part of Pydio Cells.
*
* Pydio Cells is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
... | cwe | CWE-200 | Go |
pimcore.helpers.grid.getTranslationColumnRenderer = function (value, metaData, record, rowIndex, colIndex, store) {
return t(value);
}; | cwe | CWE-79 | JavaScript |
static inline unsigned long zap_pmd_range(struct mmu_gather *tlb,
struct vm_area_struct *vma, pud_t *pud,
unsigned long addr, unsigned long end,
struct zap_details *details)
{
pmd_t *pmd;
unsigned long next;
pmd = pmd_offset(pud, addr);
do {
next = pmd_addr_end(addr, end);
if (pmd_trans_huge(*pm... | cwe | CWE-264 | C/C++ |
process_plane(uint8 * in, int width, int height, uint8 * out, int size)
{
UNUSED(size);
int indexw;
int indexh;
int code;
int collen;
int replen;
int color;
int x;
int revcode;
uint8 * last_line;
uint8 * this_line;
uint8 * org_in;
uint8 * org_out;
org_in = in;
org_out = out;
last_line = 0;
indexh = 0;... | cwe | CWE-125 | C/C++ |
void ResourceTracker::CleanupInstanceData(PP_Instance instance,
bool delete_instance) {
DLOG_IF(ERROR, !CheckIdType(instance, PP_ID_TYPE_INSTANCE))
<< instance << " is not a PP_Instance.";
InstanceMap::iterator found = instance_map_.find(instance);
if (found == inst... | cwe | CWE-416 | C/C++ |
function checkeditusername() {
var username=$('#edituser input[name=user]').val();
var rusername=$('#edituser input[name=ruser]').val();
var password=$('#edituser input[name=password]').val();
if(username=="" || password=="") {
toastr.error('You must enter a username and a password');
if(password=="") {
... | cwe | CWE-89 | JavaScript |
- (void)download:(CDVInvokedUrlCommand*)command
{
DLog(@"File Transfer downloading file...");
NSString* source = [command.arguments objectAtIndex:0];
NSString* target = [command.arguments objectAtIndex:1];
BOOL trustAllHosts = [[command.arguments objectAtIndex:2 withDefault:[NSNumber numberWithBool:YES]... | cwe | CWE-20 | Objective-C |
/*
* Copyright (c) 2004-2021, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
* list of cond... | cwe | CWE-918 | Java |
static int async_polkit_callback(sd_bus_message *reply, void *userdata, sd_bus_error *error) {
_cleanup_(sd_bus_error_free) sd_bus_error error_buffer = SD_BUS_ERROR_NULL;
AsyncPolkitQuery *q = userdata;
int r;
assert(reply);
assert(q);
q->slot = sd_bus_slot_unref(q->slo... | cwe | CWE-416 | C/C++ |
int DoWrite(WriteWrap* w,
uv_buf_t* bufs,
size_t count,
uv_stream_t* send_handle) override {
return UV_ENOSYS; // Not implemented (yet).
} | cwe | CWE-416 | Unknown |
def add_acl_usergroup(session, acl_role_id, user_group, name)
if (user_group == "user") or (user_group == "group")
stdout, stderr, retval = run_cmd(
session, PCS, "acl", user_group, "create", name.to_s, acl_role_id.to_s
)
if retval == 0
return ""
end
if not /^error: (user|group) #{name... | cwe | CWE-384 | Ruby |
public static byte[] computeLength(final byte[] aad) {
final int bitLength = ByteUtils.bitLength(aad);
return ByteBuffer.allocate(8).putLong(bitLength).array();
} | cwe | CWE-345 | Java |
UINT rdpgfx_read_rect16(wStream* s, RECTANGLE_16* rect16)
{
if (Stream_GetRemainingLength(s) < 8)
{
WLog_ERR(TAG, "not enough data!");
return ERROR_INVALID_DATA;
}
Stream_Read_UINT16(s, rect16->left); /* left (2 bytes) */
Stream_Read_UINT16(s, rect16->top); /* top (2 bytes) */
Stream_Read_UINT16(s, rect... | cwe | CWE-190 | C/C++ |
struct se_portal_group *tcm_loop_make_naa_tpg(
struct se_wwn *wwn,
struct config_group *group,
const char *name)
{
struct tcm_loop_hba *tl_hba = container_of(wwn,
struct tcm_loop_hba, tl_hba_wwn);
struct tcm_loop_tpg *tl_tpg;
char *tpgt_str, *end_ptr;
int ret;
unsigned short int tpgt;
tpgt_str = strstr(nam... | cwe | CWE-119 | C/C++ |
private def getPageAsHtmlImpl(request: GetRequest): Future[Result] = {
// Similar to loadPost and getPageAsJsonImpl, keep in sync. [7PKW0YZ2]
dieIfAssetsMissingIfDevTest()
val specifiedPagePath = PagePath.fromUrlPath(request.siteId, request.request.path) match {
case PagePath.Parsed.Good(path) => pat... | cwe | CWE-613 | Scala |
static int nlmsg_populate_mdb_fill(struct sk_buff *skb,
struct net_device *dev,
struct br_mdb_entry *entry, u32 pid,
u32 seq, int type, unsigned int flags)
{
struct nlmsghdr *nlh;
struct br_port_msg *bpm;
struct nlattr *nest, *nest2;
nlh = nlmsg_put(skb, pid, seq, type, sizeof(*bpm), NLM_F_MUL... | cwe | CWE-399 | Unknown |
def add_acl_role_remote(params, request, session)
if not allowed_for_local_cluster(session, Permissions::GRANT)
return 403, 'Permission denied'
end
retval = add_acl_role(session, params["name"], params["description"])
if retval == ""
return [200, "Successfully added ACL role"]
else
return [
... | cwe | CWE-384 | Ruby |
process_chpw_request(krb5_context context, void *server_handle, char *realm,
krb5_keytab keytab, const krb5_fulladdr *local_faddr,
const krb5_fulladdr *remote_faddr, krb5_data *req,
krb5_data *rep)
{
krb5_error_code ret;
char *ptr;
unsigned int ... | cwe | CWE-20 | C/C++ |
static ssize_t store_attach(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct socket *socket;
int sockfd = 0;
__u32 port = 0, pdev_nr = 0, rhport = 0, devid = 0, speed = 0;
struct usb_hcd *hcd;
struct vhci_hcd *vhci_hcd;
struct vhci_device *vdev;
struct vhci *vhci;... | cwe | CWE-200 | Unknown |
public JWECryptoParts encrypt(final JWEHeader header, final byte[] clearText)
throws JOSEException {
JWEAlgorithm alg = header.getAlgorithm();
if (! alg.equals(JWEAlgorithm.DIR)) {
throw new JOSEException(AlgorithmSupportMessage.unsupportedJWEAlgorithm(alg, SUPPORTED_ALGORITHMS));
}
// Check key length ... | cwe | CWE-345 | Java |
def legal?(string)
string.to_s =~ /^[0-9a-f]{24}$/i ? true : false
end | cwe | CWE-400 | Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.