code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static u_char *php_parserr(u_char *cp, u_char *end, querybuf *answer, int type_to_fetch, int store, int raw, zval *subarray)
{
u_short type, class, dlen;
u_long ttl;
long n, i;
u_short s;
u_char *tp, *p;
char name[MAXHOSTNAMELEN];
int have_v6_break = 0, in_v6_break = 0;
ZVAL_UNDEF(subarray);
n = dn_expand(an... | cwe | CWE-125 | C/C++ |
package com.salesmanager.shop.admin.model.reference;
import java.io.Serializable;
public class Weight implements Serializable {
/**
*
*/
private static final long serialVersionUID = -1006772612089740285L;
private String code;
private String name;
public String getName() {
return name;
}
public void se... | cwe | CWE-639 | Java |
static struct dentry * real_lookup(struct dentry * parent, struct qstr * name, struct nameidata *nd)
{
struct dentry * result;
struct inode *dir = parent->d_inode;
mutex_lock(&dir->i_mutex);
/*
* First re-do the cached lookup just in case it was created
* while we waited for the directory semaphore..
*
* F... | cwe | CWE-120 | Unknown |
njs_promise_resolve(njs_vm_t *vm, njs_value_t *constructor, njs_value_t *x)
{
njs_int_t ret;
njs_value_t value;
njs_object_t *object;
njs_promise_capability_t *capability;
static const njs_value_t string_constructor = njs_string("constructor");
if (... | cwe | CWE-843 | C/C++ |
static int dd_lock(struct dump_dir *dd, unsigned sleep_usec, int flags)
{
if (dd->locked)
error_msg_and_die("Locking bug on '%s'", dd->dd_dirname);
char pid_buf[sizeof(long)*3 + 2];
snprintf(pid_buf, sizeof(pid_buf), "%lu", (long)getpid());
unsigned dirname_len = strlen(dd->dd_dirname);
ch... | cwe | CWE-20 | Unknown |
window.open = async function(url)
{
if (url != null && url.startsWith('http'))
{
await requestSync({action: 'openExternal', url: url});
}
else
{
return oldWindowOpen(url);
}
} | cwe | CWE-20 | JavaScript |
/* radare - LGPL - Copyright 2020 - mrmacete */
#include <r_types.h>
#include <r_util.h>
#include <r_hash.h>
#include "coresymbolication.h"
#define R_CS_EL_OFF_SEGS 0x58
#define R_CS_EL_SIZE_SEG 0x20
#define R_CS_EL_SIZE_SECT_64 0x18
#define R_CS_EL_SIZE_SECT_32 0x10
#define R_CS_EL_SIZE_SYM 0x18
#define R_CS_EL_SIZE... | cwe | CWE-787 | C/C++ |
char *make_argv(char *buf, size_t len, int argc, char **argv)
{
size_t left= len;
const char *arg;
buf[0]= 0;
++argv; --argc;
while (argc > 0 && left > 0)
{
arg = *argv;
if (strncmp(*argv, "--password", strlen("--password")) == 0) {
arg = "--password=...";
}
if (strncmp(*argv, "--encrypt-key",
str... | cwe | CWE-200 | Unknown |
#!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from typing import Optional
from uuid import UUID
import azure.functions as func
import jwt
from onefuzztypes.enums import ErrorCode
from onefuzztypes.models import Error, Result, UserInfo
def get_bearer_token(request: ... | cwe | CWE-285 | Python |
int ext4_group_add(struct super_block *sb, struct ext4_new_group_data *input)
{
struct ext4_sb_info *sbi = EXT4_SB(sb);
struct ext4_super_block *es = sbi->s_es;
int reserved_gdb = ext4_bg_has_super(sb, input->group) ?
le16_to_cpu(es->s_reserved_gdt_blocks) : 0;
struct buffer_head *primary = NULL;
struct ext4_gro... | cwe | CWE-20 | Unknown |
"""
django-helpdesk - A Django powered ticket tracker for small enterprise.
(c) Copyright 2008 Jutda. All Rights Reserved. See LICENSE for details.
models.py - Model (and hence database) definitions. This is the core of the
helpdesk structure.
"""
from django.contrib.auth.models import Permission
from dj... | cwe | CWE-79 | Python |
/*
* linux/net/sunrpc/svc.c
*
* High-level RPC service routines
*
* Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
*
* Multiple threads pools and NUMAisation
* Copyright (c) 2006 Silicon Graphics, Inc.
* by Greg Banks <gnb@melbourne.sgi.com>
*/
#include <linux/linkage.h>
#include <linux/sched/signal... | cwe | CWE-404 | C/C++ |
package api
import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"sync"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/plugins/backendplugin"
"github.com/grafana/grafana/pkg/services/datasource... | cwe | CWE-200 | Go |
#include "http.h"
#include "arch.h"
#include "base64.h"
#include "log.h"
#include "net.h"
#include "ssi.h"
#include "util.h"
#include "version.h"
#include "ws.h"
// Multipart POST example:
// --xyz
// Content-Disposition: form-data; name="val"
//
// abcdef
// --xyz
// Content-Disposition: form-data; name="foo"; filena... | cwe | CWE-552 | C/C++ |
bgp_capability_vty_out (struct vty *vty, struct peer *peer)
{
char *pnt;
char *end;
struct capability cap;
pnt = peer->notify.data;
end = pnt + peer->notify.length;
while (pnt < end)
{
memcpy(&cap, pnt, sizeof(struct capability));
if (pnt + 2 > end)
return;
if (pnt + (cap.length + ... | cwe | CWE-125 | Unknown |
def save_tokens(params, request, session)
# pcsd runs as root thus always returns hacluster's tokens
if not allowed_for_local_cluster(session, Permissions::FULL)
return 403, "Permission denied"
end
new_tokens = {}
params.each{|nodes|
if nodes[0].start_with?"node:" and nodes[0].length > 5
node ... | cwe | CWE-384 | Ruby |
static ssize_t active_time_ms_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct wakeup_source *ws = dev_get_drvdata(dev);
ktime_t active_time =
ws->active ? ktime_sub(ktime_get(), ws->last_time) : 0;
return sprintf(buf, "%lld\n", ktime_to_ms(active_time));
} | cwe | CWE-787 | Unknown |
static VALUE cState_object_nl_set(VALUE self, VALUE object_nl)
{
unsigned long len;
GET_STATE(self);
Check_Type(object_nl, T_STRING);
len = RSTRING_LEN(object_nl);
if (len == 0) {
if (state->object_nl) {
ruby_xfree(state->object_nl);
state->object_nl = NULL;
}... | cwe | CWE-119 | Unknown |
fn exit_document(&mut self, ctx: &mut ValidatorContext<'a, S>, _: &'a Document<S>) {
assert!(self.current_fragment.is_none());
let mut detector = CycleDetector {
visited: HashSet::new(),
spreads: &self.spreads,
path_indices: HashMap::new(),
errors: Vec::n... | cwe | CWE-400 | Rust |
Map1to1(SDL_Palette * src, SDL_Palette * dst, int *identical)
{
Uint8 *map;
int i;
if (identical) {
if (src->ncolors <= dst->ncolors) {
/* If an identical palette, no need to map */
if (src == dst
||
(SDL_memcmp
(src->colors, ... | cwe | CWE-787 | Unknown |
void CtcpParser::query(CoreNetwork *net, const QString &bufname, const QString &ctcpTag, const QString &message)
{
QList<QByteArray> params;
params << net->serverEncode(bufname) << lowLevelQuote(pack(net->serverEncode(ctcpTag), net->userEncode(bufname, message)));
static const char *splitter = " .,-!?";
... | cwe | CWE-399 | C/C++ |
x11_open_helper(Buffer *b)
{
u_char *ucp;
u_int proto_len, data_len;
u_char *ucp;
u_int proto_len, data_len;
/* Check if the fixed size part of the packet is in buffer. */
if (buffer_len(b) < 12)
return 0;
debug2("Initial X11 packet contains bad byte order byte: 0x%x",
ucp[0]);
return -1;
} | cwe | CWE-264 | Unknown |
static void sig_message_join(SERVER_REC *server, const char *channel,
const char *nick, const char *address)
{
CHANNEL_REC *chanrec;
chanrec = channel_find(server, channel);
if (chanrec != NULL)
CHANNEL_LAST_MSG_ADD(chanrec, nick, FALSE);
} | cwe | CWE-416 | Unknown |
// anti-copyright Lucy Phipps 2022
// vi: sw=2 tw=80
#define VERSION "v1.0.4"
#include <errno.h>
#include <inttypes.h>
#include <limits.h>
#include <setjmp.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if CHAR_BIT != 8
#error "char isn't 8-bit"
#endif
#if __STDC_VERSION__ < 201112L... | cwe | CWE-787 | C/C++ |
callParserIfExistsQuery(parseNumberTypeQueryParams([['requiredNum', false, false], ['optionalNum', true, false], ['optionalNumArr', true, true], ['emptyNum', true, false], ['requiredNumArr', false, true]])),
callParserIfExistsQuery(parseBooleanTypeQueryParams([['bool', false, false], ['optionalBool', true, fals... | cwe | CWE-20 | JavaScript |
int open_debug_log(void) {
/* don't do anything if we're not actually running... */
if(verify_config || test_scheduling == TRUE)
return OK;
/* don't do anything if we're not debugging */
if(debug_level == DEBUGL_NONE)
return OK;
if((debug_file_fp = fopen(debug_file, "a+")) == NULL)
return ERROR;
... | cwe | CWE-264 | C/C++ |
/*
* Copyright © 2015-2018 Aeneas Rekkas <aeneas+oss@aeneas.io>
*
* 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... | cwe | CWE-345 | Go |
const validateURL = (url, debug) => {
if (!url) {
return false
}
const validURLOpts = {
protocols: ['http', 'https'],
require_protocol: true,
require_tld: !debug,
}
if (!validator.isURL(url, validURLOpts)) {
return false
}
return true
} | cwe | CWE-918 | JavaScript |
/*
* File: ximatif.cpp
* Purpose: Platform Independent TIFF Image Class Loader and Writer
* 07/Aug/2001 Davide Pizzolato - www.xdp.it
* CxImage version 7.0.2 07/Feb/2011
*/
#include "ximatif.h"
#ifndef min
#define min(a,b) (((a)<(b))?(a):(b))
#endif
#ifndef max
#define max(a,b) (((a)>(b))?(a):(b))
#endif
#if ... | cwe | CWE-770 | C/C++ |
static long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
struct ion_client *client = filp->private_data;
struct ion_device *dev = client->dev;
struct ion_handle *cleanup_handle = NULL;
int ret = 0;
unsigned int dir;
union {
struct ion_fd_data fd;
struct ion_allocation_data allocation;
... | cwe | CWE-416 | Unknown |
/************************************************************************
* 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 |
public function handle($request, Closure $next)
{
view()->share('cspNonce', $this->cspService->getNonce());
if ($this->cspService->allowedIFrameHostsConfigured()) {
config()->set('session.same_site', 'none');
}
$response = $next($request);
$this->cspService->set... | cwe | CWE-79 | PHP |
static int sco_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t len, int flags)
{
struct sock *sk = sock->sk;
struct sco_pinfo *pi = sco_pi(sk);
lock_sock(sk);
if (sk->sk_state == BT_CONNECT2 &&
test_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags)) {
sco_conn_defer_accept(p... | cwe | CWE-20 | Unknown |
#ifndef WIN32
#include "UserTerminalRouter.hpp"
#include "ETerminal.pb.h"
namespace et {
UserTerminalRouter::UserTerminalRouter(
shared_ptr<PipeSocketHandler> _socketHandler,
const SocketEndpoint &_routerEndpoint)
: socketHandler(_socketHandler) {
serverFd = *(socketHandler->listen(_routerEndpoint).begi... | cwe | CWE-120 | C/C++ |
get_clkbug_info(
sockaddr_u *srcadr,
endpt *inter,
struct req_pkt *inpkt
)
{
register int i;
register struct info_clkbug *ic;
register u_int32 *clkaddr;
register int items;
struct refclockbug bug;
sockaddr_u addr;
ZERO_SOCK(&addr);
AF(&addr) = AF_INET;
#ifdef ISC_PLATFORM_HAVESALEN
addr.sa.sa_len = SOCKLE... | cwe | CWE-476 | Unknown |
/**
* Copyright (c) 2006-2017, JGraph Ltd
* Copyright (c) 2006-2017, Gaudenz Alder
*/
//Add a closure to hide the class private variables without changing the code a lot
(function ()
{
var _token = null;
window.GitHubClient = function(editorUi, authName)
{
DrawioClient.call(this, editorUi, authName || 'ghauth');
... | cwe | CWE-79 | JavaScript |
mxImageShape.prototype.redrawHtmlShape=function(){this.node.style.left=Math.round(this.bounds.x)+"px";this.node.style.top=Math.round(this.bounds.y)+"px";this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px";this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px";this.node.innerHTML="";if(n... | cwe | CWE-94 | JavaScript |
void TabletModeWindowManager::ForgetWindow(aura::Window* window,
bool destroyed) {
added_windows_.erase(window);
window->RemoveObserver(this);
WindowToState::iterator it = window_state_map_.find(window);
if (it == window_state_map_.end())
return;
if (destroy... | cwe | CWE-362 | C/C++ |
spell_dump_compl(
char_u *pat, // leading part of the word
int ic, // ignore case
int *dir, // direction for adding matches
int dumpflags_arg) // DUMPFLAG_*
{
langp_T *lp;
slang_T *slang;
idx_T arridx[MAXWLEN];
int curi[MAXWLEN];
char_u word[MAXWLEN];
int c;
... | cwe | CWE-787 | C/C++ |
func Render(tmpl string, s *types.Step) (types.StepSlice, error) {
buffer := new(bytes.Buffer)
config := new(types.Build)
velaFuncs := funcHandler{envs: convertPlatformVars(s.Environment)}
templateFuncMap := map[string]interface{}{
"vela": velaFuncs.returnPlatformVar,
}
// parse the template with Masterminds/... | cwe | CWE-78 | Go |
static int xemaclite_of_probe(struct platform_device *ofdev)
{
struct resource *res;
struct net_device *ndev = NULL;
struct net_local *lp = NULL;
struct device *dev = &ofdev->dev;
int rc = 0;
dev_info(dev, "Device Tree Probing\n");
/* Create an ethernet device instance */
ndev = alloc_etherdev(sizeof(struct ... | cwe | CWE-703 | C/C++ |
private void handle(ServletRequestHandler pReqHandler,HttpServletRequest pReq, HttpServletResponse pResp) throws IOException {
JSONAware json = null;
try {
// Check access policy
requestHandler.checkClientIPAccess(pReq.getRemoteHost(),pReq.getRemoteAddr());
// Rememb... | cwe | CWE-352 | Java |
TfLiteStatus ComputeDepthMultiplier(TfLiteContext* context,
const TfLiteTensor* input,
const TfLiteTensor* filter,
int16* depth_multiplier) {
int num_filter_channels = SizeOfDimension(filter, 3);
int num_inpu... | cwe | CWE-369 | C/C++ |
static int __io_sync_cancel(struct io_uring_task *tctx,
struct io_cancel_data *cd, int fd)
{
struct io_ring_ctx *ctx = cd->ctx;
/* fixed must be grabbed every time since we drop the uring_lock */
if ((cd->flags & IORING_ASYNC_CANCEL_FD) &&
(cd->flags & IORING_ASYNC_CANCEL_FD_FIXED)) {
unsigned long fi... | cwe | CWE-193 | C/C++ |
/* (C) 1999-2001 Paul `Rusty' Russell
* (C) 2002-2004 Netfilter Core Team <coreteam@netfilter.org>
*
* 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/types.h>
... | cwe | CWE-787 | C/C++ |
void ACSequentialScan::DecodeBlock(LONG *block,
LONG &prevdc,LONG &prevdiff,
UBYTE small,UBYTE large,UBYTE kx,UBYTE dc,UBYTE ac)
{
// DC coding
if (m_ucScanStart == 0 && m_bResidual == false) {
LONG diff;
struct QMContextSet::DCContextZer... | cwe | CWE-617 | C/C++ |
// Copyright IBM Corp. 2013,2020. All Rights Reserved.
// Node module: loopback-connector-postgresql
// This file is licensed under the Artistic License 2.0.
// License text available at https://opensource.org/licenses/Artistic-2.0
/*!
* PostgreSQL connector for LoopBack
*/
'use strict';
const SG = require('strong-g... | cwe | CWE-89 | JavaScript |
static const char *skip( const char *in )
{
while ( in && *in && (unsigned char) *in <= 32 )
in++;
return in;
} | cwe | CWE-120 | C/C++ |
#include "extensions/common/wasm/wasm.h"
#include <stdio.h>
#include <limits>
#include <memory>
#include <string>
#include "envoy/common/exception.h"
#include "envoy/config/wasm/v2/wasm.pb.validate.h"
#include "envoy/grpc/status.h"
#include "envoy/http/codes.h"
#include "envoy/local_info/local_info.h"
#include "envo... | cwe | CWE-476 | C/C++ |
static int copy_verifier_state(struct bpf_verifier_state *dst_state,
const struct bpf_verifier_state *src)
{
struct bpf_func_state *dst;
int i, err;
/* if dst has more stack frames then src frame, free them */
for (i = src->curframe + 1; i <= dst_state->curframe; i++) {
free_func_state(dst_state->frame... | cwe | CWE-703 | Unknown |
// SPDX-License-Identifier: GPL-2.0
/*
* Completely Fair Scheduling (CFS) Class (SCHED_NORMAL/SCHED_BATCH)
*
* Copyright (C) 2007 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
*
* Interactivity improvements by Mike Galbraith
* (C) 2007 Mike Galbraith <efault@gmx.de>
*
* Various enhancements by Dmitry Adamus... | cwe | CWE-400 | C/C++ |
opj_pi_iterator_t *opj_pi_create_decode(opj_image_t *p_image,
opj_cp_t *p_cp,
OPJ_UINT32 p_tile_no)
{
/* loop */
OPJ_UINT32 pino;
OPJ_UINT32 compno, resno;
/* to store w, h, dx and dy fro all components and resolutions */
OPJ_UINT32 * l_tmp_data;
OPJ_UINT32 ** l_tmp_ptr;
/* encoding pramete... | cwe | CWE-125 | C/C++ |
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, mobconf = require('./routes/mobileconfig')
, http = require('http')
, path = require('path');
var cookieParser = require('cookie-parser')
var app = express();
// all environments
app.set('port', process.env.... | cwe | CWE-707 | JavaScript |
$this->{$callback[0]}->{$callback[1]}($objPage, $objLayout, $this);
}
}
$headBag = $this->responseContext->get(HtmlHeadBag::class);
// Set the page title and description AFTER the modules have been generated
$this->Template->mainTitle = $objPage->rootPageTitle;
$this->Template->pageTitle = htmlspecialcha... | cwe | CWE-79 | PHP |
parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
guint32 str_tbl, guint8 *level, guint8 *codepage_stag, guint8 *codepage_attr,
const wbxml_decoding *map)
{
guint32 tvb_len = tvb_reported_length (tvb);
guint32 off = offset;
guint32 len;
guint str_len;
guint32... | cwe | CWE-119 | Unknown |
function ame_ajax_set_excludestatus( page_id, status_id ) {
var ame_sack = new sack( ajaxurl );
ame_sack.execute = 1;
ame_sack.method = 'POST';
ame_sack.setVar( "action", "ame_toggle_excludestatus" );
ame_sack.setVar( "pageid", page_id );
ame_sack.setVar( "statusid", status_id );
ame_sack.onError = function() { ... | cwe | CWE-352 | JavaScript |
func (s *Server) getHandler(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
action := vars["action"]
token := vars["token"]
filename := vars["filename"]
metadata, err := s.CheckMetadata(token, filename, true)
if err != nil {
log.Printf("Error metadata: %s", err.Error())
http.Error(w, http.Sta... | cwe | CWE-79 | Go |
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This 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
* th... | cwe | CWE-79 | Java |
// Copyright 2021 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package common
import (
"fmt"
"io"
"path"
"path/filepath"
"strings"
"time"
"code.gitea.io/gitea/modules/charset"
"code.gitea.io/gitea/modules/conte... | cwe | CWE-79 | Go |
static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image)
{
#define CFormat "/Filter [ /%s ]\n"
#define ObjectsPerImage 14
#define ThrowPDFException(exception,message) \
{ \
if (xref != (MagickOffsetType *) NULL) \
xref=(MagickOffsetType *) RelinquishMagickMemory(xref); \
ThrowWriterExc... | cwe | CWE-401 | C/C++ |
dhcpv6_print(netdissect_options *ndo,
const u_char *cp, u_int length, int indent)
{
u_int i, t;
const u_char *tlv, *value;
uint16_t type, optlen;
i = 0;
while (i < length) {
tlv = cp + i;
type = EXTRACT_16BITS(tlv);
optlen = EXTRACT_16BITS(tlv + 2);
... | cwe | CWE-125 | C/C++ |
void ServiceWorkerPaymentInstrument::OnPaymentAppInvoked(
mojom::PaymentHandlerResponsePtr response) {
DCHECK(delegate_);
if (delegate_ != nullptr) {
delegate_->OnInstrumentDetailsReady(response->method_name,
response->stringified_details);
delegate_ = nullptr... | cwe | CWE-416 | C/C++ |
/*
Copyright (c) 2005, 2010, Oracle and/or its affiliates.
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; version 2 of the License.
This program is distributed in the hope that it wi... | cwe | CWE-264 | C/C++ |
static MagickBooleanType EncodeImage(const ImageInfo *image_info,Image *image,
const size_t data_size,ExceptionInfo *exception)
{
#define MaxCode(number_bits) ((one << (number_bits))-1)
#define MaxHashTable 5003
#define MaxGIFBits 12UL
#define MaxGIFTable (1UL << MaxGIFBits)
#define GIFOutputCode(code) \
{ \
/*... | cwe | CWE-703 | Unknown |
#include <cmark-gfm-extension_api.h>
#include <html.h>
#include <inlines.h>
#include <parser.h>
#include <references.h>
#include <string.h>
#include <render.h>
#include "ext_scanners.h"
#include "strikethrough.h"
#include "table.h"
#include "cmark-gfm-core-extensions.h"
cmark_node_type CMARK_NODE_TABLE, CMARK_NODE_TA... | cwe | CWE-20 | C/C++ |
/* Tokenizer implementation */
#include "Python.h"
#include "pgenheaders.h"
#include <ctype.h>
#include <assert.h>
#include "tokenizer.h"
#include "errcode.h"
#ifndef PGEN
#include "unicodeobject.h"
#include "bytesobject.h"
#include "fileobject.h"
#include "codecs.h"
#include "abstract.h"
#endif /* PGEN */
#ifnde... | cwe | CWE-125 | Python |
constructor (comp, options) {
options = parseOptions(options)
if (comp instanceof Comparator) {
if (comp.loose === !!options.loose) {
return comp
} else {
comp = comp.value
}
}
debug('comparator', comp, options)
this.options = options
this.loose = !!options.lo... | cwe | CWE-1333 | JavaScript |
require('dotenv').config()
const User = require('../../model/user')
const Org = require('../../model/org')
const logger = require('../../middleware/logger')
const argon2 = require('argon2')
const CONSTANTS = require('../../constants')
const cryptoRandomString = require('crypto-random-string')
const uuid = require('uuid... | cwe | CWE-532 | JavaScript |
/*
* Copyright (C) 2012 Red Hat, Inc. All rights reserved.
* Author: Alex Williamson <alex.williamson@redhat.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.
*
* Der... | cwe | CWE-190 | C/C++ |
static int read_gab2_sub(AVFormatContext *s, AVStream *st, AVPacket *pkt)
{
if (pkt->size >= 7 &&
pkt->size < INT_MAX - AVPROBE_PADDING_SIZE &&
!strcmp(pkt->data, "GAB2") && AV_RL16(pkt->data + 5) == 2) {
uint8_t desc[256];
int score = AVPROBE_SCORE_EXTENSION, ret;
AVISt... | cwe | CWE-200 | C/C++ |
status_t BnGraphicBufferConsumer::onTransact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
switch(code) {
case ACQUIRE_BUFFER: {
CHECK_INTERFACE(IGraphicBufferConsumer, data, reply);
BufferItem item;
int64_t presentWhen = data.readInt64();
status_t result = acquireBuffer(&item, ... | cwe | CWE-254 | C/C++ |
MagickPrivate double GenerateDifferentialNoise(RandomInfo *random_info,
const Quantum pixel,const NoiseType noise_type,const double attenuate)
{
#define SigmaUniform (attenuate*0.015625)
#define SigmaGaussian (attenuate*0.015625)
#define SigmaImpulse (attenuate*0.1)
#define SigmaLaplacian (attenuate*0.0390625)
#de... | cwe | CWE-369 | Unknown |
static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb)
{
struct ipcm_cookie ipc;
struct rtable *rt = skb_rtable(skb);
struct net *net = dev_net(rt->dst.dev);
struct sock *sk;
struct inet_sock *inet;
__be32 daddr;
if (ip_options_echo(&icmp_param->replyopts, skb))
return;
sk = icmp_xmit_lock... | cwe | CWE-362 | Unknown |
void Document::open()
{
ASSERT(!importLoader());
if (m_frame) {
if (ScriptableDocumentParser* parser = scriptableDocumentParser()) {
if (parser->isParsing()) {
if (parser->isExecutingScript())
return;
if (!parser->wasCreatedByScript() && ... | cwe | CWE-20 | C/C++ |
read_system_page (Bit_Chain *dat, int64_t size_comp, int64_t size_uncomp,
int64_t repeat_count)
{
int i;
int error = 0;
int64_t pesize; // Pre RS encoded size
int64_t block_count; // Number of RS encoded blocks
int64_t page_size;
long pedata_size;
BITCODE_RC *rsdata; // RS encoded... | cwe | CWE-787 | Unknown |
protected function _copy($source, $targetDir, $name)
{
$res = false;
$target = $this->_joinPath($targetDir, $name);
if ($this->tmp) {
$local = $this->getTempFile();
if ($this->connect->get($source, $local)
&& $this->connect->put($target, $local, NET_... | cwe | CWE-918 | PHP |
void LinkChangeSerializerMarkupAccumulator::appendElement(StringBuilder& result, Element& element, Namespaces* namespaces)
{
if (element.hasTagName(HTMLNames::htmlTag)) {
result.append('\n');
MarkupFormatter::appendComment(result, String::format(" saved from url=(%04d)%s ",
static_cast<... | cwe | CWE-20 | C/C++ |
function Bn(e){return Tn(e)&&l(e)} | cwe | CWE-200 | JavaScript |
static int asn1_template_ex_d2i(ASN1_VALUE **val,
const unsigned char **in, long inlen,
const ASN1_TEMPLATE *tt, char opt,
ASN1_TLC *ctx)
{
int flags, aclass;
int ret;
long len;
const unsigned char *p, *q;
... | cwe | CWE-674 | Unknown |
getItemHtml: function (value) {
var translatedValue = this.translatedOptions[value] || value;
var html = '' +
'<div class="list-group-item link-with-role form-inline" data-value="' + value + '">' +
'<div class="pull-left" style="width: 92%; display: inline-block;">' ... | cwe | CWE-79 | JavaScript |
void svhandler_flash_pgm_word(void) {
uint32_t dst = _param_1;
uint32_t src = _param_2;
// Do not allow firmware to erase bootstrap or bootloader sectors.
if ((dst >= BSTRP_FLASH_SECT_START) &&
(dst <= (BSTRP_FLASH_SECT_START + BSTRP_FLASH_SECT_LEN))) {
return;
}
if ((dst >= BLDR_FLASH_SECT_STAR... | cwe | CWE-668 | Unknown |
jbig2_find_changing_element(const byte *line, int x, int w)
{
int a, b;
if (line == 0)
return w;
if (x == -1) {
a = 0;
x = 0;
} else {
}
while (x < w) {
b = getbit(line, x);
if (a != b)
break;
x++;
}
return x;
} | cwe | CWE-190 | C/C++ |
/* radare - LGPL3 - Copyright 2016-2021 - Matthieu (c0riolis) Tardy - l0stb1t*/
#include <r_io.h>
#include <r_bin.h>
#include "marshal.h"
#include "pyc_magic.h"
// avoiding using r2 internals asserts
#define if_true_return(cond,ret) if(cond){return(ret);}
// TODO: kill globals
static ut32 magic_int;
static ut32 symb... | cwe | CWE-119 | C/C++ |
static int ceph_x_proc_ticket_reply(struct ceph_auth_client *ac,
struct ceph_crypto_key *secret,
void *buf, void *end)
{
void *p = buf;
char *dbuf;
char *ticket_buf;
u8 reply_struct_v;
u32 num;
int ret;
dbuf = kmalloc(TEMP_TICKET_BUF_LEN, GFP_NOFS);
if (!dbuf)
return -ENOMEM;
ret = -ENOMEM;... | cwe | CWE-119 | C/C++ |
function mergeParamIntoObject(res, key, value) {
var tmpVal;
var objectIndex = key.indexOf(".");
if(objectIndex < 0) {
// force always array for some keys even if just one parameter
if (typeof res[key] === "undefined" && key !== "heading" && key !== "point" && key !== "details") {
... | cwe | CWE-1321 | JavaScript |
function Re(t,e){!0!==e.data.show&&je(e)} | cwe | CWE-79 | JavaScript |
#
# Copyright (c) 2010 Red Hat, Inc.
#
# Authors: Jeff Ortel <jortel@redhat.com>
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR... | cwe | CWE-264 | Python |
EditorUi.prototype.updateTabContainer=function(){null!=this.tabContainer&&(this.tabContainer.style.right="70px",this.diagramContainer.style.bottom="1"==urlParams.sketch?"0px":this.tabContainerHeight+"px");e.apply(this,arguments)};var g=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function... | cwe | CWE-94 | JavaScript |
Java_org_tensorflow_lite_InterpreterTest_getNativeHandleForDelegate(
JNIEnv* env, jclass clazz) {
// A simple op which outputs a tensor with values of 7.
static TfLiteRegistration registration = {
.init = nullptr,
.free = nullptr,
.prepare =
[](TfLiteContext* context, TfLiteNode* nod... | cwe | CWE-125 | C/C++ |
import dayjs from 'dayjs'
import customParseFormat from 'dayjs/plugin/customParseFormat'
import { t } from './i18n.js'
import Projects from '../api/projects/projects.js'
import projectUsers from '../api/users/users.js'
import { periodToDates } from './periodHelpers.js'
import { getGlobalSetting, getUserSetting } from '... | cwe | CWE-79 | JavaScript |
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-120 | Unknown |
package com.fasterxml.sort.std;
import java.io.*;
import com.fasterxml.sort.TempFileProvider;
/**
* Default {@link TempFileProvider} implementation which uses JDK default
* temporary file generation mechanism.
*
* @author tatu
*/
public class StdTempFileProvider
implements TempFileProvider
{
/**
*... | cwe | CWE-668 | Java |
protected function getNewShopUrl(Request $request, Shop $newShop)
{
// Remove baseUrl from request url
$url = $request->getRequestUri();
$repository = $this->get(ModelManager::class)->getRepository(Shop::class);
$requestShop = $repository->getActiveShopByRequestAsArray($request);
... | cwe | CWE-601 | PHP |
static inline int l2cap_config_rsp(struct l2cap_conn *conn,
struct l2cap_cmd_hdr *cmd, u16 cmd_len,
u8 *data)
{
struct l2cap_conf_rsp *rsp = (struct l2cap_conf_rsp *)data;
u16 scid, flags, result;
struct l2cap_chan *chan;
int len = cmd_len - sizeof(*rsp);
int err = 0;
if (cmd_len < sizeof(*rsp))
... | cwe | CWE-787 | Unknown |
int cg_write(const char *path, const char *buf, size_t size, off_t offset,
struct fuse_file_info *fi)
{
struct fuse_context *fc = fuse_get_context();
char *localbuf = NULL;
struct cgfs_files *k = NULL;
struct file_info *f = (struct file_info *)fi->fh;
bool r;
if (f->type != LXC_TYPE_CGFILE) {
fprintf(std... | cwe | CWE-264 | C/C++ |
/* -*- C++ -*-
* File: libraw_cxx.cpp
* Copyright 2008-2017 LibRaw LLC (info@libraw.org)
* Created: Sat Mar 8 , 2008
*
* LibRaw C++ interface (implementation)
LibRaw is free software; you can redistribute it and/or modify
it under the terms of the one of two licenses as you choose:
1. GNU LESSER GENERAL PUBLIC ... | cwe | CWE-119 | C/C++ |
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { parseDate } = require('@/utils/parse-date');
const cateList = ['all', 'design-resources', 'learn-design', 'inside-eagle'];
module.exports = async (ctx) => {
let cate = ctx.params.cate ?? 'all';
let language = ctx.params.language ?... | cwe | CWE-918 | JavaScript |
/*
* This file is part of Espruino, a JavaScript interpreter for Microcontrollers
*
* Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http... | cwe | CWE-119 | C/C++ |
jSuites.crop = (function(el, options) {
// Already created, update options
if (el.crop) {
return el.crop.setOptions(options, true);
}
// New instance
var obj = {};
obj.options = {};
el.classList.add('jcrop');
// Upload icon
el.classList.add('jupload');
// Area do crop
... | cwe | CWE-79 | JavaScript |
const got = require('@/utils/got');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const { id } = ctx.params;
const limit = ctx.query.limit ? parseInt(ctx.query.limit) : 20;
const response = await got({
method: 'get',
url: `https://${id}.zhubai.love/... | cwe | CWE-918 | JavaScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.