code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
def markPageAsSeen(pageId: PageId): Action[JsValue] = PostJsonAction(NoRateLimits, maxBytes = 2) {
request =>
val watchbar = request.dao.getOrCreateWatchbar(request.theUserId)
val newWatchbar = watchbar.markPageAsSeen(pageId)
request.dao.saveWatchbar(request.theUserId, newWatchbar)
Ok
}
pr... | cwe | CWE-613 | Scala |
static const struct usb_cdc_union_desc *
ims_pcu_get_cdc_union_desc(struct usb_interface *intf)
{
const void *buf = intf->altsetting->extra;
size_t buflen = intf->altsetting->extralen;
struct usb_cdc_union_desc *union_desc;
if (!buf) {
dev_err(&intf->dev, "Missing descriptor data\n");
return NULL;
}
if (!bu... | cwe | CWE-125 | Unknown |
void rds6_inc_info_copy(struct rds_incoming *inc,
struct rds_info_iterator *iter,
struct in6_addr *saddr, struct in6_addr *daddr,
int flip)
{
struct rds6_info_message minfo6;
minfo6.seq = be64_to_cpu(inc->i_hdr.h_sequence);
minfo6.len = be32_to_cpu(inc->i_hdr.h_len);
if (flip) {
minfo6.laddr = *d... | cwe | CWE-200 | C/C++ |
def initHeader(self):
"""Initialize the IP header according to the IP format definition.
"""
# Ethernet header
# Retrieve remote MAC address
dstMacAddr = arpreq.arpreq(self.remoteIP)
if dstMacAddr is not None:
dstMacAddr = dstMacAddr.replace(':', '')
... | cwe | CWE-78 | Python |
static void recovery_abort(void) {
if (!dry_run) {
storage_reset();
}
awaiting_character = false;
memzero(mnemonic, sizeof(mnemonic));
memzero(cipher, sizeof(cipher));
} | cwe | CWE-354 | Unknown |
static RzList *classes_from_symbols(RzBinFile *bf) {
RzBinSymbol *sym;
RzListIter *iter;
rz_list_foreach (bf->o->symbols, iter, sym) {
if (sym->name[0] != '_') {
continue;
}
const char *cn = sym->classname;
if (cn) {
RzBinClass *c = rz_bin_file_add_class(bf, sym->classname, NULL, 0);
if (!c) {
c... | cwe | CWE-200 | Unknown |
smb2_ioctl_query_info(const unsigned int xid,
struct cifs_tcon *tcon,
struct cifs_sb_info *cifs_sb,
__le16 *path, int is_dir,
unsigned long p)
{
struct iqi_vars *vars;
struct smb_rqst *rqst;
struct kvec *rsp_iov;
struct cifs_ses *ses = tcon->ses;
struct TCP_Server_Info *server = cif... | cwe | CWE-476 | Unknown |
jbig2_sd_release(Jbig2Ctx *ctx, Jbig2SymbolDict *dict)
{
int i;
if (dict == NULL)
return;
for (i = 0; i < dict->n_symbols; i++)
if (dict->glyphs[i])
jbig2_image_release(ctx, dict->glyphs[i]);
jbig2_free(ctx->allocator, dict->glyphs);
jbig2_free(ctx->allocator, dict);... | cwe | CWE-119 | C/C++ |
/*
** codegen.c - mruby code generator
**
** See Copyright Notice in mruby.h
*/
#include <mruby.h>
#include <mruby/compile.h>
#include <mruby/proc.h>
#include <mruby/dump.h>
#include <mruby/numeric.h>
#include <mruby/string.h>
#include <mruby/debug.h>
#include <mruby/presym.h>
#include "node.h"
#include <mruby/opcode.... | cwe | CWE-125 | C/C++ |
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unl... | cwe | CWE-91 | Java |
function vT(){vT=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.definePropert... | cwe | CWE-284 | JavaScript |
validate_cursor(void)
{
check_cursor_moved(curwin);
if ((curwin->w_valid & (VALID_WCOL|VALID_WROW)) != (VALID_WCOL|VALID_WROW))
curs_columns(TRUE);
} | cwe | CWE-416 | Unknown |
/*jshint node:true*/
"use strict";
var exec = require("child_process").exec;
function runCommand(command, args, done) {
if(typeof args === "function") {
done = args;
args = "";
}
exec("p4 " + command + " " + (args || ""), function(err, stdOut, stdErr) {
if(err) return done(err);
... | cwe | CWE-77 | JavaScript |
static int route_doit(struct sk_buff *skb, struct nlmsghdr *nlh)
{
struct net *net = sock_net(skb->sk);
struct nlattr *tb[RTA_MAX+1];
struct net_device *dev;
struct rtmsg *rtm;
int err;
u8 dst;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
ASSERT_RTNL();
err =... | cwe | CWE-264 | Unknown |
/*
* kernel/sched/core.c
*
* Kernel scheduler and related syscalls
*
* Copyright (C) 1991-2002 Linus Torvalds
*
* 1996-12-23 Modified by Dave Grothe to fix bugs in semaphores and
* make semaphores SMP safe
* 1998-11-19 Implemented schedule_timeout() and related stuff
* by Andrea Arcangeli
* 2002-01... | cwe | CWE-200 | C/C++ |
/* 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 | C/C++ |
void Fill(OpKernelContext* ctx, random::PhiloxRandom random,
Tensor* output) override {
const Tensor& alpha_t = ctx->input(2);
TensorShape samples_shape = output->shape();
OP_REQUIRES(ctx, TensorShapeUtils::EndsWith(samples_shape, alpha_t.shape()),
errors::InvalidArgument(
... | cwe | CWE-197 | C/C++ |
static int
xmlXPathCompOpEvalPositionalPredicate(xmlXPathParserContextPtr ctxt,
xmlXPathStepOpPtr op,
xmlNodeSetPtr set,
int contextSize,
int minPos,
int maxPos,
int hasNsNodes)
{
if (op->ch1 != -1) {
xmlXPathCompExprPtr comp = ctxt->comp;
if (comp->step... | cwe | CWE-415 | Unknown |
Bool GPAC_EventProc(void *ptr, GF_Event *evt)
{
if (!term) return 0;
if (gui_mode==1) {
if (evt->type==GF_EVENT_QUIT) {
Run = 0;
} else if (evt->type==GF_EVENT_KEYDOWN) {
switch (evt->key.key_code) {
case GF_KEY_C:
if (evt->key.flags & (GF_KEY_MOD_CTRL|GF_KEY_MOD_ALT)) {
hide_shell(shell_visibl... | cwe | CWE-119 | C/C++ |
const ghostBookshelf = require('./base');
const uuid = require('uuid');
const _ = require('lodash');
const config = require('../../shared/config');
const {gravatar} = require('../lib/image');
const Member = ghostBookshelf.Model.extend({
tableName: 'members',
defaults() {
return {
status: '... | cwe | CWE-284 | JavaScript |
/*
* Copyright (c) 1997 - 2006 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* Portions Copyright (c) 2004 PADL Software Pty Ltd.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are m... | cwe | CWE-476 | C/C++ |
static inline void sem_lock_and_putref(struct sem_array *sma)
{
ipc_lock_by_ptr(&sma->sem_perm);
ipc_rcu_putref(sma);
} | cwe | CWE-189 | Unknown |
static OPJ_BOOL opj_pi_next_rpcl(opj_pi_iterator_t * pi)
{
opj_pi_comp_t *comp = NULL;
opj_pi_resolution_t *res = NULL;
OPJ_UINT32 index = 0;
if (!pi->first) {
goto LABEL_SKIP;
} else {
OPJ_UINT32 compno, resno;
pi->first = 0;
pi->dx = 0;
pi->dy = 0;
... | cwe | CWE-369 | C/C++ |
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* Fluent Bit
* ==========
* Copyright (C) 2019-2020 The Fluent Bit Authors
* Copyright (C) 2015-2018 Treasure Data Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in co... | cwe | CWE-787 | C/C++ |
/**
* <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 |
MD5::checkDataChecksum(char const* const checksum,
char const* buf, int len)
{
std::string actual_checksum = getDataChecksum(buf, len);
return (checksum == actual_checksum);
} | cwe | CWE-787 | Unknown |
Graph.fileSupport&&(D.addEventListener("dragover",function(v){v.stopPropagation();v.preventDefault()},!1),D.addEventListener("drop",function(v){v.stopPropagation();v.preventDefault();if(0<v.dataTransfer.files.length){v=v.dataTransfer.files[0];var x=new FileReader;x.onload=function(A){D.value=A.target.result};x.readAsTe... | cwe | CWE-20 | JavaScript |
int hugetlb_overcommit_handler(struct ctl_table *table, int write,
void *buffer, size_t *length, loff_t *ppos)
{
struct hstate *h = &default_hstate;
unsigned long tmp;
int ret;
if (!hugepages_supported())
return -EOPNOTSUPP;
tmp = h->nr_overcommit_huge_pages;
if (write && hstate_is_gigantic(h))
return -E... | cwe | CWE-362 | Unknown |
static ssize_t _epoll_write(oe_fd_t* epoll_, const void* buf, size_t count)
{
ssize_t ret = -1;
epoll_t* epoll = _cast_epoll(epoll_);
oe_errno = 0;
/* Call the host. */
if (oe_syscall_write_ocall(&ret, epoll->host_fd, buf, count) != OE_OK)
OE_RAISE_ERRNO(OE_EINVAL);
done:
return ret;
... | cwe | CWE-552 | Unknown |
# -*- coding: utf-8 -*-
# Copyright 2014 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 applicable l... | cwe | CWE-400 | Python |
# -*- coding: utf-8 -*-
from threading import Lock
from ..utils.struct.lock import lock
from .browser import Browser
from .bucket import Bucket
from .cookie_jar import CookieJar
from .http.http_request import HTTPRequest
from .xdcc.request import XDCCRequest
DEFAULT_REQUEST = None
class RequestFactory:
def __i... | cwe | CWE-295 | Python |
setViewTitle: function(date, view, data)
{
switch (view) {
case 'day':
return this.setTitle(date.toString('D'));
case 'week':
var dates = this.viewDates(date, view);
return this.setTitle(dates[0].toString(Kronolith.conf.date_format) + ' - ' + dates[1].toS... | cwe | CWE-79 | JavaScript |
AP4_DataAtom::AP4_DataAtom(AP4_UI32 size, AP4_ByteStream& stream) :
AP4_Atom(AP4_ATOM_TYPE_DATA, size)
{
if (size < AP4_ATOM_HEADER_SIZE+8) return;
AP4_UI32 i;
stream.ReadUI32(i); m_DataType = (DataType)i;
stream.ReadUI32(i); m_DataLang = (DataLang)i;
// the stream for the data is a substream ... | cwe | CWE-476 | C/C++ |
// SPDX-License-Identifier: GPL-2.0-or-later
/* Paravirtualization interfaces
Copyright (C) 2006 Rusty Russell IBM Corporation
2007 - x86_64 support added by Glauber de Oliveira Costa, Red Hat Inc
*/
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/export.h>
#include <linux/efi.h>
#include <... | cwe | CWE-276 | Go |
static int php_plain_files_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context)
{
int ret;
if (!url_from || !url_to) {
return 0;
}
#ifdef PHP_WIN32
if (!php_win32_check_trailing_space(url_from, (int)strlen(url_from))) {
php_win32_docref2_from_... | cwe | CWE-264 | C/C++ |
int overrun(int itemSize, int nItems) {
int len = ptr - start + itemSize * nItems;
if (len < (end - start) * 2)
len = (end - start) * 2;
U8* newStart = new U8[len];
memcpy(newStart, start, ptr - start);
ptr = newStart + (ptr - start);
delete [] start;
start = newStart;... | cwe | CWE-122 | C/C++ |
static int __init lp_setup (char *str)
{
static int parport_ptr;
int x;
if (get_option(&str, &x)) {
if (x == 0) {
/* disable driver on "lp=" or "lp=0" */
parport_nr[0] = LP_PARPORT_OFF;
} else {
printk(KERN_WARNING "warning: 'lp=0x%x' is deprecated, ignored\n", x);
return 0;
}
} else if (!strncmp... | cwe | CWE-787 | C/C++ |
/* Mach-O support for BFD.
Copyright (C) 1999-2020 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
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 Fou... | cwe | CWE-476 | C/C++ |
/*
* GPAC - Multimedia Framework C SDK
*
* Author: Romain Bouqueau, Jean Le Feuvre
* Copyright (c) Romain Bouqueau 2012- Telecom Paris 2019-
* All rights reserved
*
* Note: this development was kindly sponsorized by Vizion'R (http://vizionr.com)
*
* This file is part of GPAC / ISO Media File... | cwe | CWE-120 | C/C++ |
static int get_iovec_page_array(const struct iovec __user *iov,
unsigned int nr_vecs, struct page **pages,
struct partial_page *partial, int aligned)
{
int buffers = 0, error = 0;
down_read(¤t->mm->mmap_sem);
while (nr_vecs) {
unsigned long off, npages;
struct iovec entry;
void __user *base;
... | cwe | CWE-94 | Unknown |
static int put_v4l2_ext_controls32(struct file *file,
struct v4l2_ext_controls *kp,
struct v4l2_ext_controls32 __user *up)
{
struct v4l2_ext_control32 __user *ucontrols;
struct v4l2_ext_control __user *kcontrols =
(__force struct v4l2_ext_control __user *)kp->controls;
int n = kp->count;
compat_cadd... | cwe | CWE-787 | Unknown |
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator p... | cwe | CWE-200 | Java |
/**
* @file
* Send/receive commands to/from an IMAP server
*
* @authors
* Copyright (C) 1996-1998,2010,2012 Michael R. Elkins <me@mutt.org>
* Copyright (C) 1996-1999 Brandon Long <blong@fiction.net>
* Copyright (C) 1999-2009,2011 Brendan Cully <brendan@kublai.com>
*
* @copyright
* This program is free softwar... | cwe | CWE-20 | C/C++ |
lzw_result lzw_decode(struct lzw_ctx *ctx,
const uint8_t ** const stack_pos_out)
{
lzw_result res;
uint32_t code_new;
uint32_t code_out;
uint8_t last_value;
uint8_t *stack_pos = ctx->stack_base;
uint32_t clear_code = ctx->clear_code;
uint32_t current_entry = ctx->current_entry;
struct lzw_dictionary_entry * c... | cwe | CWE-125 | C/C++ |
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->s32_min_value;
u32 umi... | cwe | CWE-125 | Unknown |
TfLiteStatus EvalMean(TfLiteContext* context, TfLiteNode* node) {
OpContext op_context(context, node);
OpData* data = reinterpret_cast<OpData*>(node->user_data);
int num_axis = static_cast<int>(NumElements(op_context.axis));
TfLiteTensor* temp_index = GetTemporary(context, node, /*index=*/0);
TfLiteTensor* r... | cwe | CWE-125 | C/C++ |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
#include <assert.h>
#include <string.h>
#include <sys/queue.h>
#include <sys/types.h>
#include "lsquic.h"
#include "lsquic_types.h"
#include "lsquic_int_types.h"
#include "lsquic_packet_common.h"
#include "lsquic_packet_in.h"
#include "lsquic_pa... | cwe | CWE-476 | C/C++ |
int vcc_getsockopt(struct socket *sock, int level, int optname,
char __user *optval, int __user *optlen)
{
struct atm_vcc *vcc;
int len;
if (get_user(len, optlen))
return -EFAULT;
if (__SO_LEVEL_MATCH(optname, level) && len != __SO_SIZE(optname))
return -EINVAL;
vcc = ATM_SD(sock);
switch (optname) {
... | cwe | CWE-200 | C/C++ |
wc_any_to_ucs(wc_wchar_t cc)
{
int f;
wc_uint16 *map = NULL;
wc_uint32 map_size = 0x80;
wc_map *map2;
f = WC_CCS_INDEX(cc.ccs);
switch (WC_CCS_TYPE(cc.ccs)) {
case WC_CCS_A_CS94:
if (cc.ccs == WC_CCS_US_ASCII)
return cc.code;
if (f < WC_F_ISO_BASE || f > WC_F_CS94_END)
return WC... | cwe | CWE-119 | C/C++ |
public static function getHost() {
if (isset($_SERVER['HTTP_HOST'])) {
$site_address = (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] ;
} else if (class_exists('erLhcoreClassInstance')) {
$site_address = 'https://' . erLhcoreClassInstan... | cwe | CWE-116 | PHP |
static ssize_t runtime_status_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
const char *p;
if (dev->power.runtime_error) {
p = "error\n";
} else if (dev->power.disable_depth) {
p = "unsupported\n";
} else {
switch (dev->power.runtime_status) {
case RPM_SUSPENDED:
p = "suspende... | cwe | CWE-787 | Unknown |
public PBEWithSHA1AESCBC128()
{
super(new CBCBlockCipher(new AESFastEngine()), PKCS12, SHA1, 128, 16);
} | cwe | CWE-310 | Java |
void Compute(OpKernelContext* ctx) override {
const Tensor& input = ctx->input(0);
const int depth = (axis_ == -1) ? 1 : input.dim_size(axis_);
Tensor* output = nullptr;
OP_REQUIRES_OK(ctx, ctx->allocate_output(0, input.shape(), &output));
Tensor num_bits_tensor;
num_bits_tensor = ctx->input(3)... | cwe | CWE-125 | Unknown |
/// <reference types="cypress" />
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
... | cwe | CWE-918 | JavaScript |
ofputil_pull_ofp11_buckets(struct ofpbuf *msg, size_t buckets_length,
enum ofp_version version, struct ovs_list *buckets)
{
struct ofp11_bucket *ob;
uint32_t bucket_id = 0;
ovs_list_init(buckets);
while (buckets_length > 0) {
struct ofputil_bucket *bucket;
str... | cwe | CWE-772 | Unknown |
package com.salesmanager.shop.admin.controller.tax;
import com.salesmanager.core.business.services.tax.TaxService;
import com.salesmanager.core.model.merchant.MerchantStore;
import com.salesmanager.core.model.tax.TaxConfiguration;
import com.salesmanager.shop.admin.model.web.Menu;
import com.salesmanager.shop.constant... | cwe | CWE-639 | Java |
/*
* Copyright (C) 2014-2016 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT A... | cwe | CWE-284 | JavaScript |
size_t srvstr_get_path_req(TALLOC_CTX *mem_ctx, struct smb_request *req,
char **pp_dest, const char *src, int flags,
NTSTATUS *err)
{
ssize_t bufrem = smbreq_bufrem(req, src);
if (bufrem < 0) {
*err = NT_STATUS_INVALID_PARAMETER;
return 0;
}
if (req->posix_pathnames) {
return srvstr_get_path_inter... | cwe | CWE-200 | Unknown |
_asn1_decode_simple_ber (unsigned int etype, const unsigned char *der,
unsigned int _der_len, unsigned char **str,
unsigned int *str_len, unsigned int *ber_len,
unsigned dflags)
{
int tag_len, len_len;
const unsigned char *p;
int der_len = _der_len;
uint8_t *total = NULL;
unsigned total_size = 0;
u... | cwe | CWE-674 | C/C++ |
function escapeArgPowerShell(arg, interpolation, quoted) {
let result = arg
.replace(/\u0000/g, "")
.replace(/`/g, "``")
.replace(/\$/g, "`$");
if (interpolation) {
result = result
.replace(/^((?:\*|[1-6])?)(>)/g, "$1`$2")
.replace(/^(<|@|#|-|\:|\])/g, "`$1")
.replace(/(,|\;|\&|\|... | cwe | CWE-74 | JavaScript |
/* packet-eap.c
* Routines for EAP Extensible Authentication Protocol dissection
* RFC 2284, RFC 3748
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config.h"
#include <stdio.h> /* f... | cwe | CWE-404 | C/C++ |
static long mem_seek(jas_stream_obj_t *obj, long offset, int origin)
{
jas_stream_memobj_t *m = (jas_stream_memobj_t *)obj;
long newpos;
JAS_DBGLOG(100, ("mem_seek(%p, %ld, %d)\n", obj, offset, origin));
switch (origin) {
case SEEK_SET:
newpos = offset;
break;
case SEEK_END:
newpos = m->len_ - offset;
br... | cwe | CWE-415 | Unknown |
void PackLinuxElf32::unpack(OutputFile *fo)
{
unsigned const c_phnum = get_te16(&ehdri.e_phnum);
unsigned old_data_off = 0;
unsigned old_data_len = 0;
unsigned old_dtinit = 0;
unsigned szb_info = sizeof(b_info);
{
if (get_te32(&ehdri.e_entry) < 0x401180
&& Elf32_Ehdr::EM_386 ==... | cwe | CWE-476 | C/C++ |
// url.c -- Object representing uniform resource locators
// Copyright (C) 2008-2010 Markus Gutschke <markus@shellinabox.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 the Free Software Foundation.
//
/... | cwe | CWE-835 | C/C++ |
public static XStream createXStreamInstanceForDBObjects() {
return new EnhancedXStream(true);
} | cwe | CWE-91 | Java |
void SFS_ObjectMemberAccess(ScriptParser *parser)
{
if (parser->codec->LastError) return;
SFS_Expression(parser);
SFS_AddString(parser, ".");
SFS_Identifier(parser);
} | cwe | CWE-476 | Unknown |
static int tr_prepare_attributes(struct tr_context *ac)
{
struct ldb_context *ldb = ldb_module_get_ctx(ac->module);
int ret;
struct ldb_message_element *el = NULL;
uint32_t account_type, user_account_control;
struct ldb_dn *objectcategory = NULL;
ac->mod_msg = ldb_msg_copy_shallow(ac, ac->req_msg);
if (ac->mod_... | cwe | CWE-200 | Unknown |
nbd_unlocked_opt_info (struct nbd_handle *h)
{
int err;
nbd_completion_callback c = { .callback = go_complete, .user_data = &err };
int r = nbd_unlocked_aio_opt_info (h, &c);
if (r == -1)
return r;
r = wait_for_option (h);
if (r == 0 && err) {
assert (nbd_internal_is_state_negotiating (get_next_st... | cwe | CWE-617 | Unknown |
if(null!=d&&d==c)return a}for(a=a.firstChild;null!=a;){d=mxUtils.findNode(a,b,c);if(null!=d)return d;a=a.nextSibling}return null},getFunctionName:function(a){var b=null;null!=a&&(null!=a.name?b=a.name:(b=mxUtils.trim(a.toString()),/^function\s/.test(b)&&(b=mxUtils.ltrim(b.substring(9)),a=b.indexOf("("),0<a&&(b=b.substr... | cwe | CWE-94 | JavaScript |
public function remind()
{
/*if (!check_captcha())
{
$this->templatemanager->notify_next(__("You have entered wrong security code."), "error", __("Error!"));
redirect("administration/auth/forgot");
die;
}//*/
$email = trim($this->input->post("email", true));
$u = User::factory()->get_by_email($ema... | cwe | CWE-640 | PHP |
function render(d, href2, text, download) {
if (download) {
return `<a data-s3="object" data-s3key="${d}" href="${href2}" download="${download}">${text}</a>`;
}
return `<a data-s3="folder" data-s3key="${d}" href="${href2}">${text}</a>`;
} | cwe | CWE-79 | JavaScript |
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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 3 of the License, or
# (at your option) any lat... | cwe | CWE-74 | Python |
load_vector_int(BitStream& bit_stream, int nitems, std::vector<T>& vec,
int bits_wanted, int_type T::*field)
{
bool append = vec.empty();
// nitems times, read bits_wanted from the given bit stream,
// storing results in the ith vector entry.
for (int i = 0; i < nitems; ++i)
{
if (append)... | cwe | CWE-787 | Unknown |
'use strict'
var child = require('child_process')
function GitFn (version, options) {
this._version = version
this._options = {
cwd: options.dir,
env: process.env,
setsid: false,
stdio: [0, 1, 2]
}
}
module.exports = GitFn
GitFn.prototype = {
tag: function (cb) {
var cmd = ['git', 'tag', ... | cwe | CWE-77 | JavaScript |
function defaultRenderTag(tag, params) {
// This file is in lib but it's used as a helper
let siteSettings = helperContext().siteSettings;
params = params || {};
const visibleName = escapeExpression(tag);
tag = visibleName.toLowerCase();
const classes = ["discourse-tag"];
const tagName = params.tagName |... | cwe | CWE-79 | JavaScript |
void ComputeAsync(OpKernelContext* context, DoneCallback done) final {
const Tensor& input = context->input(0);
const Tensor& rhs = context->input(1);
const int ndims = input.dims();
const int64 n = input.dim_size(ndims - 1);
const int64 nrhs = rhs.dim_size(ndims - 1);
// Validate inputs.
OP... | cwe | CWE-354 | C/C++ |
/* rsa.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL 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 License, or
* (at your option) a... | cwe | CWE-787 | C/C++ |
/*
* The MIT License
*
* Copyright 2010 Sony Ericsson Mobile Communications. All rights reserved.
*
* 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 ... | cwe | CWE-352 | 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 | C/C++ |
fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
{
int r, num;
OnigCodePoint c;
OnigEncoding enc = env->enc;
OnigSyntaxType* syn = env->syntax;
UChar* prev;
UChar* p = *src;
PFETCH_READY;
start:
if (PEND) {
tok->type = TK_EOT;
return tok->type;
}
tok->type = TK_STRING;
... | cwe | CWE-476 | C/C++ |
static int ldb_wildcard_compare(struct ldb_context *ldb,
const struct ldb_parse_tree *tree,
const struct ldb_val value, bool *matched)
{
const struct ldb_schema_attribute *a;
struct ldb_val val;
struct ldb_val cnk;
struct ldb_val *chunk;
uint8_t *save_p = NULL;
unsigned int c = 0;
if (tree->operation !=... | cwe | CWE-125 | C/C++ |
// Copyright (c) 2015-2021 MinIO, Inc.
//
// This file is part of MinIO Object Storage stack
//
// This program 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-269 | Go |
Field_new_decimal::Field_new_decimal(uchar *ptr_arg,
uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg,
const char *field_name_arg,
... | cwe | CWE-120 | Unknown |
static void queue_delete(struct snd_seq_queue *q)
{
/* stop and release the timer */
snd_seq_timer_stop(q->timer);
snd_seq_timer_close(q);
/* wait until access free */
snd_use_lock_sync(&q->use_lock);
/* release resources... */
snd_seq_prioq_delete(&q->tickq);
snd_seq_prioq_delete(&q->timeq);
snd_seq_ti... | cwe | CWE-362 | C/C++ |
/*
* . .o8 oooo
* .o8 "888 `888
* .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo
* 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P'
* 888 888 888 888 8... | cwe | CWE-434 | JavaScript |
static inline bool isValid(const RemoteFsDevice::Details &d)
{
return d.isLocalFile() || RemoteFsDevice::constSshfsProtocol==d.url.scheme() ||
RemoteFsDevice::constSambaProtocol==d.url.scheme() || RemoteFsDevice::constSambaAvahiProtocol==d.url.scheme();
} | cwe | CWE-22 | Unknown |
__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 hashlib
import logging
import os
import time
import uuid
import wrapt
from flask_login import AnonymousUserMixin, UserM... | cwe | CWE-613 | Python |
bool SetExtendedFileAttribute(const char* path,
const char* name,
const char* value,
size_t value_size,
int flags) {
//// On Chrome OS, there is no component that can validate these extended
//// a... | cwe | CWE-200 | C/C++ |
# encoding: utf-8
import os
import cgi
import datetime
import logging
import magic
import mimetypes
from urllib.parse import urlparse
from werkzeug.datastructures import FileStorage as FlaskFileStorage
import ckan.lib.munge as munge
import ckan.logic as logic
import ckan.plugins as plugins
from ckan.common import co... | cwe | CWE-79 | Python |
static uint_fast32_t jpc_abstorelstepsize(jpc_fix_t absdelta, int scaleexpn)
{
int p;
uint_fast32_t mant;
uint_fast32_t expn;
int n;
if (absdelta < 0) {
abort();
}
p = jpc_fix_firstone(absdelta) - JPC_FIX_FRACBITS;
n = 11 - jpc_fix_firstone(absdelta);
mant = ((n < 0) ? (absdelta >> (-n)) : (absdelta << n))... | cwe | CWE-617 | Unknown |
function hasClass(element, className) {
className = " " + className + " ";
return (" " + element.className + " ").replace(/[\n\t]/g, " ").indexOf(className) > -1
} | cwe | CWE-400 | JavaScript |
"""
Version information for InvenTree.
Provides information on the current InvenTree version
"""
import re
import subprocess
import django
import common.models
from InvenTree.api_version import INVENTREE_API_VERSION
# InvenTree software version
INVENTREE_SW_VERSION = "0.7.1"
def inventreeInstanceName():
""" R... | cwe | CWE-434 | Python |
ChopUpSingleUncompressedStrip(TIFF* tif)
{
register TIFFDirectory *td = &tif->tif_dir;
uint64 bytecount;
uint64 offset;
uint32 rowblock;
uint64 rowblockbytes;
uint64 stripbytes;
uint32 strip;
uint64 nstrips64;
uint32 nstrips32;
uint32 rowsperstrip;
uint64* newcounts;
uint64* newoffsets;
bytecount = td->td... | cwe | CWE-125 | C/C++ |
def configure_local_ssh_key():
"""
Configure ssh rsa key locally
If /root/.ssh/id_rsa not exist, generate a new one
Add /root/.ssh/id_rsa.pub to /root/.ssh/authorized_keys anyway, make sure itself authorized
"""
if not os.path.exists(RSA_PRIVATE_KEY):
status("Generating SSH key")
... | cwe | CWE-269 | Python |
/**
* Module dependencies.
*/
var net = require('net');
var tls = require('tls');
var url = require('url');
var Agent = require('agent-base');
var inherits = require('util').inherits;
var debug = require('debug')('http-proxy-agent');
/**
* Module exports.
*/
module.exports = HttpProxyAgent;
/**
* The `HttpPro... | cwe | CWE-665 | Java |
static void cstm(JF, js_Ast *stm)
{
js_Ast *target;
int loop, cont, then, end;
emitline(J, F, stm);
switch (stm->type) {
case AST_FUNDEC:
break;
case STM_BLOCK:
cstmlist(J, F, stm->a);
break;
case STM_EMPTY:
if (F->script) {
emitline(J, F, stm);
emit(J, F, OP_POP);
emit(J, F, OP_UNDEF);
}
... | cwe | CWE-703 | Unknown |
static int pipe_to_file(struct pipe_inode_info *pipe, struct pipe_buffer *buf,
struct splice_desc *sd)
{
struct file *file = sd->u.file;
struct address_space *mapping = file->f_mapping;
unsigned int offset, this_len;
struct page *page;
pgoff_t index;
int ret;
/*
* make sure the data in this buffer is uptod... | cwe | CWE-399 | Unknown |
class OrderStatus:
DRAFT = "draft" # fully editable, not confirmed order created by staff users
UNFULFILLED = "unfulfilled" # order with no items marked as fulfilled
PARTIALLY_FULFILLED = (
"partially fulfilled" # order with some items marked as fulfilled
)
FULFILLED = "fulfilled" # orde... | cwe | CWE-203 | Python |
/**
* <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 |
package io.onedev.server.util;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.KeySpec;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;
import org.apache.commons.codec.binary.Base64;
import org.apache.shiro.crypto.... | cwe | CWE-338 | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.