code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
ProcXIChangeHierarchy(ClientPtr client) { xXIAnyHierarchyChangeInfo *any; size_t len; /* length of data remaining in request */ int rc = Success; int flags[MAXDEVICES] = { 0 }; REQUEST(xXIChangeHierarchyReq); REQUEST_AT_LEAST_SIZE(xXIChangeHierarchyReq); if (!stuff->num_changes) ...
cwe
CWE-191
Unknown
int vnc_hextile_send_framebuffer_update(VncState *vs, int x, int y, int w, int h) { int i, j; int has_fg, has_bg; uint8_t *last_fg, *last_bg; VncDisplay *vd = vs->vd; last_fg = (uint8_t *) g_malloc(vd->server->pf.bytes_per_pixel); last_bg = (uint8_t *) g_...
cwe
CWE-125
Unknown
static int do_mount(const char *mnt, char **typep, mode_t rootmode, int fd, const char *opts, const char *dev, char **sourcep, char **mnt_optsp) { int res; int flags = MS_NOSUID | MS_NODEV; char *optbuf; char *mnt_opts = NULL; const char *s; char *d; char *fsname = NULL; char *subtype = NULL; char ...
cwe
CWE-269
Unknown
"""Admin API v2 viewsets.""" from django.utils.translation import ugettext as _ from django.contrib.contenttypes.models import ContentType from django_filters import rest_framework as dj_filters from drf_spectacular.utils import extend_schema, extend_schema_view from rest_framework import ( filters, mixins, pars...
cwe
CWE-305
Python
process_secondary_order(STREAM s) { /* The length isn't calculated correctly by the server. * For very compact orders the length becomes negative * so a signed integer must be used. */ uint16 length; uint16 flags; uint8 type; uint8 *next_order; in_uint16_le(s, length); in_uint16_le(s, flags); /* used ...
cwe
CWE-119
C/C++
# -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe, json, math from frappe.model.document import Document from frappe import _ from frappe.utils import cstr from frappe.data_migration...
cwe
CWE-79
Python
void __init pt_regs_check(void) { BUILD_BUG_ON(offsetof(struct pt_regs, gpr) != offsetof(struct user_pt_regs, gpr)); BUILD_BUG_ON(offsetof(struct pt_regs, nip) != offsetof(struct user_pt_regs, nip)); BUILD_BUG_ON(offsetof(struct pt_regs, msr) != offsetof(struct user_pt_regs, msr)); BUILD_BUG_ON...
cwe
CWE-120
Unknown
/* * jdlossls.c * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1998, Thomas G. Lane. * Lossless JPEG Modifications: * Copyright (C) 1999, Ken Murchison. * libjpeg-turbo Modifications: * Copyright (C) 2022, D. R. Commander. * For conditions of distribution and use, see the acco...
cwe
CWE-787
C/C++
/* ** 2005 February 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ********************...
cwe
CWE-674
C/C++
static int resolveExprStep(Walker *pWalker, Expr *pExpr){ NameContext *pNC; Parse *pParse; pNC = pWalker->u.pNC; assert( pNC!=0 ); pParse = pNC->pParse; assert( pParse==pWalker->pParse ); #ifndef NDEBUG if( pNC->pSrcList && pNC->pSrcList->nAlloc>0 ){ SrcList *pSrcList = pNC->pSrcList; int i; ...
cwe
CWE-416
Unknown
ippSetValueTag( ipp_t *ipp, /* I - IPP message */ ipp_attribute_t **attr, /* IO - IPP attribute */ ipp_tag_t value_tag) /* I - Value tag */ { int i; /* Looping var */ _ipp_value_t *value; /* Current value */ int integer; /* Current integer value */ cups_lang_t *language; ...
cwe
CWE-120
Unknown
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-119
C/C++
"top center";ea.style.backgroundRepeat="no-repeat";ea.setAttribute("title","Minimize");var ha=!1,ma=mxUtils.bind(this,function(){T.innerHTML="";if(!ha){var aa=function(la,qa,ta){la=C("",la.funct,null,qa,la,ta);la.style.width="40px";la.style.opacity="0.7";return ca(la,null,"pointer")},ca=function(la,qa,ta){null!=qa&&la....
cwe
CWE-94
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-59
C/C++
/* * Copyright (C) the libgit2 contributors. All rights reserved. * * This file is part of libgit2, distributed under the GNU GPL v2 with * a Linking Exception. For full terms see the included COPYING file. */ #ifndef GIT_WINHTTP #include "git2.h" #include "http_parser.h" #include "buffer.h" #include "netops.h" #...
cwe
CWE-284
C/C++
{% load i18n %} {% load inventree_extras %} /* globals createNewModal, inventreeFormDataUpload, inventreeGet, inventreePut, modalEnable, modalShowSubmitButton, renderBuild, renderCompany, renderManufacturerPart, renderOwner, renderPart, renderPartCategory, renderPart...
cwe
CWE-79
Python
// Copyright 2014 Manu Martinez-Almeida. All rights reserved. // Use of this source code is governed by a MIT style // license that can be found in the LICENSE file. package gin import ( "fmt" "io" "net/http" "os" "time" "github.com/mattn/go-isatty" ) type consoleColorModeValue int const ( autoColor consol...
cwe
CWE-116
Go
package providers import ( "context" "fmt" "net/url" "strconv" "strings" "time" "github.com/oauth2-proxy/oauth2-proxy/v7/pkg/apis/sessions" "github.com/oauth2-proxy/oauth2-proxy/v7/pkg/logger" "github.com/oauth2-proxy/oauth2-proxy/v7/pkg/requests" "golang.org/x/oauth2" ) // GitLabProvider represents a GitL...
cwe
CWE-863
Go
package com.salesmanager.shop.admin.model.web; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; public class Menu implements Serializable { /** * */ private static final long serialVersionUID = 1L; private String code; ...
cwe
CWE-639
Java
static int hmac_create(struct crypto_template *tmpl, struct rtattr **tb) { struct shash_instance *inst; struct crypto_alg *alg; struct shash_alg *salg; int err; int ds; int ss; err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_SHASH); if (err) return err; salg = shash_attr_alg(tb[1], 0, 0); if (IS_ERR(sa...
cwe
CWE-787
C/C++
ProcXResQueryResourceBytes (ClientPtr client) { REQUEST(xXResQueryResourceBytesReq); int rc; ConstructResourceBytesCtx ctx; REQUEST_AT_LEAST_SIZE(xXResQueryResourceBytesReq); REQUEST_FIXED_SIZE(xXResQueryResourceBytesReq, stuff->numSpecs * si...
cwe
CWE-20
C/C++
void WT_VoiceFilter (S_FILTER_CONTROL *pFilter, S_WT_INT_FRAME *pWTIntFrame) { EAS_PCM *pAudioBuffer; EAS_I32 k; EAS_I32 b1; EAS_I32 b2; EAS_I32 z1; EAS_I32 z2; EAS_I32 acc0; EAS_I32 acc1; EAS_I32 numSamples; /* initialize some local variables */ numSamples = pWTIntFrame...
cwe
CWE-119
C/C++
vips_foreign_load_gif_scan_image( VipsForeignLoadGif *gif ) { VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( gif ); GifFileType *file = gif->file; ColorMapObject *map = file->Image.ColorMap ? file->Image.ColorMap : file->SColorMap; GifByteType *extension; if( DGifGetImageDesc( gif->file ) == GIF_ERROR...
cwe
CWE-416
C/C++
/* * DIPlib 3.0 * This file contains definitions for JPEG reading and writing * * (c)2019, Cris Luengo. * Based on original DIPlib code: (c)1995-2014, Delft University of Technology. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the Lic...
cwe
CWE-415
C/C++
static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception) { char filename[MagickPathExtent]; const char *option; FILE *file; Image *image, *next; int status, unique_file; ssize_t n; SVGInfo *svg_info; unsigned char message[MagickPathE...
cwe
CWE-476
C/C++
internals.Traceroute.trace = function (host, callback) { Dns.lookup(host.toUpperCase(), (err) => { if (err && Net.isIP(host) === 0) { return callback(new Error('Invalid host')); } const command = (internals.isWin ? 'tracert -d ' : 'traceroute -q 1 -n ') + host; Child....
cwe
CWE-74
JavaScript
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre, Romain Bouqueau, Cyril Concolato * Copyright (c) Telecom ParisTech 2000-2021 * All rights reserved * * This file is part of GPAC / Media Tools sub-project * * GPAC is free software; you can redistribute it and/or modify * it unde...
cwe
CWE-190
C/C++
/* Copyright (C) 2000-2012 by George Williams */ /* * 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 conditions and the following...
cwe
CWE-119
C/C++
computedMember: function (left, right) { return left + "[" + right + "]"; },
cwe
CWE-94
JavaScript
pci_emul_mem_handler(struct vmctx *ctx, int vcpu, int dir, uint64_t addr, int size, uint64_t *val, void *arg1, long arg2) { struct pci_vdev *pdi = arg1; struct pci_vdev_ops *ops = pdi->dev_ops; uint64_t offset; int bidx = (int) arg2; assert(bidx <= PCI_BARMAX); assert(pdi->bar[bidx].type == PCIBAR_MEM32 |...
cwe
CWE-617
C/C++
package com.salesmanager.shop.admin.controller.tax; import com.salesmanager.core.business.services.tax.TaxService; import com.salesmanager.core.model.merchant.MerchantStore; import com.salesmanager.core.model.tax.TaxConfiguration; import com.salesmanager.shop.admin.model.web.Menu; import com.salesmanager.shop.constant...
cwe
CWE-79
Java
static void parse_rtcp_report( pjmedia_rtcp_session *sess, const void *pkt, pj_size_t size) { pjmedia_rtcp_common *common = (pjmedia_rtcp_common*) pkt; const pjmedia_rtcp_rr *rr = NULL; const pjmedia_rtcp_sr *sr = NULL; pj_uint32_t last_loss, jitter_samp, jitter; /* Parse RTCP *...
cwe
CWE-125
Unknown
ScanLineInputFile::ScanLineInputFile(InputPartData* part) { if (part->header.type() != SCANLINEIMAGE) throw IEX_NAMESPACE::ArgExc("Can't build a ScanLineInputFile from a type-mismatched part."); _data = new Data(part->numThreads); _streamData = part->mutex; _data->memoryMapped = _streamData->is...
cwe
CWE-125
Unknown
/* 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
Python
int ssl3_write_bytes(SSL *s, int type, const void *buf_, int len) { const unsigned char *buf = buf_; int tot; unsigned int n, split_send_fragment, maxpipes; #if !defined(OPENSSL_NO_MULTIBLOCK) && EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK unsigned int max_send_fragment, nw; unsigned int u_len = (unsigned int)l...
cwe
CWE-20
Unknown
void Compute(OpKernelContext* context) override { const Tensor& splits = context->input(0); const Tensor& values = context->input(1); const Tensor& weights = context->input(2); bool use_weights = weights.NumElements() > 0; bool is_1d = false; const auto splits_values = splits.flat<int64>(); ...
cwe
CWE-703
Unknown
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "mojo/core/handle_table.h" #include <stdint.h> #include <limits> #include "base/trace_event/memory_dump_manager.h" namespace mojo { namespace...
cwe
CWE-190
C/C++
int __init ip_rt_init(void) { int cpu; ip_idents = kmalloc_array(IP_IDENTS_SZ, sizeof(*ip_idents), GFP_KERNEL); if (!ip_idents) panic("IP: failed to allocate ip_idents\n"); prandom_bytes(ip_idents, IP_IDENTS_SZ * sizeof(*ip_idents)); ip_tstamps = kcalloc(IP_IDENTS_SZ, sizeof(*ip_tstamps), GFP_KERNEL); ...
cwe
CWE-327
Unknown
struct bpf_map *bpf_map_get_with_uref(u32 ufd) { struct fd f = fdget(ufd); struct bpf_map *map; map = __bpf_map_get(f); if (IS_ERR(map)) return map; bpf_map_inc(map, true); fdput(f); return map; }
cwe
CWE-703
Unknown
static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *limit, int *al) { unsigned short type; unsigned short size; unsigned short len; unsigned char *data = *p; int renegotiate_seen = 0; s->servername_done = 0; s->tlsext_statu...
cwe
CWE-190
Unknown
function display_error_block() { if (!empty($_SESSION['error_msg'])) { echo ' <div> <script type="text/javascript"> $(function() { $( "#dialog:ui-dialog" ).dialog( "destroy" ); $( "#dialog-message" ).dialog({ ...
cwe
CWE-352
PHP
package eu.hinsch.spring.boot.actuator.logview; import freemarker.template.Configuration; import freemarker.template.TemplateException; import org.apache.commons.io.IOUtils; import org.springframework.boot.actuate.endpoint.Endpoint; import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint; import org.springfra...
cwe
CWE-22
Java
void SandboxIPCHandler::HandleLocaltime( int fd, base::PickleIterator iter, const std::vector<base::ScopedFD>& fds) { std::string time_string; if (!iter.ReadString(&time_string) || time_string.size() != sizeof(time_t)) return; time_t time; memcpy(&time, time_string.data(), sizeof(tim...
cwe
CWE-119
C/C++
add_header_value(VALUE hh, const char *key, int klen, const char *val, int vlen) { if (sizeof(content_type) - 1 == klen && 0 == strncasecmp(key, content_type, sizeof(content_type) - 1)) { rb_hash_aset(hh, content_type_val, rb_str_new(val, vlen)); } else if (sizeof(content_length) - 1 == klen && 0 == strncasecm...
cwe
CWE-444
Unknown
void JavascriptArray::SliceHelper(JavascriptArray* pArr, JavascriptArray* pnewArr, uint32 start, uint32 newLen) { SparseArraySegment<T>* headSeg = (SparseArraySegment<T>*)pArr->head; SparseArraySegment<T>* pnewHeadSeg = (SparseArraySegment<T>*)pnewArr->head; // Fill the newly created slice...
cwe
CWE-200
C/C++
static int __ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) { struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr; struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct in6_addr *daddr, *final_p, final; struct dst_entry *dst; struct flowi6 fl6; str...
cwe
CWE-416
Unknown
char **XListExtensions( register Display *dpy, int *nextensions) /* RETURN */ { xListExtensionsReply rep; char **list = NULL; char *ch = NULL; char *chend; int count = 0; register unsigned i; register int length; _X_UNUSED register xReq *req; unsigned long rlen = 0; LockDisplay(dpy); GetEmptyReq (Li...
cwe
CWE-193
C/C++
bgp_capability_as4 (struct peer *peer, struct capability_header *hdr) { as_t as4 = stream_getl (BGP_INPUT(peer)); if (BGP_DEBUG (as4, AS4)) zlog_debug ("%s [AS4] about to set cap PEER_CAP_AS4_RCV, got as4 %u", peer->host, as4); SET_FLAG (peer->cap, PEER_CAP_AS4_RCV); return as4; }
cwe
CWE-119
Unknown
def self.normalize_key_names(options) options = options.dup if options.key?(:key_prefix) && !options.key?(:namespace) options[:namespace] = options.delete(:key_prefix) # RailsSessionStore end options[:raw] = !options[:marshalling] options end
cwe
CWE-502
Ruby
static int kvm_vm_ioctl_create_vcpu(struct kvm *kvm, u32 id) { int r; struct kvm_vcpu *vcpu, *v; vcpu = kvm_arch_vcpu_create(kvm, id); if (IS_ERR(vcpu)) return PTR_ERR(vcpu); preempt_notifier_init(&vcpu->preempt_notifier, &kvm_preempt_ops); r = kvm_arch_vcpu_setup(vcpu); if (r) goto vcpu_destroy; mut...
cwe
CWE-399
C/C++
/* * * 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++
void AudioOutputSpeech::addFrameToBuffer(const QByteArray &qbaPacket, unsigned int iSeq) { QMutexLocker lock(&qmJitter); if (qbaPacket.size() < 2) return; PacketDataStream pds(qbaPacket); // skip flags pds.next(); int samples = 0; if (umtType == MessageHandler::UDPVoiceOpus) { int size; pds >> size; ...
cwe
CWE-119
Unknown
Literal *hermes::evalUnaryOperator( UnaryOperatorInst::OpKind kind, IRBuilder &builder, Literal *operand) { switch (kind) { case UnaryOperatorInst::OpKind::MinusKind: // Negate constant integers. switch (operand->getKind()) { case ValueKind::LiteralNumberKind: if (auto *l...
cwe
CWE-843
C/C++
/* eslint-env browser, jquery */ /* eslint no-console: ["error", { allow: ["warn", "error"] }] */ /* global moment, serverurl */ import Prism from 'prismjs' import hljs from 'highlight.js' import PDFObject from 'pdfobject' import S from 'string' import { saveAs } from 'file-saver' import escapeHTML from 'escape-html' ...
cwe
CWE-79
JavaScript
// Package nanoauth provides a uniform means of serving HTTP/S for golang // projects securely. It allows the specification of a certificate (or // generates one) as well as an auth token which is checked before the request // is processed. package nanoauth import ( "crypto/tls" "net" "net/http" ) // Auth is a str...
cwe
CWE-287
Go
validate_as_request(kdc_realm_t *kdc_active_realm, register krb5_kdc_req *request, krb5_db_entry client, krb5_db_entry server, krb5_timestamp kdc_time, const char **status, krb5_pa_data ***e_data) { int errcode; krb5_error_code ret; /* * If a...
cwe
CWE-476
C/C++
function getFestivalCmdWithArgs(fields) { var text = fields.textToSpeech, language = fields.language, cmd = 'echo "' + text + '" | festival' + ' --tts --heap 1000000 --language ' + language; return cmd; }
cwe
CWE-78
JavaScript
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
cwe
CWE-476
Python
function(q){q&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));c.init()};var l=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(c){var e=l.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(g){this.editor.graph.isSelectionEmp...
cwe
CWE-20
JavaScript
static MagickBooleanType sRGBTransformImage(Image *image, const ColorspaceType colorspace,ExceptionInfo *exception) { #define sRGBTransformImageTag "RGBTransform/Image" CacheView *image_view; MagickBooleanType status; MagickOffsetType progress; PrimaryInfo primary_info; ssize_t i; ...
cwe
CWE-369
C/C++
RectangleRequest(const struct RectangleRequest &req) : Explicit() { // Not nice, but this is really faster and simpler memcpy(this,&req,sizeof(struct RectangleRequest)); // Not linked in any way if this is new. rr_pNext = NULL; }
cwe
CWE-617
C/C++
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteLocalResponseNormParams*>(node->builtin_data); const TfLiteTensor* input = GetInput(context, node, kInputTensor); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); if (output->type == kTfLit...
cwe
CWE-125
C/C++
crypto_recv( struct peer *peer, /* peer structure pointer */ struct recvbuf *rbufp /* packet buffer pointer */ ) { const EVP_MD *dp; /* message digest algorithm */ u_int32 *pkt; /* receive packet pointer */ struct autokey *ap, *bp; /* autokey pointer */ struct exten *ep, *fp; /* extension pointers */ struct ce...
cwe
CWE-20
C/C++
/* sort - sort lines of text (with all kinds of options). Copyright (C) 1988-2014 Free Software Foundation, Inc. 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 3 of the Li...
cwe
CWE-787
C/C++
static int hashtable_do_del(hashtable_t *hashtable, const char *key, size_t hash) { pair_t *pair; bucket_t *bucket; size_t index; index = hash % num_buckets(hashtable); bucket = &hashtable->buckets[index]; pair = hashtable_find_pair(hashtable, bucket, key, hash); ...
cwe
CWE-310
Unknown
xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr inst) { /* * URGENT TODO: Normally inst->psvi Should never be reserved here, * BUT: since if we include the same stylesheet from * multiple imports, then the stylesheet will be parsed * again. We simply must not try to compute the stylesh...
cwe
CWE-119
C/C++
connect_to_server (CamelService *service, GCancellable *cancellable, GError **error) { CamelSmtpTransport *transport = CAMEL_SMTP_TRANSPORT (service); CamelNetworkSettings *network_settings; CamelNetworkSecurityMethod method; CamelSettings *settings; CamelStream *stream, *ostr...
cwe
CWE-74
Unknown
mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var a=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(a=mxUtils.htmlEntities(a,!1));a=mxUtils.replaceTrailingNewlines(a,"<div><br></div>");a=this.replaceLinefeeds?a.replace(/\n/g...
cwe
CWE-94
JavaScript
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2012 * All rights reserved * * This file is part of GPAC / FFMPEG module * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public...
cwe
CWE-119
C/C++
void PaymentRequest::NoUpdatedPaymentDetails() { spec_->RecomputeSpecForDetails(); }
cwe
CWE-189
C/C++
static CACHE_BRUSH_ORDER* update_read_cache_brush_order(rdpUpdate* update, wStream* s, UINT16 flags) { int i; BYTE iBitmapFormat; BOOL compressed = FALSE; CACHE_BRUSH_ORDER* cache_brush = calloc(1, sizeof(CACHE_BRUSH_ORDER)); if (!cache_brush) goto fail; if (Stream_GetRemainingLength(s) < 6) goto fail; St...
cwe
CWE-125
C/C++
void JTL::send( Session* session, int resolution, int tile ){ Timer function_timer; if( session->loglevel >= 3 ) (*session->logfile) << "JTL handler reached" << endl; // Make sure we have set our image this->session = session; checkImage(); // Time this command if( session->loglevel >= 2 ) command_t...
cwe
CWE-190
Unknown
if(null!=P&&null!=P.originalSrc)if(!G)P={src:P.originalSrc};else if(G&&null!=this.themes&&"darkTheme"==this.defaultThemeName){var K=this.stylesheet,F=this.shapeForegroundColor,H=this.shapeBackgroundColor;this.stylesheet=this.getDefaultStylesheet();this.shapeBackgroundColor="#ffffff";this.shapeForegroundColor="#000000";...
cwe
CWE-20
JavaScript
mxUtils.extend(Ka,mxActor);Ka.prototype.dx=20;Ka.prototype.dy=20;Ka.prototype.redrawPath=function(c,l,x,p,v){l=Math.max(0,Math.min(p,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));x=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this....
cwe
CWE-20
JavaScript
v9fs_vfs_getattr_dotl(const struct path *path, struct kstat *stat, u32 request_mask, unsigned int flags) { struct dentry *dentry = path->dentry; struct v9fs_session_info *v9ses; struct p9_fid *fid; struct p9_stat_dotl *st; p9_debug(P9_DEBUG_VFS, "dentry: %p\n", dentry); v9ses = v9fs_dentry2v9ses(dentry); if ...
cwe
CWE-835
Unknown
static void l2cap_conf_rfc_get(struct l2cap_chan *chan, void *rsp, int len) { int type, olen; unsigned long val; /* Use sane default values in case a misbehaving remote device * did not send an RFC or extended window size option. */ u16 txwin_ext = chan->ack_win; struct l2cap_conf_rfc rfc = { .mode = chan->m...
cwe
CWE-125
Unknown
static char* cJSON_strdup( const char* str ) { size_t len; char* copy; len = strlen( str ) + 1; if ( ! ( copy = (char*) cJSON_malloc( len ) ) ) return 0; memcpy( copy, str, len ); return copy; }
cwe
CWE-120
C/C++
static void drop_futex_key_refs(union futex_key *key) { if (!key->both.ptr) { /* If we're here then we tried to put a key we failed to get */ WARN_ON_ONCE(1); return; } if (!IS_ENABLED(CONFIG_MMU)) return; switch (key->both.offset & (FUT_OFF_INODE|FUT_OFF_MMSHARED)) { case FUT_OFF_INODE: iput(key->shar...
cwe
CWE-416
Unknown
# -*- coding: utf-8 -*- # rdiffweb, A web interface to rdiff-backup repositories # Copyright (C) 2012-2021 rdiffweb contributors # # 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 ...
cwe
CWE-755
Python
lldp_decode(struct lldpd *cfg, char *frame, int s, struct lldpd_hardware *hardware, struct lldpd_chassis **newchassis, struct lldpd_port **newport) { struct lldpd_chassis *chassis; struct lldpd_port *port; const char lldpaddr[] = LLDP_MULTICAST_ADDR; const char dot1[] = LLDP_TLV_ORG_DOT1; const char dot3[]...
cwe
CWE-617
Unknown
static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf, size_t count, loff_t *pos) { struct ib_uverbs_file *file = filp->private_data; struct ib_device *ib_dev; struct ib_uverbs_cmd_hdr hdr; __u32 command; __u32 flags; int srcu_key; ssize_t ret; if (count < sizeof hdr) return -...
cwe
CWE-264
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-352
Java
WORD32 impeg2d_get_slice_pos(dec_state_multi_core_t *ps_dec_state_multi_core) { WORD32 u4_bits; WORD32 i4_row; dec_state_t *ps_dec = ps_dec_state_multi_core->ps_dec_state[0]; WORD32 i4_prev_row; stream_t s_bitstrm; WORD32 i4_start_row; WORD32 i4_slice_bistream_ofst; WORD32 i; s_bitstrm =...
cwe
CWE-119
C/C++
Gfx::Gfx(XRef *xrefA, OutputDev *outA, Dict *resDict, Catalog *catalogA, PDFRectangle *box, PDFRectangle *cropBox, GBool (*abortCheckCbkA)(void *data), void *abortCheckCbkDataA) #ifdef USE_CMS : iccColorSpaceCache(5) #endif { int i; xref = xrefA; catalog = catalogA; subPage = gTrue; printCommands = g...
cwe
CWE-476
C/C++
cdf_unpack_summary_info(const cdf_stream_t *sst, const cdf_header_t *h, cdf_summary_info_header_t *ssi, cdf_property_info_t **info, size_t *count) { size_t i, maxcount; const cdf_summary_info_header_t *si = CAST(const cdf_summary_info_header_t *, sst->sst_tab); const cdf_section_declaration_t *sd = CAS...
cwe
CWE-399
C/C++
static void wdm_in_callback(struct urb *urb) { struct wdm_device *desc = urb->context; int status = urb->status; spin_lock(&desc->iuspin); clear_bit(WDM_RESPONDING, &desc->flags); if (status) { switch (status) { case -ENOENT: dev_dbg(&desc->intf->dev, "nonzero urb status received: -ENOENT"); ...
cwe
CWE-119
C/C++
grep (int fd, char const *file, struct stats *stats) { int nlines, i; int not_text; size_t residue, save; char oldc; char *beg; char *lim; char eol = eolbyte; if (!reset (fd, file, stats)) return 0; if (file && directories == RECURSE_DIRECTORIES && S_ISDIR (stats->stat.st_mode)) { ...
cwe
CWE-189
Unknown
static int dbConnect(char *host, char *user, char *passwd) { DBUG_ENTER("dbConnect"); if (verbose) { fprintf(stderr, "# Connecting to %s...\n", host ? host : "localhost"); } mysql_init(&mysql_connection); if (opt_compress) mysql_options(&mysql_connection, MYSQL_OPT_COMPRESS, NullS); #ifdef HAVE_OPEN...
cwe
CWE-319
Unknown
void AppControllerImpl::GetApps( mojom::AppController::GetAppsCallback callback) { std::vector<chromeos::kiosk_next_home::mojom::AppPtr> app_list; app_service_proxy_->AppRegistryCache().ForEachApp( [this, &app_list](const apps::AppUpdate& update) { app_list.push_back(CreateAppPtr(update)); ...
cwe
CWE-416
C/C++
read_layer_block (PSDimage *img_a, FILE *f, GError **error) { PSDlayer **lyr_a; guint32 block_len; guint32 block_end; guint32 block_rem; gint32 read_len; gint32 write_len; gint lidx; /* Layer index */ gint cidx; ...
cwe
CWE-190
Unknown
/* * Copyright (c) 2008-2017 Nicira, 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...
cwe
CWE-20
C/C++
xfs_da3_fixhashpath( struct xfs_da_state *state, struct xfs_da_state_path *path) { struct xfs_da_state_blk *blk; struct xfs_da_intnode *node; struct xfs_da_node_entry *btree; xfs_dahash_t lasthash=0; int level; int count; struct xfs_inode *dp = state->args->dp; trace_xfs_da_fixhashpath(state->args); l...
cwe
CWE-399
C/C++
/** * OLAT - Online Learning and Training<br> * http://www.olat.org * <p> * Licensed under the Apache License, Version 2.0 (the "License"); <br> * you may not use this file except in compliance with the License.<br> * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unl...
cwe
CWE-22
Java
/* 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-369
Python
void sandboxfs(int op, pid_t pid, const char *path1, const char *path2) { EUID_ASSERT(); assert(path1); // in case the pid is that of a firejail process, use the pid of the first child process pid = switch_to_child(pid); // exit if no permission to join the sandbox check_join_permission(pid); // expand paths ...
cwe
CWE-269
Unknown
void HTMLMediaElement::ProgressEventTimerFired(TimerBase*) { if (network_state_ != kNetworkLoading) return; double time = WTF::CurrentTime(); double timedelta = time - previous_progress_time_; if (GetWebMediaPlayer() && GetWebMediaPlayer()->DidLoadingProgress()) { ScheduleEvent(EventTypeNames::p...
cwe
CWE-200
C/C++
cmdline_insert_reg(int *gotesc UNUSED) { int i; int c; #ifdef USE_ON_FLY_SCROLL dont_scroll = TRUE; // disallow scrolling here #endif putcmdline('"', TRUE); ++no_mapping; ++allow_keys; i = c = plain_vgetc(); // CTRL-R <char> if (i == Ctrl_O) i = Ctrl_R; // CTRL-R CTRL-O == CTRL-R CT...
cwe
CWE-787
C/C++
int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_key *key, struct btrfs_path *p, int ins_len, int cow) { struct extent_buffer *b; int slot; int ret; int err; int level; int lowest_unlock = 1; int root_lock; /* everything at write_lock_level or lower m...
cwe
CWE-362
C/C++
#include "jsi.h" #include "jsvalue.h" #include "jsbuiltin.h" static void jsB_new_Object(js_State *J) { if (js_isundefined(J, 1) || js_isnull(J, 1)) js_newobject(J); else js_pushobject(J, js_toobject(J, 1)); } static void jsB_Object(js_State *J) { if (js_isundefined(J, 1) || js_isnull(J, 1)) js_newobject(J); ...
cwe
CWE-119
C/C++
def get(self, path: str) -> None: parts = path.split("/") component_name = parts[0] component_root = self._registry.get_component_path(component_name) if component_root is None: self.write("not found") self.set_status(404) return filename = "/...
cwe
CWE-22
Python