code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
mxCellEditor.prototype.installListeners=function(a){mxEvent.addListener(a,"dragstart",mxUtils.bind(this,function(d){this.graph.stopEditing(!1);mxEvent.consume(d)}));mxEvent.addListener(a,"blur",mxUtils.bind(this,function(d){this.blurEnabled&&this.focusLost(d)}));mxEvent.addListener(a,"keydown",mxUtils.bind(this,functio... | cwe | CWE-94 | JavaScript |
# Natural Language Toolkit: Punkt sentence tokenizer
#
# Copyright (C) 2001-2021 NLTK Project
# Algorithm: Kiss & Strunk (2006)
# Author: Willy <willy@csse.unimelb.edu.au> (original Python port)
# Steven Bird <stevenbird1@gmail.com> (additions)
# Edward Loper <edloper@gmail.com> (rewrite)
# Joel... | cwe | CWE-400 | Python |
function toggleRawSource($event) {
Calendar.$$resource.post(vm.component.pid + '/' + vm.component.id, "raw").then(function(data) {
$mdDialog.hide();
$mdDialog.show({
parent: angular.element(document.body),
targetEvent: $event,
clickOutsideToClose: true,
esca... | cwe | CWE-79 | JavaScript |
package com.salesmanager.shop.admin.controller.user;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validat... | cwe | CWE-639 | Java |
void kvm_lapic_sync_from_vapic(struct kvm_vcpu *vcpu)
{
u32 data;
void *vapic;
if (test_bit(KVM_APIC_PV_EOI_PENDING, &vcpu->arch.apic_attention))
apic_sync_pv_eoi_from_guest(vcpu, vcpu->arch.apic);
if (!test_bit(KVM_APIC_CHECK_VAPIC, &vcpu->arch.apic_attention))
return;
vapic = kmap_atomic(vcpu->arch.apic->... | cwe | CWE-20 | Unknown |
int inet6_csk_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl_unused)
{
struct ipv6_pinfo *np = inet6_sk(sk);
struct flowi6 fl6;
struct dst_entry *dst;
int res;
dst = inet6_csk_route_socket(sk, &fl6);
if (IS_ERR(dst)) {
sk->sk_err_soft = -PTR_ERR(dst);
sk->sk_route_caps = 0;
kfree_skb(skb);
r... | cwe | CWE-284 | Unknown |
static int fuse_xattr_set(const struct xattr_handler *handler,
struct dentry *dentry, struct inode *inode,
const char *name, const void *value, size_t size,
int flags)
{
if (!value)
return fuse_removexattr(inode, name);
return fuse_setxattr(inode, name, value, size, flags);
} | cwe | CWE-459 | Unknown |
from functools import partial
import django_otp
from django.conf import settings
from django.contrib.auth.views import redirect_to_login
from django.urls import NoReverseMatch, reverse
from django.utils.functional import SimpleLazyObject
from django_otp.middleware import OTPMiddleware as _OTPMiddleware
class VerifyU... | cwe | CWE-522 | Python |
TPMA_OBJECT_Unmarshal(TPMA_OBJECT *target, BYTE **buffer, INT32 *size)
{
TPM_RC rc = TPM_RC_SUCCESS;
if (rc == TPM_RC_SUCCESS) {
rc = UINT32_Unmarshal((UINT32 *)target, buffer, size); /* libtpms changed */
}
if (rc == TPM_RC_SUCCESS) {
if (*target & TPMA_OBJECT_reserved) {
rc = TPM_RC_RESERVED_B... | cwe | CWE-787 | Unknown |
rdpBitmapCache* bitmap_cache_new(rdpSettings* settings)
{
int i;
rdpBitmapCache* bitmapCache;
bitmapCache = (rdpBitmapCache*)calloc(1, sizeof(rdpBitmapCache));
if (!bitmapCache)
return NULL;
bitmapCache->settings = settings;
bitmapCache->update = ((freerdp*)settings->instance)->update;
bitmapCache->context =... | cwe | CWE-125 | Unknown |
main (int argc,
char **argv)
{
mode_t old_umask;
cleanup_free char *base_path = NULL;
int clone_flags;
char *old_cwd = NULL;
pid_t pid;
int event_fd = -1;
int child_wait_fd = -1;
const char *new_cwd;
uid_t ns_uid;
gid_t ns_gid;
struct stat sbuf;
uint64_t val;
int res UNUSED;
real_u... | cwe | CWE-20 | C/C++ |
static struct sk_buff *udp_gro_receive_segment(struct list_head *head,
struct sk_buff *skb)
{
struct udphdr *uh = udp_hdr(skb);
struct sk_buff *pp = NULL;
struct udphdr *uh2;
struct sk_buff *p;
/* requires non zero csum, for symmetry with GSO */
if (!uh->check) {
NAPI_GRO_CB(skb)->flush = 1;
retu... | cwe | CWE-787 | C/C++ |
auto Phase3() -> Local<Value> final {
return Boolean::New(Isolate::GetCurrent(), did_set);
} | cwe | CWE-913 | Unknown |
void *UntrustedCacheMalloc::GetBuffer() {
void **buffers = nullptr;
void *buffer;
bool is_pool_empty;
{
LockGuard spin_lock(&lock_);
is_pool_empty = buffer_pool_.empty();
if (is_pool_empty) {
buffers =
primitives::AllocateUntrustedBuffers(kPoolIncrement, kPoolEntrySize);
for (... | cwe | CWE-200 | C/C++ |
STATIC U8 *
S_reghop4(U8 *s, SSize_t off, const U8* llim, const U8* rlim)
{
PERL_ARGS_ASSERT_REGHOP4;
if (off >= 0) {
while (off-- && s < rlim) {
/* XXX could check well-formedness here */
s += UTF8SKIP(s);
}
}
else {
while (off++ && s > llim) {
... | cwe | CWE-416 | Unknown |
plain(void)
{
test(PTR1_ZEROES PTR1_STR " " PTR2_STR, "%p %p", PTR1, PTR2);
/*
* The field width is overloaded for some %p extensions to
* pass another piece of information. For plain pointers, the
* behaviour is slightly odd: One cannot pass either the 0
* flag nor a precision to %p without gcc complaining, ... | cwe | CWE-200 | Unknown |
PJ_DEF(pj_status_t) pjmedia_rtcp_fb_build_nack(
pjmedia_rtcp_session *session,
void *buf,
pj_size_t *length,
unsigned nack_cnt,
const pjmedia_rtcp_fb_nack nack[])
{
pjmedia_rtcp_common *hdr;
pj_uint8_t *p;
unsigned len, i;
PJ_ASSERT_RETURN(session && buf && length && nack_cnt &... | cwe | CWE-125 | C/C++ |
static int walk_hugetlb_range(unsigned long addr, unsigned long end,
struct mm_walk *walk)
{
return 0;
} | cwe | CWE-200 | Unknown |
function createContext(context = {}) {
// set initial context
Shopware.State.commit('context/setAppEnvironment', process.env.NODE_ENV);
Shopware.State.commit('context/setAppFallbackLocale', 'en-GB');
// assign unknown context information
Object.entries(context).forEach(([key, value]) => {
S... | cwe | CWE-613 | JavaScript |
exports.quote = function (xs) {
return xs.map(function (s) {
if (s && typeof s === 'object') {
return s.op.replace(/(.)/g, '\\$1');
}
else if (/["\s]/.test(s) && !/'/.test(s)) {
return "'" + s.replace(/(['\\])/g, '\\$1') + "'";
}
else if (/["'\s]/.test... | cwe | CWE-77 | JavaScript |
static int read_user_chunk_callback(png_struct *ping, png_unknown_chunkp chunk)
{
Image
*image;
/* The unknown chunk structure contains the chunk data:
png_byte name[5];
png_byte *data;
png_size_t size;
Note that libpng has already taken care of the CRC handling.
Returns one of the ... | cwe | CWE-772 | Unknown |
bool ChangeInputMethod(const char* name) {
if (!IBusConnectionsAreAlive()) {
LOG(ERROR) << "ChangeInputMethod: IBus connection is not alive";
return false;
}
if (!name) {
return false;
}
if (!InputMethodIdIsWhitelisted(name)) {
LOG(ERROR) << "Input method '" << name <<... | cwe | CWE-20 | C/C++ |
libxlLoggerNew(const char *logDir, virLogPriority minLevel)
{
xentoollog_logger_libvirt logger;
g_autofree char *path = NULL;
switch (minLevel) {
case VIR_LOG_DEBUG:
logger.minLevel = XTL_DEBUG;
break;
case VIR_LOG_INFO:
logger.minLevel = XTL_INFO;
break;
case VI... | cwe | CWE-667 | Unknown |
def set_cluster_conf(params, request, session)
if not allowed_for_local_cluster(session, Permissions::FULL)
return 403, 'Permission denied'
end
if params[:cluster_conf] != nil and params[:cluster_conf].strip != ""
Cfgsync::ClusterConf.backup()
Cfgsync::ClusterConf.from_text(params[:cluster_conf]).save... | cwe | CWE-384 | Ruby |
window.OME.handleChgrp = function(webindex, staticurl) {
webindex_url = webindex;
static_url = staticurl;
// gid, gname, oid
$chgrpform.dialog({"title": "Move to Group",
height: 450,
width: 400});
$chgrpform.dialog('open');
$chgrpform.empty();
... | cwe | CWE-116 | JavaScript |
public Controller execute(FolderComponent folderComponent, UserRequest ureq, WindowControl wContr, Translator trans) {
this.translator = trans;
FileSelection selection = new FileSelection(ureq, folderComponent.getCurrentContainerPath());
VFSContainer currentContainer = folderComponent.getCurrentContainer();
if ... | cwe | CWE-22 | Java |
int CLASS parse_jpeg(int offset)
{
int len, save, hlen, mark;
fseek(ifp, offset, SEEK_SET);
if (fgetc(ifp) != 0xff || fgetc(ifp) != 0xd8)
return 0;
while (fgetc(ifp) == 0xff && (mark = fgetc(ifp)) != 0xda)
{
order = 0x4d4d;
len = get2() - 2;
save = ftell(ifp);
if (mark == 0xc0 || mark == ... | cwe | CWE-119 | C/C++ |
void receive_xattr(int f, struct file_struct *file)
{
static item_list temp_xattr = EMPTY_ITEM_LIST;
int count, num;
#ifdef HAVE_LINUX_XATTRS
int need_sort = 0;
#else
int need_sort = 1;
#endif
int ndx = read_varint(f);
if (ndx < 0 || (size_t)ndx > rsync_xal_l.count) {
rprintf(FERROR, "receive_xattr: xa index %... | cwe | CWE-125 | C/C++ |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
import string
import random
import hashlib
import requests
from .base import Map, WeixinError
try:
from flask import request
except Exception:
request = None
try:
from lxml import etree
except ImportError:
from xml.etree i... | cwe | CWE-611 | Python |
from __future__ import absolute_import
from typing import Any, Optional, Tuple, List, Set, Iterable, Mapping, Callable, Dict
from django.utils.translation import ugettext as _
from django.conf import settings
from django.db import transaction
from django.http import HttpRequest, HttpResponse
from zerver.lib.request i... | cwe | CWE-863 | Python |
escapes(cp, tp)
const char *cp;
char *tp;
{
while (*cp) {
int cval = 0, meta = 0;
if (*cp == '\\' && cp[1] && index("mM", cp[1]) && cp[2]) {
meta = 1;
cp += 2;
}
if (*cp == '\\' && cp[1] && index("0123456789xXoO", cp[1]) && cp[2]) {
NEARDATA const char hex[] = "00112233445566778899aAbBcCdDeEfF";
... | cwe | CWE-269 | C/C++ |
public static function cleanX ($c) {
$val = self::strip_tags_content($c, '<script>', TRUE);
$val = htmlspecialchars(
$val,
ENT_QUOTES|ENT_HTML5,
"utf-8"
);
// $val = htmlentities(
// $c,
// ENT_QU... | cwe | CWE-89 | JavaScript |
(function()
{
/**
* Download from following URL as TSV and convert using https://jgraph.github.io/drawio-tools/tools/convert.html:
* https://docs.google.com/spreadsheets/d/1sAL1zn-UtmJtKPH4cLApGjRX-TRSJa5dYdfZ9NKYfRs
* Maps package and stencil names to additional tags.
*/
Sidebar.prototype.tagIndex = '5V1dV+M... | cwe | CWE-94 | JavaScript |
export function fetchRemoteBranch(remote: string, remoteBranch: string, cwd: string) {
const results = git(["fetch", remote, remoteBranch], { cwd });
if (!results.success) {
throw gitError(`Cannot fetch remote: ${remote} ${remoteBranch}`);
}
} | cwe | CWE-88 | JavaScript |
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | cwe | CWE-287 | Java |
/*
* 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-732 | Java |
SYSCALL_DEFINE3(fchmodat, int, dfd, const char __user *, filename, mode_t, mode)
{
struct path path;
struct inode *inode;
int error;
struct iattr newattrs;
error = user_path_at(dfd, filename, LOOKUP_FOLLOW, &path);
if (error)
goto out;
inode = path.dentry->d_inode;
error = mnt_want_write(path.mnt);
if (err... | cwe | CWE-732 | Unknown |
/* xfrm_user.c: User interface to configure xfrm engine.
*
* Copyright (C) 2002 David S. Miller (davem@redhat.com)
*
* Changes:
* Mitsuru KANDA @USAGI
* Kazunori MIYAZAWA @USAGI
* Kunihiro Ishiguro <kunihiro@ipinfusion.com>
* IPv6 support
*
*/
#include <linux/crypto.h>
#include <linux/module.h>
#include ... | cwe | CWE-416 | 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 |
func (s *server) authAndCreateUserLdap(UserName string, UserPassword string) (*database.User, error) {
var AuthedUser *database.User
l, err := ldap.DialURL(viper.GetString("auth.ldap.url"))
if err != nil {
log.Println("Failed connecting to ldap server at", viper.GetString("auth.ldap.url"))
return AuthedUser, err... | cwe | CWE-74 | Go |
create_pty_only(term_T *term, jobopt_T *options)
{
HANDLE hPipeIn = INVALID_HANDLE_VALUE;
HANDLE hPipeOut = INVALID_HANDLE_VALUE;
char in_name[80], out_name[80];
channel_T *channel = NULL;
create_vterm(term, term->tl_rows, term->tl_cols);
vim_snprintf(in_name, sizeof(in_name), ... | cwe | CWE-476 | C/C++ |
/*
Copyright 2022 The Vitess Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | cwe | CWE-703 | Go |
ambsdtar_selfcheck(
application_argument_t *argument)
{
char *option;
if (argument->dle.disk) {
char *qdisk = quote_string(argument->dle.disk);
fprintf(stdout, "OK disk %s\n", qdisk);
amfree(qdisk);
}
printf("OK ambsdtar version %s\n", VERSION);
ambsdtar_build_exinclude(&argument->dle, 1, N... | cwe | CWE-264 | Unknown |
static struct rds_connection *__rds_conn_create(struct net *net,
const struct in6_addr *laddr,
const struct in6_addr *faddr,
struct rds_transport *trans,
gfp_t gfp, u8 tos,
int is_outgoing,
int dev_if)
{
struct rds_connection *conn, *parent = NULL;
struct hlist_head *head = rds_con... | cwe | CWE-401 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-122 | C/C++ |
/*
* IPv6 library code, needed by static components when full IPv6 support is
* not configured or static. These functions are needed by GSO/GRO implementation.
*/
#include <linux/export.h>
#include <net/ip.h>
#include <net/ipv6.h>
#include <net/ip6_fib.h>
#include <net/addrconf.h>
#include <net/secure_seq.h>
#inclu... | cwe | CWE-190 | C/C++ |
void checkVerificationCodeUnexistingUser()
{
when(this.userReference.toString()).thenReturn("user:Foobar");
when(this.userManager.exists(this.userReference)).thenReturn(false);
String exceptionMessage = "User [user:Foobar] doesn't exist";
when(this.localizationManager.getTranslationP... | cwe | CWE-640 | Java |
QUtil::toUTF16(unsigned long uval)
{
std::string result;
if ((uval >= 0xd800) && (uval <= 0xdfff))
{
result = "\xff\xfd";
}
else if (uval <= 0xffff)
{
char out[2];
out[0] = (uval & 0xff00) >> 8;
out[1] = (uval & 0xff);
result = std::string(out, 2);
}
... | cwe | CWE-787 | Unknown |
apply_extra_data (FlatpakDir *self,
GFile *checkoutdir,
GCancellable *cancellable,
GError **error)
{
g_autoptr(GFile) metadata = NULL;
g_autofree char *metadata_contents = NULL;
gsize metadata_size;
g_autoptr(GKeyFile) metakey = NULL;
g_autof... | cwe | CWE-74 | Unknown |
/*
* Copyright 2021 ThoughtWorks, Inc.
*
* 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 agr... | cwe | CWE-77 | Java |
LookupModMask(struct xkb_context *ctx, const void *priv, xkb_atom_t field,
enum expr_value_type type, xkb_mod_mask_t *val_rtrn)
{
const char *str;
xkb_mod_index_t ndx;
const LookupModMaskPriv *arg = priv;
const struct xkb_mod_set *mods = arg->mods;
enum mod_type mod_type = arg->mod_typ... | cwe | CWE-476 | C/C++ |
rb_str_justify(int argc, VALUE *argv, VALUE str, char jflag)
{
rb_encoding *enc;
VALUE w;
long width, len, flen = 1, fclen = 1;
VALUE res;
char *p;
const char *f = " ";
long n, llen, rlen;
volatile VALUE pad;
int singlebyte = 1, cr;
rb_scan_args(argc, argv, "11", &w, &pad);
... | cwe | CWE-119 | C/C++ |
#include "cache.h"
#include "config.h"
#include "commit.h"
#include "utf8.h"
#include "diff.h"
#include "revision.h"
#include "string-list.h"
#include "mailmap.h"
#include "log-tree.h"
#include "notes.h"
#include "color.h"
#include "reflog-walk.h"
#include "gpg-interface.h"
#include "trailer.h"
#include "run-command.h"... | cwe | CWE-190 | C/C++ |
size_t c_shquote_strnspn(const char *string,
size_t n_string,
const char *accept) {
bool buffer[UCHAR_MAX] = {};
for ( ; *accept; ++accept)
buffer[(unsigned char)*accept] = true;
for (size_t i = 0; i < n_string; ++i)
... | cwe | CWE-787 | Unknown |
# -*- coding: utf-8 -*-
# Copyright 2019 New Vector 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 la... | cwe | CWE-20 | Python |
package com.salesmanager.shop.admin.controller.configurations;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import or... | cwe | CWE-639 | Java |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls import handler400, handler403, handler404, handler500
from django.urls import path
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.co... | cwe | CWE-434 | Python |
package controller
import (
"context"
"encoding/json"
"fmt"
"math"
"net/http"
"reflect"
"runtime/debug"
"sort"
"strconv"
"strings"
"sync"
"time"
clustercache "github.com/argoproj/gitops-engine/pkg/cache"
"github.com/argoproj/gitops-engine/pkg/diff"
"github.com/argoproj/gitops-engine/pkg/health"
syncco... | cwe | CWE-862 | Go |
void WorkerProcessLauncher::Core::StopWorker() {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
if (launch_success_timer_->IsRunning()) {
launch_success_timer_->Stop();
launch_backoff_.InformOfRequest(false);
}
self_ = this;
ipc_enabled_ = false;
if (process_watcher_.GetWatchedO... | cwe | CWE-399 | 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-120 | Python |
static bool extract_file(Unshield* unshield, const char* prefix, int index)
{
bool success;
char dirname[256];
char filename[256];
char* p;
int directory = unshield_file_directory(unshield, index);
char real_output_directory[256];
char real_filename[256];
strcpy(dirname, output_directory);
strcat(dir... | cwe | CWE-787 | C/C++ |
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software F... | cwe | CWE-787 | C/C++ |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | cwe | CWE-668 | Java |
int ssl3_get_server_hello(SSL *s)
{
STACK_OF(SSL_CIPHER) *sk;
SSL_CIPHER *c;
unsigned char *p,*d;
int i,al,ok;
unsigned int j;
long n;
#ifndef OPENSSL_NO_COMP
SSL_COMP *comp;
#endif
n=s->method->ssl_get_message(s,
SSL3_ST_CR_SRVR_HELLO_A,
SSL3_ST_CR_SRVR_HELLO_B,
-1,
20000, /* ?? */
&ok);
if (!ok)... | cwe | CWE-326 | Unknown |
/**
* login controller, to authenticate users
*/
var emailModel = require('../../models/email.js');
var userModel = require('../../models/user.js');
var notifEmails = require('../../models/notifEmails.js');
var userApi = require('../../controllers/api/user.js');
var md5 = userModel.md5;
var loggingTemplate = require... | cwe | CWE-285 | JavaScript |
package handlers
import (
"bytes"
"context"
"crypto/tls"
"embed"
"fmt"
"html/template"
"io/fs"
"io/ioutil"
"log"
"net/http"
"path"
"strings"
"time"
"golang.org/x/crypto/acme/autocert"
"golang.org/x/oauth2"
gh "github.com/gorilla/handlers"
"github.com/gorilla/mux"
lru "github.com/hashicorp/golang-lr... | cwe | CWE-639 | Go |
CreateForeignServer(CreateForeignServerStmt *stmt)
{
Relation rel;
Datum srvoptions;
Datum values[Natts_pg_foreign_server];
bool nulls[Natts_pg_foreign_server];
HeapTuple tuple;
Oid srvId;
Oid ownerId;
AclResult aclresult;
ObjectAddress myself;
ObjectAddress referenced;
ForeignDataWrapper *fdw;
rel ... | cwe | CWE-94 | Unknown |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.conf.urls imp... | cwe | CWE-79 | Python |
import { FlowRouter } from 'meteor/ostrio:flow-router-extra'
import './projectAccessRights.html'
import { t, i18nReady } from '../../utils/i18n.js'
import {
validateEmail, getGlobalSetting, showToast,
} from '../../utils/frontend_helpers'
import Projects from '../../api/projects/projects.js'
Template.projectAccessRi... | cwe | CWE-1236 | JavaScript |
MagickExport MagickBooleanType PosterizeImage(Image *image,const size_t levels,
const DitherMethod dither_method,ExceptionInfo *exception)
{
#define PosterizeImageTag "Posterize/Image"
#define PosterizePixel(pixel) (Quantum) (QuantumRange*(MagickRound( \
QuantumScale*pixel*(levels-1)))/MagickMax((ssize_t) levels-1... | cwe | CWE-190 | Unknown |
$("#extra").on("click", "#moveRepeatingGroup", function() {
var repeatingCols = '';
$("#extra input[type=checkbox]:checked").each(function() {
repeatingCols += $(this).val() + ', ';
});
if (repeatingCols !== '') {
var newColName = $("#extra input[type=checkbox]:c... | cwe | CWE-79 | JavaScript |
static int ext4_end_io_nolock(ext4_io_end_t *io)
{
struct inode *inode = io->inode;
loff_t offset = io->offset;
ssize_t size = io->size;
int ret = 0;
ext4_debug("ext4_end_io_nolock: io 0x%p from inode %lu,list->next 0x%p,"
"list->prev 0x%p\n",
io, inode->i_ino, io->list.next, io->list.prev);
if... | cwe | CWE-703 | Unknown |
static ssize_t gadget_dev_desc_UDC_store(struct config_item *item,
const char *page, size_t len)
{
struct gadget_info *gi = to_gadget_info(item);
char *name;
int ret;
name = kstrdup(page, GFP_KERNEL);
if (!name)
return -ENOMEM;
if (name[len - 1] == '\n')
name[len - 1] = '\0';
mutex_lock(&gi->lock);
if ... | cwe | CWE-125 | C/C++ |
static void add_bytes_c(uint8_t *dst, uint8_t *src, int w){
long i;
for(i=0; i<=w-sizeof(long); i+=sizeof(long)){
long a = *(long*)(src+i);
long b = *(long*)(dst+i);
*(long*)(dst+i) = ((a&pb_7f) + (b&pb_7f)) ^ ((a^b)&pb_80);
}
for(; i<w; i++)
dst[i+0] += src[i+0];
} | cwe | CWE-703 | Unknown |
function handleABPLinkClicks() {
// Subscribe to the list when you click an abp: link
var elems = document.querySelectorAll('[href^="abp:"], [href^="ABP:"]');
var abplinkhandler = function(event) {
event.preventDefault();
var searchquery = this.href.replace(/^.+?\?/, '?');
if (searchquery) {
var... | cwe | CWE-284 | JavaScript |
void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) {
int i, j;
Guchar *inp, *tmp_line;
switch (colorSpace->getMode()) {
case csIndexed:
case csSeparation:
tmp_line = (Guchar *) gmalloc (length * nComps2);
for (i = 0; i < length; i++) {
for (j = 0; j < nComps2; j++) {
... | cwe | CWE-189 | C/C++ |
TfLiteStatus LeakyReluPrepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 1);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input = GetInput(context, node, 0);
TfLiteTensor* output = GetOutput(context, node, 0);
TF_LITE_ENSURE_TYPES_EQ(context... | cwe | CWE-125 | C/C++ |
static inline int xsave_state_booting(struct xsave_struct *fx, u64 mask)
{
u32 lmask = mask;
u32 hmask = mask >> 32;
int err = 0;
WARN_ON(system_state != SYSTEM_BOOTING);
if (boot_cpu_has(X86_FEATURE_XSAVES))
asm volatile("1:"XSAVES"\n\t"
"2:\n\t"
: : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask)
: ... | cwe | CWE-20 | Unknown |
void __skb_get_hash(struct sk_buff *skb)
{
struct flow_keys keys;
u32 hash;
__flow_hash_secret_init();
hash = ___skb_get_hash(skb, &keys, hashrnd);
__skb_set_sw_hash(skb, hash, flow_keys_have_l4(&keys));
} | cwe | CWE-330 | Unknown |
static int pop_sync_mailbox (CONTEXT *ctx, int *index_hint)
{
int i, j, ret = 0;
char buf[LONG_STRING];
POP_DATA *pop_data = (POP_DATA *)ctx->data;
progress_t progress;
#ifdef USE_HCACHE
header_cache_t *hc = NULL;
#endif
pop_data->check_time = 0;
FOREVER
{
if (pop_reconnect (ctx) < 0)
return... | cwe | CWE-119 | Unknown |
static Image *ReadJNGImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
Image
*image;
MagickBooleanType
logging,
status;
MngInfo
*mng_info;
char
magic_number[MaxTextExtent];
size_t
count;
/*
Open image file.
*/
assert(image_info != (const ImageInfo *) NULL);
... | cwe | CWE-754 | C/C++ |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2021
* All rights reserved
*
* This file is part of GPAC / MPEG-1/2/4(Part2) video reframer filter
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the... | cwe | CWE-416 | C/C++ |
QPDF::decryptStream(PointerHolder<EncryptionParameters> encp,
PointerHolder<InputSource> file,
QPDF& qpdf_for_warning, Pipeline*& pipeline,
int objid, int generation,
QPDFObjectHandle& stream_dict,
bool is_attachment_stream,
std... | cwe | CWE-787 | Unknown |
static MagickBooleanType WritePALMImage(const ImageInfo *image_info,
Image *image,ExceptionInfo *exception)
{
MagickBooleanType
status;
MagickOffsetType
currentOffset,
offset,
scene;
MagickSizeType
cc;
PixelInfo
transpix;
QuantizeInfo
*quantize_info;
register ssize_t
x... | cwe | CWE-190 | C/C++ |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "hermes/VM/Operations.h"
#include "hermes/Support/Conversions.h"
#include "hermes/Support/OSCompat.h"
#include "hermes/... | cwe | CWE-416 | C/C++ |
/*
* This file is part of Cockpit.
*
* Copyright (C) 2013 Red Hat, Inc.
*
* Cockpit is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any l... | cwe | CWE-20 | C/C++ |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.website.website_generator import WebsiteGenerator
from frappe.website.render import clear_cache
from frappe.utils import today, cin... | cwe | CWE-79 | Python |
/* 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-476 | C/C++ |
ExifData::const_iterator isoSpeed(const ExifData& ed)
{
static const char* keys[] = {
"Exif.Photo.ISOSpeedRatings",
"Exif.Image.ISOSpeedRatings",
"Exif.CanonSi.ISOSpeed",
"Exif.CanonCs.ISOSpeed",
"Exif.Nikon1.ISOSpeed",
"Exif.Nikon2.ISO... | cwe | CWE-476 | C/C++ |
ecryptfs_decode_from_filename(unsigned char *dst, size_t *dst_size,
const unsigned char *src, size_t src_size)
{
u8 current_bit_offset = 0;
size_t src_byte_offset = 0;
size_t dst_byte_offset = 0;
if (dst == NULL) {
(*dst_size) = ecryptfs_max_decoded_size(src_size);
goto out;
}
while (src_byte_offset... | cwe | CWE-189 | C/C++ |
escape : function(name) {
return this._node.text(name).html().replace(/"/g, '"').replace(/'/g, ''');
}, | cwe | CWE-89 | JavaScript |
void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *dev)
{
if (!test_bit(SAS_DEV_DESTROY, &dev->state) &&
!list_empty(&dev->disco_list_node)) {
/* this rphy never saw sas_rphy_add */
list_del_init(&dev->disco_list_node);
sas_rphy_free(dev->rphy);
sas_unregister_common_dev(port, dev);
... | cwe | CWE-284 | Unknown |
void TaskService::RunTask(InstanceId instance_id,
RunnerId runner_id,
base::OnceClosure task) {
base::subtle::AutoReadLock task_lock(task_lock_);
{
base::AutoLock lock(lock_);
if (instance_id != bound_instance_id_)
return;
}
std::move(task).R... | cwe | CWE-20 | C/C++ |
bool ResourceFetcher::canRequest(Resource::Type type, const KURL& url, const ResourceLoaderOptions& options, bool forPreload, FetchRequest::OriginRestriction originRestriction) const
{
SecurityOrigin* securityOrigin = options.securityOrigin.get();
if (!securityOrigin && document())
securityOrigin = docu... | cwe | CWE-264 | C/C++ |
void Compute(OpKernelContext* ctx) override {
const Tensor* hypothesis_indices;
const Tensor* hypothesis_values;
const Tensor* hypothesis_shape;
const Tensor* truth_indices;
const Tensor* truth_values;
const Tensor* truth_shape;
OP_REQUIRES_OK(ctx, ctx->input("hypothesis_indices", &hypothesi... | cwe | CWE-476 | Unknown |
void PropertiesWidget::loadTorrentInfos(BitTorrent::TorrentHandle *const torrent)
{
clear();
m_torrent = torrent;
downloaded_pieces->setTorrent(m_torrent);
pieces_availability->setTorrent(m_torrent);
if (!m_torrent) return;
// Save path
updateSavePath(m_torrent);
// Hash
hash_lbl->s... | cwe | CWE-79 | Unknown |
NAN_METHOD(DetectCharacterEncoding) {
Nan::HandleScope scope;
v8::Local<v8::Object> inputBuffer = info[0]->ToObject();
UCharsetDetector *charsetDetector;
const UCharsetMatch *charsetMatch;
UErrorCode errorCode = U_ZERO_ERROR;
charsetDetector = ucsdet_open(&errorCode);
if(U_FAILURE(errorCode)) {
Nan::ThrowE... | cwe | CWE-755 | C/C++ |
resetLppTransposer (HANDLE_SBR_LPP_TRANS hLppTrans, /*!< Handle of lpp transposer */
UCHAR highBandStartSb, /*!< High band area: start subband */
UCHAR *v_k_master, /*!< Master table */
UCHAR numMaster, /*!< Valid entries in master table */
... | cwe | CWE-200 | C/C++ |
this.graph.getTooltip(c,d,e,f);this.show(k,e,f);this.state=c;this.node=d;this.stateSource=g}}),this.delay)}};mxTooltipHandler.prototype.hide=function(){this.resetTimer();this.hideTooltip()};mxTooltipHandler.prototype.hideTooltip=function(){null!=this.div&&(this.div.style.visibility="hidden",this.div.innerHTML="")}; | cwe | CWE-94 | JavaScript |
g()?"":Editor.isDarkMode()?"#ff0000":"#ffcfcf"}catch(U){b.handleError(U)}});K.setAttribute("title",mxResources.get("find")+" (Enter)");K.style.float="none";K.style.width="120px";K.style.marginTop="6px";K.style.marginLeft="8px";K.style.overflow="hidden";K.style.textOverflow="ellipsis";K.className="geBtn gePrimaryBtn";t.... | cwe | CWE-20 | JavaScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.