code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
package com.salesmanager.shop.admin.model.permission;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPrope... | cwe | CWE-79 | Java |
void set_fat(DOS_FS * fs, uint32_t cluster, int32_t new)
{
unsigned char *data = NULL;
int size;
loff_t offs;
if (new == -1)
new = FAT_EOF(fs);
else if ((long)new == -2)
new = FAT_BAD(fs);
switch (fs->fat_bits) {
case 12:
data = fs->fat + cluster * 3 / 2;
offs = fs->fat_start + cluster ... | cwe | CWE-189 | C/C++ |
// 2、答案。
const answers = map(item.answers, (value, index) =>
{
// 没有作者图片时隐藏。
const classesAvatar = cs(
"avatar",
{
"hide": isEmpty(value.avatar)
}
);
... | cwe | CWE-200 | JavaScript |
// Warning: The author still knows nothing about javascript!
// params:
// type: subject type
const got = require('@/utils/got'); // get web content
const cheerio = require('cheerio'); // html parser
const get_article = require('./_article');
module.exports = async (ctx) => {
const type = ctx.params.type ?? 'www... | cwe | CWE-918 | JavaScript |
static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
{
zval *id;
xmlDoc *docp;
dom_object *intern;
char *source = NULL, *valid_file = NULL;
int source_len = 0;
xmlSchemaParserCtxtPtr parser;
xmlSchemaPtr sptr;
xmlSchemaValidCtxtPtr vptr;
int ... | cwe | CWE-20 | Unknown |
void giveup_all(struct task_struct *tsk)
{
unsigned long usermsr;
if (!tsk->thread.regs)
return;
usermsr = tsk->thread.regs->msr;
if ((usermsr & msr_all_available) == 0)
return;
msr_check_and_set(msr_all_available);
check_if_tm_restore_required(tsk);
WARN_ON((usermsr & MSR_VSX) && !((usermsr & MSR_FP) &... | cwe | CWE-862 | C/C++ |
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS... | cwe | CWE-74 | Java |
static unsigned long get_seg_limit(struct pt_regs *regs, int seg_reg_idx)
{
struct desc_struct *desc;
unsigned long limit;
short sel;
sel = get_segment_selector(regs, seg_reg_idx);
if (sel < 0)
return 0;
if (user_64bit_mode(regs) || v8086_mode(regs))
return -1L;
if (!sel)
return 0;
desc = get_desc(sel... | cwe | CWE-362 | Unknown |
std::string PrintPreviewUI::GetPrintPreviewUIAddress() const {
char preview_ui_addr[2 + (2 * sizeof(this)) + 1];
base::snprintf(preview_ui_addr, sizeof(preview_ui_addr), "%p", this);
return preview_ui_addr;
} | cwe | CWE-200 | C/C++ |
CharArray(int len) {
buf = new char[len]();
} | cwe | CWE-787 | C/C++ |
App.Actions.WEB.update_ftp_path_hint = function(elm, hint) {
if (hint.trim() == '') {
$(elm).parent().find('.v-ftp-path-hint').html('');
}
if (hint[0] != '/') {
hint = '/' + hint;
}
hint = hint.replace(/\/(\/+)/g, '/');
$(elm).parent().find('.v-ftp-path-hint').text(hint);
} | cwe | CWE-79 | JavaScript |
int jpc_atoaf(char *s, int *numvalues, double **values)
{
static char delim[] = ", \t\n";
char buf[4096];
int n;
double *vs;
char *cp;
strncpy(buf, s, sizeof(buf));
buf[sizeof(buf) - 1] = '\0';
n = 0;
if ((cp = strtok(buf, delim))) {
++n;
while ((cp = strtok(0, delim))) {
if (cp != '\0') {
++n;
... | cwe | CWE-189 | Unknown |
static int b_unpack (lua_State *L) {
Header h;
const char *fmt = luaL_checkstring(L, 1);
size_t ld;
const char *data = luaL_checklstring(L, 2, &ld);
size_t pos = luaL_optinteger(L, 3, 1) - 1;
int n = 0; /* number of results */
defaultoptions(&h);
while (*fmt) {
int opt = *fmt++;
size_t ... | cwe | CWE-190 | C/C++ |
function ze(t,e,i){We(t,e,i),(qi||Yi)&&setTimeout(function(){We(t,e,i)},0)} | cwe | CWE-79 | JavaScript |
define([
'./summary-widget.html',
'@braintree/sanitize-url'
], function (
summaryWidgetTemplate,
urlSanitizeLib
) {
const WIDGET_ICON_CLASS = 'c-sw__icon js-sw__icon';
function SummaryWidgetView(domainObject, openmct) {
this.openmct = openmct;
this.domainObject = domainObject;
... | cwe | CWE-79 | JavaScript |
static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define RMT_EQUAL_RGB 1
#define RMT_NONE 0
#define RMT_RAW 2
#define RT_STANDARD 1
#define RT_ENCODED 2
#define RT_FORMAT_RGB 3
typedef struct _SUNInfo
{
unsigned int
magic,
width,
height,
depth,
... | cwe | CWE-125 | Unknown |
this.verifyWithMessage = (signed, message, password = null) => {
if(signed == null) {
throw "tEnvoyNaClSigningKey Fatal Error: argument signed of method verifyWithMessage is required and does not have a default value.";
}
if(message == null) {
throw "tEnvoyNaClSigningKey Fatal Error: argument message of met... | cwe | CWE-347 | JavaScript |
static void llc_cmsg_rcv(struct msghdr *msg, struct sk_buff *skb)
{
struct llc_sock *llc = llc_sk(skb->sk);
if (llc->cmsg_flags & LLC_CMSG_PKTINFO) {
struct llc_pktinfo info;
info.lpi_ifindex = llc_sk(skb->sk)->dev->ifindex;
llc_pdu_decode_dsap(skb, &info.lpi_sap);
llc_pdu_decode_da(skb, info.lpi_mac)... | cwe | CWE-200 | C/C++ |
/* 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-20 | Python |
// Copyright Istio 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 agreed to in wri... | cwe | CWE-863 | Go |
static int cgw_remove_job(struct sk_buff *skb, struct nlmsghdr *nlh)
{
struct cgw_job *gwj = NULL;
struct hlist_node *nx;
struct rtcanmsg *r;
struct cf_mod mod;
struct can_can_gw ccgw;
u8 limhops = 0;
int err = 0;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
if (nlmsg_len(nlh) < sizeof(*r))
return -EINVAL... | cwe | CWE-264 | Unknown |
(function() {
'use strict';
exports.version = '3.0.0';
var isEqual = require('lodash.isequal');
var filterd = require('lodash.filter');
var clonedeep = require('lodash.clonedeep');
var matches = require('lodash.matches');
function RuleEngine(rules, options) {
this.init();
i... | cwe | CWE-74 | JavaScript |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
auto* params =
reinterpret_cast<TfLiteSpaceToDepthParams*>(node->builtin_data);
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
#define TF_LITE_SPACE_TO_DEPTH(ty... | cwe | CWE-787 | C/C++ |
function peg$computePosDetails(pos) {
function advance(details, startPos, endPos) {
var p, ch;
for (p = startPos; p < endPos; p++) {
ch = input.charAt(p);
if (ch === "\n") {
if (!details.seenCR) { details.line++; }
details.column = 1;
detail... | cwe | CWE-1321 | JavaScript |
/* 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-131 | Python |
static int get_server_verify(SSL *s)
{
unsigned char *p;
int i, n, len;
p=(unsigned char *)s->init_buf->data;
if (s->state == SSL2_ST_GET_SERVER_VERIFY_A)
{
i=ssl2_read(s,(char *)&(p[s->init_num]),1-s->init_num);
if (i < (1-s->init_num))
return(ssl2_part_read(s,SSL_F_GET_SERVER_VERIFY,i));
s->init_num... | cwe | CWE-310 | Unknown |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
#include <errno.h>
#include <inttypes.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/queue.h>
#include "lsquic.h"
#include "lsquic_types.h"
#include "lsquic_int_types.h"
#include "lsquic_xxhash.h... | cwe | CWE-476 | C/C++ |
static int check_submodule_url(const char *url)
{
const char *curl_url;
if (looks_like_command_line_option(url))
return -1;
if (submodule_url_is_relative(url)) {
/*
* This could be appended to an http URL and url-decoded;
* check for malicious characters.
*/
char *decoded = url_decode(url);
int ha... | cwe | CWE-522 | Unknown |
void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a)
{
BN_ULONG t[8];
bn_sqr_normal(r,a,4,t);
} | cwe | CWE-310 | Unknown |
OMX_ERRORTYPE SoftVideoDecoderOMXComponent::internalSetParameter(
OMX_INDEXTYPE index, const OMX_PTR params) {
const int32_t indexFull = index;
switch (indexFull) {
case OMX_IndexParamStandardComponentRole:
{
const OMX_PARAM_COMPONENTROLETYPE *roleParams =
(const OMX_PARAM_CO... | cwe | CWE-119 | C/C++ |
/**
* Copyright (c) 2008, SnakeYAML
*
* 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... | cwe | CWE-400 | Java |
/* 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-824 | Python |
void do_connect(struct st_command *command)
{
int con_port= opt_port;
char *con_options;
my_bool con_ssl= 0, con_compress= 0;
my_bool con_pipe= 0, con_shm= 0, con_cleartext_enable= 0;
my_bool con_secure_auth= 1;
struct st_connection* con_slot;
static DYNAMIC_STRING ds_connection_name;
static DYNAMIC_ST... | cwe | CWE-284 | Unknown |
static function lookupByUsername($username) {
if (strpos($username, '@') !== false)
$user = static::lookup(array('user__emails__address'=>$username));
else
$user = static::lookup(array('username'=>$username));
return $user;
} | cwe | CWE-89 | PHP |
/**
* Copyright (c) 2006-2017, JGraph Ltd
* Copyright (c) 2006-2017, Gaudenz Alder
*/
(function()
{
if (typeof html4 !== 'undefined')
{
/**
* Enables paste from Lucidchart
*/
html4.ATTRIBS['span::data-lucid-content'] = 0;
html4.ATTRIBS['span::data-lucid-type'] = 0;
/**
* Enables custom fonts in... | cwe | CWE-79 | JavaScript |
static u32 __ipv6_select_ident(struct net *net, u32 hashrnd,
const struct in6_addr *dst,
const struct in6_addr *src)
{
u32 hash, id;
hash = __ipv6_addr_jhash(dst, hashrnd);
hash = __ipv6_addr_jhash(src, hash);
hash ^= net_hash_mix(net);
/* Treat id of 0 as unset and if we get 0 back fr... | cwe | CWE-326 | C/C++ |
/**
* Copyright (c) 2006-2017, JGraph Ltd
* Copyright (c) 2006-2017, Gaudenz Alder
*/
(function()
{
if (typeof html4 !== 'undefined')
{
/**
* Enables paste from Lucidchart
*/
html4.ATTRIBS['span::data-lucid-content'] = 0;
html4.ATTRIBS['span::data-lucid-type'] = 0;
/**
* Enables custom fonts in... | cwe | CWE-79 | JavaScript |
int rose_route_frame(struct sk_buff *skb, ax25_cb *ax25)
{
struct rose_neigh *rose_neigh, *new_neigh;
struct rose_route *rose_route;
struct rose_facilities_struct facilities;
rose_address *src_addr, *dest_addr;
struct sock *sk;
unsigned short frametype;
unsigned int lci, new_lci;
unsigned char cause, diagnostic... | cwe | CWE-20 | Unknown |
void DevToolsAgentHost::DetachAllClients() {
if (!g_devtools_instances.IsCreated())
return;
DevToolsMap copy = g_devtools_instances.Get();
for (DevToolsMap::iterator it(copy.begin()); it != copy.end(); ++it) {
DevToolsAgentHostImpl* agent_host = it->second;
agent_host->ForceDetachAllClients();
... | cwe | CWE-20 | C/C++ |
static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
BDRVParallelsState *s = bs->opaque;
int i;
struct parallels_header ph;
int ret;
bs->read_only = 1; // no write support yet
ret = bdrv_pread(bs->file, 0, &ph, sizeof(ph));
if... | cwe | CWE-190 | Unknown |
function getUserPartForHeader() {
global $i18n;
if (!$this->id) return null;
$user_part = htmlspecialchars($this->name);
$user_part .= ' - '.htmlspecialchars($this->role_name);
if ($this->behalf_id) {
$user_part .= ' <span class="onBehalf">'.$i18n->get('label.on_behalf').' '.htmlspecialchars(... | cwe | CWE-79 | PHP |
gray_render_span( int y,
int count,
const FT_Span* spans,
PWorker worker )
{
unsigned char* p;
FT_Bitmap* map = &worker->target;
/* first of all, compute the scanline offset */
p = (unsigned char*)ma... | cwe | CWE-190 | C/C++ |
def terminate_connection(self, volume, connector, **kwargs):
"""Cleanup after an iSCSI connection has been terminated.
When we clean up a terminated connection between a given connector
and volume, we:
1. Translate the given connector to a host name
2. Remove the volume-to-host ... | cwe | CWE-78 | Python |
$this->AddValidationError($prop, "$prop exceeds the maximum length of " . $fm->FieldSize . "");
}
if ($this->$prop == "" && ($fm->DefaultValue || $fm->IsAutoInsert)) {
// these fields are auto-populated so we don't need to validate them unless
// ... | cwe | CWE-639 | PHP |
skip_short_body (int fd, wgint contlen, bool chunked)
{
enum {
SKIP_SIZE = 512, /* size of the download buffer */
SKIP_THRESHOLD = 4096 /* the largest size we read */
};
wgint remaining_chunk_size = 0;
char dlbuf[SKIP_SIZE + 1];
dlbuf[SKIP_SIZE] = '\0'; /* so DEBUGP can sa... | cwe | CWE-119 | Unknown |
build_model(XML_Parser parser) {
DTD *const dtd = parser->m_dtd; /* save one level of indirection */
XML_Content *ret;
XML_Content *cpos;
XML_Char *str;
/* Detect and prevent integer overflow.
* The preprocessor guard addresses the "always false" warning
* from -Wtype-limits on platforms where
* siz... | cwe | CWE-703 | Unknown |
bool AES_GCM_EncryptContext::Encrypt(
const void *pPlaintextData, size_t cbPlaintextData,
const void *pIV,
void *pEncryptedDataAndTag, uint32 *pcbEncryptedDataAndTag,
const void *pAdditionalAuthenticationData, size_t cbAuthenticationData
) {
unsigned long long pcbEncryptedDataAndTag_longlong = *pcbEncryptedData... | cwe | CWE-120 | C/C++ |
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String encoding = request.getHeader("Accept-Encoding");
boolean supportsGzip = (encoding != null && encoding.toLowerCase().indexOf("gzip") > -1);
SessionTerminal st = (SessionTe... | cwe | CWE-287 | JavaScript |
public void testAddAndGetUser() throws Exception {
JpaUser user = createUserWithRoles(org1, "user1", "ROLE_ASTRO_101_SPRING_2011_STUDENT");
provider.addUser(user);
User loadUser = provider.loadUser("user1");
assertNotNull(loadUser);
assertEquals(user.getUsername(), loadUser.getUsername());
ass... | cwe | CWE-327 | Java |
static void parse_cfg(int flags, int argc, const char **argv, cfg_t *cfg) {
int i;
memset(cfg, 0, sizeof(cfg_t));
cfg->debug_file = stderr;
for (i = 0; i < argc; i++) {
if (strncmp(argv[i], "max_devices=", 12) == 0)
sscanf(argv[i], "max_devices=%u", &cfg->max_devs);
if (strcmp(argv[i], "manual") ... | cwe | CWE-200 | Unknown |
"""Object level permissions."""
from django.contrib.auth.models import Group, Permission
from django.contrib.contenttypes.models import ContentType
from modoboa.core import constants as core_constants, signals as core_signals
from modoboa.core.models import ObjectAccess, User
def get_account_roles(user, account=Non... | cwe | CWE-285 | Python |
# -*- coding: utf-8 -*-
from captcha import fields
from django import forms
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import PasswordResetForm as DjangoPasswordResetForm
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.t... | cwe | CWE-770 | Python |
static void rds_tcp_kill_sock(struct net *net)
{
struct rds_tcp_connection *tc, *_tc;
LIST_HEAD(tmp_list);
struct rds_tcp_net *rtn = net_generic(net, rds_tcp_netid);
struct socket *lsock = rtn->rds_tcp_listen_sock;
rtn->rds_tcp_listen_sock = NULL;
rds_tcp_listen_stop(lsock, &rtn->rds_tcp_accept_w);
spin_lock_ir... | cwe | CWE-416 | C/C++ |
WandPrivate void CLINoImageOperator(MagickCLI *cli_wand,
const char *option,const char *arg1n,const char *arg2n)
{
const char /* percent escaped versions of the args */
*arg1,
*arg2;
#define _image_info (cli_wand->wand.image_info)
#define _images (cli_wand->wand.images)
#define _exception ... | cwe | CWE-617 | C/C++ |
test func()
}{
{
"params disabled",
func() {
params := suite.app.ClaimsKeeper.GetParams(suite.ctx)
params.EnableClaims = false
suite.app.ClaimsKeeper.SetParams(suite.ctx, params)
resAck := suite.app.ClaimsKeeper.OnRecvPacket(suite.ctx, mockpacket, ack)
suite.Require().Equal(ack, resAck)
... | cwe | CWE-287 | Go |
TPMI_RH_PLATFORM_Unmarshal(TPMI_RH_PLATFORM *target, BYTE **buffer, INT32 *size)
{
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_PLATFORM:
break;
default:
rc = TPM... | cwe | CWE-787 | Unknown |
function getNotes() {
global $user, $db;
/* The global constants can be overriden by passing appropriate params */
//sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet
$require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIR... | cwe | CWE-89 | PHP |
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache... | cwe | CWE-91 | Java |
#include "source/common/http/conn_manager_impl.h"
#include <cstdint>
#include <functional>
#include <list>
#include <memory>
#include <string>
#include <vector>
#include "envoy/buffer/buffer.h"
#include "envoy/common/time.h"
#include "envoy/event/dispatcher.h"
#include "envoy/event/scaled_range_timer_manager.h"
#incl... | cwe | CWE-416 | C/C++ |
// Copyright 2005-2019 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
#include "mumble_pch.hpp"
#include "ConnectDialog.h"
#ifdef USE_B... | cwe | CWE-59 | C/C++ |
/*
* libcaca Colour ASCII-Art library
* Copyright © 2002—2018 Sam Hocevar <sam@hocevar.net>
* All Rights Reserved
*
* This library is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the ... | cwe | CWE-190 | C/C++ |
/*
* Driver for IMS Passenger Control Unit Devices
*
* Copyright (C) 2013 The IMS Company
*
* 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 Software Foundation.
*/
#include <linux/completion.h>
#i... | cwe | CWE-125 | C/C++ |
int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
{
void *pgdir;
unsigned long vsid;
struct mm_struct *mm;
pte_t *ptep;
cpumask_t tmp;
int rc, user_region = 0, local = 0;
int psize;
DBG_LOW("hash_page(ea=%016lx, access=%lx, trap=%lx\n",
ea, access, trap);
if ((ea & ~REGION_MASK) >= ... | cwe | CWE-200 | Unknown |
this.disableNewChatSoundAdmin = function(inst)
{
if (inst.prop('tagName') != 'I') {
inst = inst.find('> i.material-icons');
}
if (inst.text() == 'volume_off'){
$.get(this.wwwDir+ 'user/setsettingajax/new_chat_sound/1');
confLH.new_chat_sound_enabled = 1;
inst.tex... | cwe | CWE-352 | JavaScript |
void Compute(OpKernelContext* context) override {
const Tensor& input = context->input(0);
const TensorShape& input_shape = input.shape();
const Tensor& out_backprop = context->input(2);
const TensorShape& out_backprop_shape = out_backprop.shape();
TensorShape filter_shape;
if (takes_shape_) {... | cwe | CWE-20 | Unknown |
/*! git-pull-or-clone. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
module.exports = gitPullOrClone
const crossSpawn = require('cross-spawn')
const debug = require('debug')('git-pull-or-clone')
const fs = require('fs')
function gitPullOrClone (url, outPath, opts, cb) {
if (typeof opts === 'fu... | cwe | CWE-77 | JavaScript |
void CLASS parse_minolta(int base)
{
int save, tag, len, offset, high = 0, wide = 0, i, c;
short sorder = order;
fseek(ifp, base, SEEK_SET);
if (fgetc(ifp) || fgetc(ifp) - 'M' || fgetc(ifp) - 'R')
return;
order = fgetc(ifp) * 0x101;
offset = base + get4() + 8;
while ((save = ftell(ifp)) < offset)
{... | cwe | CWE-703 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-416 | C/C++ |
/*
Copyright (c) 2009 Dave Gamble
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distr... | cwe | CWE-125 | C/C++ |
from __future__ import annotations
import time
import uuid
from datetime import timedelta as td
from secrets import token_urlsafe
from urllib.parse import urlparse
import pyotp
import segno
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import authenticate
from django.co... | cwe | CWE-200 | Python |
static s32 gf_media_vvc_read_pps_bs_internal(GF_BitStream *bs, VVCState *vvc)
{
u32 i;
s32 pps_id;
VVC_PPS *pps;
//NAL header already read
pps_id = gf_bs_read_int_log(bs, 6, "pps_id");
if ((pps_id < 0) || (pps_id >= 64)) {
GF_LOG(GF_LOG_ERROR, GF_LOG_CODING, ("[VVC] wrong PPS ID %d in PPS\n", pps_id));
retu... | cwe | CWE-190 | C/C++ |
def process_vote(target,action,chan,mask,db,notice,conn):
if ' ' in target:
notice('Invalid nick')
return
try: votes2kick = database.get(db,'channels','votekick','chan',chan)
except: votes2kick = 10
try: votes2ban = database.get(db,'channels','voteban','chan',chan)
except: votes2ba... | cwe | CWE-89 | Python |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "hermes/VM/detail/IdentifierHashTable.h"
#include "hermes/VM/StringPrimitive.h"
using namespace hermes::vm::detail;
//... | cwe | CWE-190 | 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 |
/*
* INET An implementation of the TCP/IP protocol suite for the LINUX
* operating system. INET is implemented using the BSD Socket
* interface as the means of communication with the user level.
*
* Implementation of the Transmission Control Protocol(TCP).
*
* Authors: Ross Biro
* Fred N. van Kempen, <wa... | cwe | CWE-399 | C/C++ |
@app.route('/summary', methods=['GET'])
def summary():
if 'username' in session:
conn = mysql.connect()
cursor = conn.cursor()
#select the maximum score from the results table
cursor.execute("SELECT courseConcentration FROM results WHERE total = (SELECT MAX(total) FROM (SELECT * FROM results WHERE courseId >... | cwe | CWE-89 | Python |
void h2_task_redo(h2_task *task)
{
task->rst_error = 0;
} | cwe | CWE-770 | Unknown |
void ContextImpl::CreateFrame(
fidl::InterfaceHandle<chromium::web::FrameObserver> observer,
fidl::InterfaceRequest<chromium::web::Frame> frame_request) {
auto web_contents = content::WebContents::Create(
content::WebContents::CreateParams(browser_context_, nullptr));
frame_bindings_.AddBinding(
... | cwe | CWE-264 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-119 | C/C++ |
int ConnectionImpl::StreamImpl::onDataSourceSend(const uint8_t* framehd, size_t length) {
// In this callback we are writing out a raw DATA frame without copying. nghttp2 assumes that we
// "just know" that the frame header is 9 bytes.
// https://nghttp2.org/documentation/types.html#c.nghttp2_send_data_callback
... | cwe | CWE-400 | Unknown |
static XmlSchema createSchemaInstance(ThreadContext context, RubyClass klazz, Source source) {
Ruby runtime = context.getRuntime();
XmlSchema xmlSchema = (XmlSchema) NokogiriService.XML_SCHEMA_ALLOCATOR.allocate(runtime, klazz);
xmlSchema.setInstanceVariable("@errors", runtime.newEmptyArray());
... | cwe | CWE-611 | C/C++ |
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs)
throws IOException {
Path relativeDir = source.relativize(dir);
final Path dirToCreate = Paths.get(destDir.toString(), relativeDir.toString());
if(!dirToCreate.toFile().exists()) {
Files.createDirectory(dirToCreate... | cwe | CWE-22 | Java |
Auth.verifyToken = async function (token, done) {
let { tokens = [] } = await meta.settings.get('core.api');
tokens = tokens.reduce((memo, cur) => {
memo[cur.token] = cur.uid;
return memo;
}, {});
const uid = tokens[token];
if (uid !== undefined) {
if (parseInt(uid, 10) > 0) {
done(null, {
uid: uid,... | cwe | CWE-287 | JavaScript |
ins_compl_next_buf(buf_T *buf, int flag)
{
static win_T *wp = NULL;
if (flag == 'w') // just windows
{
if (buf == curbuf || wp == NULL) // first call for this flag/expansion
wp = curwin;
while ((wp = (wp->w_next != NULL ? wp->w_next : firstwin)) != curwin
&& wp->w_buffer->b_scanned)
;
buf ... | cwe | CWE-416 | Unknown |
/* curve25519-x.c
Copyright (C) 2014 Niels Möller
This file is part of GNU Nettle.
GNU Nettle is free software: you can redistribute it and/or
modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the Li... | cwe | CWE-327 | C/C++ |
# Generated by Django 3.0.7 on 2021-04-03 18:37
import InvenTree.fields
import company.models
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import markdownx.models
import stdimage.models
class Migration(migrations.Migration):
dependencies = [
('c... | cwe | CWE-400 | Python |
package com.salesmanager.shop.admin.controller.categories;
import java.util.*;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.... | cwe | CWE-79 | Java |
function createCaptionElement(caption, isAudioDescription) {
var captionElement = document.createElement('div');
$(captionElement).addClass('captions');
if(isAudioDescription) {
$(captionElement).addClass('audio-description');
}
$(captionElement).addClass(caption.css... | cwe | CWE-79 | JavaScript |
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* 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.apach... | cwe | CWE-287 | Java |
var FileList={
useUndo:true,
update:function(fileListHtml) {
$('#fileList').empty().html(fileListHtml);
},
addFile:function(name,size,lastModified,loading,hidden){
var basename, extension, simpleSize, sizeColor, lastModifiedTime, modifiedColor,
img=(loading)?OC.imagePath('core', 'loading.gif'):OC.imagePath('... | cwe | CWE-79 | JavaScript |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* Based on Google code released under BSD license here:
* https://groups.google.com/forum/#!topic/bbr-dev/3RTgkzi5ZD8
*/
/*
* Copyright 2017, Google Inc.
*
* Use of this source code is governed by the following BSD-style license:
*
... | cwe | CWE-476 | C/C++ |
static apr_status_t parse_chunk_size(http_ctx_t *ctx, const char *buffer,
apr_size_t len, int linelimit)
{
apr_size_t i = 0;
while (i < len) {
char c = buffer[i];
ap_xlate_proto_from_ascii(&c, 1);
/* handle CRLF after the chunk */
if (ctx->state == BODY_CHUNK_END) {
... | cwe | CWE-20 | C/C++ |
"use strict";
var exec = require("child_process").exec;
var fs = require("fs");
var flag = "--exists";
// Normally |pkg-config opencv ...| could report either OpenCV 2.x or OpenCV 3.y
// depending on what is installed. To enable both 2.x and 3.y to co-exist on
// the same machine, the opencv.pc for 3.y can be instal... | cwe | CWE-78 | JavaScript |
self.init(light: color, dark: color)
}
}
extension UIColor {
static func from(scheme: ColorSchemeColor, variant: ColorSchemeVariant? = nil) -> UIColor {
return ColorScheme.default.color(named: scheme, variant: variant)
}
/// Creates UIColor instance with color corresponding to @p accentColor ... | cwe | CWE-617 | Swift |
find_ex_command(
exarg_T *eap,
int *full UNUSED,
int (*lookup)(char_u *, size_t, int cmd, cctx_T *) UNUSED,
cctx_T *cctx UNUSED)
{
int len;
char_u *p;
int i;
#ifndef FEAT_EVAL
int vim9 = FALSE;
#else
int vim9 = in_vim9script();
/*
* Recognize a Vim9 script function/method call and ... | cwe | CWE-125 | C/C++ |
/* Copyright (C) 2007-2016 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY... | cwe | CWE-74 | C/C++ |
ssize_t nbd_receive_reply(QIOChannel *ioc, NBDReply *reply)
{
uint8_t buf[NBD_REPLY_SIZE];
uint32_t magic;
ssize_t ret;
ret = read_sync(ioc, buf, sizeof(buf));
if (ret < 0) {
return ret;
}
if (ret != sizeof(buf)) {
LOG("read failed");
return -EINVAL;
}
... | cwe | CWE-20 | C/C++ |
TEST_F(QuantizedConv2DTest, OddPaddingBatch) {
const int stride = 2;
TF_ASSERT_OK(NodeDefBuilder("quantized_conv_op", "QuantizedConv2D")
.Input(FakeInput(DT_QUINT8))
.Input(FakeInput(DT_QUINT8))
.Input(FakeInput(DT_FLOAT))
.Input(FakeInput(... | cwe | CWE-476 | Unknown |
int ptrace_get_fpr(struct task_struct *child, int index, unsigned long *data)
{
#ifdef CONFIG_PPC_FPU_REGS
unsigned int fpidx = index - PT_FPR0;
#endif
if (index > PT_FPSCR)
return -EIO;
#ifdef CONFIG_PPC_FPU_REGS
flush_fp_to_thread(child);
if (fpidx < (PT_FPSCR - PT_FPR0))
memcpy(data, &child->thread.TS_FPR(... | cwe | CWE-284 | Unknown |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-122 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.