code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1},gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};EditorUi.logError=function(c,e,g,k,... | cwe | CWE-20 | JavaScript |
'use strict';
const { url_for } = require('hexo-util');
function listTagsHelper(tags, options) {
if (!options && (!tags || !Object.prototype.hasOwnProperty.call(tags, 'length'))) {
options = tags;
tags = this.site.tags;
}
if (!tags || !tags.length) return '';
options = options || {};
const { style... | cwe | CWE-79 | JavaScript |
static int io_async_buf_func(struct wait_queue_entry *wait, unsigned mode,
int sync, void *arg)
{
struct wait_page_queue *wpq;
struct io_kiocb *req = wait->private;
struct wait_page_key *key = arg;
int ret;
wpq = container_of(wait, struct wait_page_queue, wait);
if (!wake_page_match(wpq, key))
return ... | cwe | CWE-416 | Unknown |
/* 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-197 | C/C++ |
static pj_status_t STATUS_FROM_SSL_ERR2(char *action, pj_ssl_sock_t *ssock,
int ret, int err, int len)
{
unsigned long ssl_err = err;
if (err == SSL_ERROR_SSL) {
ssl_err = ERR_peek_error();
}
/* Dig for more from OpenSSL error queue */
SSLLogErrors(action, ret, err, len, ssock);
ssock->... | cwe | CWE-362 | C/C++ |
static int pkey_gost2018_encrypt(EVP_PKEY_CTX *pctx, unsigned char *out,
size_t *out_len, const unsigned char *key,
size_t key_len)
{
PSKeyTransport_gost *pst = NULL;
EVP_PKEY *pubk = EVP_PKEY_CTX_get0_pkey(pctx);
struct gost_pmeth_data *data = EVP_PKEY_CT... | cwe | CWE-120 | C/C++ |
def load_data(path):
"""Given path to a file, load data from it."""
ext = os.path.splitext(path)[-1]
loader = None
if ext in {'.yml', '.yaml'}:
loader = yaml
if yaml is None:
req_missing(['yaml'], 'use YAML data files')
return {}
elif ext in {'.json', '.js'}:
... | cwe | CWE-502 | Python |
prepend_row_security_policies(Query* root, RangeTblEntry* rte, int rt_index)
{
Expr *rowsec_expr = NULL;
Expr *rowsec_with_check_expr = NULL;
Expr *hook_expr = NULL;
Expr *hook_with_check_expr = NULL;
List *rowsec_policies;
List *hook_policies = NIL;
Relation rel;
Oid user... | cwe | CWE-209 | Unknown |
zip_read_mac_metadata(struct archive_read *a, struct archive_entry *entry,
struct zip_entry *rsrc)
{
struct zip *zip = (struct zip *)a->format->data;
unsigned char *metadata, *mp;
int64_t offset = archive_filter_bytes(&a->archive, 0);
size_t remaining_bytes, metadata_bytes;
ssize_t hsize;
int ret = ARCHIVE_OK... | cwe | CWE-20 | C/C++ |
OJPEGPreDecode(TIFF* tif, uint16 s)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
uint32 m;
if (sp->subsamplingcorrect_done==0)
OJPEGSubsamplingCorrect(tif);
if (sp->readheader_done==0)
{
if (OJPEGReadHeaderInfo(tif)==0)
return(0);
}
if (sp->sos_end[s].log==0)
{
if (OJPEGReadSecondarySos(tif,s)==0)
r... | cwe | CWE-369 | Unknown |
filter_close (struct backend *b, struct connection *conn)
{
struct backend_filter *f = container_of (b, struct backend_filter, backend);
void *handle = connection_get_handle (conn, b->i);
debug ("%s: close", b->name);
if (handle && f->filter.close)
f->filter.close (handle);
backend_set_handle (b, conn, ... | cwe | CWE-406 | Unknown |
evbuffer_add(struct evbuffer *buf, const void *data_in, size_t datlen)
{
struct evbuffer_chain *chain, *tmp;
const unsigned char *data = data_in;
size_t remain, to_alloc;
int result = -1;
EVBUFFER_LOCK(buf);
if (buf->freeze_end) {
goto done;
}
chain = buf->last;
/* If there are no chains allocated for th... | cwe | CWE-189 | C/C++ |
package profile
import (
"bufio"
"bytes"
"context"
"crypto"
"crypto/hmac"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"crypto/sha512"
"crypto/subtle"
"crypto/tls"
"crypto/x509"
"encoding/base64"
"encoding/json"
"encoding/pem"
"fmt"
"io"
"io/ioutil"
mathrand "math/rand"
"net"
"net/http"
"net/url"
... | cwe | CWE-269 | Go |
/*
Copyright 2019 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-20 | Go |
package com.salesmanager.shop.admin.controller.payments;
import com.salesmanager.core.business.modules.integration.IntegrationException;
import com.salesmanager.core.business.services.payments.PaymentService;
import com.salesmanager.core.model.merchant.MerchantStore;
import com.salesmanager.core.model.payments.Transac... | cwe | CWE-639 | Java |
static int decode_bit_string(const u8 * inbuf, size_t inlen, void *outbuf,
size_t outlen, int invert)
{
const u8 *in = inbuf;
u8 *out = (u8 *) outbuf;
int zero_bits = *in & 0x07;
size_t octets_left = inlen - 1;
int i, count = 0;
memset(outbuf, 0, outlen);
in++;
if (outlen < octets_left)
return SC_ERR... | cwe | CWE-119 | C/C++ |
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum 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 3 of the License... | cwe | CWE-129 | Go |
'use strict'
const url = require('url')
const {send} = require('micro')
const microCors = require('micro-cors')
const fetch = require('node-fetch')
const allowHeaders = [
'accept-encoding',
'accept-language',
'accept',
'access-control-allow-origin',
'authorization',
'cache-control',
'connection',
'cont... | cwe | CWE-918 | JavaScript |
static int parse_multipart(
ogs_sbi_message_t *message, ogs_sbi_http_message_t *http)
{
char *boundary = NULL;
int i;
multipart_parser_settings settings;
multipart_parser_data_t data;
multipart_parser *parser = NULL;
ogs_assert(message);
ogs_assert(http);
memset(&settings, 0,... | cwe | CWE-787 | Unknown |
public function uninstall($templatename)
{
if (Permission::model()->hasGlobalPermission('templates', 'update')) {
if (!Template::hasInheritance($templatename)) {
TemplateConfiguration::uninstall($templatename);
} else {
Yii::app()->setFlashMessage(spri... | cwe | CWE-352 | PHP |
cdf_read_short_sector_chain(const cdf_header_t *h,
const cdf_sat_t *ssat, const cdf_stream_t *sst,
cdf_secid_t sid, size_t len, cdf_stream_t *scn)
{
size_t ss = CDF_SEC_SIZE(h), i, j;
scn->sst_len = cdf_count_chain(ssat, sid, CDF_SEC_SIZE(h));
scn->sst_dirlen = len;
if (sst->sst_tab == NULL || scn->sst_len... | cwe | CWE-119 | C/C++ |
/*
* Unsquash a squashfs filesystem. This is a highly compressed read only
* filesystem.
*
* Copyright (c) 2009, 2010, 2011, 2012, 2019, 2021
* Phillip Lougher <phillip@squashfs.org.uk>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public Licen... | cwe | CWE-59 | C/C++ |
uint32_t virtio_config_readb(VirtIODevice *vdev, uint32_t addr)
{
VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev);
uint8_t val;
k->get_config(vdev, vdev->config);
if (addr > (vdev->config_len - sizeof(val)))
return (uint32_t)-1;
val = ldub_p(vdev->config + addr);
return val;
} | cwe | CWE-269 | C/C++ |
success: function(_result, _request){
var nodeData = Ext.util.JSON.decode(_result.responseText);
node.setText(_text);
this.scope.fireEvent('containerrename', node... | cwe | CWE-79 | JavaScript |
verify_client_san(krb5_context context,
pkinit_kdc_context plgctx,
pkinit_kdc_req_context reqctx,
krb5_kdcpreauth_callbacks cb,
krb5_kdcpreauth_rock rock,
krb5_const_principal client,
int *valid_san)
{
krb5_e... | cwe | CWE-287 | C/C++ |
package com.salesmanager.shop.mapper.catalog;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.co... | cwe | CWE-639 | Java |
SockParse(Sock *sockPtr)
{
const Tcl_DString *bufPtr;
const Driver *drvPtr;
Request *reqPtr;
char save;
SockState result;
NS_NONNULL_ASSERT(sockPtr != NULL);
drvPtr = sockPtr->drvPtr;
NsUpdateProgress((Ns_Sock *) sockPtr);
reqPtr = sockPt... | cwe | CWE-20 | C/C++ |
MagickExport MagickBooleanType SubstituteString(char **string,
const char *search,const char *replace)
{
MagickBooleanType
status;
register char
*p;
size_t
extent,
replace_extent,
search_extent;
ssize_t
offset;
status=MagickFalse;
search_extent=0,
replace_extent=0;
for (p=s... | cwe | CWE-190 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-119 | C/C++ |
static inline void init_fs_pin(struct fs_pin *p, void (*kill)(struct fs_pin *))
{
init_waitqueue_head(&p->wait);
p->kill = kill;
} | cwe | CWE-703 | Unknown |
GC_INNER void * GC_generic_malloc_ignore_off_page(size_t lb, int k)
{
void *result;
size_t lg;
size_t lb_rounded;
word n_blocks;
GC_bool init;
DCL_LOCK_STATE;
if (SMALL_OBJ(lb))
return(GC_generic_malloc((word)lb, k));
lg = ROUNDED_UP_GRANULES(lb);
lb_rounded = GRANULES_TO... | cwe | CWE-189 | C/C++ |
GC_debug_malloc_atomic_ignore_off_page(size_t lb, GC_EXTRA_PARAMS)
{
void * result = GC_malloc_atomic_ignore_off_page(lb + DEBUG_BYTES);
if (result == 0) {
GC_err_printf("GC_debug_malloc_atomic_ignore_off_page(%lu)"
" returning NULL (%s:%d)\n", (unsigned long)lb, s, i);
re... | cwe | CWE-119 | Unknown |
/* 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-20 | Python |
private int
mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
const unsigned char *s, uint32_t offset, size_t nbytes, struct magic *m)
{
/*
* Note: FILE_SEARCH and FILE_REGEX do not actually copy
* anything, but setup pointers into the source
*/
if (indir == 0) {
switch (type) {
case ... | cwe | CWE-20 | C/C++ |
/*
* Copyright (c) 2014, Matt Stancliff <matt@genges.com>.
* Copyright (c) 2015-2016, Salvatore Sanfilippo <antirez@gmail.com>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redi... | cwe | CWE-190 | C/C++ |
def AsyncGetActionRateLimited(rateLimits: RateLimits)(f: GetRequest => Future[Result])
: mvc.Action[Unit] =
PlainApiAction(cc.parsers.empty, rateLimits).async(f) | cwe | CWE-613 | Scala |
xmlDictComputeFastQKey(const xmlChar *prefix, int plen,
const xmlChar *name, int len, int seed)
{
unsigned long value = (unsigned long) seed;
if (plen == 0)
value += 30 * (unsigned long) ':';
else
value += 30 * (*prefix);
if (len > 10) {
value += name[len - (plen + 1 +... | cwe | CWE-119 | C/C++ |
function a(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null} | cwe | CWE-1333 | JavaScript |
static int identity_count(void *v, const char *key, const char *val)
{
int *count = v;
*count += strlen(key) * 3 + strlen(val) * 3 + 1;
return 1;
} | cwe | CWE-787 | C/C++ |
/*
* Copyright 2019-present Facebook, Inc.
*
* 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 Lic... | cwe | CWE-20 | Go |
from vyper import ast as vy_ast
from vyper.address_space import CALLDATA, DATA, IMMUTABLES, MEMORY, STORAGE
from vyper.codegen.ir_node import Encoding, IRnode
from vyper.codegen.types import (
DYNAMIC_ARRAY_OVERHEAD,
ArrayLike,
BaseType,
ByteArrayLike,
DArrayType,
MappingType,
SArrayType,
... | cwe | CWE-120 | Python |
#include "PortForwardHandler.hpp"
namespace et {
PortForwardHandler::PortForwardHandler(
shared_ptr<SocketHandler> _networkSocketHandler,
shared_ptr<SocketHandler> _pipeSocketHandler)
: networkSocketHandler(_networkSocketHandler),
pipeSocketHandler(_pipeSocketHandler) {}
void PortForwardHandler::upd... | cwe | CWE-362 | C/C++ |
/* 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-125 | Python |
static int read_public_key(RSA *rsa)
{
int r;
sc_path_t path;
sc_file_t *file;
u8 buf[2048], *p = buf;
size_t bufsize, keysize;
r = select_app_df();
if (r)
return 1;
sc_format_path("I1012", &path);
r = sc_select_file(card, &path, &file);
if (r) {
fprintf(stderr, "Unable to select public key file: %s\n", ... | cwe | CWE-119 | Unknown |
xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size)
{
xmlParserCtxtPtr ctxt = NULL;
xmlDocPtr ret;
/*
xmlInitParser();
*/
ctxt = xmlCreateMemoryParserCtxt(buf, buf_size);
if (ctxt) {
ctxt->options -= XML_PARSE_DTDLOAD;
ctxt->sax->ignorableWhitespace = soap... | cwe | CWE-200 | C/C++ |
static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dlen)
{
struct sock *sk = sock->sk;
struct net *net = sock_net(sk);
struct tipc_sock *tsk = tipc_sk(sk);
struct tipc_uaddr *ua = (struct tipc_uaddr *)m->msg_name;
long timeout = sock_sndtimeo(sk, m->msg_flags & MSG_DONTWAIT);
struct list_head... | cwe | CWE-200 | C/C++ |
#include "source/common/http/conn_manager_impl.h"
#include <cstdint>
#include <functional>
#include <list>
#include <memory>
#include <string>
#include <vector>
#include "envoy/buffer/buffer.h"
#include "envoy/common/time.h"
#include "envoy/event/dispatcher.h"
#include "envoy/event/scaled_range_timer_manager.h"
#incl... | cwe | CWE-416 | C/C++ |
LogLuvDecode32(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
{
static const char module[] = "LogLuvDecode32";
LogLuvState* sp;
int shft;
tmsize_t i;
tmsize_t npixels;
unsigned char* bp;
uint32* tp;
uint32 b;
tmsize_t cc;
int rc;
assert(s == 0);
sp = DecoderState(tif);
assert(sp != NULL);
npixels = occ /... | cwe | CWE-787 | Unknown |
process_demand_active(STREAM s)
{
uint8 type;
uint16 len_src_descriptor, len_combined_caps;
/* at this point we need to ensure that we have ui created */
rd_create_ui();
in_uint32_le(s, g_rdp_shareid);
in_uint16_le(s, len_src_descriptor);
in_uint16_le(s, len_combined_caps);
in_uint8s(s, len_src_des... | cwe | CWE-119 | C/C++ |
// @flow
import MongoCollection from './MongoCollection';
import MongoSchemaCollection from './MongoSchemaCollection';
import { StorageAdapter } from '../StorageAdapter';
import type { SchemaType, QueryType, StorageClass, QueryOptions } from '../StorageAdapter';
import { parse as parseUrl, format as formatUrl } from '.... | cwe | CWE-755 | JavaScript |
static int dn_fib_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh)
{
struct net *net = sock_net(skb->sk);
struct dn_fib_table *tb;
struct rtmsg *r = nlmsg_data(nlh);
struct nlattr *attrs[RTA_MAX+1];
int err;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
if (!net_eq(net, &init_net))
return -EINVAL;
e... | cwe | CWE-264 | Unknown |
struct MACH0_(obj_t) {
struct MACH0_(mach_header) hdr;
struct MACH0_(segment_command) *segs;
char *intrp;
char *compiler;
int nsegs;
struct r_dyld_chained_starts_in_segment **chained_starts;
struct dyld_chained_fixups_header fixups_header;
ut64 fixups_offset;
ut64 fixups_size;
struct MACH0_(section) *sects;
... | cwe | CWE-125 | Unknown |
/*
Copyright 2020 The Kubernetes 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, softwar... | cwe | CWE-502 | Java |
do_unprotect (const char *passphrase,
int pkt_version, int pubkey_algo, int is_protected,
const char *curve, gcry_mpi_t *skey, size_t skeysize,
int protect_algo, void *protect_iv, size_t protect_ivlen,
int s2k_mode, int s2k_algo, byte *s2k_salt, u32 s2k_count,
... | cwe | CWE-20 | Unknown |
package com.salesmanager.shop.model.catalog.product;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.salesmanager.shop.model.catalog.category.ReadableCategory;
import com.salesmanager.shop.model.catalog.manufacturer.ReadableManufacturer;
import com.salesmanager.shop.model.ca... | cwe | CWE-639 | Java |
// go run mksyscall.go -l32 -tags darwin,386,!go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_386.1_11.go syscall_darwin_386.go
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build darwin,386,!go1.12
package unix
import (
"syscall"
"unsafe"
)
var _ syscall.Errno
// THIS FILE IS GE... | cwe | CWE-287 | Go |
# Copyright (c) 2021-2022, NVIDIA CORPORATION. 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 ... | cwe | CWE-502 | Python |
/*
* Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com>
* 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 co... | cwe | CWE-617 | C/C++ |
package com.zrlog.web.handler;
import com.hibegin.common.util.IOUtil;
import com.hibegin.common.util.http.HttpUtil;
import com.hibegin.common.util.http.handle.CloseResponseHandle;
import com.jfinal.core.JFinal;
import com.jfinal.handler.Handler;
import com.zrlog.common.Constants;
import com.zrlog.common.vo.AdminTokenV... | cwe | CWE-863 | Java |
TPMI_ALG_ECC_SCHEME_Unmarshal(TPMI_ALG_ECC_SCHEME *target, BYTE **buffer, INT32 *size, BOOL allowNull)
{
TPM_RC rc = TPM_RC_SUCCESS;
if (rc == TPM_RC_SUCCESS) {
rc = TPM_ALG_ID_Unmarshal(target, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
switch (*target) {
#if ALG_ECDSA
case TPM_ALG_ECDSA:
#en... | cwe | CWE-787 | Unknown |
public byte[] allocateJobCaches(byte[] cacheAllocationRequestBytes) {
CacheAllocationRequest allocationRequest = (CacheAllocationRequest) SerializationUtils
.deserialize(cacheAllocationRequestBytes);
return SerializationUtils.serialize((Serializable) jobManager.allocateJobCaches(
getJobToken(), allocationRe... | cwe | CWE-502 | Java |
public Optional<InputStream> getResourceAsStream(String path) {
URL url = classLoader.getResource(prefixPath(path));
if (url != null) {
try {
URI uri = url.toURI();
if (uri.getScheme().equals("jar")) {
synchronized (DefaultClassPathResource... | cwe | CWE-22 | Java |
static int ax25_release(struct socket *sock)
{
struct sock *sk = sock->sk;
ax25_cb *ax25;
ax25_dev *ax25_dev;
if (sk == NULL)
return 0;
sock_hold(sk);
lock_sock(sk);
sock_orphan(sk);
ax25 = sk_to_ax25(sk);
ax25_dev = ax25->ax25_dev;
if (sk->sk_type == SOCK_SEQPACKET) {
switch (ax25->state) {
case AX2... | cwe | CWE-476 | C/C++ |
def self.get_tree_by_group_for_admin(group_id)
SqlHelper.validate_token([group_id])
folder_tree = {}
tree_id = '0'
if group_id.to_s == '0'
sql = 'select distinct * from folders'
where = " where (parent_id = #{tree_id})"
where << " and ((xtype is null) or not(xtype = '#{XTYPE_GROUP}... | cwe | CWE-89 | Ruby |
void fs_logger_print_log(pid_t pid) {
EUID_ASSERT();
// in case the pid is that of a firejail process, use the pid of the first child process
pid = switch_to_child(pid);
// exit if no permission to join the sandbox
check_join_permission(pid);
// print RUN_FSLOGGER_FILE
char *fname;
if (asprintf(&fname, "/pro... | cwe | CWE-94 | Unknown |
bool decode(const SharedBuffer& data, bool onlySize)
{
m_decodingSizeOnly = onlySize;
unsigned newByteCount = data.size() - m_bufferLength;
unsigned readOffset = m_bufferLength - m_info.src->bytes_in_buffer;
m_info.src->bytes_in_buffer += newByteCount;
m_info.src->next_inpu... | cwe | CWE-399 | C/C++ |
var Utils = require("./util");
var fs = Utils.FileSystem.require(),
pth = require("path");
fs.existsSync = fs.existsSync || pth.existsSync;
var ZipEntry = require("./zipEntry"),
ZipFile = require("./zipFile");
var isWin = /^win/.test(process.platform);
module.exports = function(/*String*/input) {
var ... | cwe | CWE-22 | JavaScript |
HeaderMapImpl::HeaderEntryImpl& HeaderMapImpl::maybeCreateInline(HeaderEntryImpl** entry,
const LowerCaseString& key) {
if (*entry) {
return **entry;
}
std::list<HeaderEntryImpl>::iterator i = headers_.insert(key);
i->entry_ = i;
*entry = &... | cwe | CWE-400 | Unknown |
void stralgoLCS(client *c) {
uint32_t i, j;
long long minmatchlen = 0;
sds a = NULL, b = NULL;
int getlen = 0, getidx = 0, withmatchlen = 0;
robj *obja = NULL, *objb = NULL;
for (j = 2; j < (uint32_t)c->argc; j++) {
char *opt = c->argv[j]->ptr;
int moreargs = (c->argc-1) - j;
... | cwe | CWE-190 | C/C++ |
function(d){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=d&&0<window.location.search.length){var g="?",m;for(m in urlParams)0>mxUtils.indexOf(d,m)&&null!=urlParams[m]&&(f+=g+m+"="+urlParams[m],g="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=function(d){d=null!=d?d:window.locat... | cwe | CWE-20 | JavaScript |
gss_verify_mic_iov(OM_uint32 *minor_status, gss_ctx_id_t context_handle,
gss_qop_t *qop_state, gss_iov_buffer_desc *iov,
int iov_count)
{
OM_uint32 status;
gss_union_ctx_id_t ctx;
gss_mechanism mech;
status = val_unwrap_iov_args(minor_status, context_handle, NULL,
qop_state, iov, iov_cou... | cwe | CWE-415 | C/C++ |
static int load_em86(struct linux_binprm *bprm)
{
char *interp, *i_name, *i_arg;
struct file * file;
int retval;
struct elfhdr elf_ex;
/* Make sure this is a Linux/Intel ELF executable... */
elf_ex = *((struct elfhdr *)bprm->buf);
if (memcmp(elf_ex.e_ident, ELFMAG, SELFMAG) != 0)
return -ENOEXEC;
/* First... | cwe | CWE-200 | Unknown |
function fillDiagramsList(diagrams, isTemplate, asList, searchImportCats, internalCall)
{
function setSubmitBtnLbl()
{
toggleButtons(isTemplate);
};
if (!internalCall)
{
diagramsTiles.innerHTML = '';
swapActiveItem();
curDiagList = diagrams;
curSearchImportCats = searchImportCats;
}
... | cwe | CWE-94 | JavaScript |
/******************************************************************************
*
* Module Name: nsutils - Utilities for accessing ACPI namespace, accessing
* parents and siblings and Scope manipulation
*
*****************************************************************************/
/*
* C... | cwe | CWE-755 | C/C++ |
XpmCreateDataFromXpmImage(
char ***data_return,
XpmImage *image,
XpmInfo *info)
{
/* calculation variables */
int ErrorStatus;
char buf[BUFSIZ];
char **header = NULL, **data, **sptr, **sptr2, *s;
unsigned int header_size, header_nlines;
unsigned int data_size, data_nlines;
un... | cwe | CWE-787 | C/C++ |
int MAIN(int argc, char **argv)
{
int build_chain = 0;
SSL *con=NULL;
#ifndef OPENSSL_NO_KRB5
KSSL_CTX *kctx;
#endif
int s,k,width,state=0;
char *cbuf=NULL,*sbuf=NULL,*mbuf=NULL;
int cbuf_len,cbuf_off;
int sbuf_len,sbuf_off;
fd_set readfds,writefds;
short port=PORT;
int full_log=1;
char *host=SSL_HOST_NAME;... | cwe | CWE-310 | Unknown |
int rm_rf_child(int fd, const char *name, RemoveFlags flags) {
/* Removes one specific child of the specified directory */
if (fd < 0)
return -EBADF;
if (!filename_is_valid(name))
return -EINVAL;
if ((flags & (REMOVE_ROOT|REMOVE_MISSING_OK)) != 0) /* D... | cwe | CWE-674 | Unknown |
const createElectronStorage = require('redux-persist-electron-storage');
const { ipcRenderer, shell, remote } = require('electron');
const os = require('os');
const url = require('url');
const jitsiMeetElectronUtils = require('jitsi-meet-electron-utils');
const protocolRegex = /^https?:/i;
/**
* Opens the given lin... | cwe | CWE-345 | JavaScript |
set_curbuf(buf_T *buf, int action)
{
buf_T *prevbuf;
int unload = (action == DOBUF_UNLOAD || action == DOBUF_DEL
|| action == DOBUF_WIPE || action == DOBUF_WIPE_REUSE);
#ifdef FEAT_SYN_HL
long old_tw = curbuf->b_p_tw;
#endif
bufref_T newbufref;
bufref_T prevbufref;
setpcmark();
if ((cmd... | cwe | CWE-416 | C/C++ |
//
// Based on http://antony.lesuisse.org/software/ajaxterm/
// Public Domain License
//
gogo = { };
gogo.Terminal_ctor = function(div, width, height) {
var query0 = "w=" + width + "&h=" + height;
var query1 = query0 + "&k=";
var buf = "";
var timeout;
var error_timeout;
var keybuf = [];
var s... | cwe | CWE-287 | Java |
int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b)
{
int result = -1;
if (!a || !b || a->type != b->type)
return -1;
switch (a->type) {
case GEN_X400:
case GEN_EDIPARTY:
result = ASN1_TYPE_cmp(a->d.other, b->d.other);
break;
case GEN_OTHERNAME:
result = OTHE... | cwe | CWE-476 | Unknown |
static PHP_NAMED_FUNCTION(zif_zip_entry_read)
{
zval * zip_entry;
zend_long len = 0;
zip_read_rsrc * zr_rsrc;
zend_string *buffer;
int n = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &zip_entry, &len) == FAILURE) {
return;
}
if ((zr_rsrc = (zip_read_rsrc *)zend_fetch_resource(Z_RES_P(zip_entry), le... | cwe | CWE-190 | C/C++ |
char *string_crypt(const char *key, const char *salt) {
assert(key);
assert(salt);
char random_salt[12];
if (!*salt) {
memcpy(random_salt,"$1$",3);
ito64(random_salt+3,rand(),8);
random_salt[11] = '\0';
return string_crypt(key, random_salt);
}
if ((strlen(salt) > sizeof("$2X$00$")) &&
... | cwe | CWE-22 | C/C++ |
static struct ip_options *tcp_v4_save_options(struct sock *sk,
struct sk_buff *skb)
{
struct ip_options *opt = &(IPCB(skb)->opt);
struct ip_options *dopt = NULL;
if (opt && opt->optlen) {
int opt_size = optlength(opt);
dopt = kmalloc(opt_size, GFP_ATOMIC);
if (dopt) {
if (ip_options_echo(do... | cwe | CWE-362 | C/C++ |
int BSONTool::run() {
_objcheck = hasParam( "objcheck" );
if ( hasParam( "filter" ) )
_matcher.reset( new Matcher( fromjson( getParam( "filter" ) ) ) );
return doRun();
} | cwe | CWE-20 | Unknown |
static int8_t sn_coap_parser_options_parse(struct coap_s *handle, uint8_t **packet_data_pptr, sn_coap_hdr_s *dst_coap_msg_ptr, uint8_t *packet_data_start_ptr, uint16_t packet_len)
{
uint8_t previous_option_number = 0;
int8_t ret_status = 0;
uint16_t message_left = sn_coap_parser_move_p... | cwe | CWE-190 | 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-502 | Java |
forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
UChar* range, UChar** low, UChar** high, UChar** low_prev)
{
UChar *p, *pprev = (UChar* )NULL;
#ifdef ONIG_DEBUG_SEARCH
fprintf(stderr, "forward_search_range: str: %d, end: %d, s: %d, range: %d\n",
(int )str, (int )end, (int... | cwe | CWE-476 | C/C++ |
/*
** $Id: lvm.c $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
#define lvm_c
#define LUA_CORE
#include "lprefix.h"
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lua.h"
#include "ldebug.h"
#include "ldo.h"
#include "lfunc... | cwe | CWE-416 | C/C++ |
buildRawSendTx(config: configBuildRawSendTx, type = 0x01) {
// Check proper address formats are given
config.tokenReceiverAddressArray.forEach(outputAddress => {
if (!bchaddr.isSlpAddress(outputAddress))
throw new Error("Token receiver address not in SlpAddr format.");
... | cwe | CWE-20 | 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-197 | C/C++ |
/*
* Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com>
* 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 co... | cwe | CWE-617 | C/C++ |
static void IBusBusNameOwnerChangedCallback(
IBusBus* bus,
const gchar* name, const gchar* old_name, const gchar* new_name,
gpointer user_data) {
DCHECK(name);
DCHECK(old_name);
DCHECK(new_name);
DLOG(INFO) << "Name owner is changed: name=" << name
<< ", old_name=" <<... | cwe | CWE-20 | C/C++ |
ssh_packet_set_compress_state(struct ssh *ssh, struct sshbuf *m)
{
struct session_state *state = ssh->state;
struct sshbuf *b = NULL;
int r;
const u_char *inblob, *outblob;
size_t inl, outl;
if ((r = sshbuf_froms(m, &b)) != 0)
goto out;
if ((r = sshbuf_get_string_direct(b, &inblob, &inl)) != 0 ||
(r = ssh... | cwe | CWE-119 | C/C++ |
void __init trap_init(void)
{
int i;
#ifdef CONFIG_EISA
void __iomem *p = early_ioremap(0x0FFFD9, 4);
if (readl(p) == 'E' + ('I'<<8) + ('S'<<16) + ('A'<<24))
EISA_bus = 1;
early_iounmap(p, 4);
#endif
set_intr_gate(X86_TRAP_DE, divide_error);
set_intr_gate_ist(X86_TRAP_NMI, &nmi, NMI_STACK);
/* int4 can be c... | cwe | CWE-17 | Unknown |
static RList* sections(RBinFile* bf) {
RList* ret = NULL;
RBinSection* sect = NULL;
psxexe_header psxheader = {0};
ut64 sz = 0;
if (!(ret = r_list_new ())) {
return NULL;
}
if (!(sect = R_NEW0 (RBinSection))) {
r_list_free (ret);
return NULL;
}
if (r_buf_fread_at (bf->buf, 0, (ut8*)&psxheader, "8c17i"... | cwe | CWE-400 | C/C++ |
nfs3svc_decode_readlinkargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd3_readlinkargs *args)
{
p = decode_fh(p, &args->fh);
if (!p)
return 0;
args->buffer = page_address(*(rqstp->rq_next_page++));
return xdr_argsize_check(rqstp, p);
} | cwe | CWE-404 | C/C++ |
protected function parse()
{
parent::parse();
// grab the error-type from the parameters
$errorType = $this->getParameter('type');
// set correct headers
switch($errorType)
{
case 'module-not-allowed':
case 'action-not-allowed':
SpoonHTTP::setHeadersByCode(403);
break;
case 'not-found':... | cwe | CWE-79 | PHP |
/* 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 |
sp<IMemoryHeap> BpMemory::getMemory(ssize_t* offset, size_t* size) const
{
if (mHeap == 0) {
Parcel data, reply;
data.writeInterfaceToken(IMemory::getInterfaceDescriptor());
if (remote()->transact(GET_MEMORY, data, &reply) == NO_ERROR) {
sp<IBinder> heap = reply.readStrongBinder();
ssize_t o = r... | cwe | CWE-264 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.