code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
void MediaStreamManager::StopStreamDevice(int render_process_id,
int render_frame_id,
const std::string& device_id,
int session_id) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
DVLOG(1) << ... | cwe | CWE-189 | C/C++ |
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 |
def post(self):
"""This method handles the POST requests to add agents to the Cloud Verifier.
Currently, only agents resources are available for POSTing, i.e. /agents. All other POST uri's will return errors.
agents requests require a json block sent in the body
"""
session = ge... | cwe | CWE-20 | Python |
document.createElement("span");y.style["float"]="right";y.style.cursor="pointer";y.style.userSelect="none";y.style.marginTop="-4px";y.appendChild(n);mxUtils.write(y,mxResources.get("showStartScreen"));mxEvent.addListener(y,"click",function(F){mxEvent.getSource(F)!=n&&(n.checked=!n.checked)});header=y}var K=localStorage... | cwe | CWE-20 | JavaScript |
cdk_error_t cdk_pkt_read(cdk_stream_t inp, cdk_packet_t pkt)
{
int ctb, is_newctb;
int pkttype;
size_t pktlen = 0, pktsize = 0, is_partial = 0;
cdk_error_t rc;
if (!inp || !pkt)
return CDK_Inv_Value;
ctb = cdk_stream_getc(inp);
if (cdk_stream_eof(inp) || ctb == EOF)
return CDK_EOF;
else if (!ctb)
return... | cwe | CWE-787 | C/C++ |
static void vnc_dpy_update(DisplayState *ds, int x, int y, int w, int h)
{
int i;
VncDisplay *vd = ds->opaque;
struct VncSurface *s = &vd->guest;
h += y;
two 16-pixel blocks but we only mark the first as dirty
*/
w += (x % 16);
x -= (x % 16);
w += (x % 16);
x -= (x %... | cwe | CWE-120 | C/C++ |
void fli_read_brun(FILE *f, s_fli_header *fli_header, unsigned char *framebuf)
{
unsigned short yc;
unsigned char *pos;
for (yc=0; yc < fli_header->height; yc++) {
unsigned short xc, pc, pcnt;
pc=fli_read_char(f);
xc=0;
pos=framebuf+(fli_header->width * yc);
for (pcnt=pc; pcnt>0; pcnt--) {
unsigned shor... | cwe | CWE-787 | Unknown |
void Unpack::Unpack5(bool Solid)
{
FileExtracted=true;
if (!Suspended)
{
UnpInitData(Solid);
if (!UnpReadBuf())
return;
// Check TablesRead5 to be sure that we read tables at least once
// regardless of current block header TablePresent flag.
// So we can safefly use these tables below... | cwe | CWE-787 | C/C++ |
/* package tap wraps a set of interfaces and object to provide a generic interface to a delegated authentication
proxy */
package tap
import "encoding/json"
// Profile is the configuration objct for an authentication session, it
// combines an Action (what to do with the identity once confirmed, this is
// delegated ... | cwe | CWE-287 | Go |
static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh,
u_int16_t subsys_id)
{
struct sk_buff *oskb = skb;
struct net *net = sock_net(skb->sk);
const struct nfnetlink_subsystem *ss;
const struct nfnl_callback *nc;
static LIST_HEAD(err_list);
u32 status;
int err;
if (subsys_id >= NFNL_SUB... | cwe | CWE-125 | C/C++ |
def shame_add(name):
shame = shame_ask(name)
db = db_connect()
cursor = db.cursor()
if shame is None:
try:
cursor.execute('''
INSERT INTO people(name,karma,shame) VALUES('{}',0,1)
'''.format(name))
db.commit()
logger.debug('Inse... | cwe | CWE-89 | Python |
void FrameLoader::StopAllLoaders() {
if (frame_->GetDocument()->PageDismissalEventBeingDispatched() !=
Document::kNoDismissal)
return;
if (in_stop_all_loaders_)
return;
in_stop_all_loaders_ = true;
for (Frame* child = frame_->Tree().FirstChild(); child;
child = child->Tree().NextSi... | cwe | CWE-362 | C/C++ |
/****************************************************************************
** libebml : parse EBML files, see http://embl.sourceforge.net/
**
** <file/class description>
**
** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.
**
** This library is free software; you can redistribute it and/or
** modify it ... | cwe | CWE-119 | C/C++ |
package com.bezman.servlet;
import org.apache.commons.lang.StringEscapeUtils;
import org.json.simple.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMe... | cwe | CWE-89 | Java |
static int open_group(char *name, int has_prefix, struct backend **ret,
int *postable /* used for LIST ACTIVE only */)
{
char mailboxname[MAX_MAILBOX_BUFFER];
int r = 0;
char *acl, *newserver;
struct backend *backend_next = NULL;
/* close local group */
if (group_state)
index_close(&g... | cwe | CWE-287 | Unknown |
u32 GetHintFormat(GF_TrackBox *trak)
{
GF_HintMediaHeaderBox *hmhd = (GF_HintMediaHeaderBox *)trak->Media->information->InfoHeader;
if (hmhd->type != GF_ISOM_BOX_TYPE_HMHD)
return 0;
if (!hmhd || !hmhd->subType) {
GF_Box *a = (GF_Box *)gf_list_get(trak->Media->information->sampleTable->SampleDescription->chil... | cwe | CWE-476 | C/C++ |
function I(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t} | cwe | CWE-79 | JavaScript |
package com.dimtion.shaarlier;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import java.util.ArrayList;
import java.util.List;
/**
* Created by dimtion on 12/05/2015.
* Inte... | cwe | CWE-89 | Java |
IHEVCD_ERROR_T ihevcd_parse_pps(codec_t *ps_codec)
{
IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
WORD32 value;
WORD32 pps_id;
pps_t *ps_pps;
sps_t *ps_sps;
bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
if(0 == ps_codec->i4_sps_done)
return IHEVCD_INVALID_HEADER;
UEV_PARSE("pic_... | cwe | CWE-119 | C/C++ |
static __inline__ int scm_check_creds(struct ucred *creds)
{
const struct cred *cred = current_cred();
kuid_t uid = make_kuid(cred->user_ns, creds->uid);
kgid_t gid = make_kgid(cred->user_ns, creds->gid);
if (!uid_valid(uid) || !gid_valid(gid))
return -EINVAL;
if ((creds->pid == task_tgid_vnr(current) ||
... | cwe | CWE-264 | C/C++ |
/***
This file is part of systemd.
Copyright 2014 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later ve... | cwe | CWE-476 | C/C++ |
int MirrorJob::Do()
{
int res;
int m=STALL;
FileInfo *file;
Job *j;
switch(state)
{
case(INITIAL_STATE):
remove_this_source_dir=(remove_source_dirs && source_dir.last_char()!='/');
if(!strcmp(target_dir,".") || !strcmp(target_dir,"..") || (FlagSet(SCAN_ALL_FIRST) && parent_mirror)... | cwe | CWE-401 | C/C++ |
/*
* Copyright (C) 2011 Google Inc. 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 conditio... | cwe | CWE-20 | C/C++ |
static pyc_object *get_long_object(RzBuffer *buffer) {
pyc_object *ret = NULL;
bool error = false;
bool neg = false;
ut32 tmp = 0;
size_t size;
size_t i, j = 0, left = 0;
ut32 n;
char *hexstr;
char digist2hex[] = "0123456789abcdef";
st32 ndigits = get_st32(buffer, &error);
if (error) {
return NULL;
}
re... | cwe | CWE-190 | C/C++ |
/************************************************************************
* 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 |
static inline int cipso_v4_validate(const struct sk_buff *skb,
unsigned char **option)
{
unsigned char *opt = *option;
unsigned char err_offset = 0;
u8 opt_len = opt[1];
u8 opt_iter;
if (opt_len < 8) {
err_offset = 1;
goto out;
}
if (get_unaligned_be32(&opt[2]) == 0) {
err_offset = 2;
goto out;... | cwe | CWE-703 | C/C++ |
value () {
return this.entry[this.propertyId];
} | cwe | CWE-79 | JavaScript |
xfs_acl_from_disk(struct xfs_acl *aclp)
{
struct posix_acl_entry *acl_e;
struct posix_acl *acl;
struct xfs_acl_entry *ace;
int count, i;
count = be32_to_cpu(aclp->acl_cnt);
if (count > XFS_ACL_MAX_ENTRIES)
return ERR_PTR(-EFSCORRUPTED);
acl = posix_acl_alloc(count, GFP_KERNEL);
if (!acl)
return ERR_... | cwe | CWE-189 | C/C++ |
for(var J=0;J<X.length;J++)if("label"!=X[J].nodeName){var T=mxUtils.trim(X[J].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==U&&(E&&0<=T.indexOf(u)||!E&&T.substring(0,u.length)===u)||null!=U&&U.test(T))return!0}}return!1}function d(){x&&L.value?(S.removeAttribute("disabled"),V.removeAttribut... | cwe | CWE-20 | JavaScript |
function readDocType(xmlData, i){
const entities = {};
if( xmlData[i + 3] === 'O' &&
xmlData[i + 4] === 'C' &&
xmlData[i + 5] === 'T' &&
xmlData[i + 6] === 'Y' &&
xmlData[i + 7] === 'P' &&
xmlData[i + 8] === 'E')
{
i = i+9;
let angleBrack... | cwe | CWE-1333 | JavaScript |
static punycode_uint decode_digit(punycode_uint cp)
{
return cp - 48 < 10 ? cp - 22 : cp - 65 < 26 ? cp - 65 :
cp - 97 < 26 ? cp - 97 : base;
} | cwe | CWE-190 | C/C++ |
int qcow2_snapshot_load_tmp(BlockDriverState *bs,
const char *snapshot_id,
const char *name,
Error **errp)
{
int i, snapshot_index;
BDRVQcowState *s = bs->opaque;
QCowSnapshot *sn;
uint64_t *new_l1_table;
int new_l1_... | cwe | CWE-190 | Unknown |
def set_language(self, lang):
"""
Update language of user in the User object and in the database
:param lang: string with language tag like "en-US"
:return: None
"""
log.debug('Updating info about user %s language '
'in memory & database...', self)
... | cwe | CWE-89 | Python |
function(k){this.actions.get("shapes").funct();mxEvent.consume(k)}));c.appendChild(e);return c};EditorUi.prototype.handleError=function(c,e,g,k,m,q,v){var x=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},A=null!=c&&null!=c.error?c.error:c;if(null!=c&&("1"==urlParams.test||null!=c.stack)&... | cwe | CWE-20 | JavaScript |
bool logToUSDT(const Array& bt) {
std::lock_guard<std::mutex> lock(usdt_mutex);
memset(&bt_slab, 0, sizeof(bt_slab));
int i = 0;
IterateVNoInc(
bt.get(),
[&](TypedValue tv) -> bool {
if (i >= strobelight::kMaxStackframes) {
return true;
}
assertx(isArrayLikeType(type(tv)));... | cwe | CWE-122 | C/C++ |
/**
* OpenKM, Open Document Management System (http://www.openkm.com)
* Copyright (c) 2006-2017 Paco Avila & Josep Llort
* <p>
* No bytes were intentionally harmed during the development of this application.
* <p>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the... | cwe | CWE-377 | Java |
func logNamespaceDiagnostics(spec *specs.Spec) {
sawMountNS := false
sawUserNS := false
sawUTSNS := false
for _, ns := range spec.Linux.Namespaces {
switch ns.Type {
case specs.CgroupNamespace:
if ns.Path != "" {
logrus.Debugf("unable to join cgroup namespace, sorry about that")
} else {
logrus.De... | cwe | CWE-212 | Go |
njs_promise_prototype_then(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,
njs_index_t unused)
{
njs_int_t ret;
njs_value_t *promise, *fulfilled, *rejected, constructor;
njs_object_t *object;
njs_function_t *function;
njs_promise_capabilit... | cwe | CWE-843 | C/C++ |
main(int argc, char* argv[])
{
uint32 rowsperstrip = (uint32) -1;
TIFF *in, *out;
uint32 w, h;
uint16 samplesperpixel;
uint16 bitspersample;
uint16 config;
uint16 photometric;
uint16* red;
uint16* green;
uint16* blue;
tsize_t rowsize;
register uint32 row;
register tsample_t s;
unsigned char *inbuf, *outbu... | 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 |
bool PackLinuxElf32::calls_crt1(Elf32_Rel const *rel, int sz)
{
for (; 0 < sz; (sz -= sizeof(Elf32_Rel)), ++rel) {
unsigned const symnum = get_te32(&rel->r_info) >> 8;
char const *const symnam = get_te32(&dynsym[symnum].st_name) + dynstr;
if (0==strcmp(symnam, "__libc_start_main") // glibc
... | cwe | CWE-415 | Unknown |
static rfbBool rfbInitConnection(rfbClient* client)
{
/* Unless we accepted an incoming connection, make a TCP connection to the
given VNC server */
if (!client->listenSpecified) {
if (!client->serverHost)
return FALSE;
if (client->destHost) {
if (!ConnectToRFBRepeater(client,client->serve... | cwe | CWE-20 | Unknown |
package com.salesmanager.shop.admin.controller.user;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
import org.springframework.stereotype.Control... | cwe | CWE-79 | Java |
void _mutt_mktemp (char *s, size_t slen, const char *src, int line)
{
snprintf (s, slen, "%s/mutt-%s-%d-%d-%d", NONULL (Tempdir), NONULL(Hostname), (int) getuid(), (int) getpid (), Counter++);
dprint (3, (debugfile, "%s:%d: mutt_mktemp returns \"%s\".\n", src, line, s));
unlink (s);
} | cwe | CWE-668 | Unknown |
static void scalar32_min_max_or(struct bpf_reg_state *dst_reg,
struct bpf_reg_state *src_reg)
{
bool src_known = tnum_subreg_is_const(src_reg->var_off);
bool dst_known = tnum_subreg_is_const(dst_reg->var_off);
struct tnum var32_off = tnum_subreg(dst_reg->var_off);
s32 smin_val = src_reg->smin_value;
u32 umin_v... | cwe | CWE-787 | C/C++ |
const log = require('loglevel').getLogger('ScanimageCommand');
const CommandBuilder = require('./command-builder');
const Constants = require('../constants');
const LogFormatter = require('./log-formatter');
const Process = require('./process');
const semver = require('semver');
class Scanimage {
/**
* @param {... | cwe | CWE-78 | JavaScript |
void PrintJobWorker::GetSettingsWithUI(
int document_page_count,
bool has_selection,
bool is_scripted) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
#if defined(OS_ANDROID)
if (is_scripted) {
PrintingContextDelegate* printing_context_delegate =
static_cast<PrintingContextDelegate*>(printin... | cwe | CWE-20 | C/C++ |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
const TfLiteTensor* begin = GetInput(context, node, kBeginTensor);
const TfLiteTensor* size = GetInput(context, node, kSizeTensor);
TfLiteTensor* output = GetOutput(context, node, kOu... | cwe | CWE-125 | C/C++ |
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import atexit
import base64
import functools
import logging
import logging.config
i... | cwe | CWE-307 | Python |
status_t SoundTriggerHwService::Module::loadSoundModel(const sp<IMemory>& modelMemory,
sound_model_handle_t *handle)
{
ALOGV("loadSoundModel() handle");
if (!captureHotwordAllowed()) {
return PERMISSION_DENIED;
}
if (modelMemory == 0 || modelMemory->pointer() == NULL) {
ALOGE("loadSoundModel() modelMe... | cwe | CWE-264 | C/C++ |
static unsigned char asn1_header_decode(struct asn1_ctx *ctx,
unsigned char **eoc,
unsigned int *cls,
unsigned int *con,
unsigned int *tag)
{
unsigned int def, len;
if (!asn1_id_decode(ctx, cls, con, tag))
return 0;
def = len = 0;
if (!asn1_length_decode(ctx, &def, &len))
return 0;
if (d... | cwe | CWE-119 | 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 |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2006-2019
* 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 Le... | cwe | CWE-476 | C/C++ |
static int decode_update_thread_context(AVCodecContext *dst,
const AVCodecContext *src)
{
H264Context *h = dst->priv_data, *h1 = src->priv_data;
int inited = h->context_initialized, err = 0;
int context_reinitialized = 0;
int i, ret;
if (dst == src || !h1->co... | cwe | CWE-787 | Unknown |
PHP_METHOD(Phar, addFile)
{
char *fname, *localname = NULL;
size_t fname_len, localname_len = 0;
php_stream *resource;
zval zresource;
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &fname, &fname_len, &localname, &localname_len) == FAILURE) {
return;
}
#if PHP_API_VERSION < 201004... | cwe | CWE-20 | Unknown |
messageAddArgument(message *m, const char *arg)
{
int offset;
char *p;
assert(m != NULL);
if(arg == NULL)
return; /* Note: this is not an error condition */
while(isspace(*arg))
arg++;
if(*arg == '\0')
/* Empty argument? Probably a broken mail client... */
return;
cli_dbgmsg("messageAddArgument, arg... | cwe | CWE-125 | C/C++ |
public DSpaceObject getParentObject(Context context, Group group) throws SQLException {
if (group == null) {
return null;
}
// could a collection/community administrator manage related groups?
// check before the configuration options could give a performance gain
// ... | cwe | CWE-863 | Java |
public static Document parseText(String text) throws DocumentException {
SAXReader reader = new SAXReader();
try {
reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
reader.setFeature("http://xml.org/sax/features/external-general-entities"... | cwe | CWE-611 | Java |
NOEXPORT int dh_init(SERVICE_OPTIONS *section) {
DH *dh=NULL;
int i, n;
char description[128];
STACK_OF(SSL_CIPHER) *ciphers;
section->option.dh_temp_params=0; /* disable by default */
/* check if DH is actually enabled for this section */
ciphers=SSL_CTX_get_ciphers(section->ctx);
if(... | cwe | CWE-295 | Unknown |
static Image *ReadTILEImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
Image
*image,
*tile_image;
ImageInfo
*read_info;
/*
Initialize Image structure.
*/
assert(image_info != (const ImageInfo *) NULL);
assert(image_info->signature == MagickSignature);
if (image_info... | cwe | CWE-120 | C/C++ |
void SFS_ArrayDeref(ScriptParser *parser)
{
if (parser->codec->LastError) return;
SFS_Expression(parser);
SFS_AddString(parser, "[");
SFS_CompoundExpression(parser);
SFS_AddString(parser, "]");
} | cwe | CWE-476 | Unknown |
package server
import (
"github.com/labstack/echo/v4"
"github.com/usememos/memos/api"
"github.com/usememos/memos/common"
)
type response struct {
Data interface{} `json:"data"`
}
func composeResponse(data interface{}) response {
return response{
Data: data,
}
}
func (server *Server) DefaultAuthSkipper(c ech... | cwe | CWE-79 | Go |
/* Copyright 2021 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-476 | Python |
void vlan_setup(struct net_device *dev)
{
ether_setup(dev);
dev->priv_flags |= IFF_802_1Q_VLAN;
dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
dev->tx_queue_len = 0;
dev->netdev_ops = &vlan_netdev_ops;
dev->destructor = free_netdev;
dev->ethtool_ops = &vlan_ethtool_ops;
memset(dev->broadcast, 0, ETH_ALEN);
} | cwe | CWE-264 | Unknown |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite (interfaces: Client)
// Package internal is a generated GoMock package.
package internal
import (
reflect "reflect"
gomock "github.com/golang/mock/gomock"
fosite "github.com/ory/fosite"
)
// MockClient is a mock of Client interface
type... | cwe | CWE-345 | Go |
/*
* Copyright 2000-2020 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | cwe | CWE-668 | Java |
def connect(self):
"""Override the Connect Method to fix the Certificate Verification."""
# Add certificate verification
conn = self._new_conn()
if getattr(self, '_tunnel_host', None):
# _tunnel_host was added in Python 2.6.3
# (See: http://hg.python.org/cpython/... | cwe | CWE-327 | Python |
public String accessToken(String username) {
Algorithm algorithm = Algorithm.HMAC256(SECRET);
return JWT.create()
.withExpiresAt(new Date(new Date().getTime() + ACCESS_EXPIRE_TIME))
.withIssuer(ISSUER)
.withClaim("username", username)
.sig... | cwe | CWE-20 | Java |
var isBuffer = require('is-buffer')
module.exports = flatten
flatten.flatten = flatten
flatten.unflatten = unflatten
function keyIdentity (key) {
return key
}
function flatten (target, opts) {
opts = opts || {}
const delimiter = opts.delimiter || '.'
const maxDepth = opts.maxDepth
const transformKey = opt... | cwe | CWE-1321 | JavaScript |
f_assert_fails(typval_T *argvars, typval_T *rettv)
{
char_u *cmd;
garray_T ga;
int save_trylevel = trylevel;
int called_emsg_before = called_emsg;
char *wrong_arg_msg = NULL;
char_u *tofree = NULL;
if (check_for_string_or_number_arg(argvars, 0) == FAIL
|| check_for_opt_string_or_list... | cwe | CWE-476 | C/C++ |
/*
* Copyright (C) 2017 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 |
/*
* 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-400 | Java |
package com.salesmanager.shop.store.controller.product.facade;
import org.springframework.web.multipart.MultipartFile;
import com.salesmanager.core.model.merchant.MerchantStore;
import com.salesmanager.core.model.reference.language.Language;
import com.salesmanager.shop.model.catalog.product.attribute.PersistableProd... | cwe | CWE-639 | Java |
static void* swoole_unserialize_arr(void *buffer, zval *zvalue, uint32_t nNumOfElements, long flag)
{
//Initialize zend array
zend_ulong h, nIndex, max_index = 0;
uint32_t size = cp_zend_hash_check_size(nNumOfElements);
if (!size)
{
return NULL;
}
if (!buffer)
{
php_error... | cwe | CWE-502 | Unknown |
CSSStyleSheet* CSSStyleSheet::CreateInline(Node& owner_node,
const KURL& base_url,
const TextPosition& start_position,
const WTF::TextEncoding& encoding) {
CSSParserContext* parser_contex... | cwe | CWE-200 | C/C++ |
char *pwcheck(userid, password)
char *userid;
char *password;
{
struct spwd *pwd;
pwd = getspnam(userid);
if (!pwd) {
return "Userid not found";
}
if (strcmp(pwd->sp_pwdp, crypt(password, pwd->sp_pwdp)) != 0) {
return "Incorrect password";
}
else {
return "OK";
}
} | cwe | CWE-189 | Unknown |
#! -*- coding: utf8 -*-
from setuptools import setup, find_packages
version = '1.7.dev0'
long_description = (
open('README.rst').read()
+ '\n' +
'Contributors\n'
'============\n'
+ '\n' +
open('CONTRIBUTORS.rst').read()
+ '\n' +
open('CHANGES.rst').read()
+ '\n')
setup(
name='... | cwe | CWE-79 | Python |
/* 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-476 | Python |
transform_cipher_param(struct rte_crypto_sym_xform *xform,
VhostUserCryptoSessionParam *param)
{
int ret;
ret = cipher_algo_transform(param->cipher_algo, &xform->cipher.algo);
if (unlikely(ret < 0))
return ret;
xform->type = RTE_CRYPTO_SYM_XFORM_CIPHER;
xform->cipher.key.length = param->cipher_key_len;
if (... | cwe | CWE-125 | Unknown |
int huft_build(b, n, s, d, e, t, m)
unsigned *b; /* code lengths in bits (all assumed <= BMAX) */
unsigned n; /* number of codes (assumed <= N_MAX) */
unsigned s; /* number of simple-valued codes (0..s-1) */
ush *d; /* list of base values for non-simple codes */
ush *e... | cwe | CWE-20 | Unknown |
public function getContent()
{
$html = '';
$request = HTTPRequest::instance();
$um = UserManager::instance();
$user = $um->getCurrentUser();
$vFunc = new Valid_WhiteList('docman_func', ['show_docman']);
$vFunc->required();
if ($request->valid($vFun... | cwe | CWE-79 | PHP |
function issuePopup(owner, repo, index, $element) {
$.get(`${AppSubUrl}/api/v1/repos/${owner}/${repo}/issues/${index}`, (issue) => {
const createdAt = new Date(issue.created_at).toLocaleDateString(undefined, {year: 'numeric', month: 'short', day: 'numeric'});
let body = issue.body.replace(/\n+/g, ' ');
i... | cwe | CWE-79 | JavaScript |
static ssize_t read_mem(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
phys_addr_t p = *ppos;
ssize_t read, sz;
void *ptr;
if (p != *ppos)
return 0;
if (!valid_phys_addr_range(p, count))
return -EFAULT;
read = 0;
#ifdef __ARCH_HAS_NO_PAGE_ZERO_MAPPED
/* we don't have page 0 mapped on... | cwe | CWE-200 | Unknown |
static int parse_line(char *str)
{
uint8_t array[256];
uint16_t value, pskey, length = 0;
char *off, *end;
pskey = strtol(str + 1, NULL, 16);
off = strstr(str, "=");
if (!off)
return -EIO;
off++;
while (1) {
value = strtol(off, &end, 16);
if (value == 0 && off == end)
break;
array[length++] = val... | cwe | CWE-119 | C/C++ |
/* -*-mode:c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/**
Copyright (c) 2006...2016, Matthias Stirner and HTW Aalen University
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1.... | cwe | CWE-190 | C/C++ |
bool FrameFetchContext::UpdateTimingInfoForIFrameNavigation(
ResourceTimingInfo* info) {
if (IsDetached())
return false;
if (!GetFrame()->Owner())
return false;
if (!GetFrame()->should_send_resource_timing_info_to_parent())
return false;
if (MasterDocumentLoader()->LoadType() == WebFrameLoadT... | cwe | CWE-200 | C/C++ |
/* jshint -W097 */
/* jshint strict: false */
/* jslint node: true */
'use strict';
const express = require('express');
const fs = require('fs');
const path = require('path');
const utils = require('@iobroker/adapter-core'); // Get common adapter utils
const LE = require(utils.contro... | cwe | CWE-79 | JavaScript |
read_and_display_attr_value (unsigned long attribute,
unsigned long form,
dwarf_signed_vma implicit_const,
unsigned char * start,
unsigned char * data,
unsigned char * end,
dwarf_vma cu_offset,
dwarf... | cwe | CWE-269 | Unknown |
ssize_t nbd_wr_syncv(QIOChannel *ioc,
struct iovec *iov,
size_t niov,
size_t length,
bool do_read)
{
ssize_t done = 0;
Error *local_err = NULL;
struct iovec *local_iov = g_new(struct iovec, niov);
struct iovec *local_iov... | cwe | CWE-20 | C/C++ |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2005-2022
* All rights reserved
*
* This file is part of GPAC / common tools sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser Gener... | cwe | CWE-476 | C/C++ |
// @flow
// A database adapter that works with data exported from the hosted
// Parse database.
// @flow-disable-next
import { Parse } from 'parse/node';
// @flow-disable-next
import _ from 'lodash';
// @flow-disable-next
import intersect from 'intersect';
// @flow-disable-next
import deepcopy from 'deepcopy';
import... | cwe | CWE-74 | JavaScript |
huff_get_next_word(Jbig2HuffmanState *hs, int offset)
{
uint32_t word = 0;
Jbig2WordStream *ws = hs->ws;
if ((ws->get_next_word(ws, offset, &word)) && ((hs->offset_limit == 0) || (offset < hs->offset_limit)))
hs->offset_limit = offset;
return word;
} | cwe | CWE-119 | C/C++ |
function _makeGetter( property, next ){
if (next){
return function getter( obj ){
try {
return next( obj[property] );
}catch( ex ){
return undefined;
}
};
}else{
return function getter( obj ){
try {
return obj[property];
} catch(ex){
return undefined;
}
};
}
} | cwe | CWE-1321 | JavaScript |
bool IDNSpoofChecker::SafeToDisplayAsUnicode(base::StringPiece16 label,
bool is_tld_ascii) {
UErrorCode status = U_ZERO_ERROR;
int32_t result =
uspoof_check(checker_, label.data(),
base::checked_cast<int32_t>(label.size()), NULL, &status);
if (... | cwe | CWE-20 | C/C++ |
# -*- coding: utf-8 -*-
# Copyright 2015, 2016 OpenMarket Ltd
#
# 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-79 | Python |
OMX_ERRORTYPE SoftMPEG4Encoder::internalGetParameter(
OMX_INDEXTYPE index, OMX_PTR params) {
switch (index) {
case OMX_IndexParamVideoBitrate:
{
OMX_VIDEO_PARAM_BITRATETYPE *bitRate =
(OMX_VIDEO_PARAM_BITRATETYPE *) params;
if (bitRate->nPortIndex != 1) {
... | cwe | CWE-119 | C/C++ |
/*
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2002-2018, Open Source Geospatial Foundation (OSGeo)
*
* 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 ... | cwe | CWE-89 | Java |
'use strict'
function _process (v, mod) {
var i
var r
if (typeof mod === 'function') {
r = mod(v)
if (r !== undefined) {
v = r
}
} else if (Array.isArray(mod)) {
for (i = 0; i < mod.length; i++) {
r = mod[i](v)
if (r !== undefined) {
v = r
}
}
}
return ... | cwe | CWE-74 | JavaScript |
def main():
global logger
result = 0
parser = argparse.ArgumentParser(description='Keycloak REST client',
prog=prog_name,
epilog=verbose_help.format(prog_name=prog_name),
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argume... | cwe | CWE-377 | Python |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2018-2023
* All rights reserved
*
* This file is part of GPAC / MPEG-DASH/HLS segmenter
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser Gene... | cwe | CWE-252 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.