code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
void isis_notif_lsp_error(const struct isis_circuit *circuit,
const uint8_t *lsp_id, const char *raw_pdu,
size_t raw_pdu_len,
__attribute__((unused)) uint32_t offset,
__attribute__((unused)) uint8_t tlv_type)
{
const char *xpath = "/frr-isisd:lsp-error-detected";
struct list *arguments = yang_data... | cwe | CWE-119 | Unknown |
QPDFNumberTreeObjectHelper::updateMap(QPDFObjectHandle oh)
{
if (this->m->seen.count(oh.getObjGen()))
{
return;
}
this->m->seen.insert(oh.getObjGen());
QPDFObjectHandle nums = oh.getKey("/Nums");
if (nums.isArray())
{
size_t nitems = nums.getArrayNItems();
size_t i = ... | cwe | CWE-787 | Unknown |
njs_async_function_frame_invoke(njs_vm_t *vm, njs_value_t *retval)
{
njs_int_t ret;
njs_value_t ctor;
njs_native_frame_t *frame;
njs_promise_capability_t *capability;
frame = vm->top_frame;
frame->retval = retval;
njs_set_function(&ctor, &vm->construct... | cwe | CWE-416 | C/C++ |
sub_font_params(gs_memory_t *mem, const ref *op, gs_matrix *pmat, gs_matrix *pomat, ref *pfname)
{
ref *pmatrix, *pfontname, *pfontstyle, *porigfont, *pfontinfo;
if (dict_find_string(op, "FontMatrix", &pmatrix) <= 0 ||
read_matrix(mem, pmatrix, pmat) < 0
)
return_error(gs_error_invalidf... | cwe | CWE-704 | Unknown |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
const int num_inputs = NumInputs(node);
const bool is_soft_nms = num_inputs == 6;
if (num_inputs != 5 && num_inputs != 6) {
context->ReportError(context, "Found NMS op with invalid num inputs: %d",
NumInputs(node));
... | cwe | CWE-787 | C/C++ |
xmlParseAttValueInternal(xmlParserCtxtPtr ctxt, int *len, int *alloc,
int normalize)
{
xmlChar limit = 0;
const xmlChar *in = NULL, *start, *end, *last;
xmlChar *ret = NULL;
GROW;
in = (xmlChar *) CUR_PTR;
if (*in != '"' && *in != '\'') {
xmlFatalErr(ctxt, XML_E... | cwe | CWE-119 | C/C++ |
function checkPassword($username, $password)
{
$doUser = OA_Dal::factoryDO('users');
$doUser->username = strtolower($username);
$doUser->password = md5($password);
$doUser->find();
if ($doUser->fetch()) {
return $doUser;
} else {
return false;... | cwe | CWE-307 | PHP |
def list(self, keyfilter='/'):
path = os.path.join(self.namespace, keyfilter)
if path != '/':
path = path.rstrip('/')
try:
result = self.etcd.read(path, recursive=True)
except etcd.EtcdKeyNotFound:
return None
except etcd.EtcdException as err:
... | cwe | CWE-22 | Python |
static CURLcode imap_parse_url_path(struct connectdata *conn)
{
/* the imap struct is already inited in imap_connect() */
struct imap_conn *imapc = &conn->proto.imapc;
struct SessionHandle *data = conn->data;
const char *path = data->state.path;
int len;
if(!*path)
path = "INBOX";
/* url decode the ... | cwe | CWE-89 | Unknown |
_poppler_attachment_new (FileSpec *emb_file)
{
PopplerAttachment *attachment;
PopplerAttachmentPrivate *priv;
EmbFile *embFile;
g_assert (emb_file != nullptr);
attachment = (PopplerAttachment *) g_object_new (POPPLER_TYPE_ATTACHMENT, nullptr);
priv = POPPLER_ATTACHMENT_GET_PRIVATE (attachment);
if (emb... | cwe | CWE-476 | Unknown |
/*
*
* Copyright 2019 Asylo 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 agree... | cwe | CWE-125 | C/C++ |
static RList *relocs(RBinFile *arch) {
struct r_bin_bflt_obj *obj = (struct r_bin_bflt_obj*)arch->o->bin_obj;
RList *list = r_list_newf ((RListFree)free);
int i, len, n_got, amount;
if (!list || !obj) {
r_list_free (list);
return NULL;
}
if (obj->hdr->flags & FLAT_FLAG_GOTPIC) {
n_got = get_ngot_entries (ob... | cwe | CWE-119 | C/C++ |
(function(stylesheet, stencils)
{
// Callbacks:
// mxClientOnLoad is called after the script is loaded with the stylesheet and the function to create a
// graph (wich takes the container as an argument and returns the graph instance that was created).
// mxClientOnCreate is called when a graph has been created... | cwe | CWE-94 | JavaScript |
int v9fs_refresh_inode_dotl(struct p9_fid *fid, struct inode *inode)
{
loff_t i_size;
struct p9_stat_dotl *st;
struct v9fs_session_info *v9ses;
v9ses = v9fs_inode2v9ses(inode);
st = p9_client_getattr_dotl(fid, P9_STATS_ALL);
if (IS_ERR(st))
return PTR_ERR(st);
/*
* Don't update inode if the file type is dif... | cwe | CWE-835 | Unknown |
exif_mnote_data_fuji_load (ExifMnoteData *en,
const unsigned char *buf, unsigned int buf_size)
{
ExifMnoteDataFuji *n = (ExifMnoteDataFuji*) en;
ExifLong c;
size_t i, tcount, o, datao;
if (!n || !buf || !buf_size) {
exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
"ExifMnoteDataFuji", "Short MakerNote");
r... | cwe | CWE-908 | Unknown |
TfLiteStatus SoftmaxEval(TfLiteContext* context, TfLiteNode* node) {
auto* params = reinterpret_cast<TfLiteSoftmaxParams*>(node->builtin_data);
SoftmaxOpData* data = reinterpret_cast<SoftmaxOpData*>(node->user_data);
const TfLiteTensor* input = GetInput(context, node, 0);
TfLiteTensor* output = GetOutput(conte... | cwe | CWE-125 | C/C++ |
function O(ua,ya,Na){var Fa=U.menus.get(ua),Ra=R.addMenu(mxResources.get(ua),mxUtils.bind(this,function(){Fa.funct.apply(this,arguments)}),P);Ra.className="1"==urlParams.sketch?"geToolbarButton":"geMenuItem";Ra.style.display="inline-block";Ra.style.boxSizing="border-box";Ra.style.top="6px";Ra.style.marginRight="6px";Ra... | cwe | CWE-94 | JavaScript |
void Document::open(Document* entered_document,
ExceptionState& exception_state) {
if (ImportLoader()) {
exception_state.ThrowDOMException(
kInvalidStateError, "Imported document doesn't support open().");
return;
}
if (!IsHTMLDocument()) {
exception_state.ThrowDOMExceptio... | cwe | CWE-20 | C/C++ |
int nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp)
{
struct group_info *rqgi;
struct group_info *gi;
struct cred *new;
int i;
int flags = nfsexp_flags(rqstp, exp);
validate_process_creds();
/* discard any old override before preparing the new set */
revert_creds(get_cred(current_real_cred()));
... | cwe | CWE-269 | C/C++ |
ext4_find_extent(struct inode *inode, ext4_lblk_t block,
struct ext4_ext_path **orig_path, int flags)
{
struct ext4_extent_header *eh;
struct buffer_head *bh;
struct ext4_ext_path *path = orig_path ? *orig_path : NULL;
short int depth, i, ppos = 0;
int ret;
eh = ext_inode_hdr(inode);
depth = ext_depth(inode)... | cwe | CWE-125 | C/C++ |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-787 | Python |
def quote_column_name(name) #:nodoc:
%Q("#{name}")
end | cwe | CWE-89 | Ruby |
static int nntp_hcache_namer(const char *path, char *dest, size_t destlen)
{
return snprintf(dest, destlen, "%s.hcache", path);
} | cwe | CWE-22 | Unknown |
def filter_archived(list, user, archived: true)
list = list.joins(<<~SQL)
LEFT JOIN group_archived_messages gm ON gm.topic_id = topics.id
LEFT JOIN user_archived_messages um
ON um.user_id = #{user.id.to_i}
AND um.topic_id = topics.id
SQL
list =
if archived
... | cwe | CWE-200 | Ruby |
int quicklistPushTail(quicklist *quicklist, void *value, size_t sz) {
quicklistNode *orig_tail = quicklist->tail;
if (likely(
_quicklistNodeAllowInsert(quicklist->tail, quicklist->fill, sz))) {
quicklist->tail->zl =
ziplistPush(quicklist->tail->zl, value, sz, ZIPLIST_TAIL);
... | cwe | CWE-190 | Unknown |
/* schema_init.c - init builtin schema */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2020 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as auth... | cwe | CWE-617 | C/C++ |
package pluginproxy
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/http/httputil"
"net/url"
"strconv"
"strings"
"time"
"github.com/grafana/grafana/pkg/api/datasource"
glog "github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/p... | cwe | CWE-79 | Go |
return u};Graph.getFontUrl=function(u,E){u=Graph.customFontElements[u.toLowerCase()];null!=u&&(E=u.url);return E};Graph.processFontAttributes=function(u){u=u.getElementsByTagName("*");for(var E=0;E<u.length;E++){var J=u[E].getAttribute("data-font-src");if(null!=J){var T="FONT"==u[E].nodeName?u[E].getAttribute("face"):u... | cwe | CWE-20 | JavaScript |
void CConfig::Write(CFile& File, unsigned int iIndentation) {
CString sIndentation = CString(iIndentation, '\t');
for (const auto& it : m_ConfigEntries) {
for (const CString& sValue : it.second) {
File.Write(sIndentation + it.first + " = " + sValue + "\n");
}
}
for (const a... | cwe | CWE-20 | C/C++ |
archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
struct archive_acl *abstract_acl, __LA_MODE_T mode)
{
int ret = ARCHIVE_OK;
(void)mode; /* UNUSED */
if ((archive_acl_types(abstract_acl)
& ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) {
/* Solaris writes POSIX.1e access and default ACLs... | cwe | CWE-59 | C/C++ |
int line6_probe(struct usb_interface *interface,
const struct usb_device_id *id,
const char *driver_name,
const struct line6_properties *properties,
int (*private_init)(struct usb_line6 *, const struct usb_device_id *id),
size_t data_size)
{
struct usb_device *usbdev = interface_to_usbdev(interface);
struct... | cwe | CWE-476 | Unknown |
public Element handle(Element request, Map<String, Object> context) throws ServiceException {
ZimbraSoapContext zsc = getZimbraSoapContext(context);
Account account = getRequestedAccount(getZimbraSoapContext(context));
if (!canAccessAccount(zsc, account))
throw ServiceException.PERM... | cwe | CWE-862 | Java |
def manipulate_reservation_action(request: HttpRequest, default_foreward_url: str):
"""
This function is used to alter the reservation beeing build inside
a cookie. This function automatically crafts the required response.
"""
js_string: str = ""
r: GroupReservation = None
u: Profile = get_c... | cwe | CWE-79 | Python |
q=g.isEventsEnabled();g.setEventsEnabled(!1);var r=this.graph.isEnabled();this.graph.setEnabled(!1);var t=g.getTranslate();g.translate=new mxPoint(a,b);var u=this.graph.cellRenderer.redraw,x=g.states;a=g.scale;if(this.clipping){var y=new mxRectangle((f.x+t.x)*a,(f.y+t.y)*a,f.width*a/p,f.height*a/p),C=this;this.graph.ce... | cwe | CWE-94 | JavaScript |
/*!
* 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-20 | JavaScript |
static int jpc_enc_encodemainbody(jpc_enc_t *enc)
{
int tileno;
int tilex;
int tiley;
int i;
jpc_sot_t *sot;
jpc_enc_tcmpt_t *comp;
jpc_enc_tcmpt_t *endcomps;
jpc_enc_band_t *band;
jpc_enc_band_t *endbands;
jpc_enc_rlvl_t *lvl;
int rlvlno;
jpc_qcc_t *qcc;
jpc_cod_t *cod;
int adjust;
int j;
int absbandno... | cwe | CWE-617 | Unknown |
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | cwe | CWE-287 | Java |
public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset,
byte[] ciphertext, int ciphertextOffset, int length)
throws ShortBufferException {
int space;
if (ciphertextOffset > ciphertext.length)
space = 0;
else
space = ciphertext.length - ciphertextOffset;
if (!haskey) {
// The ke... | cwe | CWE-787 | Java |
def _set_qos_rule(self, qos, vvs_name):
max_io = self._get_qos_value(qos, 'maxIOPS')
max_bw = self._get_qos_value(qos, 'maxBWS')
cli_qos_string = ""
if max_io is not None:
cli_qos_string += ('-io %s ' % max_io)
if max_bw is not None:
cli_qos_string += ('-b... | cwe | CWE-78 | Python |
void Compute(OpKernelContext* ctx) override {
StagingMap<Ordered>* map = nullptr;
OP_REQUIRES_OK(ctx, GetStagingMap(ctx, def(), &map));
core::ScopedUnref scope(map);
typename StagingMap<Ordered>::OptionalTuple tuple;
const Tensor* key_tensor;
const Tensor* indices_tensor;
OpInputList values... | cwe | CWE-476 | Unknown |
node_t *create_node(char *filename)
{
node_t *node = malloc(sizeof(node_t));
node->next = NULL;
node->prev = NULL;
node->filename = filename;
stat(filename, &node->st);
node->content = malloc(node->st.st_size);
FILE *fp = fopen(filename, "rb");
fread(node->content, node->st.st_size, 1... | cwe | CWE-476 | C/C++ |
#include <pichi/config.hpp>
// Include config.hpp first
#include <array>
#include <boost/asio/connect.hpp>
#include <boost/asio/io_context.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/read.hpp>
#include <boost/asio/spawn2.hpp>
#include <boost/asio/write.hpp>
#include <pichi/api/balancer.hpp>
#include <pic... | cwe | CWE-295 | C/C++ |
QPDF::checkHSharedObject(std::list<std::string>& errors,
std::list<std::string>& warnings,
std::vector<QPDFObjectHandle> const& pages,
std::map<int, int>& idx_to_obj)
{
// Implementation note 125 says shared object groups always
// contain only one object. Implementation note 128 says that
// A... | cwe | CWE-787 | Unknown |
rfbSendServerCutText(rfbScreenInfoPtr rfbScreen,char *str, int len)
{
rfbClientPtr cl;
rfbServerCutTextMsg sct;
rfbClientIteratorPtr iterator;
iterator = rfbGetClientIterator(rfbScreen);
while ((cl = rfbClientIteratorNext(iterator)) != NULL) {
sct.type = rfbServerCutText;
sct.length... | cwe | CWE-772 | Unknown |
status_t MediaHTTP::connect(
const char *uri,
const KeyedVector<String8, String8> *headers,
off64_t /* offset */) {
if (mInitCheck != OK) {
return mInitCheck;
}
KeyedVector<String8, String8> extHeaders;
if (headers != NULL) {
extHeaders = *headers;
}
if (extHeaders.indexOfKey(String8("User-Agent")) ... | cwe | CWE-119 | C/C++ |
TfLiteStatus EvalMean(TfLiteContext* context, TfLiteNode* node) {
OpContext op_context(context, node);
OpData* data = reinterpret_cast<OpData*>(node->user_data);
int num_axis = static_cast<int>(NumElements(op_context.axis));
TfLiteTensor* temp_index = GetTemporary(context, node, /*index=*/0);
TfLiteTensor* r... | cwe | CWE-787 | C/C++ |
/* Copyright 2008-2015 Codership Oy <http://www.codership.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it w... | cwe | CWE-20 | C/C++ |
func (suite *KeeperTestSuite) TestPeriodChangesAfterEpochEnd() {
suite.SetupTest()
currentEpochPeriod := suite.app.InflationKeeper.GetEpochsPerPeriod(suite.ctx)
// bondingRatio is zero in tests
bondedRatio := suite.app.StakingKeeper.BondedRatio(suite.ctx)
testCases := []struct {
name string
height int64
... | cwe | CWE-287 | Go |
static opj_bool pi_next_rlcp(opj_pi_iterator_t * pi)
{
opj_pi_comp_t *comp = NULL;
opj_pi_resolution_t *res = NULL;
long index = 0;
if (!pi->first) {
comp = &pi->comps[pi->compno];
res = &comp->resolutions[pi->resno];
goto LABEL_SKIP;
} else {
pi->first = 0;
}
... | cwe | CWE-20 | C/C++ |
public VFSContainer createChildContainer(String name) {
File fNewFile = new File(getBasefile(), name);
if (!fNewFile.mkdir()) return null;
LocalFolderImpl locFI = new LocalFolderImpl(fNewFile, this);
locFI.setDefaultItemFilter(defaultFilter);
return locFI;
} | cwe | CWE-22 | Java |
package com.salesmanager.shop.admin.controller.products;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.salesmanager.core.business.services.catalog.category.CategoryService;
import com.salesmanager.core.business.services.catalog.product.ProductService;
import com.salesmanager.core.business.services.cat... | cwe | CWE-639 | Java |
t42_parse_charstrings( T42_Face face,
T42_Loader loader )
{
T42_Parser parser = &loader->parser;
PS_Table code_table = &loader->charstrings;
PS_Table name_table = &loader->glyph_names;
PS_Table swap_table = &loader->swap_table;
FT_Memo... | cwe | CWE-119 | C/C++ |
var mxClient={VERSION:"20.2.8",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==docum... | cwe | CWE-79 | JavaScript |
def request(args = {})
{ :ip => '10.1.1.1', :node => 'host.domain.com', :key => 'key', :authenticated => true }.each do |k,v|
args[k] ||= v
end
['test', :find, args[:key], args]
end | cwe | CWE-287 | Ruby |
static void php_wddx_pop_element(void *user_data, const XML_Char *name)
{
st_entry *ent1, *ent2;
wddx_stack *stack = (wddx_stack *)user_data;
HashTable *target_hash;
zend_class_entry **pce;
zval *obj;
zval *tmp;
TSRMLS_FETCH();
/* OBJECTS_FIXME */
if (stack->top == 0) {
return;
}
if (!strc... | cwe | CWE-119 | 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 *cmd;
char cmdline[LINE_MAX];
#ifdef __OpenBSD__
char mypwbuf[_PW_BUF_LEN], targpwbuf[_PW_BUF_LEN];
#else... | cwe | CWE-459 | C/C++ |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
Subgraph* subgraph = reinterpret_cast<Subgraph*>(context->impl_);
const TfLiteTensor* input_resource_id_tensor =
GetInput(context, node, kInputVariableId);
const TfLiteTensor* input_value_tensor = GetInput(context, node, kInputValue);
int res... | cwe | CWE-787 | C/C++ |
// Copyright Istio 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 wri... | cwe | CWE-400 | Go |
static void hugetlbfs_put_super(struct super_block *sb)
{
struct hugetlbfs_sb_info *sbi = HUGETLBFS_SB(sb);
if (sbi) {
sb->s_fs_info = NULL;
kfree(sbi);
}
} | cwe | CWE-399 | C/C++ |
/*
misc.c : irssi
Copyright (C) 1999 Timo Sirainen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
T... | cwe | CWE-476 | C/C++ |
static ssize_t cm_write(struct file *file, const char __user * user_buf,
size_t count, loff_t *ppos)
{
static char *buf;
static u32 max_size;
static u32 uncopied_bytes;
struct acpi_table_header table;
acpi_status status;
if (!(*ppos)) {
/* parse the table header to get the table length */
if (count <= size... | cwe | CWE-264 | C/C++ |
bool dwgReader21::parseSysPage(duint64 sizeCompressed, duint64 sizeUncompressed, duint64 correctionFactor, duint64 offset, duint8 *decompData){
//round to 8
duint64 alsize = (sizeCompressed + 7) &(-8);
//minimum RS chunk:
duint32 chunks = (((alsize * correctionFactor)+238)/239);
duint64 fpsize = chu... | cwe | CWE-191 | Unknown |
int l2tp_recv(int fd, struct l2tp_packet_t **p, struct in_pktinfo *pkt_info,
const char *secret, size_t secret_len)
{
int n, length;
uint8_t *buf;
struct l2tp_hdr_t *hdr;
struct l2tp_avp_t *avp;
struct l2tp_dict_attr_t *da;
struct l2tp_attr_t *attr, *RV = NULL;
uint8_t *ptr;
struct l2tp_packet_t *pack;
... | cwe | CWE-120 | C/C++ |
module.exports.searchOccupationNames = function(query, successNext, errNext) {
var connection = mysql.createConnection(config);
connection.connect();
// TECH DEBT: Beware SQL injection! Consider validating query
connection.query('SELECT * FROM Occupation WHERE title LIKE "%' + query + '%";', function(e... | cwe | CWE-89 | JavaScript |
async query(sql, options) {
options = { ...this.options.query, ...options };
if (options.instance && !options.model) {
options.model = options.instance.constructor;
}
if (!options.instance && !options.model) {
options.raw = true;
}
// map raw fields to model attributes
if (opt... | cwe | CWE-89 | JavaScript |
static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
char
filename[MagickPathExtent];
FILE
*file;
Image
*image,
*next;
int
status,
unique_file;
ssize_t
n;
SVGInfo
*svg_info;
unsigned char
message[MagickPathExtent];
xmlSAXHandler
... | cwe | CWE-674 | C/C++ |
package server
import (
"fmt"
"net/http"
"net/http/pprof"
"github.com/fatih/color"
"github.com/go-logr/zerologr"
grpczerolog "github.com/grpc-ecosystem/go-grpc-middleware/providers/zerolog/v2"
grpcauth "github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/auth"
grpclog "github.com/grpc-ecosystem/go-gr... | cwe | CWE-209 | Go |
public void getLogFile(@PathVariable("filename") String fileName, HttpServletResponse response) throws Exception {
InputStream inputStream = null;
try {
//Validate/Sanitize user input filename using a standard library, prevent from path traversal
String logFileName = getFilePath() ... | cwe | CWE-22 | Java |
PJ_DEF(pj_status_t) pjmedia_rtcp_fb_build_sli(
pjmedia_rtcp_session *session,
void *buf,
pj_size_t *length,
unsigned sli_cnt,
const pjmedia_rtcp_fb_sli sli[])
{
pjmedia_rtcp_common *hdr;
pj_uint8_t *p;
unsigned len, i;
PJ_ASSERT_RETURN(session && buf && length && sli_cnt && sl... | cwe | CWE-787 | C/C++ |
static SDL_Surface* Create_Surface_Shaded(int width, int height, SDL_Color fg, SDL_Color bg, Uint32 *color)
{
const int alignment = Get_Alignement() - 1;
SDL_Surface *textbuf;
Sint64 size;
Uint8 bg_alpha = bg.a;
/* Create a surface with memory:
* - pitch is rounded to alignment
* - adress... | cwe | CWE-190 | Unknown |
brcmf_wowl_nd_results(struct brcmf_if *ifp, const struct brcmf_event_msg *e,
void *data)
{
struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
struct wiphy *wiphy = cfg_to_wiphy(cfg);
struct brcmf_pno_scanresults_le *pfn_result;
struct brcmf_pno_net_info_le *netinfo;
brcmf_dbg(SCAN, "Enter\n");
if (e->... | cwe | CWE-787 | C/C++ |
bool asn1_check_enumerated(struct asn1_data *data, int v)
{
uint8_t b;
if (!asn1_start_tag(data, ASN1_ENUMERATED)) return false;
asn1_read_uint8(data, &b);
asn1_end_tag(data);
if (v != b)
data->has_error = false;
return !data->has_error;
} | cwe | CWE-399 | Unknown |
void ColorChooserDialog::DidCloseDialog(bool chose_color,
SkColor color,
RunState run_state) {
if (!listener_)
return;
EndRun(run_state);
CopyCustomColors(custom_colors_, g_custom_colors);
if (chose_color)
listener_->OnC... | cwe | CWE-399 | C/C++ |
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
if (request.getParameter("path") != null) {
writeFile(ioService.get(new URI(request.getParameter("path"))), getFileItem(request));
writeRespo... | cwe | CWE-264 | Java |
void recompute_ideal_colors_1plane(
const image_block& blk,
const error_weight_block& ewb,
const partition_info& pi,
const decimation_info& di,
int weight_quant_mode,
const uint8_t* dec_weights_quant_pvalue,
endpoints& ep,
vfloat4 rgbs_vectors[BLOCK_MAX_PARTITIONS],
vfloat4 rgbo_vectors[BLOCK_MAX_PARTITIONS]
)... | cwe | CWE-787 | Unknown |
/**
* @author ZhangHuihua@msn.com
*/
var DWZ = {
version: "1.5.0" ,
regPlugins: [ ], // [function($parent){} ...]
// sbar: show sidebar
keyCode: {
ENTER: 13, ESC: 27, END: 35, HOME: 36, SHIFT: 16, TAB: 9, LEFT: 37, RIGHT: 39, UP: 38, DOWN: 40, DELETE: 46, BACKSPACE: 8, CHAR_S: 83
} ,
e... | cwe | CWE-707 | Java |
finish_process_as_req(struct as_req_state *state, krb5_error_code errcode)
{
krb5_key_data *server_key;
krb5_keyblock *as_encrypting_key = NULL;
krb5_data *response = NULL;
const char *emsg = 0;
int did_log = 0;
loop_respond_fn oldrespond;
void *oldarg;
kdc_realm_t *kdc_active_realm = st... | cwe | CWE-617 | C/C++ |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, SUPERUSER_ID
from odoo.tools.translate import _
from odoo.exceptions import UserError
AVAILABLE_PRIORITIES = [
('0', 'Normal'),
('1', 'Good'),
('2', 'Very Good'),
('... | cwe | CWE-269 | Python |
static int internal_get_user_pages_fast(unsigned long start, int nr_pages,
unsigned int gup_flags,
struct page **pages)
{
unsigned long addr, len, end;
int nr_pinned = 0, ret = 0;
if (WARN_ON_ONCE(gup_flags & ~(FOLL_WRITE | FOLL_LONGTERM |
FOLL_FORCE | FOLL_PIN | FOLL_GET)))
return -EINVAL;
... | cwe | CWE-362 | Unknown |
v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode,
struct super_block *sb)
{
umode_t mode;
char ext[32];
char tag_name[14];
unsigned int i_nlink;
struct v9fs_session_info *v9ses = sb->s_fs_info;
struct v9fs_inode *v9inode = V9FS_I(inode);
set_nlink(inode, 1);
inode->i_atime.tv_sec = stat->atime;
in... | cwe | CWE-835 | Unknown |
"geTempDlgCreateBtn geTempDlgBtnDisabled")}function z(ha,da){if(null!=J){var ca=function(pa){qa.isExternal?g(qa,function(na){la(na,pa)},ia):qa.url?mxUtils.get(TEMPLATE_PATH+"/"+qa.url,mxUtils.bind(this,function(na){200<=na.getStatus()&&299>=na.getStatus()?la(na.getText(),pa):ia()})):la(b.emptyDiagramXml,pa)},la=functio... | cwe | CWE-20 | JavaScript |
el: $("#patientModelContainer")
});
// tell the model view where it's template is located
this.modelView.templateEl = $("#patientModelTemplate");
this.modelView.on('rendered', function () { // model rendered
$(function () {
$('.jquery-date-picker').datetimep... | cwe | CWE-79 | JavaScript |
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: https://www.espocrm.com
*
* EspoCRM is free software: you can redistribute i... | cwe | CWE-79 | JavaScript |
static unsigned char asn1_oid_decode(struct asn1_ctx *ctx,
unsigned char *eoc,
unsigned long **oid,
unsigned int *len)
{
unsigned long subid;
unsigned int size;
unsigned long *optr;
size = eoc - ctx->pointer + 1;
*oid = kmalloc(size * sizeof(unsigned long), GFP_ATOMIC);
if (*oid == NU... | cwe | CWE-119 | Unknown |
_WM_ParseNewHmi(uint8_t *hmi_data, uint32_t hmi_size) {
uint32_t hmi_tmp = 0;
uint8_t *hmi_base = hmi_data;
uint16_t hmi_bpm = 0;
uint16_t hmi_division = 0;
uint32_t *hmi_track_offset = NULL;
uint32_t i = 0;
uint32_t j = 0;
uint8_t *hmi_addr = NULL;
uint32_t *hmi_track_header... | cwe | CWE-125 | C/C++ |
TfLiteStatus ResizeOutputTensors(TfLiteContext* context, TfLiteNode* node,
const TfLiteTensor* input,
const TfLiteTensor* size_splits,
const TfLiteTensor* axis) {
int axis_value = GetTensorData<int>(axis)[0];
if (axis... | cwe | CWE-125 | C/C++ |
package ldap
import (
"fmt"
"gopkg.in/asn1-ber.v1"
)
// LDAP Result Codes
const (
LDAPResultSuccess = 0
LDAPResultOperationsError = 1
LDAPResultProtocolError = 2
LDAPResultTimeLimitExceeded = 3
LDAPResultSizeLimitExceeded = 4
LDAPResultCo... | cwe | CWE-287 | Go |
# 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-209 | Python |
ChromeURLRequestContext::ChromeURLRequestContext(
ContextType type,
chrome_browser_net::LoadTimeStats* load_time_stats)
: load_time_stats_(load_time_stats) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (load_time_stats_)
load_time_stats_->RegisterURLRequestContext(this, type);
} | cwe | CWE-399 | C/C++ |
get_clock_info(
sockaddr_u *srcadr,
endpt *inter,
struct req_pkt *inpkt
)
{
register struct info_clock *ic;
register u_int32 *clkaddr;
register int items;
struct refclockstat clock_stat;
sockaddr_u addr;
l_fp ltmp;
ZERO_SOCK(&addr);
AF(&addr) = AF_INET;
#ifdef ISC_PLATFORM_HAVESALEN
addr.sa.sa_len = SOCKL... | cwe | CWE-476 | Unknown |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-787 | C/C++ |
static void update_exception_bitmap(struct kvm_vcpu *vcpu)
{
u32 eb;
eb = (1u << PF_VECTOR) | (1u << UD_VECTOR) | (1u << MC_VECTOR) |
(1u << NM_VECTOR) | (1u << DB_VECTOR);
if ((vcpu->guest_debug &
(KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_SW_BP)) ==
(KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_SW_BP))
... | cwe | CWE-399 | C/C++ |
PHP_FUNCTION(dns_get_record)
{
char *hostname;
int hostname_len;
long type_param = PHP_DNS_ANY;
zval *authns = NULL, *addtl = NULL;
int type_to_fetch;
#if defined(HAVE_DNS_SEARCH)
struct sockaddr_storage from;
uint32_t fromsize = sizeof(from);
dns_handle_t handle;
#elif defined(HAVE_RES_NSEARCH)
struct __res_s... | cwe | CWE-119 | C/C++ |
static Image *ReadDPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
const char
*client_name;
Display
*display;
float
pixels_per_point;
Image
*image;
int
sans,
status;
Pixmap
pixmap;
register IndexPacket
*indexes;
register ssize_t
i;
register P... | cwe | CWE-401 | C/C++ |
void X509Certificate::ToLegacy(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
X509Certificate* cert;
ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder());
Local<Value> ret;
if (X509ToObject(env, cert->get()).ToLocal(&ret))
args.GetReturnValue().Set(ret);
} | cwe | CWE-295 | Unknown |
find_start_brace(void) // XXX
{
pos_T cursor_save;
pos_T *trypos;
pos_T *pos;
static pos_T pos_copy;
cursor_save = curwin->w_cursor;
while ((trypos = findmatchlimit(NULL, '{', FM_BLOCKSTOP, 0)) != NULL)
{
pos_copy = *trypos; // copy pos_T, next findmatch will change it
trypos = &pos_c... | cwe | CWE-122 | C/C++ |
idna_to_unicode_8z8z (const char *input, char **output, int flags)
{
uint32_t *ucs4;
int rc;
rc = idna_to_unicode_8z4z (input, &ucs4, flags);
*output = stringprep_ucs4_to_utf8 (ucs4, -1, NULL, NULL);
free (ucs4);
if (!*output)
return IDNA_ICONV_ERROR;
return rc;
} | cwe | CWE-119 | Unknown |
QualifyIpPacket(IPHeader *pIpHeader, ULONG len)
{
tTcpIpPacketParsingResult res;
UCHAR ver_len = pIpHeader->v4.ip_verlen;
UCHAR ip_version = (ver_len & 0xF0) >> 4;
USHORT ipHeaderSize = 0;
USHORT fullLength = 0;
res.value = 0;
if (ip_version == 4)
{
ipHeaderSize = (ver_len... | cwe | CWE-20 | C/C++ |
ins_compl_infercase_gettext(
char_u *str,
int actual_len,
int actual_compl_length,
int min_len)
{
int *wca; // Wide character array.
char_u *p;
int i, c;
int has_lower = FALSE;
int was_letter = FALSE;
IObuff[0] = NUL;
// Allocate wide character array for the completion and fill i... | cwe | CWE-122 | C/C++ |
/**
* FreeRDP: A Remote Desktop Protocol Implementation
*
* Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com>
* Copyright 2017 Armin Novak <armin.novak@thincast.com>
* Copyright 2017 Thincast Technologies GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this... | cwe | CWE-416 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.