code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
function f(r,e,n){var t=r;return e.forEach((function(r){var e=function(r){return"object"==typeof r&&null!==r?r:"function"==typeof r?{getName:r,value:{}}:{name:r,value:{}}}(r),a=e.value,o=e.type,f=e.create,i=e.override,c=e.created,l=e.skipped,p=e.got,v=function(r,e){var n=u(r,e);return n!==undefined?n:"undefined"}(t,e);... | cwe | CWE-1321 | JavaScript |
/**
*
*/
package com.salesmanager.shop.admin.model.content;
import javax.validation.constraints.NotEmpty;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import java.io.Serializable;
import java.util.List;
/**
* A bean class responsible for getting form data from shop Admin... | cwe | CWE-639 | Java |
load_image (GFile *file,
GError **error)
{
GInputStream *input;
gchar *name;
BrushHeader bh;
guchar *brush_buf = NULL;
gint32 image_ID;
gint32 layer_ID;
GimpParasite *parasite;
GeglBuffer *buffer;
const Babl *f... | cwe | CWE-125 | C/C++ |
tt_cmap8_validate( FT_Byte* table,
FT_Validator valid )
{
FT_Byte* p = table + 4;
FT_Byte* is32;
FT_UInt32 length;
FT_UInt32 num_groups;
if ( table + 16 + 8192 > valid->limit )
FT_INVALID_TOO_SHORT;
length = TT_NEXT_ULONG( p );
if ( table + leng... | cwe | CWE-190 | C/C++ |
MagickExport MemoryInfo *AcquireVirtualMemory(const size_t count,
const size_t quantum)
{
MemoryInfo
*memory_info;
size_t
extent;
if (CheckMemoryOverflow(count,quantum) != MagickFalse)
return((MemoryInfo *) NULL);
memory_info=(MemoryInfo *) MagickAssumeAligned(AcquireAlignedMemory(1,
sizeof(... | cwe | CWE-787 | Unknown |
void PrintPreviewUI::SetPrintPreviewDataForIndex(
int index,
const base::RefCountedBytes* data) {
print_preview_data_service()->SetDataEntry(preview_ui_addr_str_, index, data);
} | cwe | CWE-200 | C/C++ |
// Handles form-submit by preparing to process response
function handleSubmit()
{
var form = window.openForm || document.getElementById('openForm');
if (window.parent.openNew && window.parent.baseUrl != null)
{
window.parent.openFile.setConsumer(null);
window.parent.open(window.parent.baseUrl);
}
// NOTE: ... | cwe | CWE-94 | JavaScript |
/**
* Parse Server Configuration Builder
*
* This module builds the definitions file (src/Options/Definitions.js)
* from the src/Options/index.js options interfaces.
* The Definitions.js module is responsible for the default values as well
* as the mappings for the CLI.
*
* To rebuild the definitions file, run
... | cwe | CWE-1321 | JavaScript |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input = GetInput(context, node, 0);
switch (input->type) {
case kTfLiteFloat32:
return EvalImpl<kernel_type, kTfLiteFloat32>(context, node);
case kTfLiteUInt8:
return EvalImpl<kernel_type, kTfLiteUInt8>(context, n... | cwe | CWE-125 | 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-732 | Java |
inbound_cap_ls (server *serv, char *nick, char *extensions_str,
const message_tags_data *tags_data)
{
char buffer[256]; /* buffer for requesting capabilities and emitting the signal */
guint32 want_cap; /* format the CAP REQ string based on previous capabilities being requested or not */
guint32 want_sasl; /* ... | cwe | CWE-22 | C/C++ |
Http::FilterDataStatus Context::onResponseBody(int body_buffer_length, bool end_of_stream) {
if (!wasm_->onResponseBody_) {
return Http::FilterDataStatus::Continue;
}
switch (wasm_
->onResponseBody_(this, id_, static_cast<uint32_t>(body_buffer_length),
static_cast... | cwe | CWE-476 | C/C++ |
_kdc_as_rep(kdc_request_t r,
krb5_data *reply,
const char *from,
struct sockaddr *from_addr,
int datagram_reply)
{
krb5_context context = r->context;
krb5_kdc_configuration *config = r->config;
KDC_REQ *req = &r->req;
KDC_REQ_BODY *b = NULL;
AS_REP rep;
KDCOptions f;
krb5... | cwe | CWE-476 | C/C++ |
de265_error seq_parameter_set::read(error_queue* errqueue, bitreader* br)
{
int vlc;
video_parameter_set_id = get_bits(br,4);
sps_max_sub_layers = get_bits(br,3) +1;
if (sps_max_sub_layers>7) {
return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE;
}
sps_temporal_id_nesting_flag = get_bits(br,1);
pro... | cwe | CWE-787 | Unknown |
OMX_ERRORTYPE omx_vdec::free_buffer(OMX_IN OMX_HANDLETYPE hComp,
OMX_IN OMX_U32 port,
OMX_IN OMX_BUFFERHEADERTYPE* buffer)
{
OMX_ERRORTYPE eRet = OMX_ErrorNone;
unsigned int nPortIndex;
(void) hComp;
DEBUG_PRINT_LOW("In for decoder free_buffer");
if (m_state == OMX_S... | cwe | CWE-119 | C/C++ |
/*-
* Copyright (c) 2003-2010 Tim Kientzle
* Copyright (c) 2012 Michihiro NAKAJIMA
* 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 code must retain the abo... | cwe | CWE-59 | C/C++ |
bool Chapters::Atom::ExpandDisplaysArray()
{
if (m_displays_size > m_displays_count)
return true; // nothing else to do
const int size = (m_displays_size == 0) ? 1 : 2 * m_displays_size;
Display* const displays = new (std::nothrow) Display[size];
if (displays == NULL)
return false;
... | cwe | CWE-119 | C/C++ |
AspectDialog.prototype.createPageItem=function(b,f,l){var d=document.createElement("div");d.className="geAspectDlgListItem";d.setAttribute("data-page-id",b);d.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+mxUtils.htmlEntities(f)+"</div>";this.pagesContainer.appe... | cwe | CWE-94 | JavaScript |
$message = getlocal(
"Operator {0} joined the chat",
array($operator_name),
$this->locale,
true
);
} elseif ($is_operator_back) { | cwe | CWE-79 | PHP |
public Controller execute(FolderComponent folderComponent, UserRequest ureq, WindowControl wControl, Translator trans) {
VFSContainer currentContainer = folderComponent.getCurrentContainer();
status = FolderCommandHelper.sanityCheck(wControl, folderComponent);
if(status == FolderCommandStatus.STATUS_FAILED) {
... | cwe | CWE-22 | Java |
static NTSTATUS update_trust_user(TALLOC_CTX *mem_ctx,
struct ldb_context *sam_ldb,
struct ldb_dn *base_dn,
bool delete_user,
const char *netbios_name,
struct trustAuthInOutBlob *in)
{
const char *attrs[] = { "userAccountControl", NULL };
struct ldb_message **msgs;
struct ldb_message *m... | cwe | CWE-200 | Unknown |
private State readHeaders(ByteBuf buffer) {
final HttpMessage message = this.message;
final HttpHeaders headers = message.headers();
AppendableCharSequence line = headerParser.parse(buffer);
if (line == null) {
return null;
}
if (line.length() > 0) {
... | cwe | CWE-444 | Java |
PYBIND11_MODULE(_pywrap_tfe, m) {
py::class_<TFE_Executor> TFE_Executor_class(m, "TFE_Executor");
py::class_<TFE_ContextOptions> TFE_ContextOptions_class(m,
"TFE_ContextOptions");
py::class_<TFE_MonitoringCounter0> TFE_MonitoringCounter0_class(
m, "T... | cwe | CWE-908 | Unknown |
std::set<std::string> GetDistinctHosts(const URLPatternSet& host_patterns,
bool include_rcd,
bool exclude_file_scheme) {
typedef base::StringPairs HostVector;
HostVector hosts_best_rcd;
for (const URLPattern& pattern : host_patterns) {
... | cwe | CWE-20 | C/C++ |
start_bfd_child(void)
{
#ifndef _DEBUG_
pid_t pid;
int ret;
char *syslog_ident;
/* Initialize child process */
if (log_file_name)
flush_log_file();
pid = fork();
if (pid < 0) {
log_message(LOG_INFO, "BFD child process: fork error(%m)");
return -1;
} else if (pid) {
bfd_child = pid;
log_message(LOG_... | cwe | CWE-200 | Unknown |
package validator
import (
"errors"
"fmt"
"reflect"
"strings"
"github.com/answerdev/answer/internal/base/reason"
"github.com/answerdev/answer/internal/base/translator"
"github.com/go-playground/locales"
german "github.com/go-playground/locales/de"
english "github.com/go-playground/locales/en"
spanish "githu... | cwe | CWE-79 | Go |
function download_item($dir, $item)
{
// Security Fix:
$item=basename($item);
if (!permissions_grant($dir, $item, "read"))
show_error($GLOBALS["error_msg"]["accessfunc"]);
if (!get_is_file($dir,$item))
{
_debug("error download");
show_error($item.": ".$GLOBALS["error_msg"]["fileexist"]);
... | cwe | CWE-22 | PHP |
void ProfilingService::DumpProcessesForTracing(
bool keep_small_allocations,
bool strip_path_from_mapped_files,
DumpProcessesForTracingCallback callback) {
memory_instrumentation::MemoryInstrumentation::GetInstance()
->GetVmRegionsForHeapProfiler(base::Bind(
&ProfilingService::OnGetVmRe... | cwe | CWE-269 | C/C++ |
/*
* Copyright ConsenSys AG.
*
* 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... | cwe | CWE-681 | Java |
static int io_rw_init_file(struct io_kiocb *req, fmode_t mode)
{
struct kiocb *kiocb = &req->rw.kiocb;
struct io_ring_ctx *ctx = req->ctx;
struct file *file = req->file;
int ret;
if (unlikely(!file || !(file->f_mode & mode)))
return -EBADF;
if (!io_req_ffs_set(req))
req->flags |= io_file_get_flags(file) << ... | cwe | CWE-94 | C/C++ |
function filterTemplates()
{
var searchTerms = tmplSearchInput.value;
if (searchTerms == '')
{
resetTemplates();
return;
}
if (NewDialog.tagsList[templateFile] == null)
{
var tagsList = {};
for (var cat in categories)
{
var templateList = categories[cat];
for (var i = ... | cwe | CWE-94 | JavaScript |
void groupGenerate(const std::string &rule, std::vector<Proxy> &nodelist, string_array &filtered_nodelist, bool add_direct, extra_settings &ext)
{
std::string real_rule;
if(startsWith(rule, "[]") && add_direct)
{
filtered_nodelist.emplace_back(rule.substr(2));
}
#ifndef NO_JS_RUNTIME
else if... | cwe | CWE-434 | C/C++ |
static int nbd_negotiate_drop_sync(QIOChannel *ioc, size_t size)
{
ssize_t ret;
uint8_t *buffer = g_malloc(MIN(65536, size));
while (size > 0) {
size_t count = MIN(65536, size);
ret = nbd_negotiate_read(ioc, buffer, count);
if (ret < 0) {
g_free(buffer);
retur... | cwe | CWE-617 | C/C++ |
pixHtmlViewer(const char *dirin,
const char *dirout,
const char *rootname,
l_int32 thumbwidth,
l_int32 viewwidth)
{
char *fname, *fullname, *outname;
char *mainname, *linkname, *linknameshort;
char *viewfile, *thumbfile;
char *shtm... | cwe | CWE-119 | C/C++ |
// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
/* Copyright 2020 IBM Corp. */
#ifndef pr_fmt
#define pr_fmt(fmt) "EDK2_COMPAT: " fmt
#endif
#include <opal.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <stdint.h>
#include <ccan/endian/endian.h>
#include <mbedtls/error.h>
#include <de... | cwe | CWE-681 | C/C++ |
static FILE *open_log_file(void)
{
if(log_fp) /* keep it open unless we rotate */
return log_fp;
log_fp = fopen(log_file, "a+");
if(log_fp == NULL) {
if (daemon_mode == FALSE) {
printf("Warning: Cannot open log file '%s' for writing\n", log_file);
}
return NULL;
}
(void)fcntl(fileno(log_fp... | cwe | CWE-264 | C/C++ |
void loadServerConfigFromString(char *config) {
char *err = NULL;
int linenum = 0, totlines, i;
int slaveof_linenum = 0;
sds *lines;
lines = sdssplitlen(config,strlen(config),"\n",1,&totlines);
for (i = 0; i < totlines; i++) {
sds *argv;
int argc;
linenum = i+1;
... | cwe | CWE-119 | Unknown |
function getTextVoiceArrayFromText(text) {
var el = document.createElement('div');
el.innerHTML = text;
var $el = $(el);
return window.TTSUtils.getTextVoiceArrayFromElement($el,presenter.configuration.langTag);
} | cwe | CWE-79 | JavaScript |
Network::FilterStatus Context::onUpstreamData(int data_length, bool end_of_stream) {
if (!wasm_->onUpstreamData_) {
return Network::FilterStatus::Continue;
}
auto result = wasm_->onUpstreamData_(this, id_, static_cast<uint32_t>(data_length),
static_cast<uint32_t>(end_of_... | cwe | CWE-476 | C/C++ |
public function renderRequest()
{
$request = '';
foreach ($this->displayVars as $name) {
if (!empty($GLOBALS[$name])) {
$request .= '$' . $name . ' = ' . VarDumper::export($GLOBALS[$name]) . ";\n\n";
}
}
return '<pre>' . rtrim($request, "\n") ... | cwe | CWE-79 | PHP |
static void rebase_buffer(struct MACH0_(obj_t) *obj, ut64 off, RIODesc *fd, ut8 *buf, int count) {
if (obj->rebasing_buffer) {
return;
}
obj->rebasing_buffer = true;
ut64 eob = off + count;
int i = 0;
for (; i < obj->nsegs; i++) {
if (!obj->chained_starts[i]) {
continue;
}
ut64 page_size = obj->chained... | cwe | CWE-415 | C/C++ |
pad_or_truncate_password_V4(std::string const& password, char k1[key_bytes])
{
int password_bytes = std::min(static_cast<size_t>(key_bytes),
password.length());
int pad_bytes = key_bytes - password_bytes;
memcpy(k1, password.c_str(), password_bytes);
memcpy(k1 + passwor... | cwe | CWE-787 | Unknown |
void print_cfs_stats(struct seq_file *m, int cpu)
{
struct cfs_rq *cfs_rq, *pos;
rcu_read_lock();
for_each_leaf_cfs_rq_safe(cpu_rq(cpu), cfs_rq, pos)
print_cfs_rq(m, cpu, cfs_rq);
rcu_read_unlock();
} | cwe | CWE-835 | Unknown |
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package xz
import (
"errors"
"io"
)
// putUint32LE puts the little-endian representation of x into the first
// four bytes of p.
func putUint32LE(p []by... | cwe | CWE-835 | Go |
QPDF::readHPageOffset(BitStream h)
{
// All comments referring to the PDF spec refer to the spec for
// version 1.4.
HPageOffset& t = this->m->page_offset_hints;
t.min_nobjects = h.getBits(32); // 1
t.first_page_offset = h.getBits(32); // 2
t.nbits_delta_nobjects = h.getBits(16); ... | cwe | CWE-787 | Unknown |
PJ_DEF(pj_status_t) pjmedia_rtcp_fb_parse_sli(
const void *buf,
pj_size_t length,
unsigned *sli_cnt,
pjmedia_rtcp_fb_sli sli[])
{
pjmedia_rtcp_common *hdr = (pjmedia_rtcp_common*) buf;
pj_uint8_t *p;
unsigned cnt, i;
PJ_ASSERT_RETURN(buf && sli_cnt && sli, PJ_EINVAL);
PJ_ASSERT_... | cwe | CWE-787 | C/C++ |
do_tag(
char_u *tag, // tag (pattern) to jump to
int type,
int count,
int forceit, // :ta with !
int verbose) // print "tag not found" message
{
taggy_T *tagstack = curwin->w_tagstack;
int tagstackidx = curwin->w_tagstackidx;
int tagstacklen = curwin->w_tagstacklen;
int cur_m... | cwe | CWE-416 | Unknown |
process_bitmap_updates(STREAM s)
{
uint16 num_updates;
uint16 left, top, right, bottom, width, height;
uint16 cx, cy, bpp, Bpp, compress, bufsize, size;
uint8 *data, *bmpdata;
int i;
logger(Protocol, Debug, "%s()", __func__);
in_uint16_le(s, num_updates);
for (i = 0; i < num_updates; i++)
{
in_uint16_le(s... | cwe | CWE-703 | Unknown |
static int svc_listen(struct socket *sock,int backlog)
{
DEFINE_WAIT(wait);
struct sock *sk = sock->sk;
struct atm_vcc *vcc = ATM_SD(sock);
int error;
pr_debug("svc_listen %p\n",vcc);
lock_sock(sk);
/* let server handle listen on unbound sockets */
if (test_bit(ATM_VF_SESSION,&vcc->flags)) {
error = -EINVAL;... | cwe | CWE-399 | Unknown |
QPDF::readLinearizationData()
{
// This function throws an exception (which is trapped by
// checkLinearization()) for any errors that prevent loading.
// Hint table parsing code needs at least 32 bits in a long.
assert(sizeof(long) >= 4);
if (! isLinearized())
{
throw std::logic_error("calle... | cwe | CWE-787 | Unknown |
struct clock_source *dcn20_clock_source_create(
struct dc_context *ctx,
struct dc_bios *bios,
enum clock_source_id id,
const struct dce110_clk_src_regs *regs,
bool dp_clk_src)
{
struct dce110_clk_src *clk_src =
kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL);
if (!clk_src)
return NULL;
if (dcn20_clk_sr... | cwe | CWE-703 | Unknown |
function tagSpanFadeOut( postid, ame_tags ) {
jQuery("span#ame_tags" + postid).fadeOut('fast', function() {
var loading = '<img border="0" alt="" src="' + ameAjaxL10n.imgUrl + 'loader.gif" align="absbottom" /> ' + ameAjaxL10n.pleaseWait;
jQuery("span#ame_tags" + postid).fadeIn('fast', function() {
var ame_sack ... | cwe | CWE-352 | JavaScript |
void print_cfs_stats(struct seq_file *m, int cpu)
{
struct cfs_rq *cfs_rq, *pos;
rcu_read_lock();
for_each_leaf_cfs_rq_safe(cpu_rq(cpu), cfs_rq, pos)
print_cfs_rq(m, cpu, cfs_rq);
rcu_read_unlock();
} | cwe | CWE-703 | Unknown |
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2021 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except... | cwe | CWE-918 | C/C++ |
struct sock *dccp_v4_request_recv_sock(struct sock *sk, struct sk_buff *skb,
struct request_sock *req,
struct dst_entry *dst)
{
struct inet_request_sock *ireq;
struct inet_sock *newinet;
struct sock *newsk;
if (sk_acceptq_is_full(sk))
goto exit_overflow;
if (dst == NULL && (dst = inet_csk... | cwe | CWE-362 | Unknown |
static protected function getFontsizeSelection()
{
$current_size = $GLOBALS['PMA_Config']->get('fontsize');
// for the case when there is no config file (this is supported)
if (empty($current_size)) {
if (isset($_COOKIE['pma_fontsize'])) {
$current_size = $_COOKIE... | cwe | CWE-79 | PHP |
Status check_index_ordering(const Tensor& indices) {
auto findices = indices.flat<int>();
for (std::size_t i = 0; i < findices.dimension(0) - 1; ++i) {
if (findices(i) < findices(i + 1)) {
continue;
}
return Status(
errors::InvalidArgument("Indices are not strictly ordered"... | cwe | CWE-824 | C/C++ |
#ifndef JSI_LITE_ONLY
#ifndef JSI_AMALGAMATION
#include "jsiInt.h"
#endif
/* Return value from call to function will is not used. */
bool Jsi_FunctionReturnIgnored(Jsi_Interp *interp, Jsi_Func *funcPtr) {
return funcPtr->callflags.bits.isdiscard;
}
bool Jsi_FunctionIsConstructor(Jsi_Func *funcPtr)
{
return (f... | cwe | CWE-120 | C/C++ |
grub_ext2_iterate_dir (grub_fshelp_node_t dir,
int (*hook) (const char *filename,
enum grub_fshelp_filetype filetype,
grub_fshelp_node_t node,
void *closure),
void *closure)
{
unsigned int fpos = 0;
struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir;
if (! d... | cwe | CWE-787 | C/C++ |
public function encode($image, $format, $quality)
{
return $this->encoder->process($image, $format, $quality);
} | cwe | CWE-89 | JavaScript |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
const TfLiteTensor* size = GetInput(context, node, kSizeTensor);
TfLiteTensor* o... | cwe | CWE-125 | C/C++ |
cisco_autorp_print(netdissect_options *ndo,
register const u_char *bp, register u_int len)
{
int type;
int numrps;
int hold;
ND_TCHECK(bp[0]);
ND_PRINT((ndo, " auto-rp "));
type = bp[0];
switch (type) {
case 0x11:
ND_PRINT((ndo, "candidate-advert"));
break;
case 0x12:
ND_PRINT((ndo, "... | cwe | CWE-125 | C/C++ |
/*
* Copyright (c) 2004, PostgreSQL Global Development Group
* See the LICENSE file in the project root for more information.
*/
// Copyright (c) 2004, Open Cloud Limited.
package org.postgresql.util;
import static org.postgresql.util.internal.Nullness.castNonNull;
import org.checkerframework.checker.nullness.qua... | cwe | CWE-377 | Java |
fribidi_get_par_embedding_levels_ex (
/* input */
const FriBidiCharType *bidi_types,
const FriBidiBracketType *bracket_types,
const FriBidiStrIndex len,
/* input and output */
FriBidiParType *pbase_dir,
/* output */
FriBidiLevel *embedding_levels
)
{
FriBidiLevel base_level_per_iso_level[FRIBIDI_BIDI_... | cwe | CWE-787 | C/C++ |
public function link($target, $link)
{
if (! windows_os()) {
return symlink($target, $link);
}
$mode = $this->isDirectory($target) ? 'J' : 'H';
exec("mklink /{$mode} \"{$link}\" \"{$target}\"");
} | cwe | CWE-78 | PHP |
function escapeArgZsh(arg, interpolation, quoted) {
let result = arg.replace(/\u0000/g, "");
if (interpolation) {
result = result
.replace(/\\/g, "\\\\")
.replace(/^(~|#)/g, "\\$1")
.replace(/(\*|\?)/g, "\\$1")
.replace(/(\$|\;|\&|\|)/g, "\\$1")
.replace(/(\(|\)|\<|\>)/g, "\\$1")
... | cwe | CWE-74 | JavaScript |
proto_read_attribute_array (p11_rpc_message *msg,
CK_ATTRIBUTE_PTR *result,
CK_ULONG *n_result)
{
CK_ATTRIBUTE_PTR attrs;
uint32_t n_attrs, i;
assert (msg != NULL);
assert (result != NULL);
assert (n_result != NULL);
assert (msg->input != NULL);
/* Make s... | cwe | CWE-190 | Unknown |
function forEach(obj, iterator, context) {
var key, length;
if (obj) {
if (isFunction(obj)) {
for (key in obj) {
if (key !== 'prototype' && key !== 'length' && key !== 'name' && obj.hasOwnProperty(key)) {
iterator.call(context, obj[key], key, obj);
}
}
} else if (isArra... | cwe | CWE-74 | JavaScript |
export function buildQueryString(params: Object, traditional?: Boolean): string {
let pairs = [];
let keys = Object.keys(params || {}).sort();
for (let i = 0, len = keys.length; i < len; i++) {
let key = keys[i];
pairs = pairs.concat(buildParam(key, params[key], traditional));
}
if (pairs.length === ... | cwe | CWE-1321 | JavaScript |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | cwe | CWE-668 | Java |
static int klsi_105_get_line_state(struct usb_serial_port *port,
unsigned long *line_state_p)
{
int rc;
u8 *status_buf;
__u16 status;
dev_info(&port->serial->dev->dev, "sending SIO Poll request\n");
status_buf = kmalloc(KLSI_STATUSBUF_LEN, GFP_KERNEL);
if (!status_buf)
return -ENOMEM;
status_buf[0] =... | cwe | CWE-532 | C/C++ |
process_bitmap_updates(STREAM s)
{
uint16 num_updates;
uint16 left, top, right, bottom, width, height;
uint16 cx, cy, bpp, Bpp, compress, bufsize, size;
uint8 *data, *bmpdata;
int i;
logger(Protocol, Debug, "%s()", __func__);
in_uint16_le(s, num_updates);
for (i = 0; i < num_updates; i++)
{
in_uint16... | cwe | CWE-119 | C/C++ |
// SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 2013 - 2018 Intel Corporation. */
#include <linux/types.h>
#include <linux/module.h>
#include <net/ipv6.h>
#include <net/ip.h>
#include <net/tcp.h>
#include <linux/if_macvlan.h>
#include <linux/prefetch.h>
#include "fm10k.h"
#define DRV_VERSION "0.26.1-k"
#define D... | cwe | CWE-476 | C/C++ |
/*
* Copyright (c) 2001 Vojtech Pavlik
*
* CATC EL1210A NetMate USB Ethernet driver
*
* Sponsored by SuSE
*
* Based on the work of
* Donald Becker
*
* Old chipset support added by Simon Evans <spse@secret.org.uk> 2002
* - adds support for Belkin F5U011
*/
/*
* This program is free software; you ... | cwe | CWE-119 | C/C++ |
mxResources.get("dragImagesHere"));l.appendChild(x);var A={},z=null,L=null,M=null;f=function(F){"true"!=mxEvent.getSource(F).getAttribute("contentEditable")&&null!=M&&(M(),M=null,mxEvent.consume(F))};mxEvent.addListener(v,"mousedown",f);mxEvent.addListener(v,"pointerdown",f);mxEvent.addListener(v,"touchstart",f);var n=... | cwe | CWE-20 | JavaScript |
static int multiSelect(
Parse *pParse, /* Parsing context */
Select *p, /* The right-most of SELECTs to be coded */
SelectDest *pDest /* What to do with query results */
){
int rc = SQLITE_OK; /* Success code from a subroutine */
Select *pPrior; /* Another SELECT immediately to o... | cwe | CWE-476 | Unknown |
static int perf_trace_event_perm(struct ftrace_event_call *tp_event,
struct perf_event *p_event)
{
/* The ftrace function trace is allowed only for root. */
if (ftrace_event_is_function(tp_event) &&
perf_paranoid_kernel() && !capable(CAP_SYS_ADMIN))
return -EPERM;
/* No tracing, just counting, so ... | cwe | CWE-264 | C/C++ |
def index
authorize! :posts, @post_type
per_page = current_site.admin_per_page
posts_all = @post_type.posts.eager_load(:parent, :post_type)
if params[:taxonomy].present? && params[:taxonomy_id].present?
if params[:taxonomy] == "category"
cat_owner = current_site.full_categories.find(params... | cwe | CWE-89 | Ruby |
/*
* Released under the GPLv2 only.
* SPDX-License-Identifier: GPL-2.0
*/
#include <linux/usb.h>
#include <linux/usb/ch9.h>
#include <linux/usb/hcd.h>
#include <linux/usb/quirks.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/device.h>
#include <asm/byteorder.h>
#include "usb.h"
#define USB_M... | cwe | CWE-119 | C/C++ |
function escapeShellArgWithInterpolation(arg, shell) {
let result = arg
.replace(/\u{0}/gu, "")
.replace(/\\/g, "\\\\")
.replace(/^(~|#)/g, "\\$1")
.replace(/(\*|\?)/gu, "\\$1")
.replace(/(\$|\;|\&|\|)/g, "\\$1")
.replace(/(\(|\)|\<|\>)/g, "\\$1")
.replace(/("|'|`)/g, "\\$1");
if (shell... | cwe | CWE-200 | JavaScript |
package ops
import (
"bytes"
"fmt"
"io"
"os"
"strconv"
"text/template"
"io/ioutil"
"os/exec"
"path"
"path/filepath"
"strings"
"syscall"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/openshift/assisted-installer/src/config"
"github.com/openshift/assisted-installer/src/inventory_cli... | cwe | CWE-532 | Go |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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 applic... | cwe | CWE-770 | C/C++ |
unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags)
{
struct mm_struct *mm = current->mm;
struct vm_area_struct * vma;
unsigned long task_size = TASK_SIZE;
int do_color_align;
struct vm_unmapped_area_info info;
if (flags & MAP_F... | cwe | CWE-119 | Unknown |
def category_preferences_export
return enum_for(:category_preferences_export) unless block_given?
CategoryUser
.where(user_id: @current_user.id)
.select(:category_id, :notification_level, :last_seen_at)
.each do |cu|
yield [
cu.category_id,
piped_category... | cwe | CWE-200 | Ruby |
int Visualizer_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize,
void *pCmdData, uint32_t *replySize, void *pReplyData) {
VisualizerContext * pContext = (VisualizerContext *)self;
int retsize;
if (pContext == NULL || pContext->mState == VISUALIZER_STATE_UNINITIALIZED) {
return -EINVAL;
}
... | cwe | CWE-119 | C/C++ |
function escapeArgBash(arg, interpolation, quoted) {
let result = arg.replace(/\u0000/g, "");
if (interpolation) {
result = result
.replace(/\\/g, "\\\\")
.replace(/\n/g, " ")
.replace(/(^|\s)(~|#)/g, "$1\\$2")
.replace(/(\*|\?)/g, "\\$1")
.replace(/(\$|\;|\&|\|)/g, "\\$1")
... | cwe | CWE-1333 | JavaScript |
function inetLatency(host, callback) {
// fallback - if only callback is given
if (util.isFunction(host) && !callback) {
callback = host;
host = '';
}
host = host || '8.8.8.8';
return new Promise((resolve) => {
process.nextTick(() => {
if (typeof host !== 'string') {
if (callback)... | cwe | CWE-20 | JavaScript |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from django.core.exceptions import ImproperlyConfigured
from djang... | cwe | CWE-79 | Python |
bool Greeter::start() {
// check flag
if (m_started)
return false;
if (daemonApp->testing()) {
// create process
m_process = new QProcess(this);
// delete process on finish
connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus))... | cwe | CWE-284 | C/C++ |
main(int argc, char **argv)
{
const char *safepath = "/bin:/sbin:/usr/bin:/usr/sbin:"
"/usr/local/bin:/usr/local/sbin";
const char *confpath = NULL;
char *shargv[] = { NULL, NULL };
char *sh;
const char *p;
const char *cmd;
char cmdline[LINE_MAX];
struct passwd mypwstore, targpwstore;
struct passwd *mypw,... | cwe | CWE-200 | C/C++ |
PJ_DEF(void) pjmedia_rtcp_init2( pjmedia_rtcp_session *sess,
const pjmedia_rtcp_session_setting *settings)
{
pjmedia_rtcp_sr_pkt *sr_pkt = &sess->rtcp_sr_pkt;
pj_time_val now;
/* Memset everything */
pj_bzero(sess, sizeof(pjmedia_rtcp_session));
/* Last RX timestamp in RTP packet */
s... | cwe | CWE-787 | Unknown |
# Copyright 2014 Netflix, 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... | cwe | CWE-601 | Python |
void nfcmrvl_nci_unregister_dev(struct nfcmrvl_private *priv)
{
struct nci_dev *ndev = priv->ndev;
if (priv->ndev->nfc_dev->fw_download_in_progress)
nfcmrvl_fw_dnld_abort(priv);
nfcmrvl_fw_dnld_deinit(priv);
if (gpio_is_valid(priv->config.reset_n_io))
gpio_free(priv->config.reset_n_io);
nci_unregister_devi... | cwe | CWE-416 | C/C++ |
nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp)
{
struct svc_procedure *proc;
kxdrproc_t xdr;
__be32 nfserr;
__be32 *nfserrp;
dprintk("nfsd_dispatch: vers %d proc %d\n",
rqstp->rq_vers, rqstp->rq_proc);
proc = rqstp->rq_procinfo;
/*
* Give the xdr decoder a chance to change this if it wan... | cwe | CWE-20 | C/C++ |
check_tty(const char *tty)
{
/* Check that we're not being set up to take a fall. */
if ((tty == NULL) || (strlen(tty) == 0)) {
return NULL;
}
/* Pull out the meaningful part of the tty's name. */
if (strchr(tty, '/') != NULL) {
if (strncmp(tty, "/dev/", 5) != 0) {
/* Make sure the device node is actually i... | cwe | CWE-22 | C/C++ |
PHP_METHOD(Phar, loadPhar)
{
char *fname, *alias = NULL, *error;
size_t fname_len, alias_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!", &fname, &fname_len, &alias, &alias_len) == FAILURE) {
return;
}
phar_request_initialize();
RETVAL_BOOL(phar_open_from_filename(fname, fname_len, alias, alias_le... | cwe | CWE-20 | Unknown |
// SPDX-License-Identifier: GPL-2.0
#include <linux/ptrace.h>
#include <linux/sched.h>
#include <linux/sched/task_stack.h>
#include <linux/export.h>
#include <asm/syscall.h>
static int collect_syscall(struct task_struct *target, struct syscall_info *info)
{
struct pt_regs *regs;
if (!try_get_task_stack(target)) {
... | cwe | CWE-681 | C/C++ |
int vc_allocate(unsigned int currcons) /* return 0 on success */
{
struct vt_notifier_param param;
struct vc_data *vc;
WARN_CONSOLE_UNLOCKED();
if (currcons >= MAX_NR_CONSOLES)
return -ENXIO;
if (vc_cons[currcons].d)
return 0;
/* due to the granularity of kmalloc, we waste some memory here */
/* the allo... | cwe | CWE-362 | Unknown |
asmlinkage long sys_setrlimit(unsigned int resource, struct rlimit __user *rlim)
{
struct rlimit new_rlim, *old_rlim;
unsigned long it_prof_secs;
int retval;
if (resource >= RLIM_NLIMITS)
return -EINVAL;
if (copy_from_user(&new_rlim, rlim, sizeof(*rlim)))
return -EFAULT;
if (new_rlim.rlim_cur > new_rlim.rlim... | cwe | CWE-20 | Unknown |
/** \file
* This C source file was generated by $ANTLR version 3.4
*
* - From the grammar source file : ../grammars/belle_sip_message.g
* - On : 2021-05-13 15:53:11
* - for the lexer : belle_sip_messageLexerLexer
*
* Editing it, at least manually, is not w... | cwe | CWE-444 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.