code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
copy_rrset(const struct ub_packed_rrset_key* key, struct regional* region)
{
struct ub_packed_rrset_key* ck = regional_alloc(region,
sizeof(struct ub_packed_rrset_key));
struct packed_rrset_data* d;
struct packed_rrset_data* data = key->entry.data;
size_t dsize, i;
uint8_t* nextrdata;
/* derived from packed_rr... | cwe | CWE-190 | Unknown |
@Override
protected void configure(final HttpSecurity http) throws Exception {
http
.csrf()
.disable()
.authorizeRequests()
.antMatchers("/css/**").permitAll()
.antMatchers("/js/**").permitAll()
.antMatchers("/fonts/**").permitAll()
.antMatchers("/plugins... | cwe | CWE-352 | Java |
WebNavigationPolicy RenderViewImpl::decidePolicyForNavigation(
WebFrame* frame, const WebURLRequest& request, WebNavigationType type,
const WebNode&, WebNavigationPolicy default_policy, bool is_redirect) {
if (is_swapped_out_) {
if (request.url() != GURL("about:swappedout"))
return WebKit::WebNaviga... | cwe | CWE-264 | C/C++ |
return code.includes(hash);
});
if (containsMentions) {
// disable code highlighting if there is a mention in there
// highlighting will be wrong anyway because this is not valid code
return code;
}
return hljs.highlightAuto(code).value;
},
}); | cwe | CWE-79 | JavaScript |
package com.salesmanager.shop.admin.controller.products;
import com.salesmanager.core.business.services.catalog.category.CategoryService;
import com.salesmanager.core.business.services.catalog.product.ProductService;
import com.salesmanager.core.business.services.catalog.product.image.ProductImageService;
import com.s... | cwe | CWE-79 | Java |
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.content.service;
import java.io.IOException;
import java.io.InputStream;
import jav... | cwe | CWE-863 | Java |
static void Ins_MDRP( INS_ARG )
{
Int point;
TT_F26Dot6 distance,
org_dist;
point = (Int)args[0];
if ( BOUNDS( args[0], CUR.zp1.n_points ) )
{
/* Current version of FreeType silently ignores this out of bounds error
* and drops the instruction, se... | cwe | CWE-125 | Unknown |
static char *get_header(FILE *fp)
{
long start;
/* First 1024 bytes of doc must be header (1.7 spec pg 1102) */
char *header;
header = calloc(1, 1024);
start = ftell(fp);
fseek(fp, 0, SEEK_SET);
SAFE_E(fread(header, 1, 1023, fp), 1023, "Failed to load PDF header.\n");
fseek(fp, st... | cwe | CWE-787 | C/C++ |
c;else if("mxfile"==c.nodeName){var k=c.getElementsByTagName("diagram");if(0<k.length){g=k[0];var m=e.getGlobalVariable;e.getGlobalVariable=function(q){return"page"==q?g.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==q?1:m.apply(this,arguments)}}}null!=g&&(c=Editor.parseDiagramNode(g))}k=this... | cwe | CWE-20 | JavaScript |
static int shmem_getpage(struct inode *inode, unsigned long idx,
struct page **pagep, enum sgp_type sgp, int *type)
{
struct address_space *mapping = inode->i_mapping;
struct shmem_inode_info *info = SHMEM_I(inode);
struct shmem_sb_info *sbinfo;
struct page *filepage = *pagep;
struct page *swappage;
swp_entry_... | cwe | CWE-200 | Unknown |
cff_decoder_parse_charstrings( CFF_Decoder* decoder,
FT_Byte* charstring_base,
FT_ULong charstring_len )
{
FT_Error error;
CFF_Decoder_Zone* zone;
FT_Byte* ip;
FT_Byte* limit;
CFF_Builder* ... | cwe | CWE-189 | Unknown |
package com.salesmanager.shop.admin.controller.user;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
import org.springframework.stereotype.Control... | cwe | CWE-639 | Java |
/*
Ming, an SWF output library
Copyright (C) 2002 Opaque Industries - http://www.opaque.net/
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 Foundation; either
version 2.1 of the ... | cwe | CWE-119 | C/C++ |
package io.swagger.client.api;
import io.swagger.client.ApiException;
import io.swagger.client.ApiClient;
import io.swagger.client.ApiResponse;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import javax.ws.rs.core.GenericType;
import io.swagger.client.model.User;
import java.util.ArrayList;... | cwe | CWE-732 | Java |
package com.salesmanager.shop.admin.controller.configurations;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
impor... | cwe | CWE-639 | Java |
#
# 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 not u... | cwe | CWE-20 | C/C++ |
INST_HANDLER (lds) { // LDS Rd, k
int d = ((buf[0] >> 4) & 0xf) | ((buf[1] & 0x1) << 4);
int k = (buf[3] << 8) | buf[2];
op->ptr = k;
__generic_ld_st (op, "ram", 0, 1, 0, k, 0);
ESIL_A ("r%d,=,", d);
} | cwe | CWE-125 | C/C++ |
mono_runtime_shutdown (void)
{
mono_domain_foreach (fire_process_exit_event, NULL);
} | cwe | CWE-264 | Unknown |
// Copyright (c) 2015-2021 MinIO, Inc.
//
// This file is part of MinIO Object Storage stack
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (... | cwe | CWE-863 | Go |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
auto* params = reinterpret_cast<TfLiteL2NormParams*>(node->builtin_data);
TF_LITE_ENSURE_EQ(context, NumInputs(node), 1);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
TfLit... | cwe | CWE-787 | C/C++ |
mxUtils.bind(this,function(){0===C&&(c=U.full_path,m=J.path,v="",O(null,!0))})));k.appendChild(E)})(X[u])}}));G()}else G(),mxUtils.write(k,mxResources.get("noFiles"));100==V.length&&(k.appendChild(A),B=function(){k.scrollTop>=k.scrollHeight-k.offsetHeight&&P()},mxEvent.addListener(k,"scroll",B))}),y)}}))});b?this.user?... | cwe | CWE-20 | JavaScript |
int tls1_mac(SSL *ssl, SSL3_RECORD *rec, unsigned char *md, int send)
{
unsigned char *seq;
EVP_MD_CTX *hash;
size_t md_size;
int i;
EVP_MD_CTX *hmac = NULL, *mac_ctx;
unsigned char header[13];
int stream_mac = (send ? (ssl->mac_flags & SSL_MAC_FLAG_WRITE_MAC_STREAM)
: ... | cwe | CWE-20 | C/C++ |
function scrollActiveSidebar(router) {
const cover = dom.find('.cover.show');
coverHeight = cover ? cover.offsetHeight : 0;
const sidebar = dom.getNode('.sidebar');
let lis = [];
if (sidebar !== null && sidebar !== undefined) {
lis = dom.findAll(sidebar, 'li');
}
for (let i = 0, len = lis.length; i ... | cwe | CWE-79 | JavaScript |
/* 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-476 | Python |
/*
* Copyright (c) 2019 HAW Hamburg
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup sys_clif
* @{
*
* @file
* @brief CoRE Link format encoding and decoding li... | cwe | CWE-120 | C/C++ |
package defaults
import (
"time"
)
const (
// these requests take at _least_ two minutes at the moment.
ProvideTimeout = time.Minute * 3
ProvSearchDelay = time.Second
// Number of concurrent workers in decision engine that process requests to the blockstore
BitswapEngineBlockstoreWorkerCount = 128
// the tot... | cwe | CWE-400 | Go |
'use strict'
const Client = require('./lib/client')
const Dispatcher = require('./lib/dispatcher')
const errors = require('./lib/core/errors')
const Pool = require('./lib/pool')
const BalancedPool = require('./lib/balanced-pool')
const Agent = require('./lib/agent')
const util = require('./lib/core/util')
const { Inva... | cwe | CWE-918 | JavaScript |
def add_user(username, password):
encPass = crypt.crypt(password,"22")
os.system("useradd -G docker,wheel -p "+encPass+" "+username) | cwe | CWE-78 | Python |
/*
* 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 |
$(document).ready(function(){function t(){api.IMAP.get().success(function(e){0==e.length?$("#lastlogindiv").hide():(0==(e=e[0]).enabled?$("#lastlogindiv").hide():$("#lastlogindiv").show(),$("#imapusername").val(e.username),$("#imaphost").val(e.host),$("#imapport").val(e.port),$("#imappassword").val(e.password),$("#use_... | cwe | CWE-79 | Go |
Reprog *regcompx(void *(*alloc)(void *ctx, void *p, int n), void *ctx,
const char *pattern, int cflags, const char **errorp)
{
struct cstate g;
Renode *node;
Reinst *split, *jump;
int i, n;
g.pstart = NULL;
g.prog = NULL;
if (setjmp(g.kaboom)) {
if (errorp) *errorp = g.error;
alloc(ctx, g.pstart, 0);
al... | cwe | CWE-703 | Unknown |
static int stbi__process_frame_header(stbi__jpeg *z, int scan)
{
stbi__context *s = z->s;
int Lf,p,i,q, h_max=1,v_max=1,c;
Lf = stbi__get16be(s); if (Lf < 11) return stbi__err("bad SOF len","Corrupt JPEG"); // JPEG
p = stbi__get8(s); if (p != 8) return stbi__err("only 8-bit","JPEG format... | cwe | CWE-787 | C/C++ |
static int splice_pipe_to_pipe(struct pipe_inode_info *ipipe,
struct pipe_inode_info *opipe,
size_t len, unsigned int flags)
{
struct pipe_buffer *ibuf, *obuf;
int ret = 0, nbuf;
bool input_wakeup = false;
retry:
ret = ipipe_prep(ipipe, flags);
if (ret)
return ret;
ret = opipe_prep(opipe,... | cwe | CWE-416 | Unknown |
def index
valid_http_methods :get, :post, :put
# for permission check
if params[:package] and not ["_repository", "_jobhistory"].include?(params[:package])
pkg = DbPackage.get_by_project_and_name( params[:project], params[:package], use_source=false )
else
prj = DbProject.get_by_name params... | cwe | CWE-20 | Ruby |
static ssize_t _epoll_readv(
oe_fd_t* desc,
const struct oe_iovec* iov,
int iovcnt)
{
ssize_t ret = -1;
epoll_t* file = _cast_epoll(desc);
void* buf = NULL;
size_t buf_size = 0;
if (!file || (iovcnt && !iov) || iovcnt < 0 || iovcnt > OE_IOV_MAX)
OE_RAISE_ERRNO(OE_EINVAL);
/... | cwe | CWE-552 | Unknown |
static int pkey_GOST_ECcp_decrypt(EVP_PKEY_CTX *pctx, unsigned char *key,
size_t *key_len, const unsigned char *in,
size_t in_len)
{
const unsigned char *p = in;
EVP_PKEY *priv = EVP_PKEY_CTX_get0_pkey(pctx);
GOST_KEY_TRANSPORT *gkt = NULL;
int ret =... | cwe | CWE-120 | Unknown |
function G(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.hasLoaded,a=o;return Object($.t)(e)&&!Object($.p)(e)&&"function"==typeof e.afterLoad&&(a=!0,X(e.afterLoad).call(this,t)),Object($.s)(e)?G.call(this,e(t),t,{hasLoaded:a}):Object($.p)(e)?M()(e).call(e,(function(e){return G.call(n,e... | cwe | CWE-601 | JavaScript |
/* vi:set ts=8 sts=4 sw=4 noet:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
#include "vim.h"
/*
* Vim originated fro... | cwe | CWE-787 | C/C++ |
static int ext4_ext_grow_indepth(handle_t *handle, struct inode *inode,
unsigned int flags)
{
struct ext4_extent_header *neh;
struct buffer_head *bh;
ext4_fsblk_t newblock, goal = 0;
struct ext4_super_block *es = EXT4_SB(inode->i_sb)->s_es;
int err = 0;
/* Try to prepend new index to old one */
if (ext_dep... | cwe | CWE-908 | Unknown |
static int stimer_set_config(struct kvm_vcpu_hv_stimer *stimer, u64 config,
bool host)
{
union hv_stimer_config new_config = {.as_uint64 = config},
old_config = {.as_uint64 = stimer->config.as_uint64};
struct kvm_vcpu *vcpu = hv_stimer_to_vcpu(stimer);
struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu);
struc... | cwe | CWE-476 | 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-22 | Java |
php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
const char *path, const char *mode, int options, char **opened_path,
php_stream_context *context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */
{
php_stream *stream = NULL;
php_url *resource = NULL;
int use_ssl;
int use_proxy =... | cwe | CWE-119 | Unknown |
StringVal decrypt(FunctionContext* ctx, const StringVal& src, const StringVal& key,
const StringVal& iv, EncryptionMode mode) {
if (src.len == 0 || src.is_null) {
return StringVal::null();
}
int cipher_len = src.len;
std::unique_ptr<char[]> p;
p.reset(new char[cipher_len]);... | cwe | CWE-200 | Unknown |
package org.akaza.openclinica.controller.openrosa;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSer... | cwe | CWE-22 | Java |
PQconnectPoll(PGconn *conn)
{
bool reset_connection_state_machine = false;
bool need_new_connection = false;
PGresult *res;
char sebuf[PG_STRERROR_R_BUFLEN];
int optval;
if (conn == NULL)
return PGRES_POLLING_FAILED;
/* Get the new data */
switch (conn->status)
{
/*
* We really shouldn't have... | cwe | CWE-522 | C/C++ |
Status GraphConstructor::MakeEdge(Node* src, int output_index, Node* dst,
int input_index) {
DataType src_out = src->output_type(output_index);
DataType dst_in = dst->input_type(input_index);
if (!TypesCompatible(dst_in, src_out)) {
return errors::InvalidArgument(
"In... | cwe | CWE-369 | C/C++ |
q):mxscript("js/extensions.min.js",q))};EditorUi.prototype.generatePlantUmlImage=function(d,g,k,l){function p(y,A,B){c1=y>>2;c2=(y&3)<<4|A>>4;c3=(A&15)<<2|B>>6;c4=B&63;r="";r+=q(c1&63);r+=q(c2&63);r+=q(c3&63);return r+=q(c4&63)}function q(y){if(10>y)return String.fromCharCode(48+y);y-=10;if(26>y)return String.fromCharC... | cwe | CWE-20 | JavaScript |
public function getBranches()
{
if (null === $this->branches) {
$branches = array();
$bookmarks = array();
$this->process->execute('hg branches', $output, $this->repoDir);
foreach ($this->process->splitLines($output) as $branch) {
if ($branch ... | cwe | CWE-88 | PHP |
WandPrivate MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand,
const char *option,const char *arg1n,const char *arg2n)
{
const char /* percent escaped versions of the args */
*arg1,
*arg2;
Image
*new_images;
MagickStatusType
status;
ssize_t
parse;
#define _image_info (... | cwe | CWE-399 | C/C++ |
// mkerrors.sh -m64
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build amd64,openbsd
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m64 _const.go
package unix
import "syscall"
const (
AF_APPLETALK = 0x10
AF_BLUETOOTH = 0x... | cwe | CWE-287 | Go |
package com.salesmanager.shop.admin.controller.products;
import com.salesmanager.core.business.services.catalog.product.attribute.ProductOptionValueService;
import com.salesmanager.core.business.services.content.ContentService;
import com.salesmanager.core.business.services.reference.language.LanguageService;
import c... | cwe | CWE-79 | Java |
static void *load_bytes(RBinFile *arch, const ut8 *buf, ut64 sz, ut64 loaddr, Sdb *sdb) {
if (!buf || !sz || sz == UT64_MAX) {
return NULL;
}
RBuffer *tbuf = r_buf_new ();
r_buf_set_bytes (tbuf, buf, sz);
struct r_bin_bflt_obj *res = r_bin_bflt_new_buf (tbuf);
r_buf_free (tbuf);
return res ? res : NULL;
... | cwe | CWE-119 | C/C++ |
DataBuf FileIo::read(long rcount)
{
assert(p_->fp_ != 0);
DataBuf buf(rcount);
long readCount = read(buf.pData_, buf.size_);
buf.size_ = readCount;
return buf;
} | cwe | CWE-125 | Unknown |
def self.search_by_host(key, operator, value)
conditions = "hosts.name #{operator} '#{value_to_sql(operator, value)}'"
direct = Puppetclass.all(:conditions => conditions, :joins => :hosts, :select => 'puppetclasses.id').map(&:id).uniq
hostgroup = Hostgroup.joins(:hosts).where(conditions).first
indi... | cwe | CWE-89 | Ruby |
const got = require('@/utils/got');
const cheerio = require('cheerio');
const timezone = require('@/utils/timezone');
const { parseDate } = require('@/utils/parse-date');
const { art } = require('@/utils/render');
const path = require('path');
module.exports = async (ctx) => {
const user = ctx.params.user ?? '';
... | cwe | CWE-918 | JavaScript |
int HttpFileImpl::save(const std::string &path) const
{
assert(!path.empty());
if (fileName_.empty())
return -1;
filesystem::path fsPath(utils::toNativePath(path));
if (!fsPath.is_absolute() &&
(!fsPath.has_parent_path() ||
(fsPath.begin()->string() != "." && fsPath.begin()->str... | cwe | CWE-552 | Unknown |
/* 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 ... | cwe | CWE-369 | Python |
NativeModule::NativeModule(const std::string& filename) : init(nullptr) {
if (uv_dlopen(filename.c_str(), &lib) != 0) {
throw RuntimeGenericError("Failed to load module");
}
if (uv_dlsym(&lib, "InitForContext", reinterpret_cast<void**>(&init)) != 0 || init == nullptr) {
uv_dlclose(&lib);
throw RuntimeGenericEr... | cwe | CWE-703 | 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-787 | C/C++ |
/* $OpenBSD: sshd.c,v 1.475 2016/08/28 22:28:12 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
* This program is the ssh daemon. It listens for connections from clients,
* and performs authentication, ... | cwe | CWE-119 | C/C++ |
xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
int ret = 0;
int avail, tlen;
xmlChar cur, next;
const xmlChar *lastlt, *lastgt;
if (ctxt->input == NULL)
return(0);
#ifdef DEBUG_PUSH
switch (ctxt->instate) {
case XML_PARSER_EOF:
xmlGenericError(xmlGenericErrorContext,... | cwe | CWE-125 | Unknown |
function mxODPicker(b,e,f,c,m,n,v,d,g,k,l,p,q,x){function y(P,Q){Q=Q||document;return Q.querySelector(P)}function z(P,Q,S){if(null==P["@microsoft.graph.downloadUrl"])if(null==P.parentReference)S();else{c(P.id,P.parentReference.driveId,function(da){z(da,Q,S)},S);return}var Y=new XMLHttpRequest;Y.open("GET",P["@microsoft... | cwe | CWE-94 | JavaScript |
uploads.upload = async function (socket, data) {
const methodToFunc = {
'user.uploadCroppedPicture': socketUser.uploadCroppedPicture,
'user.updateCover': socketUser.updateCover,
'groups.cover.update': socketGroup.cover.update,
};
if (!socket.uid || !data || !data.chunk || !data.params || !data.params.method ||... | cwe | CWE-79 | JavaScript |
'use strict';
// Load modules
const Boom = require('boom');
const Cryptiles = require('cryptiles');
const Hoek = require('hoek');
const Iron = require('iron');
const Items = require('items');
// Declare internals
const internals = {
version: '2'
};
exports = module.exports = internals.Socket = function (ws, ... | cwe | CWE-287 | JavaScript |
export function isOriginPotentiallyTrustworthy(url) {
// 1. If origin is an opaque origin, return "Not Trustworthy".
// Not applicable
// 2. Assert: origin is a tuple origin.
// Not for implementations
// 3. If origin's scheme is either "https" or "wss", return "Potentially Trustworthy".
if (/^(http|ws)s:$/.tes... | cwe | CWE-1333 | JavaScript |
var chownr = require('chownr')
var tar = require('tar-stream')
var pump = require('pump')
var mkdirp = require('mkdirp')
var fs = require('fs')
var path = require('path')
var os = require('os')
var win32 = os.platform() === 'win32'
var noop = function () {}
var echo = function (name) {
return name
}
var normalize... | cwe | CWE-20 | Java |
/*
** 2001 September 15
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
*******************... | cwe | CWE-755 | C/C++ |
static void cmdRemedy(MprHash *args)
{
MprCmd *cmd;
cchar **argv;
char *command, *data;
int rc, status, argc, background;
#if DEBUG_IDE && ME_UNIX_LIKE
unsetenv("DYLD_LIBRARY_PATH");
unsetenv("DYLD_FRAMEWORK_PATH");
#endif
if ((cmd = mprCreateCmd(NULL)) == 0) {
... | cwe | CWE-476 | C/C++ |
package com.salesmanager.shop.admin.controller.categories;
import java.util.*;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.... | cwe | CWE-639 | Java |
// imagew-bmp.c
// Part of ImageWorsener, Copyright (c) 2011 by Jason Summers.
// For more information, see the readme.txt file.
#include "imagew-config.h"
#include <stdio.h> // for SEEK_SET
#include <stdlib.h>
#include <string.h>
#define IW_INCLUDE_UTIL_FUNCTIONS
#include "imagew.h"
#define IWBMP_BI_RGB 0 //... | cwe | CWE-119 | C/C++ |
lyd_new(struct lyd_node *parent, const struct lys_module *module, const char *name)
{
const struct lys_node *snode = NULL, *siblings;
if ((!parent && !module) || !name) {
LOGARG;
return NULL;
}
siblings = lyd_new_find_schema(parent, module, 0);
if (!siblings) {
LOGARG;
... | cwe | CWE-119 | Unknown |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-20 | C/C++ |
/* Copyright (c) 2001 Matej Pfajfar.
* Copyright (c) 2001-2004, Roger Dingledine.
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
* Copyright (c) 2007-2016, The Tor Project, Inc. */
/* See LICENSE for licensing information */
/**
* \file connection_edge.c
* \brief Handle edge streams.
*
* An edge_c... | cwe | CWE-617 | C/C++ |
/*!
* URI.js - Mutating URLs
*
* Version: 1.19.10
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
*
*/
(function (root, factory) {
'use strict';
// https://github.com/umdjs/umd/blob/master/returnExports.js... | cwe | CWE-601 | JavaScript |
Http::FilterMetadataStatus Context::onResponseMetadata() {
if (!wasm_->onResponseMetadata_) {
return Http::FilterMetadataStatus::Continue;
}
if (wasm_->onResponseMetadata_(this, id_).u64_ == 0) {
return Http::FilterMetadataStatus::Continue;
}
return Http::FilterMetadataStatus::Continue; // This is cur... | cwe | CWE-476 | C/C++ |
protected function _copy($source, $targetDir, $name) {
$this->clearcache();
$id = $this->_joinPath($targetDir, $name);
$sql = $id > 0
? sprintf('REPLACE INTO %s (id, parent_id, name, content, size, mtime, mime, width, height, `read`, `write`, `locked`, `hidden`) (SELECT %d, %d, name, content, size, mtime, mim... | cwe | CWE-89 | JavaScript |
static int vorbis_finish_frame(stb_vorbis *f, int len, int left, int right)
{
int prev,i,j;
if (f->previous_length) {
int i,j, n = f->previous_length;
float *w = get_window(f, n);
for (i=0; i < f->channels; ++i) {
for (j=0; j < n; ++j)
f->channel_buffers[i][left+j] =
... | cwe | CWE-617 | C/C++ |
FLAC__StreamDecoderWriteStatus FLACParser::writeCallback(
const FLAC__Frame *frame, const FLAC__int32 * const buffer[])
{
if (mWriteRequested) {
mWriteRequested = false;
mWriteHeader = frame->header;
mWriteBuffer = buffer;
mWriteCompleted = true;
return FLAC__STREAM_DECODE... | cwe | CWE-119 | C/C++ |
static inline bool can_follow_write_pte(pte_t pte, unsigned int flags)
{
return pte_write(pte) ||
((flags & FOLL_FORCE) && (flags & FOLL_COW) && pte_dirty(pte));
} | cwe | CWE-362 | Unknown |
public void translate(ServerTradeListPacket packet, GeyserSession session) {
Inventory openInventory = session.getOpenInventory();
if (!(openInventory instanceof MerchantContainer && openInventory.getId() == packet.getWindowId())) {
return;
}
// Retrieve the fake villager in... | cwe | CWE-287 | Java |
package config
import (
"bytes"
"fmt"
"io/ioutil"
"net"
"os"
"os/exec"
"path/filepath"
"regexp"
"strings"
"github.com/BurntSushi/toml"
"github.com/container-orchestrated-devices/container-device-interface/pkg/cdi"
conmonconfig "github.com/containers/conmon/runner/config"
"github.com/containers/image/v5/p... | cwe | CWE-400 | Go |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package br.com.magazine.dao;
import br.com.magazine.entidade.Cliente;
import br.com.magazine.entidade.Editora;
import br.com.magazine.... | cwe | CWE-89 | Java |
copy: function (from, dist, callback) {
var that = this,
cmd = '';
dist = path.resolve(dist);
fs.lstat(from, function (err, stats) {
if (err) {
callback(err);
} else {
if (stats.isDirectory()) {
that.mkdir(dist, function (err) {
if (err) {
... | cwe | CWE-77 | JavaScript |
"""Base Tornado handlers for the notebook server."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import datetime
import functools
import ipaddress
import json
import mimetypes
import os
import re
import sys
import traceback
import types
import warnings
from htt... | cwe | CWE-601 | Python |
s4u_identify_user(krb5_context context,
krb5_creds *in_creds,
krb5_data *subject_cert,
krb5_principal *canon_user)
{
krb5_error_code code;
krb5_preauthtype ptypes[1] = { KRB5_PADATA_S4U_X509_USER };
krb5_creds creds;
int use_master = 0;
krb5_get_... | cwe | CWE-617 | C/C++ |
i_alloc_byte_array_immovable(gs_memory_t * mem, uint num_elements,
uint elt_size, client_name_t cname)
{
gs_ref_memory_t * const imem = (gs_ref_memory_t *)mem;
obj_header_t *obj;
#ifdef MEMENTO
if (Memento_failThisEvent())
return NULL;
#endif
obj = alloc_obj(imem, ... | cwe | CWE-190 | Unknown |
static void nsc_encode_subsampling(NSC_CONTEXT* context)
{
UINT16 x;
UINT16 y;
BYTE* co_dst;
BYTE* cg_dst;
INT8* co_src0;
INT8* co_src1;
INT8* cg_src0;
INT8* cg_src1;
UINT32 tempWidth;
UINT32 tempHeight;
tempWidth = ROUND_UP_TO(context->width, 8);
tempHeight = ROUND_UP_TO(context->height, 2);
for... | cwe | CWE-787 | C/C++ |
int RGWGetObj_ObjStore_S3::send_response_data(bufferlist& bl, off_t bl_ofs,
off_t bl_len)
{
const char *content_type = NULL;
string content_type_str;
map<string, string> response_attrs;
map<string, string>::iterator riter;
bufferlist metadata_bl;
if (sent_header)
goto send_data;
if (custo... | cwe | CWE-79 | C/C++ |
int libsoc_pwm_get_polarity(pwm *pwm)
{
int polarity;
char path[STR_BUF];
char tmp_str[1];
if (pwm == NULL)
{
libsoc_pwm_debug(__func__, -1, -1, "invalid pwm pointer");
return EXIT_FAILURE;
}
sprintf(path, "/sys/class/pwm/pwmchip%d/pwm%d/polarity", pwm->chip, pwm->pwm);
if (file_read_str(path... | cwe | CWE-119 | C/C++ |
opj_pi_iterator_t *opj_pi_create_decode(opj_image_t *p_image,
opj_cp_t *p_cp,
OPJ_UINT32 p_tile_no)
{
/* loop */
OPJ_UINT32 pino;
OPJ_UINT32 compno, resno;
/* to store w, h, dx and dy fro all components and resolutions */
OPJ_UINT32 * l_tmp_data;
OPJ_UINT32 ** l_tmp_ptr;
/* encoding pramete... | cwe | CWE-190 | C/C++ |
switchGroup(uid_t uid, const struct passwd *userInfo, gid_t gid) {
if (userInfo != NULL) {
bool setgroupsCalled = false;
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#ifdef __APPLE__
int groups[1024];
int ngroups = sizeof(groups) / sizeof(int);
#else
gid_t groups[1024];
... | cwe | CWE-284 | C/C++ |
static void virgl_resource_attach_backing(VirtIOGPU *g,
struct virtio_gpu_ctrl_command *cmd)
{
struct virtio_gpu_resource_attach_backing att_rb;
struct iovec *res_iovs;
int ret;
VIRTIO_GPU_FILL_CMD(att_rb);
trace_virtio_gpu_cmd_res_back_attach(att_rb.resour... | cwe | CWE-772 | C/C++ |
static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags,
struct in6_addr *addr, uint32_t *ifindex)
{
struct sockaddr_in6 sin6;
unsigned char cbuf[CMSG_SPACE(sizeof(struct in6_pktinfo))];
struct iovec iovec;
struct msghdr msghdr;
struct cmsghdr *cmsghdr;
ssize_t len;
iovec.iov_len = *buf... | cwe | CWE-284 | Unknown |
static MYSQL *db_connect(char *host, char *database,
char *user, char *passwd)
{
MYSQL *mysql;
if (verbose)
fprintf(stdout, "Connecting to %s\n", host ? host : "localhost");
if (!(mysql= mysql_init(NULL)))
return 0;
if (opt_compress)
mysql_options(mysql,MYSQL_OPT_COMPRESS,Nu... | cwe | CWE-284 | Unknown |
/*
libdcr version 0.1.8.93 03/May/2009
libdcr : copyright (C) 2007-2009, Davide Pizzolato
based on dcraw.c -- Dave Coffin's raw photo decoder
Copyright 1997-2009 by Dave Coffin, dcoffin a cybercom o net
Covered code is provided under this license on an "as is" basis, without warranty
of any kind, either ... | cwe | CWE-770 | C/C++ |
function highlight(path) {
if (!enableScrollEvent) {
return;
}
const sidebar = dom.getNode('.sidebar');
const anchors = dom.findAll('.anchor');
const wrap = dom.find(sidebar, '.sidebar-nav');
let active = dom.find(sidebar, 'li.active');
const doc = document.documentElement;
const top = ((doc && doc... | cwe | CWE-79 | JavaScript |
const got = require('@/utils/got');
const utils = require('./utils');
module.exports = async (ctx) => {
const site = ctx.params.site;
const only_media = ctx.params.only_media ? 'true' : 'false';
const url = `http://${site}/api/v1/timelines/public?remote=true&only_media=${only_media}`;
const response ... | cwe | CWE-918 | JavaScript |
void check_system_chunk(struct btrfs_trans_handle *trans, u64 type)
{
struct btrfs_transaction *cur_trans = trans->transaction;
struct btrfs_fs_info *fs_info = trans->fs_info;
struct btrfs_space_info *info;
u64 left;
u64 thresh;
int ret = 0;
u64 num_devs;
/*
* Needed because we can end up allocating a system... | cwe | CWE-703 | Unknown |
package io.whitesource.cure;
import java.io.File;
import java.io.IOException;
import lombok.NonNull;
import org.apache.commons.io.FilenameUtils;
/**
* Remediation Solver static class written by WhiteSource with the community ❤. Here you can find
* wrapper functions to secure unsafe operations in your code.
*/
publ... | cwe | CWE-22 | Java |
function isOriginPotentiallyTrustworthy(url) {
// 1. If origin is an opaque origin, return "Not Trustworthy".
// Not applicable
// 2. Assert: origin is a tuple origin.
// Not for implementations
// 3. If origin's scheme is either "https" or "wss", return "Potentially Trustworthy".
if (/^(http|ws)s:$/.test(url.p... | cwe | CWE-1333 | JavaScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.