code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
private void displayVerificationWarningDialog(final Contact contact, final Invite invite) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.verify_omemo_keys); View view = getLayoutInflater().inflate(R.layout.dialog_verify_fingerprints, null); final CheckBox isTrustedSourc...
cwe
CWE-200
Java
mxCellRenderer.prototype.destroy=function(u){D.apply(this,arguments);null!=u.secondLabel&&(u.secondLabel.destroy(),u.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(u){return[u.shape,u.text,u.secondLabel,u.control]};var G=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValid...
cwe
CWE-20
JavaScript
// 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-863
Go
gdk_pixbuf__jpeg_image_load_increment (gpointer data, const guchar *buf, guint size, GError **error) { JpegProgContext *context = (JpegProgContext *)data; struct jpeg_decompress_struct *cinfo; my_src_ptr src; guint ...
cwe
CWE-787
C/C++
Ra=document.createElement("div");Ra.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgLoading";var Qa=document.createElement("img");Qa.style.display="none";(function(Ma,Ta,Ua){Qa.onload=function(){Ta.className="geTempDlgDiagramTileImg";Ma.style.display=""};Qa.onerror=function(){this.src!=Ua?this.src=Ua:Ta.class...
cwe
CWE-20
JavaScript
static int sc_open_snapd_tool(const char *tool_name) { // +1 is for the case where the link is exactly PATH_MAX long but we also // want to store the terminating '\0'. The readlink system call doesn't add // terminating null, but our initialization of buf handles this for us. char buf[PATH_MAX + 1] = { 0 }; if (re...
cwe
CWE-94
Unknown
static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, s64 change, struct gfs2_quota_data *qd, struct fs_disk_quota *fdq) { struct inode *inode = &ip->i_inode; struct address_space *mapping = inode->i_mapping; unsigned long index = loc >> PAGE_CACHE_SHIFT; unsigned offset = loc & (PAGE_CACH...
cwe
CWE-399
Unknown
static void query_remove_all(IRC_CHANNEL_REC *channel) { SERVER_QUERY_REC *rec; int n; rec = channel->server->chanqueries; /* remove channel from query lists */ for (n = 0; n < CHANNEL_QUERIES; n++) rec->queries[n] = g_slist_remove(rec->queries[n], channel); rec->current_queries = g_slist_remove(rec->current_...
cwe
CWE-416
Unknown
krb5_init_creds_step(krb5_context context, krb5_init_creds_context ctx, krb5_data *in, krb5_data *out, krb5_krbhst_info *hostinfo, unsigned int *flags) { krb5_error_code ret; size_t len = 0; size_t size; AS_REQ req2; krb5_data_zero(out); if (ctx->as_req.req_b...
cwe
CWE-320
C/C++
int ASN1_item_ex_i2d(const ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass) { const ASN1_TEMPLATE *tt = NULL; int i, seqcontlen, seqlen, ndef = 1; const ASN1_EXTERN_FUNCS *ef; const ASN1_AUX *aux = it->funcs; ASN1_aux_const_cb *asn1_cb = NULL; ...
cwe
CWE-476
Unknown
app.get('/api/search', function (req, res) { // WARNING: this API pattern should be revisited and potentially rewritten as its probably bad! var zip = req.query.zip, last_name = req.query.last_name, where = ''; if (zip) where += "provider_business_practice_location_address_postal_code = '" + zip + "' ...
cwe
CWE-89
JavaScript
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input = GetInput(context, node, kInputTensor); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); if (input->type != kTfLiteFloat32) { TF_LITE_UNSUPPORTED_TYPE(context, input->type, "Ceil"); } optimized_ops::Ce...
cwe
CWE-787
C/C++
// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2007-2009 Patrick McHardy <kaber@trash.net> * * Development of this code funded by Astaro AG (http://www.astaro.com/) */ #include <linux/module.h> #include <linux/init.h> #include <linux/list.h> #include <linux/skbuff.h> #include <linux/netlink.h> #includ...
cwe
CWE-476
C/C++
int ptrace_setxregs(struct task_struct *child, void __user *uregs) { struct thread_info *ti = task_thread_info(child); struct pt_regs *regs = task_pt_regs(child); elf_xtregs_t *xtregs = uregs; int ret = 0; #if XTENSA_HAVE_COPROCESSORS /* Flush all coprocessors before we overwrite them. */ coprocessor_flush...
cwe
CWE-20
C/C++
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 2); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const auto* params = reinterpret_cast<const TfLiteGatherParams*>(node->builtin_data); const TfLiteTensor* input = GetInput(context, node, kInpu...
cwe
CWE-125
C/C++
DefineSequence(ParseState *pstate, CreateSeqStmt *seq) { FormData_pg_sequence seqform; FormData_pg_sequence_data seqdataform; bool need_seq_rewrite; List *owned_by; CreateStmt *stmt = makeNode(CreateStmt); Oid seqoid; ObjectAddress address; Relation rel; HeapTuple tuple; TupleDesc tupDesc; Datum value...
cwe
CWE-94
Unknown
package io.onedev.server.web; import org.apache.wicket.core.request.mapper.ResourceMapper; import org.apache.wicket.markup.html.pages.BrowserInfoPage; import org.apache.wicket.protocol.http.WebApplication; import org.apache.wicket.request.IRequestMapper; import org.apache.wicket.request.mapper.CompoundRequestMapper; ...
cwe
CWE-502
Java
F.substring(0,11)){var J=F.indexOf(",");0<J&&(F=F.substring(0,J)+";base64,"+F.substring(J+1))}c(F,null,0,0,G,N);v.scrollTop=v.scrollHeight}})});m.setAttribute("id","btnAddImageUrl");m.className="geBtn";d.appendChild(m);this.saveBtnClickHandler=function(F,G,N,J){b.saveLibrary(F,G,N,J)};m=mxUtils.button(mxResources.get("...
cwe
CWE-20
JavaScript
function striptags_internal(html, context) { let allowable_tags = context.allowable_tags; let tag_replacement = context.tag_replacement; let state = context.state; let tag_buffer = context.tag_buffer; let depth = context.depth; let in_quote_char = con...
cwe
CWE-843
JavaScript
static int get_cox(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c) { uint8_t byte; if (bytestream2_get_bytes_left(&s->g) < 5) return AVERROR_INVALIDDATA; /* nreslevels = number of resolution levels = number of decomposition level +1 */ c->nreslevels = bytestream2_get_byt...
cwe
CWE-20
C/C++
static enum led_brightness k90_backlight_get(struct led_classdev *led_cdev) { int ret; struct k90_led *led = container_of(led_cdev, struct k90_led, cdev); struct device *dev = led->cdev.dev->parent; struct usb_interface *usbif = to_usb_interface(dev->parent); struct usb_device *usbdev = interface_to_usbdev(usbif);...
cwe
CWE-399
Unknown
void naludmx_create_avc_decoder_config(GF_NALUDmxCtx *ctx, u8 **dsi, u32 *dsi_size, u8 **dsi_enh, u32 *dsi_enh_size, u32 *max_width, u32 *max_height, u32 *max_enh_width, u32 *max_enh_height, GF_Fraction *sar) { u32 i, count; Bool first = GF_TRUE; Bool first_svc = GF_TRUE; GF_AVCConfig *cfg; GF_AVCConfig *avcc; GF...
cwe
CWE-697
C/C++
initialise_banding(fz_context *ctx, render_details *render, int color) { size_t min_band_mem; int bpp, h, w, reps; render->colorspace = output_cs; render->format = output_format; #if GREY_FALLBACK != 0 if (color == 0) { if (render->colorspace == CS_RGB) { /* Fallback from PPM to PGM */ render->colorspa...
cwe
CWE-369
C/C++
App.main=function(b,f){function l(k){mxUtils.getAll("1"!=urlParams.dev?[k]:[k,STYLE_PATH+"/default.xml"],function(m){function q(){var n=null!=f?f():new App(new Editor("0"==urlParams.chrome||"min"==uiTheme,null,null,null,"0"!=urlParams.chrome));if(null!=window.mxscript){if("function"===typeof window.DropboxClient&&null=...
cwe
CWE-20
JavaScript
/* Copyright 2017 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
$dashboard = $user_dashboards->first(); } // specific dashboard was requested, but doesn't exist if (isset($dashboard) && ! empty($request->dashboard)) { flash() ->using('template.librenms') ->title('Requested Dashboard Not Fou...
cwe
CWE-79
PHP
"""Custom fields used in InvenTree.""" import sys from decimal import Decimal from django import forms from django.core import validators from django.db import models as models from django.forms.fields import URLField as FormURLField from django.utils.translation import gettext_lazy as _ from djmoney.forms.fields im...
cwe
CWE-400
Python
function updateSelectedTags(tags, selected, selectedColor, filter) { tagCloud.innerHTML = ''; var title = document.createElement('div'); title.style.marginBottom = '8px'; mxUtils.write(title, (filter != null) ? 'Select hidden tags:' : 'Or add/remove existing tags for cell(s):'); tagCloud.appendChil...
cwe
CWE-94
JavaScript
function onPaste(event) { var editor = event.listenerData && event.listenerData.editor; var $event = event.data.$; var clipboardData = $event.clipboardData; var found = false; var imageType = /^image/; if (!clipboardData) { return; } return Array.prototype.forEach.call(clipboardData.types, function (type, i)...
cwe
CWE-434
JavaScript
ecb_ews_connect_sync (ECalMetaBackend *meta_backend, const ENamedParameters *credentials, ESourceAuthenticationResult *out_auth_result, gchar **out_certificate_pem, GTlsCertificateFlags *out_certificate_errors, GCancellable *cancellable, GError **error) { ECalBackendEws ...
cwe
CWE-295
Unknown
static void snd_timer_user_tinterrupt(struct snd_timer_instance *timeri, unsigned long resolution, unsigned long ticks) { struct snd_timer_user *tu = timeri->callback_data; struct snd_timer_tread *r, r1; struct timespec tstamp; int prev, append = 0; memset(&tstamp, 0, sizeof(tstamp)); spin_lo...
cwe
CWE-200
C/C++
const sharp = require(`./safe-sharp`) const { generateImageData } = require(`./image-data`) const imageSize = require(`probe-image-size`) const { isCI } = require(`gatsby-core-utils/ci`) const _ = require(`lodash`) const fs = require(`fs-extra`) const path = require(`path`) const { createArgsDigest } = require(`./pro...
cwe
CWE-22
JavaScript
void AddBatchOffsets(Tensor* indices, const Tensor& params) { int64_t batch_size = 1; // The size of all batch dimensions. for (int idx = 0; idx < batch_dims_; ++idx) { batch_size *= params.dim_size(idx); } auto indices_flat = indices->flat<Index>(); int64_t const index_inner_size = indices-...
cwe
CWE-369
C/C++
var S=document.createElement("tbody"),Q=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(e=mxUtils.indexOf(b.pages,b.currentPage));for(p=f.length-1;0<=p;p--){var P=function(T){var X=new Date(T.modifiedDate),ba=null;if(0<=X.getTime()){var ja=function(ka){v.stop();E.innerHTML="";var da=mxUtils.parseXml(ka),...
cwe
CWE-94
JavaScript
add_account (GoaProvider *provider, GoaClient *client, GtkDialog *dialog, GtkBox *vbox, GError **error) { AddAccountData data; GVariantBuilder credentials; GVariantBuilder details; GoaEwsClient *ews_client; GoaObject *ret; const...
cwe
CWE-310
Unknown
void AuthorizationSessionImpl::_refreshUserInfoAsNeeded(OperationContext* opCtx) { AuthorizationManager& authMan = getAuthorizationManager(); UserSet::iterator it = _authenticatedUsers.begin(); while (it != _authenticatedUsers.end()) { User* user = *it; if (!user->isValid()) { //...
cwe
CWE-613
Unknown
int ecall_start(struct ecall *ecall, enum icall_call_type call_type, bool audio_cbr) { int err; info("ecall(%p): start\n", ecall); if (!ecall) return EINVAL; #ifdef ECALL_CBR_ALWAYS_ON audio_cbr = true; #endif if (ecall->econn) { if (ECONN_PENDING_INCOMING == econn_current_state(ecall->econn)) { retur...
cwe
CWE-134
C/C++
package auth import ( "context" "net/http" "github.com/concourse/concourse/atc" "github.com/concourse/concourse/atc/api/accessor" "github.com/concourse/concourse/atc/db" ) type CheckPipelineAccessHandlerFactory interface { HandlerFor(pipelineScopedHandler http.Handler, rejector Rejector) http.Handler } type c...
cwe
CWE-863
Go
n.toDataURL();if(y.length<e.length){var K=document.createElement("canvas");K.width=L;K.height=M;var B=K.toDataURL();y!==B&&(e=y,x=L,A=M)}}}catch(F){}g(e,x,A)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,e,g){try{var k=new Ima...
cwe
CWE-20
JavaScript
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { OpData* data = reinterpret_cast<OpData*>(node->user_data); const TfLiteTensor* input1 = GetInput(context, node, kInputTensor1); const TfLiteTensor* input2 = GetInput(context, node, kInputTensor2); TfLiteTensor* output = GetOutput(context, node, kOut...
cwe
CWE-125
C/C++
const http = require('http') const https = require('https') const { URL } = require('url') const dns = require('dns') const ipAddress = require('ip-address') const request = require('request') const logger = require('../logger') const FORBIDDEN_IP_ADDRESS = 'Forbidden IP address' function isIPAddress (address) { co...
cwe
CWE-918
JavaScript
u_char *_our_safe_pcap_next(pcap_t *pcap, struct pcap_pkthdr *pkthdr, const char *funcname, const int line, const char *file) { u_char *pktdata = (u_char *)pcap_next(pcap, pkthdr); if (pktdata) { if (pkthdr->len > MAXPACKET) { fprintf(stderr, "safe_pcap_next ERROR: Invalid packet l...
cwe
CWE-125
C/C++
function createSection(name, inside) { var extendecInside = {}; extendecInside['section-header'] = { pattern: /^ ?\*{3}.+?\*{3}/, alias: 'keyword' }; // copy inside tokens for (var token in inside) { extendecInside[token] = inside[token]; } extendecInside['tag'] = { pattern: /([\r\n](?: |\...
cwe
CWE-400
JavaScript
static void hugetlb_vm_op_close(struct vm_area_struct *vma) { struct hstate *h = hstate_vma(vma); struct resv_map *reservations = vma_resv_map(vma); struct hugepage_subpool *spool = subpool_vma(vma); unsigned long reserve; unsigned long start; unsigned long end; if (reservations) { start = vma_hugecache_offse...
cwe
CWE-399
Unknown
void kvm_lapic_sync_to_vapic(struct kvm_vcpu *vcpu) { u32 data, tpr; int max_irr, max_isr; struct kvm_lapic *apic = vcpu->arch.apic; void *vapic; apic_sync_pv_eoi_to_guest(vcpu, apic); if (!test_bit(KVM_APIC_CHECK_VAPIC, &vcpu->arch.apic_attention)) return; tpr = kvm_apic_get_reg(apic, APIC_TASKPRI) & 0xff;...
cwe
CWE-20
Unknown
int ssl3_accept(SSL *s) { BUF_MEM *buf; unsigned long alg_k,Time=(unsigned long)time(NULL); void (*cb)(const SSL *ssl,int type,int val)=NULL; int ret= -1; int new_state,state,skip=0; RAND_add(&Time,sizeof(Time),0); ERR_clear_error(); clear_sys_error(); if (s->info_callback != NULL) cb=s->info_callback; e...
cwe
CWE-310
Unknown
def __init__(self,p): p = pickle.loads(p) try: self.tokens = np.array([symbolToIndex["START"]] + [ symbolToIndex[s] for s in serializeProgram(p) ] + [symbolToIndex["END"]]) except KeyError: print "Key error in tokenization",serializeProgram(p) assert False ...
cwe
CWE-502
Python
// SPDX-FileCopyrightText: 2010-2020 nibble <nibble.ds@gmail.com> // SPDX-FileCopyrightText: 2010-2020 pancake <pancake@nopcode.org> // SPDX-License-Identifier: LGPL-3.0-only #include <stdio.h> #include <rz_types.h> #include <rz_util.h> #include "mach0.h" #include <rz_hash.h> #include "mach0_utils.inc" // TODO: depr...
cwe
CWE-787
C/C++
function(){var u=document.createElement("div");u.style.position="relative";u.style.border="1px solid gray";u.style.width="100%";u.style.height="360px";u.style.overflow="hidden";u.style.marginBottom="16px";mxEvent.disableContextMenu(u);d.appendChild(u);var t=new Graph(u);t.setCellsCloneable(!0);t.setPanning(!0);t.setAll...
cwe
CWE-20
JavaScript
var updateSerpPreview = function () { var metaPanel = this.layout.getComponent("metaDataPanel"); var title = metaPanel.getComponent("title").getValue(); var description = metaPanel.getComponent("description").getValue(); var truncate = function( text, n ...
cwe
CWE-79
JavaScript
static void WillDispatchTabUpdatedEvent(WebContents* contents, Profile* profile, const Extension* extension, ListValue* event_args) { DictionaryValue* tab_value = ExtensionTabUtil::CreateTabValue( ...
cwe
CWE-264
C/C++
fetch_interval_quantifier(UChar** src, UChar* end, PToken* tok, ScanEnv* env) { int low, up, syn_allow, non_low = 0; int r = 0; OnigCodePoint c; OnigEncoding enc = env->enc; UChar* p = *src; PFETCH_READY; syn_allow = IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_INVALID_INTERVAL); if (PEND) { if (syn_a...
cwe
CWE-125
C/C++
/* * Copyright (C) 2015 Adrien Vergé * * 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 License, or * (at your option) any later version. * * This program is...
cwe
CWE-295
C/C++
char *Hub::inflate(char *data, size_t &length) { dynamicInflationBuffer.clear(); inflationStream.next_in = (Bytef *) data; inflationStream.avail_in = length; int err; do { inflationStream.next_out = (Bytef *) inflationBuffer; inflationStream.avail_out = LARGE_BUFFER_SIZE; e...
cwe
CWE-20
C/C++
static void RemoveResolutionFromResourceBlock(StringInfo *bim_profile) { register const unsigned char *p; size_t length; unsigned char *datum; unsigned int count, long_sans; unsigned short id, short_sans; length=GetStringInfoLength(bim_profile); if (length < 16) return...
cwe
CWE-125
C/C++
static int rc4_hmac_md5_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr) { EVP_RC4_HMAC_MD5 *key = data(ctx); switch (type) { case EVP_CTRL_AEAD_SET_MAC_KEY: { unsigned int i; unsigned char hmac_key[64]; memset(hmac_key, 0, si...
cwe
CWE-125
Unknown
FastHufDecoder::FastHufDecoder (const char *&table, int numBytes, int minSymbol, int maxSymbol, int rleSymbol) : _rleSymbol (rleSymbol), _numSymbols (0), _minCodeLength (255), _maxCodeLength (0), _idToSymbol (0) { // // List of symbols that we find with non-zero code ...
cwe
CWE-190
Unknown
int mutt_from_base64 (char *out, const char *in) { int len = 0; register unsigned char digit1, digit2, digit3, digit4; do { digit1 = in[0]; if (digit1 > 127 || base64val (digit1) == BAD) return -1; digit2 = in[1]; if (digit2 > 127 || base64val (digit2) == BAD) return -1; digit3 ...
cwe
CWE-120
C/C++
// // Copyright 2021 The Sigstore 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 ...
cwe
CWE-770
Go
static int handle_eac3(MOVMuxContext *mov, AVPacket *pkt, MOVTrack *track) { GetBitContext gbc; AC3HeaderInfo tmp, *hdr = &tmp; struct eac3_info *info; int num_blocks; if (!track->eac3_priv && !(track->eac3_priv = av_mallocz(sizeof(*info)))) return AVERROR(ENOMEM); info = track->eac3_pr...
cwe
CWE-125
Unknown
pjmedia_avi_player_create_streams(pj_pool_t *pool, const char *filename, unsigned options, pjmedia_avi_streams **p_streams) { pjmedia_avi_hdr avi_hdr; struct avi_reader_port *fport[PJMEDIA_AVI_MAX_NUM_STREAMS]; pj_off_t pos; unsigned i, nstr = 0; pj_stat...
cwe
CWE-835
C/C++
def main() -> None: rbac_only_states = [ ("check_region", Client.check_region), ("rbac", Client.setup_rbac), ("arm", Client.deploy_template), ("assign_scaleset_identity_role", Client.assign_scaleset_identity_role), ] full_deployment_states = rbac_only_states + [ ("ap...
cwe
CWE-346
Python
void Compute(OpKernelContext* context) override { const auto& input = context->input(0); auto flat_in = input.flat<tstring>(); int fixed_length; const auto& length_input = context->input(1); OP_REQUIRES(context, TensorShapeUtils::IsScalar(length_input.shape()), errors::InvalidArgume...
cwe
CWE-787
C/C++
def _get_host_from_connector(self, connector): """List the hosts defined in the storage. Return the host name with the given connection info, or None if there is no host fitting that information. """ prefix = self._connector_to_hostname_prefix(connector) LOG.debug(_('e...
cwe
CWE-78
Python
int hns_nic_net_xmit_hw(struct net_device *ndev, struct sk_buff *skb, struct hns_nic_ring_data *ring_data) { struct hns_nic_priv *priv = netdev_priv(ndev); struct hnae_ring *ring = ring_data->ring; struct device *dev = ring_to_dev(ring); struct netdev_queue *dev_queue; struct skb_frag_struct *frag; int b...
cwe
CWE-416
Unknown
package logic import ( "encoding/json" "github.com/gravitl/netmaker/database" ) type serverData struct { PrivateKey string `json:"privatekey,omitempty" bson:"privatekey,omitempty"` } // StorePrivKey - stores server client WireGuard privatekey if needed func StorePrivKey(serverID string, privateKey string) error ...
cwe
CWE-798
Go
/* * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at * http://www.eclipse.org/legal/epl-2.0. * * This Source Code may also be made available...
cwe
CWE-20
Java
/* BGP packet management routine. * Contains utility functions for constructing and consuming BGP messages. * Copyright (C) 2017 Cumulus Networks * Copyright (C) 1999 Kunihiro Ishiguro * * This file is part of GNU Zebra. * * GNU Zebra is free software; you can redistribute it and/or modify it * under the terms ...
cwe
CWE-125
C/C++
# Copyright (C) 2013, Red Hat, Inc. # All rights reserved. # # 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, modif...
cwe
CWE-20
Python
queryin(char *buf) { QPRS_STATE state; int32 i; ltxtquery *query; int32 commonlen; ITEM *ptr; NODE *tmp; int32 pos = 0; #ifdef BS_DEBUG char pbuf[16384], *cur; #endif /* init state */ state.buf = buf; state.state = WAITOPERAND; state.count = 0; state.num = 0; state.str = NULL; /* init...
cwe
CWE-189
C/C++
int ff_h263_decode_picture_header(MpegEncContext *s) { int format, width, height, i; uint32_t startcode; align_get_bits(&s->gb); startcode= get_bits(&s->gb, 22-8); for(i= get_bits_left(&s->gb); i>24; i-=8) { startcode = ((startcode << 8) | get_bits(&s->gb, 8)) & 0x003FFFFF; if...
cwe
CWE-189
C/C++
static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) { char cache_filename[MagickPathExtent], id[MagickPathExtent], keyword[MagickPathExtent], *options; const unsigned char *p; GeometryInfo geometry_info; Image *image; int c; LinkedListInfo ...
cwe
CWE-772
Unknown
/* 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-754
Python
/** * Copyright (c) 2006-2018, JGraph Ltd * Copyright (c) 2006-2018, Gaudenz Alder * * Realtime collaboration for any file. */ DrawioFileSync = function(file) { mxEventSource.call(this); this.lastActivity = Date.now(); this.clientId = Editor.guid(); this.ui = file.ui; this.file = file; // Listens to on...
cwe
CWE-78
JavaScript
void RenderThreadImpl::Shutdown() { FOR_EACH_OBSERVER( RenderProcessObserver, observers_, OnRenderProcessShutdown()); ChildThread::Shutdown(); if (memory_observer_) { message_loop()->RemoveTaskObserver(memory_observer_.get()); memory_observer_.reset(); } if (webkit_platform_support_) { ...
cwe
CWE-362
C/C++
my_object_finalize (GObject *object) { MyObject *mobject = MY_OBJECT (object); g_free (mobject->this_is_a_string); (G_OBJECT_CLASS (my_object_parent_class)->finalize) (object); }
cwe
CWE-264
C/C++
/* * Copyright (C) 2006, 2007, 2009 Rusty Russell, IBM Corporation * Copyright (C) 2009, 2010, 2011 Red Hat, Inc. * Copyright (C) 2009, 2010, 2011 Amit Shah <amit.shah@redhat.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as pub...
cwe
CWE-787
C/C++
var log4js = require('log4js'); var apiLogger = log4js.getLogger("API"); var clientLogger = log4js.getLogger("client"); var formidable = require('formidable'); var apiHandler = require('../../handler/APIHandler'); //This is for making an api call, collecting all post information and passing it to the apiHandler var ap...
cwe
CWE-284
JavaScript
exif_mnote_data_olympus_load (ExifMnoteData *en, const unsigned char *buf, unsigned int buf_size) { ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) en; ExifShort c; size_t i, tcount, o, o2, datao = 6, base = 0; if (!n || !buf || !buf_size) { exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMn...
cwe
CWE-908
Unknown
void GrpcHealthCheckerImpl::GrpcActiveHealthCheckSession::onRpcComplete( Grpc::Status::GrpcStatus grpc_status, const std::string& grpc_message, bool end_stream) { logHealthCheckStatus(grpc_status, grpc_message); if (isHealthCheckSucceeded(grpc_status)) { handleSuccess(false); } else { handleFailure(en...
cwe
CWE-476
Unknown
static int splice_pipe_to_pipe(struct pipe_inode_info *ipipe, struct pipe_inode_info *opipe, size_t len, unsigned int flags) { struct pipe_buffer *ibuf, *obuf; int ret = 0, nbuf; bool input_wakeup = false; retry: ret = ipipe_prep(ipipe, flags); if (ret) return ret; ret = opipe_prep(opipe,...
cwe
CWE-416
C/C++
void HierarchicalBitmapRequester::PrepareForDecoding(void) { #if ACCUSOFT_CODE UBYTE i; BuildCommon(); if (m_ppDecodingMCU == NULL) { m_ppDecodingMCU = (struct Line **)m_pEnviron->AllocMem(sizeof(struct Line *) * m_ucCount*8); memset(m_ppDecodingMCU,0,sizeof(struct Line *) * m_ucCount * 8); } if (...
cwe
CWE-125
Unknown
// Miscellaneous utils. package utils import ( "bufio" "bytes" "crypto/rand" "encoding/hex" "fmt" "io" "io/ioutil" "os" "path/filepath" "runtime" "runtime/debug" "sort" "strconv" "strings" "sync" "time" "github.com/Sirupsen/logrus" "github.com/dropbox/godropbox/container/set" "github.com/dropbox/go...
cwe
CWE-59
Go
expand_string_integer(uschar *string, BOOL isplus) { int_eximarith_t value; uschar *s = expand_string(string); uschar *msg = US"invalid integer \"%s\""; uschar *endptr; /* If expansion failed, expand_string_message will be set. */ if (s == NULL) return -1; /* On an overflow, strtol() returns LONG_MAX or LONG_MIN,...
cwe
CWE-189
C/C++
void impeg2d_peek_next_start_code(dec_state_t *ps_dec) { stream_t *ps_stream; ps_stream = &ps_dec->s_bit_stream; impeg2d_bit_stream_flush_to_byte_boundary(ps_stream); while ((impeg2d_bit_stream_nxt(ps_stream,START_CODE_PREFIX_LEN) != START_CODE_PREFIX) && (ps_dec->s_bit_stream.u4_offset <= ps_...
cwe
CWE-200
C/C++
void onComplete(const Status& status, ContextImpl& context) const override { auto& completion_state = context.getCompletionState(this); if (completion_state.is_completed_) { return; } // If any of children is OK, return OK if (Status::Ok == status) { completion_state.is_completed_ = tru...
cwe
CWE-703
Unknown
/* * 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-787
C/C++
function presentationPods() { const tokenValidation = AuthTokenValidation.findOne({ connectionId: this.connection.id }); if (!tokenValidation || tokenValidation.validationStatus !== ValidationStates.VALIDATED) { Logger.warn(`Publishing PresentationPods was requested by unauth connection ${this.connection.id}`)...
cwe
CWE-918
JavaScript
int main(int argc, char **argv) { FILE *infile, *outfile[NUM_ENCODERS]; vpx_codec_ctx_t codec[NUM_ENCODERS]; vpx_codec_enc_cfg_t cfg[NUM_ENCODERS]; vpx_codec_pts_t frame_cnt = 0; vpx_image_t raw[NUM_ENCODERS]; vpx_codec_err_t res[NUM_ENCODERS]; ...
cwe
CWE-119
C/C++
// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2018, Linaro Ltd */ #include <linux/miscdevice.h> #include <linux/module.h> #include <linux/poll.h> #include <linux/skbuff.h> #include <linux/uaccess.h> #include "qrtr.h" struct qrtr_tun { struct qrtr_endpoint ep; struct sk_buff_head queue; wait_queue_head_t r...
cwe
CWE-400
C/C++
/** * Copyright JS Foundation and other contributors, http://js.foundation * * 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 r...
cwe
CWE-22
JavaScript
MagickExport double GenerateDifferentialNoise(RandomInfo *random_info, const Quantum pixel,const NoiseType noise_type,const MagickRealType attenuate) { #define SigmaUniform (attenuate*0.015625) #define SigmaGaussian (attenuate*0.015625) #define SigmaImpulse (attenuate*0.1) #define SigmaLaplacian (attenuate*0.03906...
cwe
CWE-369
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
public Controller execute(FolderComponent folderComponent, UserRequest ureq, WindowControl wContr, Translator trans) { this.translator = trans; FileSelection selection = new FileSelection(ureq, folderComponent.getCurrentContainerPath()); VFSContainer currentContainer = folderComponent.getCurrentContainer(); if ...
cwe
CWE-23
Java
k&&k(x)}}),k)};EditorUi.prototype.removeDatabaseItem=function(c,e,g,k){this.openDatabase(mxUtils.bind(this,function(m){k=k||"objects";Array.isArray(k)||(k=[k],c=[c]);m=m.transaction(k,"readwrite");m.oncomplete=e;m.onerror=g;for(var q=0;q<k.length;q++)m.objectStore(k[q]).delete(c[q])}),g)};EditorUi.prototype.getDatabase...
cwe
CWE-20
JavaScript
_formatReplyToUserPost(avatar, link) { const htmlLink = `<a class="user-link" href="${link.href}">${link.anchor}</a>`; return htmlSafe(`${avatar}${htmlLink}`); }
cwe
CWE-918
JavaScript
function U(t){return t=t.toUpperCase(),function(e){return e&&e.nodeName.toUpperCase()===t}}
cwe
CWE-79
JavaScript
/** * Copyright (c) 2006-2020, JGraph Ltd * Copyright (c) 2006-2020, draw.io AG */ /** * Constructs a new point for the optional x and y coordinates. If no * coordinates are given, then the default values for <x> and <y> are used. * @constructor * @class Implements a basic 2D point. Known subclassers = {@link m...
cwe
CWE-284
Java
PS_CREATE_SID_FUNC(mm) { char *sid; PS_MM_DATA; sid = php_session_create_id((void **)&data, newlen TSRMLS_CC); return sid; }
cwe
CWE-264
Unknown
static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset, ssize_t size, void *private) { ext4_io_end_t *io_end = iocb->private; struct workqueue_struct *wq; /* if not async direct IO or dio with 0 bytes write, just return */ if (!io_end || !size) return; ext_debug("ext4_end_io_dio(): io_end ...
cwe
CWE-703
Unknown