code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static int decode_avp(struct l2tp_avp_t *avp, const struct l2tp_attr_t *RV,
const char *secret, size_t secret_len)
{
MD5_CTX md5_ctx;
uint8_t md5[MD5_DIGEST_LENGTH];
uint8_t p1[MD5_DIGEST_LENGTH];
uint8_t *prev_block = NULL;
uint16_t attr_len;
uint16_t orig_attr_len;
uint16_t bytes_left;
uint16_t blocks... | cwe | CWE-120 | C/C++ |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
TfLiteIntArray* input_dims = input->dims;
int input_dims_size = input_dims->size;... | cwe | CWE-125 | C/C++ |
/* Copyright 2017 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-369 | C/C++ |
public RedirectView callback(@RequestParam(defaultValue = "/") String redirect,
@PathVariable String serverId,
@RequestParam String code,
@RequestParam String state,
HttpServletRequest req... | cwe | CWE-352 | Java |
static enum count_type __read_io_type(struct page *page)
{
struct address_space *mapping = page->mapping;
if (mapping) {
struct inode *inode = mapping->host;
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
if (inode->i_ino == F2FS_META_INO(sbi))
return F2FS_RD_META;
if (inode->i_ino == F2FS_NODE_INO(sbi))
... | cwe | CWE-476 | Unknown |
static int attach_child_main(void* data)
{
struct attach_clone_payload* payload = (struct attach_clone_payload*)data;
int ipc_socket = payload->ipc_socket;
lxc_attach_options_t* options = payload->options;
struct lxc_proc_context_info* init_ctx = payload->init_ctx;
#if HAVE_SYS_PERSONALITY_H
long new_personality;
... | cwe | CWE-17 | C/C++ |
pipe_read(struct kiocb *iocb, const struct iovec *_iov,
unsigned long nr_segs, loff_t pos)
{
struct file *filp = iocb->ki_filp;
struct pipe_inode_info *pipe = filp->private_data;
int do_wakeup;
ssize_t ret;
struct iovec *iov = (struct iovec *)_iov;
size_t total_len;
total_len = iov_length(iov, nr_segs);
/*... | cwe | CWE-17 | C/C++ |
static int hfi1_file_close(struct inode *inode, struct file *fp)
{
struct hfi1_filedata *fdata = fp->private_data;
struct hfi1_ctxtdata *uctxt = fdata->uctxt;
struct hfi1_devdata *dd = container_of(inode->i_cdev,
struct hfi1_devdata,
user_cdev);
unsigned long flags, *ev;
fp->private_data =... | cwe | CWE-416 | Unknown |
void TestGatherNd(int* param_dims, const ParamType* param_data, int* index_dims,
const IndexType* index_data, int* output_dims,
ParamType* output_data,
const ParamType* expected_output_data) {
TfLiteIntArray* pdims = IntArrayFromInts(param_dims);
TfLiteIntArray*... | cwe | CWE-703 | Unknown |
void snd_timer_interrupt(struct snd_timer * timer, unsigned long ticks_left)
{
struct snd_timer_instance *ti, *ts, *tmp;
unsigned long resolution, ticks;
struct list_head *p, *ack_list_head;
unsigned long flags;
int use_tasklet = 0;
if (timer == NULL)
return;
spin_lock_irqsave(&timer->lock, flags);
/* reme... | cwe | CWE-200 | Unknown |
static void ProxyLocaltimeCallToBrowser(time_t input, struct tm* output,
char* timezone_out,
size_t timezone_out_len) {
base::Pickle request;
request.WriteInt(LinuxSandbox::METHOD_LOCALTIME);
request.WriteString(
std::string(r... | cwe | CWE-119 | C/C++ |
static int parse_next_header(struct message_parser_ctx *ctx,
struct message_block *block_r)
{
struct message_part *part = ctx->part;
struct message_header_line *hdr;
struct message_boundary *boundary;
bool full;
int ret;
if ((ret = message_parser_read_more(ctx, block_r, &full)) == 0)
return ret;
if (... | cwe | CWE-20 | Unknown |
package middleware
import (
"fmt"
"html/template"
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"github.com/labstack/echo/v4"
"github.com/labstack/gommon/bytes"
)
type (
// StaticConfig defines the config for Static middleware.
StaticConfig struct {
// Skipper defines a function to skip mi... | cwe | CWE-22 | Go |
horizontalDifferenceF(float *ip, int n, int stride, uint16 *wp, uint16 *FromLT2)
{
int32 r1, g1, b1, a1, r2, g2, b2, a2, mask;
float fltsize = Fltsize;
#define CLAMP(v) ( (v<(float)0.) ? 0 \
: (v<(float)2.) ? FromLT2[(int)(v*fltsize)] \
: (v>(float)24.2) ? 2047 \
: LogK1*log(v*LogK2) + 0.... | cwe | CWE-119 | C/C++ |
static void get_socket_name( char* buf, int len )
{
char* dpy = g_strdup(g_getenv("DISPLAY"));
if(dpy && *dpy)
{
char* p = strchr(dpy, ':');
for(++p; *p && *p != '.' && *p != '\n';)
++p;
if(*p)
*p = '\0';
}
g_snprintf( buf, len, "%s/.menu-cached-%s... | cwe | CWE-20 | C/C++ |
*/
static void php_wddx_pop_element(void *user_data, const XML_Char *name)
{
st_entry *ent1, *ent2;
wddx_stack *stack = (wddx_stack *)user_data;
HashTable *target_hash;
zend_class_entry **pce;
zval *obj;
zval *tmp;
TSRMLS_FETCH();
/* OBJECTS_FIXME */
if (stack->top == 0) {
return;
}
if (!s... | cwe | CWE-476 | C/C++ |
// SPDX-License-Identifier: GPL-2.0-only
/*
* net/ipv6/fib6_rules.c IPv6 Routing Policy Rules
*
* Copyright (C)2003-2006 Helsinki University of Technology
* Copyright (C)2003-2006 USAGI/WIDE Project
*
* Authors
* Thomas Graf <tgraf@suug.ch>
* Ville Nuorvala <vnuorval@tcs.hut.fi>
*/
#include <linux/netdevice... | cwe | CWE-772 | C/C++ |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
// Reinterprete the opaque data provided by user.
OpData* data = reinterpret_cast<OpData*>(node->user_data);
const TfLiteTensor* input1 = GetInput... | cwe | CWE-125 | C/C++ |
@register.filter
def json_dumps(value, indent=None):
if isinstance(value, QuerySet):
result = serialize('json', value, indent=indent)
else:
result = json.dumps(value, indent=indent, cls=DjbletsJSONEncoder)
return mark_safe(result) | cwe | CWE-79 | Python |
/*jshint node:true*/
'use strict';
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var favicon = require('serve-favicon');
var logger = require('morgan');
var port = process.env.PORT || 8001;
var four0four = require('./utils/404')();
var environment = process.env.NODE_E... | cwe | CWE-79 | JavaScript |
static struct dir *squashfs_opendir(unsigned int block_start, unsigned int offset,
struct inode **i)
{
squashfs_dir_header_3 dirh;
char buffer[sizeof(squashfs_dir_entry_3) + SQUASHFS_NAME_LEN + 1]
__attribute__((aligned));
squashfs_dir_entry_3 *dire = (squashfs_dir_entry_3 *) buffer;
long long start;
int bytes ... | cwe | CWE-200 | Unknown |
// Copyright (C) 2015 University of Dundee & Open Microscopy Environment.
// All rights reserved.
// 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
... | cwe | CWE-116 | Python |
verifyEmail(req) {
const { token, username } = req.query;
const appId = req.params.appId;
const config = Config.get(appId);
if (!config) {
this.invalidRequest();
}
if (!config.publicServerURL) {
return this.missingPublicServerURL();
}
if (!token || !username) {
retur... | cwe | CWE-285 | JavaScript |
keyring_get_keyblock (KEYRING_HANDLE hd, KBNODE *ret_kb)
{
PACKET *pkt;
int rc;
KBNODE keyblock = NULL, node, lastnode;
IOBUF a;
int in_cert = 0;
int pk_no = 0;
int uid_no = 0;
int save_mode;
if (ret_kb)
*ret_kb = NULL;
if (!hd->found.kr)
return -1; /* no succes... | cwe | CWE-416 | Unknown |
/*
* Copyright (C) 2007 Martin Willi
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any ... | cwe | CWE-476 | C/C++ |
const bootbox = require('bootbox');
require('../services/Requisitions');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(function() {
'use strict';
const policyView = require('../../views/policy.html');
const moveView = require('../../views/move.html');
cons... | cwe | CWE-79 | Java |
/* Copyright 2020 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 |
it "should reject a critical extension that isn't on the whitelist" do
@request.stubs(:request_extensions).returns [{ "oid" => "banana",
"value" => "yumm",
"critical" => true }]
expect { @ca.sig... | cwe | CWE-264 | Ruby |
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
*
* LibTomCrypt is a library that provides various cryptographic
* algorithms in a highly modular and flexible manner.
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://l... | cwe | CWE-20 | C/C++ |
function sanitizeShellString(str) {
let result = str;
result = result.replace(/>/g, "");
result = result.replace(/</g, "");
result = result.replace(/\*/g, "");
result = result.replace(/\?/g, "");
result = result.replace(/\[/g, "");
result = result.replace(/\]/g, "");
result = result.replace(/\|/g, "");
... | cwe | CWE-77 | JavaScript |
static void cil_reset_classperms_set(struct cil_classperms_set *cp_set)
{
cil_reset_classpermission(cp_set->set);
} | cwe | CWE-416 | C/C++ |
function Su(e){let t=e.match(/^(-?[0-9]+)(px|%)?$/);return t?t[1]+(t[2]||"px"):void 0} | cwe | CWE-352 | JavaScript |
void start()
{
adaptor_.start([this](const asio::error_code& ec) {
if (!ec)
{
start_deadline();
do_read();
}
else
{
CROW_LOG_ERROR << "Could not start adaptor:... | cwe | CWE-416 | Unknown |
int venc_dev::venc_output_log_buffers(const char *buffer_addr, int buffer_len)
{
if (!m_debug.outfile) {
int size = 0;
if(m_sVenc_cfg.codectype == V4L2_PIX_FMT_MPEG4) {
size = snprintf(m_debug.outfile_name, PROPERTY_VALUE_MAX, "%s/output_enc_%lu_%lu_%p.m4v",
... | cwe | CWE-200 | C/C++ |
/* ruleset.c - rsyslog's ruleset object
*
* We have a two-way structure of linked lists: one global linked list
* (llAllRulesets) hold alls rule sets that we know. Included in each
* list is a list of rules (which contain a list of actions, but that's
* a different story).
*
* Usually, only a single rule set is ... | cwe | CWE-772 | C/C++ |
static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define ThrowDCMException(exception,message) \
{ \
if (info.scale != (Quantum *) NULL) \
info.scale=(Quantum *) RelinquishMagickMemory(info.scale); \
if (data != (unsigned char *) NULL) \
data=(unsigned char *) RelinquishMagi... | cwe | CWE-401 | Unknown |
/*
* Copyright (c) 2004-2021, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
* list of cond... | cwe | CWE-918 | Java |
/*
* 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-707 | Java |
/* 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-369 | Python |
show_transport_handle(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct iscsi_internal *priv = dev_to_iscsi_internal(dev);
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
return sprintf(buf, "%llu\n", (unsigned long long)iscsi_handle(priv->iscsi_transport));
} | cwe | CWE-787 | Unknown |
static ssize_t stellaris_enet_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
stellaris_enet_state *s = qemu_get_nic_opaque(nc);
int n;
uint8_t *p;
uint32_t crc;
if ((s->rctl & SE_RCTL_RXEN) == 0)
return -1;
if (s->np >= 31) {
return 0;
}
DPRINTF("Receive... | cwe | CWE-120 | C/C++ |
struct inode *fuse_iget(struct super_block *sb, u64 nodeid,
int generation, struct fuse_attr *attr,
u64 attr_valid, u64 attr_version)
{
struct inode *inode;
struct fuse_inode *fi;
struct fuse_conn *fc = get_fuse_conn_super(sb);
/*
* Auto mount points get their node id from the submount root, which is
* n... | cwe | CWE-459 | Unknown |
PostgresMain(int argc, char *argv[],
const char *dbname,
const char *username)
{
int firstchar;
StringInfoData input_message;
sigjmp_buf local_sigjmp_buf;
volatile bool send_ready_for_query = true;
/* Initialize startup process environment if necessary. */
if (!IsUnderPostmaster)
InitStandaloneProces... | cwe | CWE-89 | Unknown |
import graphene
from django.contrib.auth import password_validation
from django.contrib.auth.tokens import default_token_generator
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from ....account import events as account_events
from ....account import models
from ....account.error_codes import A... | cwe | CWE-863 | Python |
static int do_pages_stat(struct mm_struct *mm, struct page_to_node *pm)
{
down_read(&mm->mmap_sem);
for ( ; pm->node != MAX_NUMNODES; pm++) {
struct vm_area_struct *vma;
struct page *page;
int err;
err = -EFAULT;
vma = find_vma(mm, pm->addr);
if (!vma)
goto set_status;
page = follow_page(vma, pm->... | cwe | CWE-20 | Unknown |
def get(self, path: str) -> None:
parts = path.split("/")
component_name = parts[0]
component_root = self._registry.get_component_path(component_name)
if component_root is None:
self.write("not found")
self.set_status(404)
return
filename = "/... | cwe | CWE-22 | Python |
void HeaderMapImpl::removeInline(HeaderEntryImpl** ptr_to_entry) {
if (!*ptr_to_entry) {
return;
}
HeaderEntryImpl* entry = *ptr_to_entry;
*ptr_to_entry = nullptr;
headers_.erase(entry->entry_);
} | cwe | CWE-703 | Unknown |
function getUserGroupID($name, $affilid=DEFAULT_AFFILID) {
$query = "SELECT id "
. "FROM usergroup "
. "WHERE name = '$name' AND "
. "affiliationid = $affilid";
$qh = doQuery($query, 300);
if($row = mysql_fetch_row($qh)) {
return $row[0];
}
$query = "INSERT INTO usergroup "
... | cwe | CWE-264 | PHP |
empe_inlinepgp_signed_parse (EMailParserExtension *extension,
EMailParser *parser,
CamelMimePart *part,
GString *part_id,
GCancellable *cancellable,
GQueue *out_mail_parts)
{
... | cwe | CWE-347 | Unknown |
/******************************************************************************\
This file is part of the C! library. A.K.A the cbang library.
Copyright (c) 2003-2019, Cauldron Development LLC
Copyright (c) 2003-2017, Stanford University
All... | cwe | CWE-22 | C/C++ |
void Compute(OpKernelContext* ctx) override {
const Tensor* inputs;
const Tensor* labels_indices;
const Tensor* labels_values;
const Tensor* seq_len;
OP_REQUIRES_OK(ctx, ctx->input("inputs", &inputs));
OP_REQUIRES_OK(ctx, ctx->input("labels_indices", &labels_indices));
OP_REQUIRES_OK(ctx, ct... | cwe | CWE-665 | C/C++ |
bool feed(const char* buffer, int length)
{
const static http_parser_settings settings_{
on_message_begin,
on_method,
on_url,
on_header_field,
on_header_value,
on_headers_complete,
on_body,
... | cwe | CWE-416 | Unknown |
_processSubscribeResponse(status, payload) {
if (status.error) {
// if error comes from request abort, ignore
if (status.errorData && status.errorData.message === 'Aborted') {
return;
}
// if we timeout from server, restart the loop.
if (status.category === categoryConstants.P... | cwe | CWE-331 | JavaScript |
void AOClient::pktRemoveEvidence(AreaData* area, int argc, QStringList argv, AOPacket packet)
{
if (!checkEvidenceAccess(area))
return;
bool is_int = false;
int idx = argv[0].toInt(&is_int);
if (is_int && idx <= area->evidence().size() && idx >= 0) {
area->deleteEvidence(idx);
}
... | cwe | CWE-129 | C/C++ |
bool WindowsServiceControl::install( const QString& filePath, const QString& displayName )
{
m_serviceHandle = CreateService(
m_serviceManager, // SCManager database
WindowsCoreFunctions::toConstWCharArray( m_name ), // name of service
WindowsCoreFunctions::toConstWCharArray( displayName ),// name to dis... | cwe | CWE-295 | C/C++ |
@app.route("/search", methods = ["POST"])
def search_pages():
search = request.form.get("search")
page = db.query("select title from page where title = '%s'" % search).namedresult()
if len(page) == 0:
return redirect("/%s" % search)
else:
return place_holder(search) | cwe | CWE-89 | Python |
async function exportSecrets() {
const vaultUrl = core.getInput('url', { required: true });
const vaultNamespace = core.getInput('namespace', { required: false });
const extraHeaders = parseHeadersInput('extraHeaders', { required: false });
const exportEnv = core.getInput('exportEnv', { required: false ... | cwe | CWE-532 | JavaScript |
static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image,
ExceptionInfo *exception)
{
#define WriteRunlengthPacket(image,pixel,length,p) \
{ \
if ((image->alpha_trait != UndefinedPixelTrait) && (length != 0) && \
(GetPixelAlpha(image,p) == (Quantum) TransparentAlpha)) \
{ \
q=P... | cwe | CWE-787 | C/C++ |
static void WriteProfile(j_compress_ptr jpeg_info,Image *image)
{
const char
*name;
const StringInfo
*profile;
MagickBooleanType
iptc;
register ssize_t
i;
size_t
length,
tag_length;
StringInfo
*custom_profile;
/*
Save image profile as a APP marker.
*/
iptc=MagickF... | cwe | CWE-119 | C/C++ |
def self.create_user_from_invite(email:, invite:, username: nil, name: nil, password: nil, user_custom_fields: nil, ip_address: nil, session: nil, email_token: nil)
if username && UsernameValidator.new(username).valid_format? && User.username_available?(username, email)
available_username = username
else
... | cwe | CWE-285 | Ruby |
function next() {
if (++f < files.length) {
spawn(process.argv[0], [ files[f] ], { stdio: 'inherit' })
.on('exit', function(code) {
if (code === 0)
process.nextTick(next);
else
process.exit(code);
});
}
} | cwe | CWE-78 | JavaScript |
/* $Id$ */
/* tiffcrop.c -- a port of tiffcp.c extended to include manipulations of
* the image data through additional options listed below
*
* Original code:
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
* Additions (c) Richard Nolde 2006-2010
*
* Permission to use, ... | cwe | CWE-119 | C/C++ |
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved
*
* $Header$
*/
#include "k5-int.h"
#include <sys/time.h>
#include <kadm5/admin.h>
#include <kdb.h>
#include "server_internal.h"
#ifdef USE_PASSWORD_SERV... | cwe | CWE-476 | C/C++ |
static int zpff_init(struct hid_device *hid)
{
struct zpff_device *zpff;
struct hid_report *report;
struct hid_input *hidinput = list_entry(hid->inputs.next,
struct hid_input, list);
struct input_dev *dev = hidinput->input;
int i, error;
for (i = 0; i < 4; i++) {
report = hid_validate_values(hid, HID_OUT... | cwe | CWE-787 | C/C++ |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TfLitePackParams* data =
reinterpret_cast<TfLitePackParams*>(node->builtin_data);
TF_LITE_ENSURE_EQ(context, NumInputs(node), data->values_count);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input0 = GetInput(conte... | cwe | CWE-125 | C/C++ |
function configure(config, layouts) {
let layout = layouts.basicLayout;
if (config.layout) {
layout = layouts.layout(config.layout.type, config.layout);
}
const options = {
flags: config.flags || 'a',
encoding: config.encoding || 'utf8',
mode: config.mode || 0o644
};
return fileAppender(
... | cwe | CWE-276 | JavaScript |
E);null!=T&&J.setAttribute("backgroundImage",JSON.stringify(T));J.setAttribute("math",this.graph.mathEnabled?"1":"0");J.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(T=this.graph.extFonts.map(function(N){return N.name+"^"+N.url}),J.setAttribute("extFon... | cwe | CWE-20 | JavaScript |
/* radare - LGPL - Copyright 2009-2021 - pancake, nibble */
#include <r_types.h>
#include <r_list.h>
#include <r_flag.h>
#include <r_core.h>
#include <r_bin.h>
#include <ht_uu.h>
#include <r_util/r_graph_drawable.h>
#include <string.h>
HEAPTYPE (ut64);
// used to speedup strcmp with rconfig.get in loops
enum {
R2_... | cwe | CWE-416 | C/C++ |
SCTP_STATIC int sctp_init_sock(struct sock *sk)
{
struct sctp_endpoint *ep;
struct sctp_sock *sp;
SCTP_DEBUG_PRINTK("sctp_init_sock(sk: %p)\n", sk);
sp = sctp_sk(sk);
/* Initialize the SCTP per socket area. */
switch (sk->sk_type) {
case SOCK_SEQPACKET:
sp->type = SCTP_SOCKET_UDP;
break;
case SOCK_STREA... | cwe | CWE-400 | Unknown |
function pn(e){var t=e[Jt]||{},n=t.resizer;delete t.resizer,fn(e),n&&n.parentNode&&n.parentNode.removeChild(n)} | cwe | CWE-79 | JavaScript |
/*
* Copyright (c) 2005-2007 William Pitcock, et al.
* Rights to this code are as documented in doc/LICENSE.
*
* This file contains code for the CService FLAGS functions.
*
*/
#include "atheme.h"
#include "template.h"
DECLARE_MODULE_V1
(
"chanserv/flags", false, _modinit, _moddeinit,
PACKAGE_STRING,
"Atheme ... | cwe | CWE-284 | C/C++ |
function hostChecked(box) {
var cid = parseInt(box.id.replace("host_ids_", ""));
if (box.checked)
addHostId(cid);
else
rmHostId(cid);
$.cookie($.cookieName, JSON.stringify($.foremanSelectedHosts));
toggle_actions();
update_counter();
return false;
} | cwe | CWE-284 | JavaScript |
// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
//
// This file is provided under a dual BSD/GPLv2 license. When using or
// redistributing this file, you may do so under either license.
//
// Copyright(c) 2018 Intel Corporation. All rights reserved.
//
// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
... | cwe | CWE-401 | C/C++ |
static int __init big_key_crypto_init(void)
{
int ret = -EINVAL;
/* init RNG */
big_key_rng = crypto_alloc_rng(big_key_rng_name, 0, 0);
if (IS_ERR(big_key_rng)) {
big_key_rng = NULL;
return -EFAULT;
}
/* seed RNG */
ret = crypto_rng_reset(big_key_rng, NULL, crypto_rng_seedsize(big_key_rng));
if (ret)
... | cwe | CWE-476 | C/C++ |
int ParseWave64HeaderConfig (FILE *infile, char *infilename, char *fourcc, WavpackContext *wpc, WavpackConfig *config)
{
int64_t total_samples = 0, infilesize;
Wave64ChunkHeader chunk_header;
Wave64FileHeader filehdr;
WaveHeader WaveHeader;
uint32_t bcount;
infilesize = DoGetFileSize (infile);
... | cwe | CWE-119 | Unknown |
private def createSessionId(siteId: SiteId, userId: UserId): SidOk = {
// For now, create a SID value and *parse* it to get a SidOk.
// This is stupid and inefficient.
val now = globals.now()
val uid = "" // for now
val useridDateRandom =
userId +"."+
now.millis +"."+
(nex... | cwe | CWE-613 | Scala |
v8::Local<v8::Value> ModuleSystem::LoadModule(const std::string& module_name) {
v8::EscapableHandleScope handle_scope(GetIsolate());
v8::Local<v8::Context> v8_context = context()->v8_context();
v8::Context::Scope context_scope(v8_context);
v8::Local<v8::Value> source(GetSource(module_name));
if (source.IsEmp... | cwe | CWE-264 | C/C++ |
pci_emul_add_msixcap(struct pci_vdev *dev, int msgnum, int barnum)
{
uint32_t tab_size;
struct msixcap msixcap;
assert(msgnum >= 1 && msgnum <= MAX_MSIX_TABLE_ENTRIES);
assert(barnum >= 0 && barnum <= PCIR_MAX_BAR_0);
tab_size = msgnum * MSIX_TABLE_ENTRY_SIZE;
/* Align table size to nearest 4K */
tab_size = r... | cwe | CWE-617 | Unknown |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/* Copyright (c) 2015 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE.chrome file.
*/
/* This file contains common certificates. It's designed to be #i... | cwe | CWE-476 | C/C++ |
htmlParseNameComplex(xmlParserCtxtPtr ctxt) {
int len = 0, l;
int c;
int count = 0;
const xmlChar *base = ctxt->input->base;
/*
* Handler for more complex cases
*/
GROW;
c = CUR_CHAR(l);
if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */
(!IS_LETTER(c) && (c != ... | cwe | CWE-787 | C/C++ |
xmlBufCCat(xmlBufPtr buf, const char *str) {
const char *cur;
if ((buf == NULL) || (buf->error))
return(-1);
CHECK_COMPAT(buf)
if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return -1;
if (str == NULL) {
#ifdef DEBUG_BUFFER
xmlGenericError(xmlGenericErrorContext,
"xmlBufCCat: str =... | cwe | CWE-190 | Unknown |
def get_first_month(db, scene):
sql = "select date from matches where scene='{}' order by date limit 1;".format(scene)
res = db.exec(sql)
date = res[0][0]
return date | cwe | CWE-89 | Python |
/*************************************************************************
This project implements a complete(!) JPEG (Recommendation ITU-T
T.81 | ISO/IEC 10918-1) codec, plus a library that can be used to
encode and decode JPEG streams.
It also implements ISO/IEC 18477 aka JPEG XT which is an extensi... | cwe | CWE-125 | C/C++ |
urlParams.sketch?3:48)));this.getX()==V&&this.getY()==X||mxWindow.prototype.setLocation.apply(this,arguments)};var W=mxUtils.bind(this,function(){var V=this.window.getX(),X=this.window.getY();this.window.setLocation(V,X)});mxEvent.addListener(window,"resize",W);this.destroy=function(){mxEvent.removeListener(window,"res... | cwe | CWE-20 | JavaScript |
ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len,
const BIGNUM *in_kinv, const BIGNUM *in_r,
EC_KEY *eckey)
{
int ok = 0, i;
BIGNUM *kinv = NULL, *s, *m = NULL, *tmp = NULL;
const BIGNUM *order, *ckinv;
BN_CTX *ctx = NUL... | cwe | CWE-203 | Unknown |
gtls_connect_step3(struct Curl_easy *data,
struct connectdata *conn,
int sockindex)
{
unsigned int cert_list_size;
const gnutls_datum_t *chainp;
unsigned int verify_status = 0;
gnutls_x509_crt_t x509_cert, x509_issuer;
gnutls_datum_t issuerp;
gnutls_datum_t certfields;
... | cwe | CWE-290 | Unknown |
static void *__bpf_ringbuf_reserve(struct bpf_ringbuf *rb, u64 size)
{
unsigned long cons_pos, prod_pos, new_prod_pos, flags;
u32 len, pg_off;
struct bpf_ringbuf_hdr *hdr;
if (unlikely(size > RINGBUF_MAX_RECORD_SZ))
return NULL;
len = round_up(size + BPF_RINGBUF_HDR_SZ, 8);
cons_pos = smp_load_acquire(&rb->co... | cwe | CWE-787 | C/C++ |
package com.salesmanager.core.business.repositories.catalog.product.attribute;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import com.salesmanager.core.model.catalog.product.attribute.ProductAttribute;
public interface Pr... | cwe | CWE-639 | Java |
static long pipe_set_size(struct pipe_inode_info *pipe, unsigned long nr_pages)
{
struct pipe_buffer *bufs;
/*
* We can shrink the pipe, if arg >= pipe->nrbufs. Since we don't
* expect a lot of shrink+grow operations, just free and allocate
* again like we would do for growing. If the pipe currently
* contai... | cwe | CWE-399 | C/C++ |
function _typed(name, signatures) {
var refs = new Refs();
// parse signatures, expand them
var _signatures = parseSignatures(signatures);
if (_signatures.length == 0) {
throw new Error('No signatures provided');
}
// filter all any type signatures
var anys = filterAn... | cwe | CWE-20 | JavaScript |
static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
{
BOOL rc = FALSE;
rdpContext* context = update->context;
rdpPrimaryUpdate* primary = update->primary;
ORDER_INFO* orderInfo = &(primary->order_info);
rdpSettings* settings = context->settings;
const char* orderName;
if (flags & OR... | cwe | CWE-125 | C/C++ |
void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed)
{
struct hstate *h = hstate_inode(inode);
long chg = region_truncate(&inode->i_mapping->private_list, offset);
spin_lock(&inode->i_lock);
inode->i_blocks -= (blocks_per_huge_page(h) * freed);
spin_unlock(&inode->i_lock);
hugetlb_put_quot... | cwe | CWE-399 | C/C++ |
bool OutOfProcessInstance::Init(uint32_t argc,
const char* argn[],
const char* argv[]) {
pp::Var document_url_var = pp::URLUtil_Dev::Get()->GetDocumentURL(this);
std::string document_url = document_url_var.is_string() ?
document_url_var.AsStri... | cwe | CWE-20 | C/C++ |
static MagickOffsetType TIFFSeekCustomStream(const MagickOffsetType offset,
const int whence,void *user_data)
{
PhotoshopProfile
*profile;
profile=(PhotoshopProfile *) user_data;
switch (whence)
{
case SEEK_SET:
default:
{
if (offset < 0)
return(-1);
profile->offset=offset... | cwe | CWE-190 | C/C++ |
static void vdbeVComment(Vdbe *p, const char *zFormat, va_list ap){
assert( p->nOp>0 || p->aOp==0 );
assert( p->aOp==0 || p->aOp[p->nOp-1].zComment==0 || p->db->mallocFailed );
if( p->nOp ){
assert( p->aOp );
sqlite3DbFree(p->db, p->aOp[p->nOp-1].zComment);
p->aOp[p->nOp-1].zComment = sqlite3VMPrintf(... | cwe | CWE-755 | C/C++ |
/* Copyright 2016 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-369 | Python |
/*
nicklist.c : irssi
Copyright (C) 1999-2000 Timo Sirainen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later versio... | cwe | CWE-416 | C/C++ |
static Jsi_RC jsi_ArrayUnshiftCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,Jsi_Value **ret, Jsi_Func *funcPtr) {
if (_this->vt != JSI_VT_OBJECT || !Jsi_ObjIsArray(interp, _this->d.obj))
return Jsi_LogError("expected array object");
Jsi_Obj *obj = _this->d.obj;
int argc = Jsi_ValueGetLe... | cwe | CWE-190 | C/C++ |
XcursorCommentCreate (XcursorUInt comment_type, int length)
{
XcursorComment *comment;
if (length > XCURSOR_COMMENT_MAX_LEN)
return NULL;
{
XcursorComment *comment;
if (length > XCURSOR_COMMENT_MAX_LEN)
return NULL;
comment = malloc (sizeof (XcursorComment) + length + 1);
comment->c... | cwe | CWE-190 | C/C++ |
static bool check_inode(struct exfat_de_iter *iter, struct exfat_inode *node)
{
struct exfat *exfat = iter->exfat;
struct exfat_dentry *dentry;
bool ret = true;
uint16_t checksum;
if (check_clus_chain(exfat, node))
return false;
if (node->size > le32_to_cpu(exfat->bs->bsx.clu_count) *
exfat->clus_size) {
... | cwe | CWE-190 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.