code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
/* SPDX-License-Identifier: BSD-2-Clause */
/*******************************************************************************
* Copyright 2018-2019, Fraunhofer SIT sponsored by Infineon Technologies AG
* All rights reserved.
*******************************************************************************/
#ifdef HAVE... | cwe | CWE-909 | C/C++ |
void WebContentsImpl::AttachInterstitialPage(
InterstitialPageImpl* interstitial_page) {
DCHECK(interstitial_page);
GetRenderManager()->set_interstitial_page(interstitial_page);
CancelActiveAndPendingDialogs();
for (auto& observer : observers_)
observer.DidAttachInterstitialPage();
if (frame_tree... | cwe | CWE-20 | C/C++ |
package server
import (
"fmt"
"time"
"github.com/usememos/memos/server/profile"
"github.com/usememos/memos/store"
"github.com/gorilla/securecookie"
"github.com/gorilla/sessions"
"github.com/labstack/echo-contrib/session"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
)
type Server s... | cwe | CWE-79 | Go |
compile_length_bag_node(BagNode* node, regex_t* reg)
{
int len;
int tlen;
if (node->type == BAG_OPTION)
return compile_length_option_node(node, reg);
if (NODE_BAG_BODY(node)) {
tlen = compile_length_tree(NODE_BAG_BODY(node), reg);
if (tlen < 0) return tlen;
}
else
tlen = 0;
switch (node... | cwe | CWE-476 | Unknown |
protected void error(HttpServletRequest request,
HttpServletResponse response,
Throwable e)
{
String path = ServletUtils.getPath(request);
if (response.isCommitted())
{
getLog().error("An error occured but the response headers hav... | cwe | CWE-79 | Java |
/* vi:set et sw=2 sts=2 cin cino=t0,f0,(0,{s,>2s,n-s,^-s,e-s:
* Copyright © 2017 Red Hat, Inc
*
* This program 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, ... | cwe | CWE-116 | C/C++ |
def qute_settings(url):
"""Handler for qute://settings. View/change qute configuration."""
if url.path() == '/set':
return _qute_settings_set(url)
src = jinja.render('settings.html', title='settings',
configdata=configdata,
confget=config.instance.get_s... | cwe | CWE-352 | Python |
#include "encoding.h"
#include <Windows.h>
namespace {
// Wrapper for Windows API MultiByteToWideChar.
std::wstring MB2WC(const std::string& input, unsigned int code_page) {
if (input.empty()) {
return L"";
}
int length = ::MultiByteToWideChar(code_page, 0, &input[0],
... | cwe | CWE-22 | C/C++ |
static int atusb_get_and_show_revision(struct atusb *atusb)
{
struct usb_device *usb_dev = atusb->usb_dev;
unsigned char buffer[3];
int ret;
/* Get a couple of the ATMega Firmware values */
ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0),
ATUSB_ID, ATUSB_REQ_FROM_DEV, 0, 0,
buffer, 3, 1000);
i... | cwe | CWE-119 | Unknown |
void WebGL2RenderingContextBase::texSubImage2D(GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLsizei width,
... | cwe | CWE-125 | C/C++ |
void Compute(OpKernelContext* context) override {
const Tensor* input_indices;
const Tensor* input_values;
const Tensor* input_shape;
SparseTensorsMap* map;
OP_REQUIRES_OK(context, context->input("sparse_indices", &input_indices));
OP_REQUIRES_OK(context, context->input("sparse_values", &input_... | cwe | CWE-190 | C/C++ |
static int cirrus_bitblt_videotovideo_patterncopy(CirrusVGAState * s)
{
return cirrus_bitblt_common_patterncopy(s,
s->vram_ptr +
(s->cirrus_blt_srcaddr & ~7));
} | cwe | CWE-787 | Unknown |
Status DoCompute(OpKernelContext* ctx) {
tensorflow::ResourceTagger tag(kTFDataResourceTag,
ctx->op_kernel().type_string());
tstring filename;
TF_RETURN_IF_ERROR(
ParseScalarArgument<tstring>(ctx, "filename", &filename));
tstring compression_type;
TF_RETURN... | cwe | CWE-787 | C/C++ |
protected void submit(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, FormException {
super.submit(req,rsp);
JSONObject json = req.getSubmittedForm();
makeDisabled(req.getParameter("disable")!=null);
jdk = req.getParameter("jdk");
if(req.getParame... | cwe | CWE-264 | Java |
package com.salesmanager.shop.admin.controller.products;
import com.salesmanager.core.business.services.catalog.product.ProductService;
import com.salesmanager.core.business.services.catalog.product.attribute.ProductAttributeService;
import com.salesmanager.core.business.services.catalog.product.attribute.ProductOptio... | cwe | CWE-79 | Java |
static MagickBooleanType WriteGIFImage(const ImageInfo *image_info,Image *image,
ExceptionInfo *exception)
{
int
c;
ImageInfo
*write_info;
MagickBooleanType
status;
MagickOffsetType
scene;
RectangleInfo
page;
register ssize_t
i;
register unsigned char
*q;
size_t
... | cwe | CWE-772 | C/C++ |
void read_sequence_header(decoder_info_t *decoder_info, stream_t *stream) {
decoder_info->width = get_flc(16, stream);
decoder_info->height = get_flc(16, stream);
decoder_info->log2_sb_size = get_flc(3, stream);
decoder_info->pb_split = get_flc(1, stream);
decoder_info->tb_split_enable = get_flc(1, strea... | cwe | CWE-119 | C/C++ |
static int cg_rmdir(const char *path)
{
struct fuse_context *fc = fuse_get_context();
char *fpath = NULL, *cgdir = NULL, *controller;
const char *cgroup;
int ret;
if (!fc)
return -EIO;
controller = pick_controller_from_path(fc, path);
if (!controller)
return -EINVAL;
cgroup = find_cgroup_in_path(path);
... | cwe | CWE-264 | C/C++ |
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException {
HttpServletRequest httpRequest = (HttpServletRequest) request;
String path = httpRequest.getServletPath();
LOG.debug("Handling request for path {}", ... | cwe | CWE-287 | JavaScript |
public function getCookiePath()
{
static $cookie_path = null;
if (null !== $cookie_path && !defined('TESTSUITE')) {
return $cookie_path;
}
if (isset($GLOBALS['PMA_PHP_SELF'])) {
$parsed_url = parse_url($GLOBALS['PMA_PHP_SELF']);
} else {
... | cwe | CWE-254 | PHP |
/*
* NSV demuxer
* Copyright (c) 2004 The Libav Project
*
* first version by Francois Revol <revol@free.fr>
*
* This file is part of Libav.
*
* Libav 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 Founda... | cwe | CWE-476 | C/C++ |
bool FrameworkListener::onDataAvailable(SocketClient *c) {
char buffer[CMD_BUF_SIZE];
int len;
len = TEMP_FAILURE_RETRY(read(c->getSocket(), buffer, sizeof(buffer)));
if (len < 0) {
SLOGE("read() failed (%s)", strerror(errno));
return false;
} else if (!len)
return false;
... | cwe | CWE-264 | C/C++ |
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | cwe | CWE-287 | Java |
PHP_FUNCTION(openssl_random_pseudo_bytes)
{
long buffer_length;
unsigned char *buffer = NULL;
zval *zstrong_result_returned = NULL;
int strong_result = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|z", &buffer_length, &zstrong_result_returned) == FAILURE) {
return;
}
if (buffer_length <= 0) {
... | cwe | CWE-310 | C/C++ |
static void port_show_vhci(char **out, int hub, int port, struct vhci_device *vdev)
{
if (hub == HUB_SPEED_HIGH)
*out += sprintf(*out, "hs %04u %03u ",
port, vdev->ud.status);
else /* hub == HUB_SPEED_SUPER */
*out += sprintf(*out, "ss %04u %03u ",
port, vdev->ud.status);
if (vdev->ud.stat... | cwe | CWE-200 | Unknown |
CheckSetDeviceIndicators(char *wire,
DeviceIntPtr dev,
int num, int *status_rtrn, ClientPtr client)
{
xkbDeviceLedsWireDesc *ledWire;
int i;
XkbSrvLedInfoPtr sli;
ledWire = (xkbDeviceLedsWireDesc *) wire;
for (i = 0; i < num; i++) {
if (clie... | cwe | CWE-94 | Unknown |
/*
* uriparser - RFC 3986 URI parsing library
*
* Copyright (C) 2007, Weijia Song <songweijia@gmail.com>
* Copyright (C) 2007, Sebastian Pipping <sebastian@pipping.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the... | cwe | CWE-476 | C/C++ |
package com.salesmanager.shop.admin.controller.shipping;
import com.salesmanager.core.business.services.reference.country.CountryService;
import com.salesmanager.core.business.services.shipping.ShippingService;
import com.salesmanager.core.business.utils.ProductPriceUtils;
import com.salesmanager.core.business.utils.a... | cwe | CWE-639 | Java |
public function shippingMethodSave(Request $request) {
if (is_array($request->get('Address'))) {
$request->merge([
'city'=>$request->get('Address')['city'],
'zip'=>$request->get('Address')['zip'],
'state'=>$request->get('Address')['state'],
... | cwe | CWE-190 | PHP |
storeRawNames(XML_Parser parser) {
TAG *tag = parser->m_tagStack;
while (tag) {
int bufSize;
int nameLen = sizeof(XML_Char) * (tag->name.strLen + 1);
char *rawNameBuf = tag->buf + nameLen;
/* Stop if already stored. Since m_tagStack is a stack, we can stop
at the first entry that has already... | cwe | CWE-190 | Unknown |
clone (gitUrl, options, callback) {
if (typeof options === "function") {
callback = options;
options = "";
}
return this.exec("clone " + gitUrl + " " + options, callback);
} | cwe | CWE-77 | JavaScript |
/* Copyright 2019 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 | Python |
static bool ldb_dn_explode(struct ldb_dn *dn)
{
char *p, *ex_name = NULL, *ex_value = NULL, *data, *d, *dt, *t;
bool trim = true;
bool in_extended = true;
bool in_ex_name = false;
bool in_ex_value = false;
bool in_attr = false;
bool in_value = false;
bool in_quote = false;
bool is_oid = false;
bool escape = f... | cwe | CWE-200 | Unknown |
/*====================================================================*
- Copyright (C) 2001 Leptonica. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source c... | cwe | CWE-369 | C/C++ |
public static String compileMustache(Map<String, Object> context, String template) {
if (context == null || StringUtils.isBlank(template)) {
return "";
}
Writer writer = new StringWriter();
try {
Mustache.compiler().escapeHTML(false).emptyStringIsFalse(true).compile(template).execute(context, writer);
}... | cwe | CWE-79 | Java |
static CURLcode ossl_connect_step1(struct Curl_easy *data,
struct connectdata *conn, int sockindex)
{
CURLcode result = CURLE_OK;
char *ciphers;
SSL_METHOD_QUAL SSL_METHOD *req_method = NULL;
X509_LOOKUP *lookup = NULL;
curl_socket_t sockfd = conn->sock[sockindex];
struct ... | cwe | CWE-290 | Unknown |
!0,0,mxUtils.bind(this,function(b){this.hsplitPosition=b;this.refresh()})))};EditorUi.prototype.createStatusContainer=function(){var a=document.createElement("a");a.className="geItem geStatus";return a};EditorUi.prototype.setStatusText=function(a){this.statusContainer.innerHTML=a;0==this.statusContainer.getElementsByTa... | cwe | CWE-94 | JavaScript |
static int read_header(FFV1Context *f)
{
uint8_t state[CONTEXT_SIZE];
int i, j, context_count = -1; //-1 to avoid warning
RangeCoder *const c = &f->slice_context[0]->c;
memset(state, 128, sizeof(state));
if (f->version < 2) {
int chroma_planes, chroma_h_shift, chroma_v_shift, transparency,... | cwe | CWE-125 | Unknown |
xmlTextReaderConstValue(xmlTextReaderPtr reader) {
xmlNodePtr node;
if (reader == NULL)
return(NULL);
if (reader->node == NULL)
return(NULL);
if (reader->curnode != NULL)
node = reader->curnode;
else
node = reader->node;
switch (node->type) {
case XML_NAMESPACE_DECL:
return(((x... | cwe | CWE-399 | Unknown |
def create_info_block(options)
return nil unless options
assignments = options.map { |k, v| "img.#{k} = #{v}" }
code = "lambda { |img| " + assignments.join(";") + "}"
eval code
end | cwe | CWE-74 | Ruby |
parseuid(const char *s, uid_t *uid)
{
struct passwd *pw;
const char *errstr;
if ((pw = getpwnam(s)) != NULL) {
*uid = pw->pw_uid;
return 0;
}
#if !defined(__linux__) && !defined(__NetBSD__)
*uid = strtonum(s, 0, UID_MAX, &errstr);
#else
sscanf(s, "%d", uid);
#endif
if (errstr)
return -1;
return 0;
} | cwe | CWE-754 | C/C++ |
error_t rawSocketSendIpPacket(Socket *socket, const SocketMsg *message,
uint_t flags)
{
error_t error;
size_t offset;
NetBuffer *buffer;
NetInterface *interface;
IpPseudoHeader pseudoHeader;
NetTxAncillary ancillary;
//The socket may be bound to a particular network interface
interface = soc... | cwe | CWE-20 | C/C++ |
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build darwin,386,!go1.12
package unix
//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
// Copyright 2019 ... | cwe | CWE-287 | Go |
void disable_config(void) {
EUID_USER();
#ifndef HAVE_ONLY_SYSCFG_PROFILES
char *fname;
if (asprintf(&fname, "%s/.config/firejail", cfg.homedir) == -1)
errExit("asprintf");
disable_file(BLACKLIST_FILE, fname);
free(fname);
#endif
// disable run time information
disable_file(BLACKLIST_FILE, RUN_FIREJAIL_NETWOR... | cwe | CWE-269 | Unknown |
ipmi_get_session_info(struct ipmi_intf * intf,
Ipmi_Session_Request_Type session_request_type,
uint32_t id_or_handle)
{
int i, retval = 0;
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t rqdata[5]; // max length of the variable length request
struct get_session_info_rsp... | cwe | CWE-120 | C/C++ |
package io.onedev.server.web;
import org.apache.wicket.core.request.mapper.ResourceMapper;
import org.apache.wicket.markup.html.pages.BrowserInfoPage;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.request.IRequestMapper;
import org.apache.wicket.request.mapper.CompoundRequestMapper;
... | cwe | CWE-74 | Java |
bmexec_trans (kwset_t kwset, char const *text, size_t size)
{
unsigned char const *d1;
char const *ep, *sp, *tp;
int d;
int len = kwset->mind;
char const *trans = kwset->trans;
if (len == 0)
return 0;
if (len > size)
return -1;
if (len == 1)
{
tp = memchr_kwset (text, size, kwset);
... | cwe | CWE-119 | Unknown |
BGD_DECLARE(void) gdImageWebpEx (gdImagePtr im, FILE * outFile, int quality)
{
gdIOCtx *out = gdNewFileCtx(outFile);
if (out == NULL) {
return;
}
gdImageWebpCtx(im, out, quality);
out->gd_free(out);
} | cwe | CWE-415 | Unknown |
RenderFrameHostImpl* RenderFrameHostManager::GetFrameHostForNavigation(
const NavigationRequest& request) {
DCHECK(!request.common_params().url.SchemeIs(url::kJavaScriptScheme))
<< "Don't call this method for JavaScript URLs as those create a "
"temporary NavigationRequest and we don't want to res... | cwe | CWE-20 | C/C++ |
WebContents* TabsCaptureVisibleTabFunction::GetWebContentsForID(
int window_id,
std::string* error) {
Browser* browser = NULL;
if (!GetBrowserFromWindowID(chrome_details_, window_id, &browser, error))
return nullptr;
WebContents* contents = browser->tab_strip_model()->GetActiveWebContents();
if (!c... | cwe | CWE-863 | C/C++ |
/* Copyright 2018 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-617 | Python |
@app.route("/api/preferences/set/<key>/<value>")
def pref_set(key, value):
if get_user() is None:
return "Authentication required", 401
get_preferences()[key] = (None if value == 'null' else value)
return Response(json.dumps({'key': key, 'success': ''})), 201 | cwe | CWE-79 | Python |
def vault_decrypt(v_ciphertexts, mp, vault_size):
iv = '01234567'
des3 = DES3.new(hash_mp(mp), DES3.MODE_CFB, iv)
return vault_decode(des3.decrypt(v_ciphertexts), mp, vault_size) | cwe | CWE-327 | Python |
static __u8 *nci_extract_rf_params_nfcf_passive_poll(struct nci_dev *ndev,
struct rf_tech_specific_params_nfcf_poll *nfcf_poll,
__u8 *data)
{
nfcf_poll->bit_rate = *data++;
nfcf_poll->sensf_res_len = *data++;
pr_debug("bit_rate %d, sensf_res_len %d\n",
nfcf_poll->bit_rate, nfcf_poll->sensf_res_len)... | cwe | CWE-119 | C/C++ |
#include "CMOS.h"
#include "Process.h"
#include "StdLib.h"
#include <AK/Assertions.h>
#include <AK/kstdio.h>
#include <Kernel/Arch/i386/CPU.h>
#include <Kernel/FileSystem/Inode.h>
#include <Kernel/Multiboot.h>
#include <Kernel/VM/AnonymousVMObject.h>
#include <Kernel/VM/InodeVMObject.h>
#include <Kernel/VM/MemoryManage... | cwe | CWE-119 | C/C++ |
package com.salesmanager.shop.admin.controller;
/**
* Interface contain constant for Controller.These constant will be used throughout
* sm-shop to providing constant values to various Controllers being used in the
* application.
* @author Umesh A
*
*/
public interface ControllerConstants
{
interface Tiles... | cwe | CWE-79 | Java |
/* nbdkit
* Copyright (C) 2013-2019 Red Hat Inc.
*
* 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 conditions and the f... | cwe | CWE-406 | C/C++ |
/*!
Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
/* global FieldValueSet, ListAdvFilter */
// 列表公共操作
const _RbList = functio... | cwe | CWE-89 | Java |
int ssl3_get_server_hello(SSL *s)
{
STACK_OF(SSL_CIPHER) *sk;
const 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... | cwe | CWE-310 | Unknown |
asn1_find_node (asn1_node pointer, const char *name)
{
asn1_node p;
char *n_end, n[ASN1_MAX_NAME_SIZE + 1];
const char *n_start;
unsigned int nsize;
unsigned int nhash;
if (pointer == NULL)
return NULL;
if (name == NULL)
return NULL;
p = pointer;
n_start = name;
if (name[0] == '?' && nam... | cwe | CWE-119 | Unknown |
var setValue = function(obj, key, value) {
var o = obj;
var keys = Array.isArray(key) ? key : key.split('.');
for (var x = 1; x < keys.length; ++x) {
var currentKey = keys[x];
var lastKey = keys[x - 1];
if (typeof(currentKey) === 'number') {
if (!o[lastKey]) { o[lastKey] = []; }
o = o[las... | cwe | CWE-1321 | JavaScript |
recordDependencyOnCurrentExtension(const ObjectAddress *object,
bool isReplace)
{
/* Only whole objects can be extension members */
Assert(object->objectSubId == 0);
if (creating_extension)
{
ObjectAddress extension;
/* Only need to check for existing membership if isReplace */
if (isReplace)
{... | cwe | CWE-94 | Unknown |
int iscsi_session_get_param(struct iscsi_cls_session *cls_session,
enum iscsi_param param, char *buf)
{
struct iscsi_session *session = cls_session->dd_data;
int len;
switch(param) {
case ISCSI_PARAM_FAST_ABORT:
len = sprintf(buf, "%d\n", session->fast_abort);
break;
case ISCSI_PARAM_ABORT_TMO:
len =... | cwe | CWE-787 | Unknown |
package com.databasir.core.infrastructure.jwt;
import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.exceptions.JWTVerificationException;
import com.auth0.jwt.interfaces.JWTVerifier;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.time... | cwe | CWE-20 | Java |
delete_principal_2_svc(dprinc_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg;
gss_buffer_desc client_name,
service_name;
OM_uint32 minor_stat;
kadm5_server_handle_t handle;
... | cwe | CWE-772 | C/C++ |
void BnCrypto::readVector(const Parcel &data, Vector<uint8_t> &vector) const {
uint32_t size = data.readInt32();
vector.insertAt((size_t)0, size);
data.read(vector.editArray(), size);
} | cwe | CWE-908 | C/C++ |
#ifndef GPAC_DISABLE_ISOM_HINTING
void dump_isom_sdp(GF_ISOFile *file, char *inName, Bool is_final_name)
{
const char *sdp;
u32 size, i;
FILE *dump;
if (inName) {
char szBuf[1024];
strcpy(szBuf, inName);
if (!is_final_name) {
char *ext = strchr(szBuf, '.');
if (ext) ext[0] = 0;
strcat(szBuf, "_sdp.... | cwe | CWE-476 | C/C++ |
append_command(char_u *cmd)
{
char_u *s = cmd;
char_u *d;
STRCAT(IObuff, ": ");
d = IObuff + STRLEN(IObuff);
while (*s != NUL && d - IObuff + 5 < IOSIZE)
{
if (enc_utf8 ? (s[0] == 0xc2 && s[1] == 0xa0) : *s == 0xa0)
{
s += enc_utf8 ? 2 : 1;
STRCPY(d, "<a0>");
d += 4;
}
else i... | cwe | CWE-787 | Unknown |
public function specialLogin( $error = null ) {
$request = $this->getRequest();
$out = $this->getOutput();
$out->setPageTitle( wfMessage('soa2-login-title')->escaped() );
if ($error) {
$this->error($error);
} else if (
$request->wasPosted() && $request->getCheck( 'username' )
) {
$username = $reque... | cwe | CWE-79 | PHP |
header_gets (SF_PRIVATE *psf, char *ptr, int bufsize)
{ int k ;
for (k = 0 ; k < bufsize - 1 ; k++)
{ if (psf->headindex < psf->headend)
{ ptr [k] = psf->header [psf->headindex] ;
psf->headindex ++ ;
}
else
{ psf->headend += psf_fread (psf->header + psf->headend, 1, 1, psf) ;
ptr [k] = psf->header [p... | cwe | CWE-119 | C/C++ |
int32_t *enc_untrusted_create_wait_queue() {
MessageWriter input;
MessageReader output;
input.Push<uint64_t>(sizeof(int32_t));
const auto status = NonSystemCallDispatcher(
::asylo::host_call::kLocalLifetimeAllocHandler, &input, &output);
CheckStatusAndParamCount(status, output, "enc_untrusted_create_wai... | cwe | CWE-787 | C/C++ |
void operator()(const CPUDevice& d, typename TTypes<T, 4>::ConstTensor input,
typename TTypes<T, 3>::ConstTensor filter,
typename TTypes<T, 4>::ConstTensor out_backprop,
int stride_rows, int stride_cols, int rate_rows,
int rate_cols, int pad_top, i... | cwe | CWE-787 | C/C++ |
/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy o... | cwe | CWE-476 | C/C++ |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* Stream/crypto handshake adapter for the server side. Since on the server
* side, the handshake logic is handled in mini conn, this adapter does not
* have much to do. If peer sends any data on this stream, the adapter
* throws the data... | cwe | CWE-476 | C/C++ |
static void Sp_split_regexp(js_State *J)
{
js_Regexp *re;
const char *text;
int limit, len, k;
const char *p, *a, *b, *c, *e;
Resub m;
text = checkstring(J, 0);
re = js_toregexp(J, 1);
limit = js_isdefined(J, 2) ? js_tointeger(J, 2) : 1 << 30;
js_newarray(J);
len = 0;
e = text + strlen(text);
/* splitti... | cwe | CWE-400 | Unknown |
do_async_error (IncrementData *data)
{
GError *error;
error = g_error_new (MY_OBJECT_ERROR,
MY_OBJECT_ERROR_FOO,
"%s",
"this method always loses");
dbus_g_method_return_error (data->context, error);
g_free (data);
return FALSE;
} | cwe | CWE-264 | C/C++ |
# -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
# Copyright (C) 2019 Nicolargo <nicolas@nicolargo.com>
#
# Glances 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 3 of the Lic... | cwe | CWE-611 | Python |
int yr_object_array_set_item(
YR_OBJECT* object,
YR_OBJECT* item,
int index)
{
YR_OBJECT_ARRAY* array;
int i;
int count;
assert(index >= 0);
assert(object->type == OBJECT_TYPE_ARRAY);
array = object_as_array(object);
if (array->items == NULL)
{
count = yr_max(64, (index + 1) * 2);... | cwe | CWE-119 | C/C++ |
/*
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2016 The PHP Group |
+---------... | cwe | CWE-476 | C/C++ |
package io.onedev.server.plugin.executor.kubernetes;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import javax.inject.Inj... | cwe | CWE-74 | Java |
untrusted_launcher_response_callback (GtkDialog *dialog,
int response_id,
ActivateParametersDesktop *parameters)
{
GdkScreen *screen;
char *uri;
GFile *file;
switch (response_id)
{
... | cwe | CWE-20 | C/C++ |
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its S... | cwe | CWE-787 | C/C++ |
def run_cmd(session, *args)
options = {}
return run_cmd_options(session, options, *args)
end | cwe | CWE-384 | Ruby |
import { Meteor } from 'meteor/meteor';
import RedisPubSub from '/imports/startup/server/redis';
import Logger from '/imports/startup/server/logger';
import Users from '/imports/api/users';
import createDummyUser from '../modifiers/createDummyUser';
import setConnectionIdAndAuthToken from '../modifiers/setConnectionIdA... | cwe | CWE-74 | JavaScript |
TfLiteStatus TanhEval(TfLiteContext* context, TfLiteNode* node) {
OpData* data = reinterpret_cast<OpData*>(node->user_data);
const TfLiteTensor* input = GetInput(context, node, 0);
TfLiteTensor* output = GetOutput(context, node, 0);
switch (input->type) {
case kTfLiteFloat32: {
if (kernel_type == kRef... | cwe | CWE-125 | C/C++ |
struct mapped_device *dm_get_from_kobject(struct kobject *kobj)
{
struct mapped_device *md;
md = container_of(kobj, struct mapped_device, kobj_holder.kobj);
if (test_bit(DMF_FREEING, &md->flags) ||
dm_deleting_md(md))
return NULL;
dm_get(md);
return md;
} | cwe | CWE-362 | C/C++ |
set_file_metadata (const char *origin_url, const char *referrer_url, FILE *fp)
{
/* Save metadata about where the file came from (requested, final URLs) to
* user POSIX Extended Attributes of retrieved file.
*
* For more details about the user namespace see
* [http://freedesktop.org/wiki/CommonExtendedAtt... | cwe | CWE-200 | Unknown |
package configstore
import (
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strings"
"sync"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/gorilla/mux"
"github.com/grafana/agent/pkg/metrics/cluster/configapi"
"github.com/grafana/agent/pkg/metrics/instance"
"github.com/prometheus/client_gola... | cwe | CWE-200 | Go |
long long Segment::CreateInstance(IMkvReader* pReader, long long pos,
Segment*& pSegment) {
assert(pReader);
assert(pos >= 0);
pSegment = NULL;
long long total, available;
const long status = pReader->Length(&total, &available);
if (status < 0) // error
return status;... | cwe | CWE-20 | C/C++ |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | cwe | CWE-352 | Python |
def snoozeNotifications(): Action[JsValue] =
PostJsonAction(RateLimits.ConfigUser, 200) { request => | cwe | CWE-613 | Scala |
/* The ziplist is a specially encoded dually linked list that is designed
* to be very memory efficient. It stores both strings and integer values,
* where integers are encoded as actual integers instead of a series of
* characters. It allows push and pop operations on either side of the list
* in O(1) time. Howeve... | cwe | CWE-190 | C/C++ |
long kvm_arch_vcpu_ioctl(struct file *filp,
unsigned int ioctl, unsigned long arg)
{
struct kvm_vcpu *vcpu = filp->private_data;
void __user *argp = (void __user *)arg;
switch (ioctl) {
case KVM_ARM_VCPU_INIT: {
struct kvm_vcpu_init init;
if (copy_from_user(&init, argp, sizeof(init)))
return -EFAULT;
... | cwe | CWE-399 | C/C++ |
/*
Copyright 2008-2017 LibRaw LLC (info@libraw.org)
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 LICENSE version 2.1
(See file LICENSE.LGPL provided in LibRaw distribution archive for details).
2. COMMON... | cwe | CWE-125 | C/C++ |
constructor (opt) {
opt = opt || {}
// the order in which rules are applied.
opt.ignoreFiles = [
rootBuiltinRules,
'package.json',
'.npmignore',
'.gitignore',
packageNecessaryRules,
]
opt.includeEmpty = false
opt.path = opt.path || process.cwd()
// only follo... | cwe | CWE-200 | JavaScript |
function editClient() {
var elem = $(this).attr("id");
var tr = $(this).closest("tr");
var id = tr.attr("data-id");
var groups = tr.find("#multiselect_" + id).val();
var ip = tr.find("#ip_" + id).text();
var name = utils.escapeHtml(tr.find("#name_" + id).text());
var comment = utils.escapeHtml(tr.find("#c... | cwe | CWE-862 | JavaScript |
void MidiManagerUsb::DispatchSendMidiData(MidiManagerClient* client,
uint32_t port_index,
const std::vector<uint8>& data,
double timestamp) {
DCHECK_LT(port_index, output_streams_.size());
... | cwe | CWE-119 | C/C++ |
/*
* IPV6 GSO/GRO offload support
* Linux INET6 implementation
*
* 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-400 | C/C++ |
package api
type Shortcut struct {
ID int `json:"id"`
// Standard fields
RowStatus RowStatus `json:"rowStatus"`
CreatorID int `json:"creatorId"`
CreatedTs int64 `json:"createdTs"`
UpdatedTs int64 `json:"updatedTs"`
// Domain specific fields
Title string `json:"title"`
Payload string `json:"p... | cwe | CWE-269 | Go |
void ServerConnectionImpl::onResetStream(StreamResetReason reason) {
active_request_->response_encoder_.runResetCallbacks(reason);
connection_.dispatcher().deferredDelete(std::move(active_request_));
} | cwe | CWE-416 | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.