code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
static int wdm_post_reset(struct usb_interface *intf) { struct wdm_device *desc = wdm_find_device(intf); int rv; clear_bit(WDM_RESETTING, &desc->flags); rv = recover_from_urb_loss(desc); mutex_unlock(&desc->wlock); mutex_unlock(&desc->rlock); return 0; }
cwe
CWE-269
Unknown
dtls1_hm_fragment_free(hm_fragment *frag) { if (frag->fragment) OPENSSL_free(frag->fragment); if (frag->reassembly) OPENSSL_free(frag->reassembly); OPENSSL_free(frag); int curr_mtu; unsigned int len, frag_off, mac_size, blocksize; /* AHA! Figure out the MTU, and stick to the right s...
cwe
CWE-310
C/C++
/* 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-617
Python
parse_array(JsonLexContext *lex, JsonSemAction *sem) { /* * an array is a possibly empty sequence of array elements, separated by * commas and surrounded by square brackets. */ json_struct_action astart = sem->array_start; json_struct_action aend = sem->array_end; json_struct_action astart = sem->array_sta...
cwe
CWE-119
C/C++
import tornado.ioloop import tornado.web import os #import sqlite3 import json import sys import rtxcomplete import traceback #class MainHandler(tornado.web.RequestHandler): # def get(self): # self.write("Hello, world") #print __file__ root = os.path.dirname(os.path.abspath(__file__)) rtxcomplete.load() #co...
cwe
CWE-79
Python
Aa.style.padding="0px";Aa.style.boxShadow="none";Aa.className="geMenuItem";Aa.style.display="inline-block";Aa.style.width="40px";Aa.style.height="12px";Aa.style.marginBottom="-2px";Aa.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")";Aa.style.backgroundPosition="top center";Aa.style.backgroundRepeat="n...
cwe
CWE-94
JavaScript
/* * Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy,...
cwe
CWE-287
Java
/* zmalloc - total amount of allocated memory aware version of malloc() * * Copyright (c) 2009-2010, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions ar...
cwe
CWE-190
C/C++
#include "rar.hpp" QuickOpen::QuickOpen() { Buf=NULL; Init(NULL,false); } QuickOpen::~QuickOpen() { Close(); delete[] Buf; } void QuickOpen::Init(Archive *Arc,bool WriteMode) { if (Arc!=NULL) // Unless called from constructor. Close(); QuickOpen::Arc=Arc; QuickOpen::WriteMode=WriteMode; ListS...
cwe
CWE-787
C/C++
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { const TfLiteUnpackParams* data = reinterpret_cast<TfLiteUnpackParams*>(node->builtin_data); TF_LITE_ENSURE_EQ(context, NumInputs(node), 1); TF_LITE_ENSURE_EQ(context, NumOutputs(node), data->num); const TfLiteTensor* input = GetInput(conte...
cwe
CWE-787
C/C++
package main import ( "database/sql" "fmt" "log" "net/http" "github.com/gorilla/mux" _ "github.com/lib/pq" ) var servport = ":6862" func failOnError(err error, msg string) { if err != nil { log.Fatalf("[X] %s, %s", msg, err) panic(fmt.Sprintf("%s, %s", msg, err)) } } func main() { log.Println("[i] Ser...
cwe
CWE-89
Go
import hashlib import logging import random import urllib from django import template from django.conf import settings from django.db.models import Q from django.shortcuts import get_object_or_404 from django.template.defaultfilters import stringfilter from django.templatetags.static import static from django.urls imp...
cwe
CWE-79
Python
def update return unless access_granted?(params[:id]) id = params[:article][:id] || params[:id] @article = Article.find(id) if params[:article][:draft] fetch_fresh_or_existing_draft_for_article else @article = Article.find(@article.parent_id) unless @article.parent_id.nil? end ...
cwe
CWE-639
Ruby
'use strict'; // @ts-check // ================================================================================== // internet.js // ---------------------------------------------------------------------------------- // Description: System Information - library // for Node.js // Copyright: (c) 2014 - ...
cwe
CWE-78
JavaScript
beep_print(netdissect_options *ndo, const u_char *bp, u_int length) { if (l_strnstart("MSG", 4, (const char *)bp, length)) /* A REQuest */ ND_PRINT((ndo, " BEEP MSG")); else if (l_strnstart("RPY ", 4, (const char *)bp, length)) ND_PRINT((ndo, " BEEP RPY")); else if (l_strnstart("ERR ", 4, (const char *)bp, leng...
cwe
CWE-125
Unknown
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-119
C/C++
// Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore // Parse the header files for OpenBSD and generate a Go usable sysctl MIB. // // Build a MIB with each entry being an array containing the lev...
cwe
CWE-287
Go
void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color) { int lastBorder; /* Seek left */ int leftLimit = -1, rightLimit; int i, restoreAlphaBlending = 0; if (border < 0) { /* Refuse to fill to a non-solid border */ return; } restoreAlphaBlending = im->alphaBlendingFlag; im->alphaBle...
cwe
CWE-119
Unknown
/** * Licensed to The Apereo Foundation under one or more contributor license * agreements. See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * * The Apereo Foundation licenses this file to you under the Educational * Community License, Version 2.0 (the ...
cwe
CWE-74
Java
void ndpi_parse_packet_line_info(struct ndpi_detection_module_struct *ndpi_str, struct ndpi_flow_struct *flow) { u_int32_t a; struct ndpi_packet_struct *packet = &flow->packet; if((packet->payload_packet_len < 3) || (packet->payload == NULL)) return; if(packet->packet_lines_parsed_complete != 0) retur...
cwe
CWE-125
C/C++
"120px",k.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",k.style.backgroundPosition="center 65%",k.style.backgroundRepeat="no-repeat",D=document.createElement("div"),D.style.position="absolute",D.style.width="420px",D.style.top="58%",D.style.textAlign="center",D.style.fontSize="18px",D.style.color="#a0c3f...
cwe
CWE-20
JavaScript
static int db_interception(struct vcpu_svm *svm) { struct kvm_run *kvm_run = svm->vcpu.run; if (!(svm->vcpu.guest_debug & (KVM_GUESTDBG_SINGLESTEP | KVM_GUESTDBG_USE_HW_BP)) && !svm->nmi_singlestep) { kvm_queue_exception(&svm->vcpu, DB_VECTOR); return 1; } if (svm->nmi_singlestep) { svm->nmi_single...
cwe
CWE-399
Unknown
static int try_smi_init(struct smi_info *new_smi) { int rv = 0; int i; char *init_name = NULL; pr_info("Trying %s-specified %s state machine at %s address 0x%lx, slave address 0x%x, irq %d\n", ipmi_addr_src_to_str(new_smi->io.addr_source), si_to_str[new_smi->io.si_type], addr_space_to_str[new_smi->io.addr_ty...
cwe
CWE-416
C/C++
/** * This file is part of alf.io. * * alf.io 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. * * alf.io is distributed in the ...
cwe
CWE-1236
Java
/** * DAO * Copyright 22.02.2015 by Michael Peter Christen, @0rb1t3r * * This library 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 the License, or (at your option...
cwe
CWE-22
Java
document.createElement("div");pa.className="geTempDlgNewDiagramCatItemLbl";pa.innerHTML=qa;ma.appendChild(pa);Ca.appendChild(ma);mxEvent.addListener(ma,"click",function(){function Ka(){var Ra=Ia.querySelector(".geTemplateDrawioCatLink");null!=Ra?Ra.click():setTimeout(Ka,200)}Z=!0;var Ia=M.querySelector(".geTemplatesLis...
cwe
CWE-20
JavaScript
/* * Copyright (C) Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * See the COPYRIGHT file distributed with this wo...
cwe
CWE-617
C/C++
void base64_decode_xmlrpc(struct buffer_st *bfr, const char *source, int length) { int i; int offset = 0; int endoffile; int count; buffer_new(bfr); for (i = 0; i < 255; i++) { dtable[i] = 0x80; } for (i = 'A'; i <= 'Z'; i++) { dtable[i] = 0 + (i - 'A'); } for (i = 'a'...
cwe
CWE-125
C/C++
void list_proxy(char *server, void *data __attribute__((unused)), void *rock) { struct enum_rock *erock = (struct enum_rock *) rock; struct backend *be; int r; char *result; be = proxy_findserver(server, &nntp_protocol, nntp_userid ? nntp_userid : "anonymous", &backend_cached, &backend_cu...
cwe
CWE-287
Unknown
/* DVB USB framework compliant Linux driver for the * DVBWorld DVB-S 2101, 2102, DVB-S2 2104, DVB-C 3101, * TeVii S421, S480, S482, S600, S630, S632, S650, S660, S662, * Prof 1100, 7500, * Geniatech SU3000, T220, * TechnoTrend S2-4600, * Terratec Cinergy S2 cards * Copyright (C) 2008-2012 Igor M. Liplianin (lipl...
cwe
CWE-119
C/C++
bool SetOpAttrScalar(TFE_Context* ctx, TFE_Op* op, const char* key, PyObject* py_value, TF_AttrType type, tensorflow::gtl::FlatMap<string, int64_t>* attr_list_sizes, TF_Status* status) { if (type == TF_ATTR_STRING) { tensorflow::StringPiece value; ...
cwe
CWE-476
C/C++
export function store_isFeatFlagOn(store: Store, featureFlag: St): Bo { return _.includes(store.siteFeatureFlags, featureFlag) || _.includes(store.serverFeatureFlags, featureFlag); }
cwe
CWE-613
Scala
void kvm_mmu_invpcid_gva(struct kvm_vcpu *vcpu, gva_t gva, unsigned long pcid) { struct kvm_mmu *mmu = vcpu->arch.mmu; bool tlb_flush = false; uint i; if (pcid == kvm_get_active_pcid(vcpu)) { mmu->invlpg(vcpu, gva, mmu->root.hpa); tlb_flush = true; } for (i = 0; i < KVM_MMU_NUM_PREV_ROOTS; i++) { if (VALI...
cwe
CWE-476
C/C++
get_user_command_name(int idx, int cmdidx) { if (cmdidx == CMD_USER && idx < ucmds.ga_len) return USER_CMD(idx)->uc_name; if (cmdidx == CMD_USER_BUF) { // In cmdwin, the alternative buffer should be used. buf_T *buf = #ifdef FEAT_CMDWIN is_in_cmdwin() ? prevwin->w_buffer : #endif curbuf; if...
cwe
CWE-476
C/C++
static int DecodeChunk(EXRImage *exr_image, const EXRHeader *exr_header, const std::vector<tinyexr::tinyexr_uint64> &offsets, const unsigned char *head, const size_t size, std::string *err) { int num_channels = exr_header->num_channels; int num_s...
cwe
CWE-20
C/C++
static int udf_read_inode(struct inode *inode, bool hidden_inode) { struct buffer_head *bh = NULL; struct fileEntry *fe; struct extendedFileEntry *efe; uint16_t ident; struct udf_inode_info *iinfo = UDF_I(inode); struct udf_sb_info *sbi = UDF_SB(inode->i_sb); struct kernel_lb_addr *iloc = &iinfo->i_location; un...
cwe
CWE-703
C/C++
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 1); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* input = GetInput(context, node, kInputTensor); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); output->type = k...
cwe
CWE-125
C/C++
struct svc_rdma_req_map *svc_rdma_get_req_map(struct svcxprt_rdma *xprt) { struct svc_rdma_req_map *map = NULL; spin_lock(&xprt->sc_map_lock); if (list_empty(&xprt->sc_maps)) goto out_empty; map = list_first_entry(&xprt->sc_maps, struct svc_rdma_req_map, free); list_del_init(&map->free); spin_unlock(&...
cwe
CWE-404
C/C++
$parameter = strtolower( $parameter ); //Force lower case for ease of use. if ( empty( $parameter ) || substr( $parameter, 0, 1 ) == '#' || ( $this->parameters->exists( $parameter ) && !$this->parameters->testRichness( $parameter ) ) ) { continue; } if ( !$this->parameters->exists( $parameter ) ) { $t...
cwe
CWE-400
PHP
process_tgs_req(struct server_handle *handle, krb5_data *pkt, const krb5_fulladdr *from, krb5_data **response) { krb5_keyblock * subkey = 0; krb5_keyblock *header_key = NULL; krb5_kdc_req *request = 0; krb5_db_entry *server = NULL; krb5_db_entry *stkt_server = NULL; krb5_kdc_rep ...
cwe
CWE-20
Unknown
static inline loff_t ext4_isize(struct ext4_inode *raw_inode) { return ((loff_t)le32_to_cpu(raw_inode->i_size_high) << 32) | le32_to_cpu(raw_inode->i_size_lo);
cwe
CWE-399
Unknown
function addNote(request, response, note){ var parts = url.parse(request.url,true); var query = connection.query("INSERT INTO notes_"+(parts.query.table).substring(6)+" (testId,who,note) VALUES ("+note.testId+",'" + note.who + "','"+note.note+"')", function(err, rows, fields) { if (err) { response.statusCode = 4...
cwe
CWE-89
JavaScript
elseif ($permission == $mergedPermission && $mergedPermissions[$permission] == 1) { $matched = true; break; }
cwe
CWE-287
PHP
regional_create_custom(size_t size) { struct regional* r = (struct regional*)malloc(size); log_assert(sizeof(struct regional) <= size); if(!r) return NULL; r->first_size = size; regional_init(r); return r; }
cwe
CWE-190
C/C++
//------------------------------------------------------------------------------ // Copyright (c) 2011-2012 by European Organization for Nuclear Research (CERN) // Author: Lukasz Janyst <ljanyst@cern.ch> //------------------------------------------------------------------------------ // XRootD is free software: you can...
cwe
CWE-77
C/C++
uint64_t ThreadCommand::pc() const { uint64_t entry = 0; switch(architecture_) { case CPU_TYPES::CPU_TYPE_X86: { entry = reinterpret_cast<const details::x86_thread_state_t*>(state_.data())->eip; break; } case CPU_TYPES::CPU_TYPE_X86_64: { entry = reinterpret_cast<c...
cwe
CWE-787
Unknown
/* * Builtin "git clone" * * Copyright (c) 2007 Kristian Høgsberg <krh@redhat.com>, * 2008 Daniel Barkalow <barkalow@iabervon.org> * Based on git-commit.sh by Junio C Hamano and Linus Torvalds * * Clone a repository into a different directory that does not yet exist. */ #define USE_THE_INDEX_VARIABLE #includ...
cwe
CWE-59
C/C++
function extractProtocol(address) { address = trimLeft(address); var match = protocolre.exec(address) , protocol = match[1] ? match[1].toLowerCase() : '' , slashes = !!(match[2] && match[2].length >= 2) , rest = match[2] && match[2].length === 1 ? '/' + match[3] : match[3]; return { protocol: p...
cwe
CWE-601
JavaScript
bool GLES2DecoderImpl::SimulateAttrib0(GLuint max_vertex_accessed) { if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2) return false; const VertexAttribManager::VertexAttribInfo* info = vertex_attrib_manager_.GetVertexAttribInfo(0); bool attrib_0_used = current_program_->GetAttribIn...
cwe
CWE-125
C/C++
package io.metersphere.gateway.filter; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.cloud.client.discovery.DiscoveryClient; import org.springframework.cloud.gateway.support.ServerWebExchangeUtils; import org.springframework.http.serv...
cwe
CWE-79
Java
func (k Keeper) OnRecvPacket( ctx sdk.Context, packet channeltypes.Packet, ack exported.Acknowledgement, ) exported.Acknowledgement { params := k.GetParams(ctx) // short circuit in case claim is not active (no-op) if !params.IsClaimsActive(ctx.BlockTime()) { return ack } // unmarshal packet data to obtain t...
cwe
CWE-287
Go
public function createComment($id, $source = "leaves/leaves"){ $this->auth->checkIfOperationIsAllowed('view_leaves'); $data = getUserContext($this); $oldComment = $this->leaves_model->getCommentsLeave($id); $newComment = new stdClass; $newComment->type = "comment"; $newComment->autho...
cwe
CWE-79
PHP
void RegKey::getBinary(const TCHAR* valname, void** data, int* length, void* def, int deflen) const { try { getBinary(valname, data, length); } catch(rdr::Exception&) { if (deflen) { *data = new char[deflen]; memcpy(*data, def, deflen); } else *data = 0; *length = deflen; } }
cwe
CWE-122
C/C++
ignore_cert_errors: $("#ignore_cert_errors").prop("checked"), headers: headers, } } btnHtml = $("#sendTestModalSubmit").html() $("#sendTestModalSubmit").html('<i class="fa fa-spinner fa-spin"></i> Sending') // Send the test email api.send_test_email(test_email_request) .s...
cwe
CWE-79
JavaScript
import { defaultSettings, Globalsettings } from './globalsettings.js' import { checkAdminAuthentication } from '../../utils/server_method_helpers.js' Meteor.methods({ updateGlobalSettings(settingsArray) { checkAdminAuthentication(this) check(settingsArray, Array) for (const setting of settingsArray) { ...
cwe
CWE-285
JavaScript
function factory(options) { options = options || {} var objectPath = function(obj) { return Object.keys(objectPath).reduce(function(proxy, prop) { if(prop === 'create') { return proxy; } /*istanbul ignore else*/ if (typeof objectPath[prop] === 'function') { ...
cwe
CWE-843
JavaScript
DhcpOption *dhcpGetOption(const DhcpMessage *message, size_t length, uint8_t optionCode) { uint_t i; DhcpOption *option; //Make sure the DHCP header is valid if(length < sizeof(DhcpMessage)) return NULL; //Get the length of the options field length -= sizeof(DhcpMessage); //Parse DHCP op...
cwe
CWE-20
C/C++
from django.template import Library from django.template.defaultfilters import stringfilter from rest_framework.reverse import reverse from openforms.config.models import GlobalConfiguration from ..context_processors import sdk_urls register = Library() @register.simple_tag(takes_context=True) def api_base_url(co...
cwe
CWE-601
Python
def stops if params['lat'] and params['lng'] @page[:order] = params[:order] || "distance ASC" @page[:limit] = params[:limit] || 5 distance = "7912*ASIN(SQRT(POWER(SIN((lat-#{params['lat']})*pi()/180/2),2)+COS(lat*pi()/180)*COS(#{params['lat']}*pi()/180)*POWER(SIN((lng-#{params['lng']})*pi()/180/2)...
cwe
CWE-89
Ruby
// SPDX-License-Identifier: GPL-2.0-or-later /* * fs/eventpoll.c (Efficient event retrieval implementation) * Copyright (C) 2001,...,2009 Davide Libenzi * * Davide Libenzi <davidel@xmailserver.org> */ #include <linux/init.h> #include <linux/kernel.h> #include <linux/sched/signal.h> #include <linux/fs.h> #incl...
cwe
CWE-416
C/C++
/* nautilus-file-operations.c - Nautilus file operations. * * Copyright (C) 1999, 2000 Free Software Foundation * Copyright (C) 2000, 2001 Eazel, Inc. * Copyright (C) 2007 Red Hat, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public Li...
cwe
CWE-20
C/C++
static int mark_source_chains(const struct xt_table_info *newinfo, unsigned int valid_hooks, void *entry0) { unsigned int hook; /* No recursion; use packet counter to save back ptrs (reset * to 0 as we leave), and comefrom to save source hook bitmask. */ for (hook = 0; hook < NF_ARP_NUMHOOKS; hook++) {...
cwe
CWE-119
Unknown
static void atomic2gen (lua_State *L, global_State *g) { /* sweep all elements making them old */ sweep2old(L, &g->allgc); /* everything alive now is old */ g->reallyold = g->old = g->survival = g->allgc; /* repeat for 'finobj' lists */ sweep2old(L, &g->finobj); g->finobjrold = g->finobjold = g->finobjsu...
cwe
CWE-763
Unknown
void Compute(OpKernelContext* context) override { const Tensor& contents = context->input(0); OP_REQUIRES(context, TensorShapeUtils::IsScalar(contents.shape()), errors::InvalidArgument("contents must be scalar, got shape ", contents.shape().DebugString()))...
cwe
CWE-125
C/C++
/* 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-476
Python
static int ohci_service_ed_list(OHCIState *ohci, uint32_t head, int completion) { struct ohci_ed ed; uint32_t next_ed; uint32_t cur; int active; active = 0; if (head == 0) return 0; for (cur = head; cur; cur = next_ed) { if (ohci_read_ed(ohci, cur, &ed)) { trac...
cwe
CWE-835
Unknown
IndexedDBDispatcher* IndexedDBDispatcher::ThreadSpecificInstance() { if (g_idb_dispatcher_tls.Pointer()->Get()) return g_idb_dispatcher_tls.Pointer()->Get(); IndexedDBDispatcher* dispatcher = new IndexedDBDispatcher; if (WorkerTaskRunner::Instance()->CurrentWorkerId()) webkit_glue::WorkerTaskRunner::I...
cwe
CWE-399
C/C++
static Sdb *store_versioninfo_gnu_verdef(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz) { const char *section_name = ""; const char *link_section_name = ""; char *end = NULL; Elf_(Shdr) *link_shdr = NULL; ut8 dfs[sizeof (Elf_(Verdef))] = {0}; Sdb *sdb; int cnt, i; if (shdr->sh_link > bin->ehdr.e_shnum) { return false...
cwe
CWE-476
C/C++
/* * jdmerge.c * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1994-1996, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB * Copyright (C) 2009, 2011, 2014-2015, D. R. Commander. * Copyright (C) 2013, Linaro Limited. ...
cwe
CWE-476
C/C++
*/ static enum hrtimer_restart bfq_idle_slice_timer(struct hrtimer *timer) { struct bfq_data *bfqd = container_of(timer, struct bfq_data, idle_slice_timer); struct bfq_queue *bfqq = bfqd->in_service_queue; /* * Theoretical race here: the in-service queue can be NULL or * different from the queue that ...
cwe
CWE-416
Unknown
/* * L2TPv3 IP encapsulation support * * Copyright (c) 2008,2009,2010 Katalix Systems Ltd * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your...
cwe
CWE-264
C/C++
/* * 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) 2010 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a copy of...
cwe
CWE-264
Python
/* 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-835
C/C++
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * md5_client.c -- This client sends one or more files to MD5 QUIC server * for MD5 sum calculation. */ #include <assert.h> #include <errno.h> #include <inttypes.h> #include <stdio.h> #include <stdlib.h> #include <string.h> ...
cwe
CWE-476
C/C++
/* * * Copyright (C) 2011 Novell Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published by * the Free Software Foundation. */ #include <linux/fs.h> #include <linux/slab.h> #include <linux/file.h> #include <linux...
cwe
CWE-399
C/C++
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2012 * All rights reserved * * This file is part of GPAC / Scene Management sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser...
cwe
CWE-119
C/C++
func ServeData(ctx *context.Context, name string, size int64, reader io.Reader) error { buf := make([]byte, 1024) n, err := util.ReadAtMost(reader, buf) if err != nil { return err } if n >= 0 { buf = buf[:n] } ctx.Resp.Header().Set("Cache-Control", "public,max-age=86400") if size >= 0 { ctx.Resp.Header(...
cwe
CWE-79
Go
def add_label options, f, attr label_size = options.delete(:label_size) || "col-md-2" required_mark = check_required(options, f, attr) label = options[:label] == :none ? '' : options.delete(:label) label ||= ((clazz = f.object.class).respond_to?(:gettext_translation_for_attribute_name) && s_(cla...
cwe
CWE-79
Ruby
# -*- 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-770
Python
void ssl3_cbc_digest_record( const EVP_MD *digest, unsigned char* md_out, size_t* md_out_size, const unsigned char header[13], const unsigned char *data, size_t data_plus_mac_size, size_t data_plus_mac_plus_padding_size, const unsigned char *mac_secret, unsigned mac_secret_length, char is_sslv3) { union { d...
cwe
CWE-310
Unknown
import os import socket from flask import current_app, make_response, request from flask import send_file, render_template from .redis_config import DecodedRedis from .redis_conn import FlaskRedis # from flaskapi.core.worker import celery # import celery.states as states from flask import Blueprint route_blueprint ...
cwe
CWE-22
Python
int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) { int i, bits, ret = 0, window, wvalue; int top; BN_MONT_CTX *mont = NULL; int numPowers; unsigned char *powerb...
cwe
CWE-200
Unknown
def _moderate(request, pk, field_name, to_value, action=None, message=None): topic = get_object_or_404(Topic, pk=pk) if is_post(request): count = ( Topic.objects .filter(pk=pk) .exclude(**{field_name: to_value}) .update(**{ field_name: to_...
cwe
CWE-601
Python
remove: function (from, callback) { var that = this, cmd = ''; fs.lstat(from, function (err, stats) { if (err) { callback(err); } else { if (that._win32) { // windows if (stats.isDirectory()) { cmd = 'rd /s /q "' + from + '"'; } else if...
cwe
CWE-77
JavaScript
[];for(G=0;G<d.length;G++)C.push(d[G]);d=C;this.confirmImageResize(function(K){L=K;P()},A)}else P()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=fu...
cwe
CWE-20
JavaScript
_crypt_extended_r(const char *key, const char *setting, struct php_crypt_extended_data *data) { int i; uint32_t count, salt, l, r0, r1, keybuf[2]; u_char *p, *q; if (!data->initialized) des_init_local(data); /* * Copy the key, shifting each character up by one bit * and padding with zeros. */ ...
cwe
CWE-310
C/C++
static int pkey_GOST_ECcp_encrypt(EVP_PKEY_CTX *pctx, unsigned char *out, size_t *out_len, const unsigned char *key, size_t key_len) { GOST_KEY_TRANSPORT *gkt = NULL; EVP_PKEY *pubk = EVP_PKEY_CTX_get0_pkey(pctx); struct gost_pmeth_data *data = EVP_PKEY_...
cwe
CWE-120
C/C++
static ssize_t _consolefs_write(oe_fd_t* file_, const void* buf, size_t count) { ssize_t ret = -1; file_t* file = _cast_file(file_); if (!file) OE_RAISE_ERRNO(OE_EINVAL); if (oe_syscall_write_ocall(&ret, file->host_fd, buf, count) != OE_OK) OE_RAISE_ERRNO(OE_EINVAL); done: return ...
cwe
CWE-200
Unknown
static void ftrace_syscall_exit(void *data, struct pt_regs *regs, long ret) { struct trace_array *tr = data; struct ftrace_event_file *ftrace_file; struct syscall_trace_exit *entry; struct syscall_metadata *sys_data; struct ring_buffer_event *event; struct ring_buffer *buffer; unsigned long irq_flags; int pc; ...
cwe
CWE-264
Unknown
#define PGEN #include "parsetok.c" #define PGEN #include "parsetok.c"
cwe
CWE-125
Python
void ID3::Iterator::getstring(String8 *id, bool otherdata) const { id->setTo(""); const uint8_t *frameData = mFrameData; if (frameData == NULL) { return; } uint8_t encoding = *frameData; if (mParent.mVersion == ID3_V1 || mParent.mVersion == ID3_V1_1) { if (mOffset == 126 || mOffset == 127) { char tmp[16]...
cwe
CWE-20
C/C++
static int flattenSubquery( Parse *pParse, /* Parsing context */ Select *p, /* The parent or outer SELECT statement */ int iFrom, /* Index in p->pSrc->a[] of the inner subquery */ int isAgg /* True if outer SELECT uses aggregate functions */ ){ const char *zSavedAuthContex...
cwe
CWE-476
Unknown
static pyc_object *get_object(RBuffer *buffer) { bool error = false; pyc_object *ret = NULL; ut8 code = get_ut8 (buffer, &error); ut8 flag = code & FLAG_REF; RListIter *ref_idx = NULL; ut8 type = code & ~FLAG_REF; if (error) { return NULL; } if (flag) { ret = get_none_object (); if (!ret) { return N...
cwe
CWE-415
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-400
C/C++
/******************************************************************************* * Copyright (c) 2013 Mover Zhou * * 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.apac...
cwe
CWE-74
Java
ProcessStartupPacket(Port *port, bool ssl_done, bool gss_done) { int32 len; char *buf; ProtocolVersion proto; MemoryContext oldcontext; pq_startmsgread(); /* * Grab the first byte of the length word separately, so that we can tell * whether we have no data at all or an incomplete packet. (This might ...
cwe
CWE-89
C/C++
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++
package com.salesmanager.core.business.services.merchant; import java.util.List; import java.util.Optional; import javax.inject.Inject; import org.jsoup.helper.Validate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.CacheEvict; import org.springframework.c...
cwe
CWE-79
Java
static void cmd_anal_esil(RCore *core, const char *input) { RAnalEsil *esil = core->anal->esil; ut64 addr = core->offset; ut64 adr ; char *n, *n1; int off; int stacksize = r_config_get_i (core->config, "esil.stack.depth"); int iotrap = r_config_get_i (core->config, "esil.iotrap"); int romem = r_config_get_i (co...
cwe
CWE-416
Unknown