code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
/*
* apply.c
*
* Copyright (C) Linus Torvalds, 2005
*
* This applies patches on top of some (arbitrary) version of the SCM.
*
*/
#include "cache.h"
#include "config.h"
#include "object-store.h"
#include "blob.h"
#include "delta.h"
#include "diff.h"
#include "dir.h"
#include "xdiff-interface.h"
#include "ll-merg... | cwe | CWE-59 | C/C++ |
static uint64_t ReadBits(BitReader* reader, int num_bits) {
DCHECK_GE(reader->bits_available(), num_bits);
DCHECK((num_bits > 0) && (num_bits <= 64));
uint64_t value;
reader->ReadBits(num_bits, &value);
return value;
} | cwe | CWE-908 | C/C++ |
xmlXPtrNewCollapsedRange(xmlNodePtr start) {
xmlXPathObjectPtr ret;
if (start == NULL)
return(NULL);
ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
if (ret == NULL) {
xmlXPtrErrMemory("allocating range");
return(NULL);
}
memset(ret, 0 , (size_t) sizeof(xmlXPathObject));... | cwe | CWE-119 | Unknown |
/************************************************************************
* 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 |
/*
* Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
*
* Author: zccrs <zccrs@live.com>
*
* Maintainer: zccrs <zhangjide@deepin.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 Foun... | cwe | CWE-362 | C/C++ |
it "limits the query" do
session.should_receive(:query) do |query|
query.limit.should eq(-1)
reply
end
session.simple_query(query)
end | cwe | CWE-20 | Ruby |
/* radare - LGPL - Copyright 2019 - GustavoLCR */
#include "ne.h"
static char *__get_target_os(r_bin_ne_obj_t *bin) {
switch (bin->ne_header->targOS) {
case 1:
return "OS/2";
case 2:
return "Windows";
case 3:
return "European MS-DOS 4.x";
case 4:
return "Windows 386";
case 5:
return "BOSS (Borland Ope... | cwe | CWE-129 | C/C++ |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteUnpackParams* data =
reinterpret_cast<TfLiteUnpackParams*>(node->builtin_data);
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
switch (input->type) {
case kTfLiteFloat32: {
UnpackImpl<float>(context, nod... | cwe | CWE-125 | C/C++ |
def custom_logout(request, **kwargs):
if not request.user.is_authenticated:
return redirect(request.GET.get('next', reverse(settings.LOGIN_URL)))
if request.method == 'POST':
return _logout_view(request, **kwargs)
return render(request, 'spirit/user/auth/logout.html') | cwe | CWE-601 | Python |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE(context, node->inputs->size == kInputNum);
TF_LITE_ENSURE(context, node->outputs->size == kOutputNum);
const TfLiteTensor* input = GetInput(context, node, kInputData);
const TfLiteTensor* prev_activation =
GetInput(context, n... | cwe | CWE-787 | C/C++ |
static int rdn_rename_callback(struct ldb_request *req, struct ldb_reply *ares)
{
struct ldb_context *ldb;
struct rename_context *ac;
struct ldb_request *mod_req;
const char *rdn_name;
const struct ldb_schema_attribute *a = NULL;
const struct ldb_val *rdn_val_p;
struct ldb_val rdn_val;
struct ldb_message *msg;
... | cwe | CWE-200 | Unknown |
static int tvaudio_set_ctrl(struct CHIPSTATE *chip,
struct v4l2_control *ctrl)
{
struct CHIPDESC *desc = chip->desc;
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
if (ctrl->value < 0 || ctrl->value >= 2)
return -ERANGE;
chip->muted = ctrl->value;
if (chip->muted)
chip_write_masked(chip,desc->inpu... | cwe | CWE-399 | Unknown |
static void dtls1_clear_queues(SSL *s)
{
pitem *item = NULL;
hm_fragment *frag = NULL;
DTLS1_RECORD_DATA *rdata;
while ((item = pqueue_pop(s->d1->unprocessed_rcds.q)) != NULL) {
rdata = (DTLS1_RECORD_DATA *)item->data;
if (rdata->rbuf.buf) {
OPENSSL_free(rdata->rbuf.buf);
... | cwe | CWE-399 | Unknown |
PJ_DEF(pj_status_t) pj_file_setpos( pj_oshandle_t fd,
pj_off_t offset,
enum pj_file_seek_type whence)
{
int mode;
switch (whence) {
case PJ_SEEK_SET:
mode = SEEK_SET; break;
case PJ_SEEK_CUR:
mode = SEEK_CUR; break;... | cwe | CWE-703 | Unknown |
static void IBusBusGlobalEngineChangedCallback(
IBusBus* bus, const gchar* engine_name, gpointer user_data) {
DCHECK(engine_name);
DLOG(INFO) << "Global engine is changed to " << engine_name;
g_return_if_fail(user_data);
InputMethodStatusConnection* self
= static_cast<InputMethodStatusCon... | cwe | CWE-20 | C/C++ |
handle_event_moddone(struct module_qstate* qstate, int id)
{
struct dns64_qstate* iq = (struct dns64_qstate*)qstate->minfo[id];
/*
* In many cases we have nothing special to do. From most to least common:
*
* - An internal query.
* - A query for a record type other than AAAA.
* - CD ... | cwe | CWE-613 | Unknown |
var FilePropertiesDialog=function(b){var e=document.createElement("table"),f=document.createElement("tbody");e.style.width="100%";e.style.marginTop="8px";var c=b.getCurrentFile();var m=null!=c&&null!=c.getTitle()?c.getTitle():b.defaultFilename;var n=function(){};if(/(\.png)$/i.test(m)){n=1;var v=0;m=b.fileNode;null!=m&... | cwe | CWE-20 | JavaScript |
#!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import azure.functions as func
# This endpoint handles the signalr negotation
# As we do not differentiate from clients at this time, we pass the Functions runtime
# provided connection straight to the client
#
# For more... | cwe | CWE-863 | Python |
static void parse_relocation_info(struct MACH0_(obj_t) *bin, RSkipList *relocs, ut32 offset, ut32 num) {
if (!num || !offset || (st32)num < 0) {
return;
}
ut64 total_size = num * sizeof (struct relocation_info);
if (offset > bin->size) {
return;
}
if (total_size > bin->size) {
total_size = bin->size - offs... | cwe | CWE-122 | C/C++ |
static int mv_read_header(AVFormatContext *avctx)
{
MvContext *mv = avctx->priv_data;
AVIOContext *pb = avctx->pb;
AVStream *ast = NULL, *vst = NULL; //initialization to suppress warning
int version, i;
int ret;
avio_skip(pb, 4);
version = avio_rb16(pb);
if (version == 2) {
uin... | cwe | CWE-834 | 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_le(s... | cwe | CWE-119 | Unknown |
func (p *HTTPClient) ReadByte() (c byte, err error) {
return readByte(p.response.Body)
} | cwe | CWE-770 | Go |
function update($vars, &$errors) {
if (!$vars['grace_period'])
$errors['grace_period'] = __('Grace period required');
elseif (!is_numeric($vars['grace_period']))
$errors['grace_period'] = __('Numeric value required (in hours)');
elseif ($vars['grace_period'] > 8760)
... | cwe | CWE-79 | PHP |
/*
* hmp.c -- Midi Wavetable Processing library
*
* Copyright (C) WildMIDI Developers 2001-2016
*
* This file is part of WildMIDI.
*
* WildMIDI is free software: you can redistribute and/or modify the player
* under the terms of the GNU General Public License and you can redistribute
* and/or modify the librar... | cwe | CWE-125 | C/C++ |
Status BuildInputArgIndex(const OpDef::ArgDef& arg_def, AttrSlice attr_values,
const FunctionDef::ArgAttrs* arg_attrs,
bool ints_on_device,
int64_t resource_arg_unique_id) {
bool is_type_list;
DataTypeVector dtypes;
TF_RETUR... | cwe | CWE-617 | C/C++ |
gdk_pixbuf__tiff_image_stop_load (gpointer data,
GError **error)
{
TiffData *context = (TiffData*) data;
gboolean retval = FALSE;
g_return_val_if_fail (data != NULL, TRUE);
fflush (context->file);
rewind (context->file);
if (context->all_okay) {
G... | cwe | CWE-20 | Unknown |
const {Parser: AcornParser, isNewLine: acornIsNewLine, getLineInfo: acornGetLineInfo} = require('acorn');
const {full: acornWalkFull} = require('acorn-walk');
const INTERNAL_STATE_NAME = 'VM2_INTERNAL_STATE_DO_NOT_USE_OR_PROGRAM_WILL_FAIL';
function assertType(node, type) {
if (!node) throw new Error(`None existent... | cwe | CWE-74 | JavaScript |
/*
* "Real" compatible demuxer.
* Copyright (c) 2000, 2001 Fabrice Bellard
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of th... | cwe | CWE-416 | C/C++ |
static MagickBooleanType EncodeImage(const ImageInfo *image_info,Image *image,
const size_t data_size,ExceptionInfo *exception)
{
#define MaxCode(number_bits) ((one << (number_bits))-1)
#define MaxHashTable 5003
#define MaxGIFBits 12UL
#define MaxGIFTable (1UL << MaxGIFBits)
#define GIFOutputCode(code) \
{ \
/*... | cwe | CWE-119 | Unknown |
function phoromatic_quit_if_invalid_input_found($input_keys = null)
{
if(empty($input_keys))
{
// Check them all if not being selective about what keys to check
$input_keys = array_keys($_REQUEST);
}
// backup as to sanitization and stripping elsewhere, safeguard namely check for things like < for fields that s... | cwe | CWE-79 | PHP |
# Copyright 2021 The Matrix.org Foundation C.I.C.
#
# 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-674 | Python |
const makeRegex = (string) => {
// default: case_senstivie = true
if (ctx.query.filter_case_sensitive === 'false') {
return new RegExp(string, 'i');
} else {
return new RegExp(string);
}
}; | cwe | CWE-400 | JavaScript |
static int geneve6_xmit_skb(struct sk_buff *skb, struct net_device *dev,
struct geneve_dev *geneve,
const struct ip_tunnel_info *info)
{
bool xnet = !net_eq(geneve->net, dev_net(geneve->dev));
struct geneve_sock *gs6 = rcu_dereference(geneve->sock6);
const struct ip_tunnel_key *key = &info->key;
struc... | cwe | CWE-319 | Unknown |
/* Determine a canonical name for the current locale's character encoding.
Copyright (C) 2000-2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; ... | cwe | CWE-200 | C/C++ |
MagickExport MagickBooleanType EqualizeImage(Image *image,
ExceptionInfo *exception)
{
#define EqualizeImageTag "Equalize/Image"
CacheView
*image_view;
double
black[CompositePixelChannel+1],
*equalize_map,
*histogram,
*map,
white[CompositePixelChannel+1];
MagickBooleanType
status... | cwe | CWE-125 | C/C++ |
status_t ESDS::parseESDescriptor(size_t offset, size_t size) {
if (size < 3) {
return ERROR_MALFORMED;
}
offset += 2; // skip ES_ID
size -= 2;
unsigned streamDependenceFlag = mData[offset] & 0x80;
unsigned URL_Flag = mData[offset] & 0x40;
unsigned OCRstreamFlag = mData[offset] & 0x20;
++offset;
... | cwe | CWE-189 | C/C++ |
TfLiteStatus ResizeOutput(TfLiteContext* context, TfLiteNode* node) {
TfLiteIntArray* output_shape = GetOutputShape(context, node);
std::unique_ptr<TfLiteIntArray, void (*)(TfLiteIntArray*)>
scoped_output_shape(output_shape, TfLiteIntArrayFree);
const TfLiteTensor* input = GetInput(context, node, kInputTen... | cwe | CWE-125 | C/C++ |
/*
* Marvell Wireless LAN device driver: PCIE specific handling
*
* Copyright (C) 2011-2014, Marvell International Ltd.
*
* This software file (the "File") is distributed by Marvell International
* Ltd. under the terms of the GNU General Public License Version 2, June 1991
* (the "License"). You may use, redist... | cwe | CWE-400 | C/C++ |
pim_print(netdissect_options *ndo,
register const u_char *bp, register u_int len, const u_char *bp2)
{
register const u_char *ep;
register const struct pim *pim = (const struct pim *)bp;
ep = (const u_char *)ndo->ndo_snapend;
if (bp >= ep)
return;
#ifdef notyet /* currently we see only version and ty... | cwe | CWE-125 | C/C++ |
inline Status SparseTensor::Split(const SparseTensor& input_tensor,
const int split_dim, const int num_split,
std::vector<SparseTensor>* result) {
std::vector<Tensor> output_indices;
std::vector<Tensor> output_values;
std::vector<TensorShape> out... | cwe | CWE-703 | C/C++ |
static void Sp_search(js_State *J)
{
js_Regexp *re;
const char *text;
Resub m;
text = checkstring(J, 0);
if (js_isregexp(J, 1))
js_copy(J, 1);
else if (js_isundefined(J, 1))
js_newregexp(J, "", 0);
else
js_newregexp(J, js_tostring(J, 1), 0);
re = js_toregexp(J, -1);
if (!js_regexec(re->prog, text, &m... | cwe | CWE-400 | Unknown |
package com.salesmanager.shop.admin.controller.content;
import com.salesmanager.core.business.services.content.ContentService;
import com.salesmanager.core.business.utils.ajax.AjaxResponse;
import com.salesmanager.core.model.content.FileContentType;
import com.salesmanager.core.model.content.InputContentFile;
import c... | cwe | CWE-639 | Java |
/*
* Copyright 2019 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* 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.apach... | cwe | CWE-377 | Java |
static st64 buf_format(RBuffer *dst, RBuffer *src, const char *fmt, int n) {
st64 res = 0;
int i;
for (i = 0; i < n; i++) {
int j;
int m = 1;
int tsize = 2;
bool bigendian = true;
for (j = 0; fmt[j]; j++) {
switch (fmt[j]) {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
... | cwe | CWE-400 | C/C++ |
Gfx::Gfx(XRef *xrefA, OutputDev *outA, int pageNum, Dict *resDict, Catalog *catalogA,
double hDPI, double vDPI, PDFRectangle *box,
PDFRectangle *cropBox, int rotate,
GBool (*abortCheckCbkA)(void *data),
void *abortCheckCbkDataA)
#ifdef USE_CMS
: iccColorSpaceCache(5)
#endif
{
int i;
xref = xrefA;
catalo... | cwe | CWE-476 | C/C++ |
static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns)
{
struct mnt_namespace *new_ns;
struct ucounts *ucounts;
int ret;
ucounts = inc_mnt_namespaces(user_ns);
if (!ucounts)
return ERR_PTR(-ENOSPC);
new_ns = kmalloc(sizeof(struct mnt_namespace), GFP_KERNEL);
if (!new_ns) {
dec_mnt_namesp... | cwe | CWE-400 | C/C++ |
Oa+="@import url("+Ma+");\n":Ia+='@font-face {\nfont-family: "'+Ca+'";\nsrc: url("'+Ma+'");\n}\n'}Ka.appendChild(Ba.createTextNode(Oa+Ia));xa.getElementsByTagName("defs")[0].appendChild(Ka)}null!=la&&(this.shapeBackgroundColor=Fa,this.shapeForegroundColor=Aa,this.stylesheet=la,this.refresh());return xa};var B=Graph.pro... | cwe | CWE-20 | JavaScript |
_gnutls_x509_verify_certificate (const gnutls_x509_crt_t * certificate_list,
int clist_size,
const gnutls_x509_crt_t * trusted_cas,
int tcas_size,
const gnutls_x509_crl_t * CRLs,
int crls_size, unsigned int flags)
{
int i = 0, ret;
unsigned int status = 0, output;
if (clist_size > 1)
... | cwe | CWE-17 | C/C++ |
static int fuse_readpage(struct file *file, struct page *page)
{
struct inode *inode = page->mapping->host;
int err;
err = -EIO;
if (is_bad_inode(inode))
goto out;
err = fuse_do_readpage(file, page);
fuse_invalidate_atime(inode);
out:
unlock_page(page);
return err;
} | cwe | CWE-459 | Unknown |
def get_resource_agents_avail(session)
code, result = send_cluster_request_with_token(
session, params[:cluster], 'get_avail_resource_agents'
)
return {} if 200 != code
begin
ra = JSON.parse(result)
if (ra["noresponse"] == true) or (ra["notauthorized"] == "true") or (ra["notoken"] == true) or (ra["p... | cwe | CWE-384 | Ruby |
ExecCreateTableAs(CreateTableAsStmt *stmt, const char *queryString,
ParamListInfo params, QueryEnvironment *queryEnv,
char *completionTag)
{
Query *query = castNode(Query, stmt->query);
IntoClause *into = stmt->into;
bool is_matview = (into->viewQuery != NULL);
DestReceiver *dest;
Oid save_userid... | cwe | CWE-94 | Unknown |
// Copyright 2009 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... | cwe | CWE-89 | Java |
static void xen_netbk_tx_submit(struct xen_netbk *netbk)
{
struct gnttab_copy *gop = netbk->tx_copy_ops;
struct sk_buff *skb;
while ((skb = __skb_dequeue(&netbk->tx_queue)) != NULL) {
struct xen_netif_tx_request *txp;
struct xenvif *vif;
u16 pending_idx;
unsigned data_len;
pending_idx = *((u16 *)skb->dat... | cwe | CWE-399 | C/C++ |
function XMLRPCremoveNode($nodeID){
require_once(".ht-inc/privileges.php");
global $user;
if(!in_array("nodeAdmin", $user['privileges'])){
return array(
'status' => 'error',
'errorcode' => 56,
'errormsg' => 'User cannot administer nodes');
}
if(!checkUserH... | cwe | CWE-264 | PHP |
static int recv_stream(struct kiocb *iocb, struct socket *sock,
struct msghdr *m, size_t buf_len, int flags)
{
struct sock *sk = sock->sk;
struct tipc_port *tport = tipc_sk_port(sk);
struct sk_buff *buf;
struct tipc_msg *msg;
long timeout;
unsigned int sz;
int sz_to_copy, target, needed;
int sz_copied ... | cwe | CWE-200 | C/C++ |
/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
* Copyright (c) 2016 Facebook
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in th... | cwe | CWE-20 | C/C++ |
#include <config.h>
#include "ftpd.h"
#include "utils.h"
#ifdef WITH_DMALLOC
# include <dmalloc.h>
#endif
#ifdef HAVE_LIBSODIUM
# if !defined(pure_memzero) || !defined(pure_memcmp)
# error pure_memzero/pure_memcmp not defined
# endif
#else
void pure_memzero(void * const pnt, const size_t len)
{
# ifdef HAVE_EXPLI... | cwe | CWE-125 | C/C++ |
static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
{
VALUE source, opts;
GET_PARSER_INIT;
if (json->Vsource) {
rb_raise(rb_eTypeError, "already initialized instance");
}
#ifdef HAVE_RB_SCAN_ARGS_OPTIONAL_HASH
rb_scan_args(argc, argv, "1:", &source, &opts);
#else
rb_scan_... | cwe | CWE-20 | C/C++ |
int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t size, int flags)
{
struct sock *sk = sock->sk;
int err = 0;
size_t target, copied = 0;
long timeo;
if (flags & MSG_OOB)
return -EOPNOTSUPP;
msg->msg_namelen = 0;
BT_DBG("sk %p size %zu", sk, size);
... | cwe | CWE-20 | C/C++ |
void StorageHandler::SetRenderer(RenderProcessHost* process_host,
RenderFrameHostImpl* frame_host) {
process_ = process_host;
} | cwe | CWE-20 | C/C++ |
foreach($paths as $path)
{
// Convert wild-cards to RegEx
$path = str_replace(array(':any', '*'), '.*', str_replace(':num', '[0-9]+', $path));
// Does the RegEx match?
if (!empty($_SERVER['HTTP_HOST']) AND preg_match('#^'.$path.'$#', $_SERVER['HTTP_HOST']))
{
define('ENVIRONMENT', $env);
... | cwe | CWE-74 | PHP |
long Segment::ParseNext(const Cluster* pCurr, const Cluster*& pResult,
long long& pos, long& len) {
assert(pCurr);
assert(!pCurr->EOS());
assert(m_clusters);
pResult = 0;
if (pCurr->m_index >= 0) { // loaded (not merely preloaded)
assert(m_clusters[pCurr->m_index] == pCurr);
const long next_idx = pCur... | cwe | CWE-20 | C/C++ |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite/handler/pkce (interfaces: PKCERequestStorage)
// Package internal is a generated GoMock package.
package internal
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
fosite "github.com/ory/fosite"
)
// M... | cwe | CWE-345 | Go |
const {
setActions,
// queue: jobQueue,
// reportError,
_unstable_createJob,
_lazyJobsEnabled,
} = require(`./index`)
const { pathExists } = require(`fs-extra`)
const { slash } = require(`gatsby-core-utils/path`)
const { setPluginOptions } = require(`./plugin-options`)
const path = require(`path`)
function ... | cwe | CWE-22 | JavaScript |
void IOHandler::SetRenderer(RenderProcessHost* process_host,
RenderFrameHostImpl* frame_host) {
process_host_ = process_host;
} | cwe | CWE-20 | C/C++ |
SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size,
unsigned int, flags, struct sockaddr __user *, addr,
int __user *, addr_len)
{
struct socket *sock;
struct iovec iov;
struct msghdr msg;
struct sockaddr_storage address;
int err, err2;
int fput_needed;
if (size > INT_MAX)
size = INT_... | cwe | CWE-264 | C/C++ |
static CACHE_BITMAP_ORDER* update_read_cache_bitmap_order(rdpUpdate* update, wStream* s,
BOOL compressed, UINT16 flags)
{
CACHE_BITMAP_ORDER* cache_bitmap;
if (!update || !s)
return NULL;
cache_bitmap = calloc(1, sizeof(CACHE_BITMAP_ORDER));
if (!cache_... | cwe | CWE-125 | Unknown |
/*
* Copyright (c) 2004-2021, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
* list of cond... | cwe | CWE-918 | Java |
static int emsff_init(struct hid_device *hid)
{
struct emsff_device *emsff;
struct hid_report *report;
struct hid_input *hidinput = list_first_entry(&hid->inputs,
struct hid_input, list);
struct list_head *report_list =
&hid->report_enum[HID_OUTPUT_REPORT].report_list;
struct input_dev *dev = hidinput->in... | cwe | CWE-787 | C/C++ |
void fpm_children_bury() /* {{{ */
{
int status;
pid_t pid;
struct fpm_child_s *child;
while ( (pid = waitpid(-1, &status, WNOHANG | WUNTRACED)) > 0) {
char buf[128];
int severity = ZLOG_NOTICE;
int restart_child = 1;
child = fpm_child_find(pid);
if (WIFEXITED(status)) {
snprintf(buf, sizeof(buf), ... | cwe | CWE-787 | Unknown |
static ssize_t proc_pid_cmdline_read(struct file *file, char __user *buf,
size_t _count, loff_t *pos)
{
struct task_struct *tsk;
struct mm_struct *mm;
char *page;
unsigned long count = _count;
unsigned long arg_start, arg_end, env_start, env_end;
unsigned long len1, len2, len;
unsigned long p;
char c;
... | cwe | CWE-119 | Unknown |
decode_sequence(const uint8_t *asn1, size_t len, const struct seq_info *seq,
void *val)
{
krb5_error_code ret;
const uint8_t *contents;
size_t i, j, clen;
taginfo t;
assert(seq->n_fields > 0);
for (i = 0; i < seq->n_fields; i++) {
if (len == 0)
break;
... | cwe | CWE-674 | Unknown |
function selectRelativeTime() {
var quantityField = new Ext.form.TextField({
fieldLabel: 'Show the past',
width: 90,
allowBlank: false,
regex: /\d+/,
regexText: 'Please enter a number',
value: TimeRange.relativeStartQuantity
});
var unitField = new Ext.form.ComboBox({
fieldLabel: '',
... | cwe | CWE-707 | JavaScript |
public SshPublicKeyCredential(String userName, String passphrase, File keyFile) throws SVNException {
this.userName = userName;
this.passphrase = Scrambler.scramble(passphrase);
Random r = new Random();
StringBuilder buf = new StringBuilder();
... | cwe | CWE-255 | Java |
tiff12_print_page(gx_device_printer * pdev, gp_file * file)
{
gx_device_tiff *const tfdev = (gx_device_tiff *)pdev;
int code;
/* open the TIFF device */
if (gdev_prn_file_is_new(pdev)) {
tfdev->tif = tiff_from_filep(pdev, pdev->dname, file, tfdev->BigEndian, tfdev->UseBigTIFF);
if (!tfd... | cwe | CWE-787 | C/C++ |
struct clock_source *dce112_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 (dce112_clk_... | cwe | CWE-400 | Unknown |
int ber_write_octet_string_tag(wStream* s, int length)
{
ber_write_universal_tag(s, BER_TAG_OCTET_STRING, FALSE);
ber_write_length(s, length);
return 1 + _ber_skip_length(length);
} | cwe | CWE-476 | Unknown |
/* 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-190 | C/C++ |
xps_encode_font_char_imp(xps_font_t *font, int code)
{
byte *table;
/* no cmap selected: return identity */
if (font->cmapsubtable <= 0)
return code;
table = font->data + font->cmapsubtable;
switch (u16(table))
{
case 0: /* Apple standard 1-to-1 mapping. */
return table[co... | cwe | CWE-125 | Unknown |
package com.salesmanager.core.model.catalog.product.price;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* Transient entity used to display
* different price information in the catalogue
* @author Carl Samson
*
*/
public class FinalPrice implements Se... | cwe | CWE-79 | Java |
base_sock_create(struct net *net, struct socket *sock, int protocol, int kern)
{
struct sock *sk;
if (sock->type != SOCK_RAW)
return -ESOCKTNOSUPPORT;
sk = sk_alloc(net, PF_ISDN, GFP_KERNEL, &mISDN_proto, kern);
if (!sk)
return -ENOMEM;
sock_init_data(sock, sk);
sock->ops = &base_sock_ops;
sock->state = S... | cwe | CWE-862 | Unknown |
static void svm_clear_vintr(struct vcpu_svm *svm)
{
const u32 mask = V_TPR_MASK | V_GIF_ENABLE_MASK | V_GIF_MASK | V_INTR_MASKING_MASK;
svm_clr_intercept(svm, INTERCEPT_VINTR);
/* Drop int_ctl fields related to VINTR injection. */
svm->vmcb->control.int_ctl &= mask;
if (is_guest_mode(&svm->vcpu)) {
svm->vmcb01... | cwe | CWE-862 | Unknown |
bool GestureSequence::PinchUpdate(const TouchEvent& event,
const GesturePoint& point, Gestures* gestures) {
DCHECK(state_ == GS_PINCH);
float distance = points_[0].Distance(points_[1]);
if (abs(distance - pinch_distance_current_) < kMinimumPinchUpdateDistance) {
if (!points_[0].DidScroll(event, kMinimu... | cwe | CWE-20 | C/C++ |
/* Copyright 2020 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 | C/C++ |
compile_length_bag_node(BagNode* node, regex_t* reg)
{
int len;
int tlen;
if (node->type == BAG_OPTION)
return compile_length_option_node(node, reg);
if (NODE_BAG_BODY(node)) {
tlen = compile_length_tree(NODE_BAG_BODY(node), reg);
if (tlen < 0) return tlen;
}
else
tlen = 0;
switch (node... | cwe | CWE-125 | Unknown |
static int uvc_scan_chain_forward(struct uvc_video_chain *chain,
struct uvc_entity *entity, struct uvc_entity *prev)
{
struct uvc_entity *forward;
int found;
/* Forward scan */
forward = NULL;
found = 0;
while (1) {
forward = uvc_entity_by_reference(chain->dev, entity->id,
forward);
if (forward == NULL)... | cwe | CWE-269 | C/C++ |
TfLiteStatus NonMaxSuppressionMultiClassFastHelper(TfLiteContext* context,
TfLiteNode* node,
OpData* op_data,
const float* scores) {
const TfLiteTensor* input_box_en... | cwe | CWE-125 | C/C++ |
/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2002-2014 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
*
* OpenNMS(... | cwe | CWE-79 | Java |
public User getUser() {
return user;
} | cwe | CWE-200 | Java |
function XMLRPCremoveNode($nodeID){
require_once(".ht-inc/privileges.php");
global $user;
if(!in_array("nodeAdmin", $user['privileges'])){
return array(
'status' => 'error',
'errorcode' => 56,
'errormsg' => 'User cannot administer nodes');
}
if(!checkUserH... | cwe | CWE-20 | PHP |
static Jsi_RC NumberToFixedCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
char buf[100];
int prec = 0, skip = 0;
Jsi_Number num;
Jsi_Value *v;
ChkStringN(_this, funcPtr, v);
Jsi_Value *pa = Jsi_ValueArrayIndex(interp, args, skip);
if (pa ... | cwe | CWE-120 | C/C++ |
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator p... | cwe | CWE-732 | Java |
parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
guint32 str_tbl, guint8 *level,
guint8 *codepage_stag, guint8 *codepage_attr)
{
guint32 tvb_len = tvb_reported_length (tvb);
guint32 off = offset;
guint32 len;
guint str_len;
guint32 ent;
guin... | cwe | CWE-119 | Unknown |
soup_ntlm_response (const char *nonce,
const char *user,
guchar nt_hash[21],
guchar lm_hash[21],
const char *host,
const char *domain,
gboolean ntlmv2_session)
{
int offset;
gsize hlen, dlen, ulen;
guchar lm_resp[24], nt_resp[24];
char *user_conv, *host_conv, *doma... | cwe | CWE-125 | Unknown |
_setupPopup(string, index) {
if (this.initialized === true && this.allowCreation === true && this.popupCounter < this.popupLimit) {
let div = document.createElement("div");
div.id = "vis-configuration-popup";
div.className = "vis-configuration-popup";
div.innerHTML = string;
div.onclic... | cwe | CWE-79 | JavaScript |
gss_get_mic_iov(OM_uint32 *minor_status, gss_ctx_id_t context_handle,
gss_qop_t qop_req, gss_iov_buffer_desc *iov, int iov_count)
{
OM_uint32 status;
gss_union_ctx_id_t ctx;
gss_mechanism mech;
status = val_wrap_iov_args(minor_status, context_handle, 0, qop_req, NULL,
iov, iov_count);
i... | cwe | CWE-415 | C/C++ |
protected function parseChunkedRequest(Request $request)
{
$index = $request->get('qqpartindex');
$total = $request->get('qqtotalparts');
$uuid = $request->get('qquuid');
$orig = $request->get('qqfilename');
$last = ((int) $total - 1) === (int) $index;
return [$last,... | cwe | CWE-23 | PHP |
int amf_namf_comm_handle_n1_n2_message_transfer(
ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg)
{
int status;
amf_ue_t *amf_ue = NULL;
amf_sess_t *sess = NULL;
ogs_pkbuf_t *n1buf = NULL;
ogs_pkbuf_t *n2buf = NULL;
ogs_pkbuf_t *gmmbuf = NULL;
ogs_pkbuf_t *ngapbuf = NULL;
... | cwe | CWE-476 | C/C++ |
configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
const char *zname)
{
const cfg_obj_t *updatepolicy = NULL;
const cfg_listelt_t *element, *element2;
dns_ssutable_t *table = NULL;
isc_mem_t *mctx = dns_zone_getmctx(zone);
bool autoddns = false;
isc_result_t result;
(void)cfg_map_get(zconfig... | cwe | CWE-269 | C/C++ |
static unsigned char asn1_length_decode(struct asn1_ctx *ctx,
unsigned int *def,
unsigned int *len)
{
unsigned char ch, cnt;
if (!asn1_octet_decode(ctx, &ch))
return 0;
if (ch == 0x80)
*def = 0;
else {
*def = 1;
if (ch < 0x80)
*len = ch;
else {
cnt = ch & 0x7F;
*len = 0;
while (c... | cwe | CWE-119 | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.