code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
@discourseComputed("deleting", "channelNameConfirmation", "confirmed") buttonDisabled(deleting, channelNameConfirmation, confirmed) { if (deleting || confirmed) { return true; } if ( isEmpty(channelNameConfirmation) || channelNameConfirmation.toLowerCase() !== this.chatChannel.t...
cwe
CWE-79
JavaScript
static inline int hpel_motion(MpegEncContext *s, uint8_t *dest, uint8_t *src, int src_x, int src_y, op_pixels_func *pix_op, int motion_x, int motion_y) { int dxy = 0; int emu = 0; src_x +...
cwe
CWE-476
C/C++
get_results(struct iperf_test *test) { int r = 0; cJSON *j; cJSON *j_cpu_util_total; cJSON *j_cpu_util_user; cJSON *j_cpu_util_system; cJSON *j_sender_has_retransmits; int result_has_retransmits; cJSON *j_streams; int n, i; cJSON *j_stream; cJSON *j_id; cJSON *j_bytes; ...
cwe
CWE-120
Unknown
TfLiteStatus GreaterEqualEval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input1 = GetInput(context, node, kInputTensor1); const TfLiteTensor* input2 = GetInput(context, node, kInputTensor2); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); bool requires_broadcast = !HaveSameS...
cwe
CWE-787
C/C++
#include "webcc/router.h" #include <algorithm> #include "boost/algorithm/string.hpp" #include "webcc/logger.h" namespace webcc { bool Router::Route(string_view url, ViewPtr view, const Strings& methods) { assert(view); // TODO: More error check routes_.push_back({ ToString(url), {}, view, methods }); re...
cwe
CWE-22
C/C++
int dtls1_get_record(SSL *s) { int ssl_major, ssl_minor; int i, n; SSL3_RECORD *rr; unsigned char *p = NULL; unsigned short version; DTLS1_BITMAP *bitmap; unsigned int is_next_epoch; rr = &(s->s3->rrec); again: /* * The epoch may have changed. If so, process all the pending ...
cwe
CWE-189
Unknown
void perf_pmu_migrate_context(struct pmu *pmu, int src_cpu, int dst_cpu) { struct perf_event_context *src_ctx; struct perf_event_context *dst_ctx; struct perf_event *event, *tmp; LIST_HEAD(events); src_ctx = &per_cpu_ptr(pmu->pmu_cpu_context, src_cpu)->ctx; dst_ctx = &per_cpu_ptr(pmu->pmu_cpu_context, dst_cpu)->...
cwe
CWE-264
C/C++
static int bin_pe_parse_imports(RBinPEObj* pe, struct r_bin_pe_import_t** importp, int* nimp, const char* dll_name, PE_DWord OriginalFirstThunk, PE_DWord FirstThunk) { char import_name[PE_NAM...
cwe
CWE-400
C/C++
set_cs_start(char *line) { char *p, *q, *r; if ((p = strstr(line, "string currentfile"))) { /* enforce presence of `readstring' -- 5/29/99 */ if (!strstr(line, "readstring")) return; /* locate the name of the charstring start command */ *p = '\0'; /* damage line[] */ q = strrchr(lin...
cwe
CWE-119
C/C++
def _port_conf_generator(self, cmd): ssh_cmd = '%s -delim !' % cmd out, err = self._run_ssh(ssh_cmd) if not len(out.strip()): return port_lines = out.strip().split('\n') if not len(port_lines): return header = port_lines.pop(0) yield head...
cwe
CWE-78
Python
bool ECDSA_Verification_Operation::verify(const uint8_t msg[], size_t msg_len, const uint8_t sig[], size_t sig_len) { if(sig_len != m_group.get_order_bytes() * 2) return false; const BigInt e(msg, msg_len, m_group.get_order_bits()); const BigInt r(sig, sig_l...
cwe
CWE-200
C/C++
var CommentsWindow=function(b,e,k,n,D,t){function E(){for(var ja=da.getElementsByTagName("div"),U=0,J=0;J<ja.length;J++)"none"!=ja[J].style.display&&ja[J].parentNode==da&&U++;ba.style.display=0==U?"block":"none"}function d(ja,U,J,V){function P(){U.removeChild(la);U.removeChild(ta);ia.style.display="block";R.style.displ...
cwe
CWE-94
JavaScript
ignore_error_for_testing(char_u *error) { if (ignore_error_list.ga_itemsize == 0) ga_init2(&ignore_error_list, sizeof(char_u *), 1); if (STRCMP("RESET", error) == 0) ga_clear_strings(&ignore_error_list); else ga_add_string(&ignore_error_list, error); }
cwe
CWE-416
C/C++
GURL SanitizeFrontendURL(const GURL& url, const std::string& scheme, const std::string& host, const std::string& path, bool allow_query_and_fragment) { std::vector<std::string> query_parts; std::string fragment; if...
cwe
CWE-20
C/C++
ProcessInterrupts(void) { /* OK to accept interrupt now? */ if (InterruptHoldoffCount != 0 || CritSectionCount != 0) return; InterruptPending = false; if (ProcDiePending) { ProcDiePending = false; QueryCancelPending = false; /* ProcDie trumps QueryCancel */ ImmediateInterruptOK = false; /* not idle anymor...
cwe
CWE-89
Unknown
dns_cache_lookup(struct module_env* env, uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, uint16_t flags, struct regional* region, struct regional* scratch, int no_partial, uint8_t* dpname, size_t dpnamelen) { struct lruhash_entry* e; struct query_info k; hashvalue_type h; time_t now = *env->now...
cwe
CWE-613
Unknown
->first(function (User $user) { return $user->getPreference('blocksPd', false); }) !== null;
cwe
CWE-269
JavaScript
int saa7164_bus_get(struct saa7164_dev *dev, struct tmComResInfo* msg, void *buf, int peekonly) { struct tmComResBusInfo *bus = &dev->bus; u32 bytes_to_read, write_distance, curr_grp, curr_gwp, new_grp, buf_size, space_rem; struct tmComResInfo msg_tmp; int ret = SAA_ERR_BAD_PARAMETER; saa7164_bus_verify(dev); ...
cwe
CWE-125
C/C++
void CoordinatorImpl::FinalizeGlobalMemoryDumpIfAllManagersReplied() { TRACE_EVENT0(base::trace_event::MemoryDumpManager::kTraceCategory, "GlobalMemoryDump.Computation"); DCHECK(!queued_memory_dump_requests_.empty()); QueuedRequest* request = &queued_memory_dump_requests_.front(); if (!request->...
cwe
CWE-416
C/C++
void SoftAVC::setDecodeArgs( ivd_video_decode_ip_t *ps_dec_ip, ivd_video_decode_op_t *ps_dec_op, OMX_BUFFERHEADERTYPE *inHeader, OMX_BUFFERHEADERTYPE *outHeader, size_t timeStampIx) { size_t sizeY = outputBufferWidth() * outputBufferHeight(); size_t sizeUV; uin...
cwe
CWE-20
C/C++
set<int> PipeSocketHandler::listen(const SocketEndpoint& endpoint) { lock_guard<std::recursive_mutex> guard(globalMutex); string pipePath = endpoint.name(); if (pipeServerSockets.find(pipePath) != pipeServerSockets.end()) { throw runtime_error("Tried to listen twice on the same path"); } sockaddr_un loc...
cwe
CWE-362
C/C++
var set = function set(obj, path, val) { var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; var internalPath = path, objPart; options = _objectSpread({ "transformRead": returnWhatWasGiven, "transformKey": returnWhatWasGiven, "transformWrite": returnWhatWasGiven...
cwe
CWE-1321
JavaScript
static struct rpmsg_device *rpmsg_virtio_add_ctrl_dev(struct virtio_device *vdev) { struct virtproc_info *vrp = vdev->priv; struct virtio_rpmsg_channel *vch; struct rpmsg_device *rpdev_ctrl; int err = 0; vch = kzalloc(sizeof(*vch), GFP_KERNEL); if (!vch) return ERR_PTR(-ENOMEM); /* Link the channel to the vr...
cwe
CWE-415
C/C++
/* Copyright 2008-2018 LibRaw LLC (info@libraw.org) LibRaw is free software; you can redistribute it and/or modify it under the terms of the one of two licenses as you choose: 1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1 (See file LICENSE.LGPL provided in LibRaw distribution archive for details). 2. COMMON...
cwe
CWE-835
C/C++
public static AlgorithmMode resolveAlgorithmMode(final JWEAlgorithm alg) throws JOSEException { if (alg.equals(JWEAlgorithm.ECDH_ES)) { return AlgorithmMode.DIRECT; } else if (alg.equals(JWEAlgorithm.ECDH_ES_A128KW) || alg.equals(JWEAlgorithm.ECDH_ES_A192KW) || alg.equals(JWEAlgorithm.ECDH_ES_A256KW))...
cwe
CWE-347
Java
package server import ( "bytes" "encoding/json" "fmt" "io" "net/http" "net/url" "strconv" "strings" "time" "github.com/pkg/errors" "github.com/usememos/memos/api" "github.com/usememos/memos/common" metric "github.com/usememos/memos/plugin/metrics" "github.com/labstack/echo/v4" ) const ( // The max fi...
cwe
CWE-79
Go
cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h, uint32_t offs, cdf_property_info_t **info, size_t *count, size_t *maxcount) { const cdf_section_header_t *shp; cdf_section_header_t sh; const uint8_t *p, *q, *e; size_t i, o4, nelements, j, slen, left; cdf_property_info_t *inp; if (offs >...
cwe
CWE-787
C/C++
/************************************************************************ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. * Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko * Website: https://www.espocrm.com * * EspoCRM is free software: you can redistribute i...
cwe
CWE-79
JavaScript
static void file_add_remove(struct diff_options *options, int addremove, unsigned mode, const unsigned char *sha1, const char *base, const char *path) { int diff = REV_TREE_DIFFERENT; /* * Is it an add of a new file? It means that the old tree * didn't have it at all, so we will turn "REV_TREE_...
cwe
CWE-119
Unknown
function escapeShellArgWithInterpolation(arg, shell) { let result = arg .replace(/\u{0}/gu, "") .replace(/\\/g, "\\\\") .replace(/^(~|#)/g, "\\$1") .replace(/(\*|\?)/gu, "\\$1") .replace(/(\$|\;|\&|\|)/g, "\\$1") .replace(/(\(|\)|\<|\>)/g, "\\$1") .replace(/("|'|`)/g, "\\$1"); if (shell...
cwe
CWE-78
JavaScript
void LZ4_init(LZ4_stream_t_internal* lz4ds, const BYTE* base) { MEM_INIT(lz4ds->hashTable, 0, LZ4_STREAMSIZE); lz4ds->bufferStart = base; }
cwe
CWE-20
Unknown
tor_tls_context_init(int is_public_server, crypto_pk_env_t *client_identity, crypto_pk_env_t *server_identity, unsigned int key_lifetime) { int rv1 = 0; int rv2 = 0; if (is_public_server) { tor_tls_context_t *new_ctx; tor_tls_context_t *old_c...
cwe
CWE-264
Unknown
/* GRAPHITE2 LICENSING Copyright 2010, SIL International All rights reserved. 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 License, or (at yo...
cwe
CWE-476
C/C++
int sfgets(void) { struct pollfd pfd; int pollret; ssize_t readnb; signed char seen_r = 0; static size_t scanned; static size_t readnbd; if (scanned > (size_t) 0U) { /* support pipelining */ readnbd -= scanned; memmove(cmd, cmd + scanned, readnbd); ...
cwe
CWE-399
C/C++
from django.contrib import admin import import_export.widgets as widgets from import_export.admin import ImportExportModelAdmin from import_export.fields import Field from import_export.resources import ModelResource from part.models import Part from .models import (Company, ManufacturerPart, ManufacturerPartAttachm...
cwe
CWE-1236
Python
int HexOutStream::length() { return offset + ptr - start; }
cwe
CWE-787
C/C++
# -*- coding: utf-8 -*- # # (c) Cornelius Kölbel # License: AGPLv3 # contact: http://www.privacyidea.org # # This code is free software; you can redistribute it and/or # modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE # License as published by the Free Software Foundation; either # version 3 of ...
cwe
CWE-20
Python
sctp_disposition_t sctp_sf_do_asconf(struct net *net, const struct sctp_endpoint *ep, const struct sctp_association *asoc, const sctp_subtype_t type, void *arg, sctp_cmd_seq_t *commands) { struct sctp_chunk *chunk = arg; struct sctp_chunk *asconf_ack = NULL; struct sctp_paramhdr *...
cwe
CWE-20
C/C++
static struct scatterlist *alloc_sgtable(int size) { int alloc_size, nents, i; struct page *new_page; struct scatterlist *iter; struct scatterlist *table; nents = DIV_ROUND_UP(size, PAGE_SIZE); table = kcalloc(nents, sizeof(*table), GFP_KERNEL); if (!table) return NULL; sg_init_table(table, nents); iter = t...
cwe
CWE-401
C/C++
/** * */ package com.salesmanager.shop.store.controller.shoppingCart.facade; import java.util.ArrayList; import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.UUID; import javax.inject.Inject; import javax.persistence.NoResultException; import org.apache.com...
cwe
CWE-20
Java
/* * Copyright (C) 2012 The Android Open Source Project * * 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 app...
cwe
CWE-862
Java
public ResponseEntity<Resource> download(@PathVariable String key) { LitemallStorage litemallStorage = litemallStorageService.findByKey(key); if (key == null) { ResponseEntity.notFound(); } String type = litemallStorage.getType(); MediaType mediaType = MediaType.parse...
cwe
CWE-22
Java
constructor(connection, {root, cwd} = {}) { this.connection = connection; this.cwd = nodePath.normalize(cwd ? nodePath.join(nodePath.sep, cwd) : nodePath.sep); this._root = nodePath.resolve(root || process.cwd()); }
cwe
CWE-22
JavaScript
static int init_items(struct MACH0_(obj_t)* bin) { struct load_command lc = {0, 0}; ut8 loadc[sizeof (struct load_command)] = {0}; bool is_first_thread = true; ut64 off = 0LL; int i, len; bin->uuidn = 0; bin->os = 0; bin->has_crypto = 0; if (bin->hdr.sizeofcmds > bin->size) { bprintf ("Warning: chopping hdr...
cwe
CWE-416
C/C++
package com.salesmanager.core.constants; import java.util.HashMap; import java.util.Locale; public class SchemaConstant { public final static String SALESMANAGER_SCHEMA = "SALESMANAGER"; /** * Languages iso codes * */ //public static final String[] LANGUAGE_ISO_CODE = {"en", "fr", "ru", "es", "ar"}; publ...
cwe
CWE-639
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-190
Python
static long mem_seek(jas_stream_obj_t *obj, long offset, int origin) { jas_stream_memobj_t *m = (jas_stream_memobj_t *)obj; long newpos; JAS_DBGLOG(100, ("mem_seek(%p, %ld, %d)\n", obj, offset, origin)); switch (origin) { case SEEK_SET: newpos = offset; break; case SEEK_END: newpos = m->len_ - offset; br...
cwe
CWE-190
Unknown
const bootbox = require('bootbox'); require('../services/Requisitions'); const RequisitionNode = require('../model/RequisitionNode'); const RequisitionMetaDataEntry = require('../model/RequisitionMetaDataEntry'); /** * @author Alejandro Galue <agalue@opennms.org> * @copyright 2014 The OpenNMS Group, Inc. */ (functi...
cwe
CWE-352
Java
int data_on_connection(int fd, callback_remove_handler remove) { int nread; char *network_packet; char network_line[8192]; char *p; unsigned long id; char string[1024]; unsigned long msg_id = UINT32_MAX; enum network_protocol version = network_client_get_version(fd); ioctl(fd, FIONREAD, &nread); univention...
cwe
CWE-200
Unknown
func RunUsingChroot(spec *specs.Spec, bundlePath, homeDir string, stdin io.Reader, stdout, stderr io.Writer) (err error) { var confwg sync.WaitGroup var homeFound bool for _, env := range spec.Process.Env { if strings.HasPrefix(env, "HOME=") { homeFound = true break } } if !homeFound { spec.Process.Env...
cwe
CWE-212
Go
Address Zone::NewExpand(int size) { // Make sure the requested size is already properly aligned and that // there isn't enough room in the Zone to satisfy the request. ASSERT(size == RoundDown(size, kAlignment)); ASSERT(size > limit_ - position_); // Compute the new segment size. We use a 'high water mark' ...
cwe
CWE-119
Unknown
Field_new_decimal::Field_new_decimal(uint32 len_arg, bool maybe_null_arg, const char *name, uint8 dec_arg, bool unsigned_arg) :Field_num((uchar*) 0, len_arg, ...
cwe
CWE-120
Unknown
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-119
C/C++
zfont_info(gs_font *font, const gs_point *pscale, int members, gs_font_info_t *info) { int code = gs_default_font_info(font, pscale, members & ~(FONT_INFO_COPYRIGHT | FONT_INFO_NOTICE | FONT_INFO_FAMILY_NAME | FONT_INFO_FULL_NAME), ...
cwe
CWE-704
Unknown
static inline void ModulateHWB(const double percent_hue, const double percent_whiteness,const double percent_blackness,double *red, double *green,double *blue) { double blackness, hue, whiteness; /* Increase or decrease color blackness, whiteness, or hue. */ ConvertRGBToHWB(*red,*green,*blu...
cwe
CWE-835
Unknown
/** httpserver ResourceHost.cpp Copyright 2011-2019 Ramsey Kant 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...
cwe
CWE-22
C/C++
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * th...
cwe
CWE-601
Java
__author__ = "Gina Häußge <osd@foosel.net>" __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html" __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License" import atexit import base64 import functools import logging import logging.config i...
cwe
CWE-613
Python
void SNC_io_parser<EW>::read_items(int plus01) { typename std::vector<Vertex_iterator>::iterator vi; for(vi=Vertex_of.begin(); vi!=Vertex_of.end(); ++vi) { if (!read_vertex<K>(*vi)) CGAL_error_msg("SNC_io_parser::read: error in node line"); } typename std::vector<Halfedge_iterator>::iterator ei; f...
cwe
CWE-125
Unknown
'use strict'; const datastore = require('@google-cloud/datastore')(); class Cache { async clearCache() { const query = datastore.createQuery('Page'); const data = await datastore.runQuery(query); const entities = data[0]; const entityKeys = entities.map((entity) => entity[datastore.KEY]); consol...
cwe
CWE-22
JavaScript
struct l2tp_packet_t *l2tp_packet_alloc(int ver, int msg_type, const struct sockaddr_in *addr, int H, const char *secret, size_t secret_len) { struct l2tp_packet_t *pack = mempool_alloc(pack_pool); if (!pack) return NULL; memset(pack, 0, sizeof(*pack)); INIT_LIST_HEAD(&pack->attrs); pack->hdr.ver = ve...
cwe
CWE-125
Unknown
/************************************************************************ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. * Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko * Website: https://www.espocrm.com * * EspoCRM is free software: you can redistribute i...
cwe
CWE-79
JavaScript
/* * Copyright 2014-2018 the original author or 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 app...
cwe
CWE-94
Java
ssize_t __weak cpu_show_spectre_v2(struct device *dev, struct device_attribute *attr, char *buf) { return sprintf(buf, "Not affected\n"); }
cwe
CWE-787
Unknown
httpGet(url) { const _this = this; const session = _this; return new Promise((resolve, reject) => { let requestMethod = Http.request; if (url.indexOf("https://") === 0) { requestMethod = Https.request; } else if (url.indexOf("http://") !== 0) { err = new Error("Protocol no...
cwe
CWE-918
JavaScript
static GF_Err nhmldmx_send_sample(GF_Filter *filter, GF_NHMLDmxCtx *ctx) { GF_XMLNode *node, *childnode; u64 sample_duration = 0; char szMediaTemp[GF_MAX_PATH], szXmlFrom[1000], szXmlTo[1000]; char *szSubSampleName = ctx->is_dims ? "DIMSSubUnit" : "NHNTSubSample"; while ((node = (GF_XMLNode *) gf_list_enum(ctx->r...
cwe
CWE-787
Unknown
/* Jappix - An open social platform These are the Message Carbons JS script for Jappix ------------------------------------------------- License: AGPL Author: Valérian Saliou */ // Bundle var Carbons = (function () { /** * Alias of this * @private */ var self = {}; /** * Configur...
cwe
CWE-20
JavaScript
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2021 * All rights reserved * * This file is part of GPAC / ISO Media File Format sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU L...
cwe
CWE-476
C/C++
static TfLiteStatus AllocateTemporaryTensorsIfRequired(TfLiteContext* context, TfLiteNode* node, bool is_hybrid, bool is_per_channel, ...
cwe
CWE-787
C/C++
static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception) { const unsigned char *pixels; Image *canvas_image, *image; MagickBooleanType status; MagickOffsetType scene; QuantumInfo *quantum_info; QuantumType quantum_type; size_t length; ssize_...
cwe
CWE-401
Unknown
int MAIN(int argc, char **argv) { int off=0, clr = 0; SSL *con=NULL,*con2=NULL; X509_STORE *store = NULL; int s,k,width,state=0; char *cbuf=NULL,*sbuf=NULL,*mbuf=NULL; int cbuf_len,cbuf_off; int sbuf_len,sbuf_off; fd_set readfds,writefds; short port=PORT; int full_log=1; char *host=SSL_HOST_NAME; char *cer...
cwe
CWE-310
Unknown
def make_hs256_token(payload = nil) payload = { sub: 'abc123' } if payload.nil? JWT.encode payload, client_secret, 'HS256' end
cwe
CWE-347
Ruby
text += `${c.amount(value, a.currency)}<br>`; });
cwe
CWE-79
JavaScript
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2021 * All rights reserved * * This file is part of GPAC / ISO Media File Format sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU L...
cwe
CWE-190
C/C++
psf_close (SF_PRIVATE *psf) { uint32_t k ; int error = 0 ; if (psf->codec_close) { error = psf->codec_close (psf) ; /* To prevent it being called in psf->container_close(). */ psf->codec_close = NULL ; } ; if (psf->container_close) error = psf->container_close (psf) ; error = psf_fclose (psf) ; psf_cl...
cwe
CWE-119
C/C++
async function decrypt(oid, cipher_algo, hash_algo, V, C, d, fingerprint) { const Z = await genPrivateEphemeralKey(oid, cipher_algo, hash_algo, V, d, fingerprint); return new BN(aes_kw.unwrap(Z, C)); }
cwe
CWE-327
JavaScript
PackLinuxElf32::PackLinuxElf32help1(InputFile *f) { e_type = get_te16(&ehdri.e_type); e_phnum = get_te16(&ehdri.e_phnum); e_shnum = get_te16(&ehdri.e_shnum); unsigned const e_phentsize = get_te16(&ehdri.e_phentsize); if (ehdri.e_ident[Elf32_Ehdr::EI_CLASS]!=Elf32_Ehdr::ELFCLASS32 || sizeof(Elf3...
cwe
CWE-476
Unknown
/* ELF executable support for BFD. Copyright (C) 1993-2020 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. 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 Sof...
cwe
CWE-787
C/C++
void X509Certificate::InfoAccess(const FunctionCallbackInfo<Value>& args) { Environment* env = Environment::GetCurrent(args); X509Certificate* cert; ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder()); BIOPointer bio(BIO_new(BIO_s_mem())); Local<Value> ret; if (GetInfoString<NID_info_access>(env, bio, cert->get()...
cwe
CWE-295
Unknown
PJ_DEF(pj_status_t) pjmedia_wav_player_port_create( pj_pool_t *pool, const char *filename, unsigned ptime, unsigned options, pj_ssize_t buff_size, pjmedia_port **p_port ) { pjmedia_wave_hdr wave_hdr; pj_ssize_t size_to_read, size_read; struct file_reade...
cwe
CWE-835
C/C++
OMX_ERRORTYPE omx_vdec::set_config(OMX_IN OMX_HANDLETYPE hComp, OMX_IN OMX_INDEXTYPE configIndex, OMX_IN OMX_PTR configData) { (void) hComp; if (m_state == OMX_StateInvalid) { DEBUG_PRINT_ERROR("Get Config in Invalid State"); return OMX_ErrorInvalidState; } OMX_ERRORTYPE re...
cwe
CWE-20
C/C++
static int oidc_handle_logout(request_rec *r, oidc_cfg *c, oidc_session_t *session) { oidc_provider_t *provider = NULL; /* pickup the command or URL where the user wants to go after logout */ char *url = NULL; oidc_util_get_request_parameter(r, OIDC_REDIRECT_URI_REQUEST_LOGOUT, &url); oidc_debug(r, "enter (url...
cwe
CWE-601
C/C++
static int mincore_unmapped_range(unsigned long addr, unsigned long end, struct mm_walk *walk) { walk->private += __mincore_unmapped_range(addr, end, walk->vma, walk->private); return 0; }
cwe
CWE-200
Unknown
# -*- coding: utf-8 -*- import logging import pytz from odoo import _, api, fields, models from odoo.tools import format_datetime from odoo.exceptions import AccessError, UserError, ValidationError from odoo.tools.translate import html_translate from dateutil.relativedelta import relativedelta _logger = logging.get...
cwe
CWE-269
Python
const pkgConfigPath = function () { if (process.platform !== 'win32') { const brewPkgConfigPath = spawnSync('which brew >/dev/null 2>&1 && eval $(brew --env) && echo $PKG_CONFIG_LIBDIR', spawnSyncOptions).stdout || ''; return [ brewPkgConfigPath.trim(), env.PKG_CONFIG_PATH, '/usr/local/lib/p...
cwe
CWE-77
JavaScript
package org.pac4j.oidc.config; import java.io.IOException; import java.net.URL; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import org.pac4j.core.client.config.BaseClientConfiguration; import org.pac4j.co...
cwe
CWE-347
Java
static int arc_emac_tx(struct sk_buff *skb, struct net_device *ndev) { struct arc_emac_priv *priv = netdev_priv(ndev); unsigned int len, *txbd_curr = &priv->txbd_curr; struct net_device_stats *stats = &ndev->stats; __le32 *info = &priv->txbd[*txbd_curr].info; dma_addr_t addr; if (skb_padto(skb, ETH_ZLEN)) retu...
cwe
CWE-362
C/C++
SplashPath *Splash::makeDashedPath(SplashPath *path) { SplashPath *dPath; SplashCoord lineDashTotal; SplashCoord lineDashStartPhase, lineDashDist, segLen; SplashCoord x0, y0, x1, y1, xa, ya; GBool lineDashStartOn, lineDashOn, newPath; int lineDashStartIdx, lineDashIdx; int i, j, k; lineDashTotal = 0; ...
cwe
CWE-119
C/C++
cff_charset_load( CFF_Charset charset, FT_UInt num_glyphs, FT_Stream stream, FT_ULong base_offset, FT_ULong offset, FT_Bool invert ) { FT_Memory memory = stream->memory; FT_Error error ...
cwe
CWE-189
Unknown
/* SPDX-License-Identifier: GPL-2.0 */ /* * vboxguest linux pci driver, char-dev and input-device code, * * Copyright (C) 2006-2016 Oracle Corporation */ #include <linux/input.h> #include <linux/kernel.h> #include <linux/miscdevice.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/poll.h> #includ...
cwe
CWE-362
C/C++
static ssize_t oz_cdev_write(struct file *filp, const char __user *buf, size_t count, loff_t *fpos) { struct oz_pd *pd; struct oz_elt_buf *eb; struct oz_elt_info *ei; struct oz_elt *elt; struct oz_app_hdr *app_hdr; struct oz_serial_ctx *ctx; spin_lock_bh(&g_cdev.lock); pd = g_cdev.active_pd; if (pd) ...
cwe
CWE-119
C/C++
processFinished(struct module_qstate* qstate, struct iter_qstate* iq, int id) { log_query_info(VERB_QUERY, "finishing processing for", &qstate->qinfo); /* store negative cache element for parent side glue. */ if(!qstate->no_cache_store && iq->query_for_pside_glue && !iq->pside_glue) iter_store_parentside_n...
cwe
CWE-613
Unknown
generate_dnskey_prefetch(struct module_qstate* qstate, struct iter_qstate* iq, int id) { struct module_qstate* subq; log_assert(iq->dp); /* is this query the same as the prefetch? */ if(qstate->qinfo.qtype == LDNS_RR_TYPE_DNSKEY && query_dname_compare(iq->dp->name, qstate->qinfo.qname)==0 && (qstate->query_f...
cwe
CWE-400
Unknown
def update_inverter(self, inverter_serial, ts, status, etoday, etotal): query = ''' UPDATE Inverters SET TimeStamp='%s', Status='%s', eToday='%s', eTotal='%s' WHERE Serial='%s'; ''' % (ts, status, ...
cwe
CWE-89
Python
#include <linux/err.h> #include <linux/igmp.h> #include <linux/kernel.h> #include <linux/netdevice.h> #include <linux/rculist.h> #include <linux/skbuff.h> #include <linux/if_ether.h> #include <net/ip.h> #include <net/netlink.h> #if IS_ENABLED(CONFIG_IPV6) #include <net/ipv6.h> #endif #include "br_private.h" static in...
cwe
CWE-399
C/C++
public static String compileMustache(Map<String, Object> context, String template) { if (context == null || StringUtils.isBlank(template)) { return ""; } Writer writer = new StringWriter(); try { Mustache.compiler().escapeHTML(false).emptyStringIsFalse(true).compile(template).execute(context, writer); }...
cwe
CWE-79
Java
"#ffffff")),Fa=mxUtils.setStyle(Fa,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(Aa,mxConstants.STYLE_STROKECOLOR,"#000000")),Fa=mxUtils.setStyle(Fa,mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(Aa,mxConstants.STYLE_GRADIENTCOLOR,null)),S.getModel().isVertex(Ia[Ea])&&(Fa=mxUtils.setStyle(Fa,mxConstants.STYLE_FONTCO...
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 / 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++
def __init__(self, hs): super().__init__(hs) self.http_client = SimpleHttpClient(hs) # We create a blacklisting instance of SimpleHttpClient for contacting identity # servers specified by clients self.blacklisting_http_client = SimpleHttpClient( hs, ip_blacklist=hs.c...
cwe
CWE-601
Python
do_pdf_save_document(fz_context *ctx, pdf_document *doc, pdf_write_state *opts, pdf_write_options *in_opts) { int lastfree; int num; int xref_len; if (in_opts->do_incremental) { /* If no changes, nothing to write */ if (doc->num_incremental_sections == 0) return; if (opts->out) { fz_seek_output(ctx,...
cwe
CWE-119
Unknown