code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
bool TaskService::UnbindInstance() { { base::AutoLock lock(lock_); if (bound_instance_id_ == kInvalidInstanceId) return false; bound_instance_id_ = kInvalidInstanceId; DCHECK(default_task_runner_); default_task_runner_ = nullptr; } base::subtle::AutoWriteLock task_lock(task_lock_); ...
cwe
CWE-20
C/C++
function handleRequest(req, res) { // express puts content after first slash into 0 index element const path = req.params.path + req.params[0]; const attributeIds = sql.getColumn("SELECT attributeId FROM attributes WHERE isDeleted = 0 AND type = 'label' AND name IN ('customRequestHandler', 'customResource...
cwe
CWE-79
JavaScript
/* Copyright (c) 2001 Matej Pfajfar. * Copyright (c) 2001-2004, Roger Dingledine. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. * Copyright (c) 2007-2015, The Tor Project, Inc. */ /* See LICENSE for licensing information */ /** * \file buffers.c * \brief Implements a generic interface buffer. Buff...
cwe
CWE-119
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-190
C/C++
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "hermes/BCGen/HBC/BytecodeGenerator.h" #include "hermes/BCGen/HBC/ConsecutiveStringStorage.h" #include "hermes/FrontEndDe...
cwe
CWE-787
C/C++
int inet6_sk_rebuild_header(struct sock *sk) { struct ipv6_pinfo *np = inet6_sk(sk); struct dst_entry *dst; dst = __sk_dst_check(sk, np->dst_cookie); if (!dst) { struct inet_sock *inet = inet_sk(sk); struct in6_addr *final_p, final; struct flowi6 fl6; memset(&fl6, 0, sizeof(fl6)); fl6.flowi6_proto = sk...
cwe
CWE-416
Unknown
// SPDX-License-Identifier: GPL-2.0 /* * This is a maximally equidistributed combined Tausworthe generator * based on code from GNU Scientific Library 1.5 (30 Jun 2004) * * lfsr113 version: * * x_n = (s1_n ^ s2_n ^ s3_n ^ s4_n) * * s1_{n+1} = (((s1_n & 4294967294) << 18) ^ (((s1_n << 6) ^ s1_n) >> 13)) * s2_{...
cwe
CWE-330
C/C++
public static void unzip(File input, File destinationDir) throws IOException { try (ZipInputStream zipInput = new ZipInputStream(new BufferedInputStream(new FileInputStream(input)))) { ZipEntry entry; while ((entry = zipInput.getNextEntry()) != null) { File dest = new File(destinationDir, entry.getName()); ...
cwe
CWE-22
Java
void CiffDirectory::readDirectory(const byte* pData, uint32_t size, ByteOrder byteOrder) { if (size < 4) throw Error(kerCorruptedMetadata); uint32_t o = getULong(pData + size - 4, byteOrder); if ( o+...
cwe
CWE-125
C/C++
/* eslint-disable no-redeclare */ 'use strict'; const $ = require('jquery'); const zxcvbn = require('zxcvbn'); const utils = require('./utils.common'); utils.getLanguage = function () { let lang = 'en-GB'; if (typeof window === 'object' && window.config && window.utils) { lang = utils.params().lang || config.us...
cwe
CWE-330
JavaScript
/*- * Copyright (c) 2011 Michihiro NAKAJIMA * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of ...
cwe
CWE-125
C/C++
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <errno.h> #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <sys/mman.h> #include <linux/mman.h> #include <arpa/inet.h> #include "log.h" #include "mempool.h" #include "radius_p.h" #include "memdebug.h" static mempool_t packet_pool;...
cwe
CWE-191
C/C++
#include "rar.hpp" size_t Archive::ReadHeader() { // Once we failed to decrypt an encrypted block, there is no reason to // attempt to do it further. We'll never be successful and only generate // endless errors. if (FailedHeaderDecryption) return 0; CurBlockPos=Tell(); size_t ReadSize; switch(Form...
cwe
CWE-787
C/C++
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-119
Unknown
// SPDX-License-Identifier: BSD-2-Clause /* * Copyright (c) 2014, STMicroelectronics International N.V. */ #include <assert.h> #include <compiler.h> #include <crypto/crypto.h> #include <kernel/tee_ta_manager.h> #include <mm/tee_mmu.h> #include <stdlib_ext.h> #include <string_ext.h> #include <string.h> #include <sys/...
cwe
CWE-327
C/C++
public void addUser(JpaUser user) throws UnauthorizedException { if (!UserDirectoryUtils.isCurrentUserAuthorizedHandleRoles(securityService, user.getRoles())) throw new UnauthorizedException("The user is not allowed to set the admin role on other users"); // Create a JPA user with an encoded password. ...
cwe
CWE-327
Java
function format_topic(topic_data) { const last_msg = message_store.get(topic_data.last_msg_id); const stream = last_msg.stream; const stream_id = last_msg.stream_id; const stream_info = sub_store.get(stream_id); if (stream_info === undefined) { // stream was deleted return {}; } ...
cwe
CWE-79
JavaScript
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * lsquic_hspack_valid.c -- Handshake packet validator. * * We want to eliminate invalid packets as soon as we read them in and not * feed them to lsquic engine if we can avoid it. The handshake packet * possesses several characteristics ...
cwe
CWE-476
C/C++
def add_fence_level_remote(params, request, session) if not allowed_for_local_cluster(session, Permissions::WRITE) return 403, 'Permission denied' end retval, stdout, stderr = add_fence_level( session, params["level"], params["devices"], params["node"], params["remove"] ) if retval == 0 return [20...
cwe
CWE-384
Ruby
evbuffer_ptr_memcmp(const struct evbuffer *buf, const struct evbuffer_ptr *pos, const char *mem, size_t len) { struct evbuffer_chain *chain; size_t position; int r; ASSERT_EVBUFFER_LOCKED(buf); if (pos->pos + len > buf->total_len) return -1; chain = pos->internal_.chain; position = pos->internal_.pos_in...
cwe
CWE-189
Unknown
// Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: Requester) // Package internal is a generated GoMock package. package internal import ( url "net/url" reflect "reflect" time "time" gomock "github.com/golang/mock/gomock" fosite "github.com/ory/fosite" ) // MockRequester ...
cwe
CWE-345
Go
function usersPersistentData() { if (!this.userId) { return UsersPersistentData.find({ meetingId: '' }); } const { meetingId, requesterUserId } = extractCredentials(this.userId); check(meetingId, String); check(requesterUserId, String); const selector = { meetingId, }; const options = {}; ...
cwe
CWE-918
JavaScript
MONGO_EXPORT int mongo_run_command( mongo *conn, const char *db, const bson *command, bson *out ) { int ret = MONGO_OK; bson response = {NULL, 0}; bson fields; int sl = strlen( db ); char *ns = bson_malloc( sl + 5 + 1 ); /* ".$cmd" + nul */ int res, success = ...
cwe
CWE-190
Unknown
/* * 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++
copy_file (char const *from, char const *to, struct stat *tost, int to_flags, mode_t mode, bool to_dir_known_to_exist) { int tofd; if (debug & 4) say ("Copying %s %s to %s\n", S_ISLNK (mode) ? "symbolic link" : "file", quotearg_n (0, from), quotearg_n (1, to)); if (S_ISLNK (mode)) { char *...
cwe
CWE-59
Unknown
static int tcos_select_file(sc_card_t *card, const sc_path_t *in_path, sc_file_t **file_out) { sc_context_t *ctx; sc_apdu_t apdu; sc_file_t *file=NULL; u8 buf[SC_MAX_APDU_BUFFER_SIZE], pathbuf[SC_MAX_PATH_SIZE], *path = pathbuf; unsigned int i; int r, pathlen; assert(card != NULL && in_path != NUL...
cwe
CWE-119
Unknown
this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save())));this.addListener("formatWidthChanged",function(){mxSe...
cwe
CWE-94
JavaScript
Toolbar.prototype.addDropDownArrow=function(a,b,f,d,g,e,k,n){g=EditorUi.compactUi?g:n;a.style.whiteSpace="nowrap";a.style.overflow="hidden";a.style.position="relative";a.style.width=d-(null!=k?k:32)+"px";a.innerHTML='<div class="geSprite '+b+'"></div>';this.appendDropDownImageHtml(a);b=a.getElementsByTagName("div")[0];...
cwe
CWE-94
JavaScript
function restoreConfig(baseURL: string): ?Object { const key = `${_CONFIG_STORE_PREFIX}/${baseURL}`; const config = jitsiLocalStorage.getItem(key); if (config) { try { return JSON.parse(config) || undefined; } catch (e) { // Somehow incorrect data ended up in the sto...
cwe
CWE-1321
JavaScript
static void setFeature(DocumentBuilderFactory dbf, String featureName) throws ParserConfigurationException { try { dbf.setFeature(featureName, true); } catch (ParserConfigurationException e) { if (Boolean.getBoolean(SYSTEM_PROPERTY_IGNORE_XXE_PROTECTION_FAILURES)) { ...
cwe
CWE-611
Java
/* Copyright The containerd 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...
cwe
CWE-863
Go
from hashlib import sha256 from .signature import Signature from .math import Math from .utils.integer import RandomInteger from .utils.binary import numberFromByteString from .utils.compatibility import * class Ecdsa: @classmethod def sign(cls, message, privateKey, hashfunc=sha256): byteMessage = ha...
cwe
CWE-347
Python
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-20
C/C++
XRRGetProviderResources(Display *dpy, Window window) { XExtDisplayInfo *info = XRRFindDisplay(dpy); xRRGetProvidersReply rep; xRRGetProvidersReq *req; XRRProviderResources *xrpr; long nbytes, nbytesRead; int rbytes; RRCheckExtension (dpy, info, NULL); LockDisplay (dpy); GetReq(RR...
cwe
CWE-787
C/C++
static bool extract_sections_symbols(pyc_object *obj, RList *sections, RList *symbols, RList *cobjs, char *prefix) { pyc_code_object *cobj = NULL; RBinSection *section = NULL; RBinSymbol *symbol = NULL; RListIter *i = NULL; //each code object is a section if_true_return (!obj || (obj->type != TYPE_CODE_v1 && obj...
cwe
CWE-415
Unknown
// 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
static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception) { char buffer[MagickPathExtent], name[MagickPathExtent]; Image *image; MagickBooleanType status; register ssize_t i, x; register Quantum *q; register unsigned char *p; short int hex_d...
cwe
CWE-703
C/C++
TfLiteStatus PrepareAny(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 2); const TfLiteTensor* input = GetInput(context, node, 0); TF_LITE_ENSURE_TYPES_EQ(context, input->type, kTfLiteBool); return PrepareSimple(context, node); }
cwe
CWE-787
C/C++
static int tight_init_stream(VncState *vs, int stream_id, int level, int strategy) { z_streamp zstream = &vs->tight.stream[stream_id]; if (zstream->opaque == NULL) { int err; VNC_DEBUG("VNC: TIGHT: initializing zlib stream %d\n", stream_id); VNC_DEBUG("VNC:...
cwe
CWE-401
Unknown
changed_common( linenr_T lnum, colnr_T col, linenr_T lnume, long xtra) { win_T *wp; tabpage_T *tp; int i; int cols; pos_T *p; int add; // mark the buffer as modified changed(); #ifdef FEAT_EVAL may_record_change(lnum, col, lnume, xtra); #endif #ifdef FEAT_DIFF ...
cwe
CWE-120
Unknown
static bool is_partition_in_criterias( const std::string& partition, const std::vector<Criteria>& criterias) { bool returned_value = false; for (auto criteria_it = criterias.begin(); !returned_value && criteria_it != criterias.end(); ++criteria_it) { for (auto part : (*c...
cwe
CWE-284
Unknown
bool IsSupported(const NodeDef* node) const override { return IsAnyMul(*node) && node->input(0) == node->input(1); }
cwe
CWE-476
Unknown
async function fastifyCsrfProtection (fastify, opts) { const { cookieKey, cookieOpts, sessionKey, getToken, getUserInfo, sessionPlugin } = Object.assign({}, defaultOptions, opts) const csrfOpts = opts && opts.csrfOpts ? opts.csrfOpts : {} assert(typeof cookieKey === 'string', 'cookieKe...
cwe
CWE-352
JavaScript
/* * nautilus-directory-async.c: Nautilus directory model state machine. * * Copyright (C) 1999, 2000, 2001 Eazel, 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 versi...
cwe
CWE-20
C/C++
""" Slixmpp: The Slick XMPP Library Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout This file is part of Slixmpp. See the file LICENSE for copying permissio """ import logging import slixmpp from slixmpp.stanza import Message, Iq from slixmpp.xmlstream.handler import Callback from slixmpp.xml...
cwe
CWE-20
Python
Status explain(OperationContext* opCtx, const OpMsgRequest& opMsgRequest, ExplainOptions::Verbosity verbosity, rpc::ReplyBuilderInterface* result) const override { std::string dbname = opMsgRequest.getDatabase().toString(); const BSONObj& cmdObj =...
cwe
CWE-20
Unknown
package teler import ( "fmt" "strings" "net/http" "github.com/kitabisa/teler-waf/request" "github.com/kitabisa/teler-waf/threat" "gitlab.com/golang-commonmark/mdurl" ) // inThreatIndex checks if the given substring is in specific threat datasets func (t *Teler) inThreatIndex(kind threat.Threat, substr string)...
cwe
CWE-79
Go
gxps_archive_input_stream_read (GInputStream *stream, void *buffer, gsize count, GCancellable *cancellable, GError **error) { GXPSArchiveInputStream *istream = GXPS_ARCHIVE_INPUT_STREAM (stream); gssize bytes_read; if (g_cancellable_set_error_if_canc...
cwe
CWE-125
C/C++
static void mbochs_remove(struct mdev_device *mdev) { struct mdev_state *mdev_state = dev_get_drvdata(&mdev->dev); mbochs_used_mbytes -= mdev_state->type->mbytes; vfio_unregister_group_dev(&mdev_state->vdev); kfree(mdev_state->pages); kfree(mdev_state->vconfig); kfree(mdev_state); }
cwe
CWE-200
Unknown
static int nfnl_cthelper_new(struct net *net, struct sock *nfnl, struct sk_buff *skb, const struct nlmsghdr *nlh, const struct nlattr * const tb[], struct netlink_ext_ack *extack) { const char *helper_name; struct nf_conntrack_helper *cur, *helper = NULL; struct nf_conntrack_tuple tuple; str...
cwe
CWE-862
Unknown
static void btu_exec_tap_fd_read(void *p_param) { struct pollfd ufd; int fd = (int)p_param; if (fd == INVALID_FD || fd != btpan_cb.tap_fd) return; for (int i = 0; i < PAN_POOL_MAX && btif_is_enabled() && btpan_cb.flow; i++) { BT_HDR *buffer = (BT_HDR *)GKI_getpoolbuf(PAN_POOL_ID); if (!buffer) { ...
cwe
CWE-284
C/C++
protected function curl_get_contents(&$url, $timeout, $redirect_max, $ua, $outfp) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); if ($outfp) { curl_setopt($ch, CURLOPT_FILE, $outfp); } else { curl_set...
cwe
CWE-78
PHP
ext4_xattr_cache_find(struct inode *inode, struct ext4_xattr_header *header, struct mb_cache_entry **pce) { __u32 hash = le32_to_cpu(header->h_hash); struct mb_cache_entry *ce; struct mb_cache *ext4_mb_cache = EXT4_GET_MB_CACHE(inode); if (!header->h_hash) return NULL; /* never share */ ea_idebug(inode...
cwe
CWE-19
Unknown
__imlib_Ellipse_DrawToData(int xc, int yc, int a, int b, DATA32 color, DATA32 * dst, int dstw, int clx, int cly, int clw, int clh, ImlibOp op, char dst_alpha, char blend) { ImlibPointDrawFunction pfunc; int xx, yy, x, y, prev_x, prev_y, ty, by,...
cwe
CWE-189
C/C++
// mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. // +build arm64,openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_BLUETOOTH = 0x...
cwe
CWE-287
Go
static ssize_t _hostfs_readv( oe_fd_t* desc, const struct oe_iovec* iov, int iovcnt) { ssize_t ret = -1; file_t* file = _cast_file(desc); void* buf = NULL; size_t buf_size = 0; if (!file || (!iov && iovcnt) || iovcnt < 0 || iovcnt > OE_IOV_MAX) OE_RAISE_ERRNO(OE_EINVAL); /*...
cwe
CWE-552
Unknown
void snd_pcm_period_elapsed(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime; unsigned long flags; if (PCM_RUNTIME_CHECK(substream)) return; runtime = substream->runtime; snd_pcm_stream_lock_irqsave(substream, flags); if (!snd_pcm_running(substream) || snd_pcm_update_hw_ptr0(substre...
cwe
CWE-416
C/C++
def create_event(self, title, start_time, time_zone, server_id, description): sql = """INSERT INTO events (title, start_time, time_zone, server_id, description) VALUES ('{0}', '{1}', '{2}', '{3}', '{4}') """.format(title, start_time, time_zone, server_id, description) s...
cwe
CWE-89
Python
void fillWidgetStates(AXObject& axObject, protocol::Array<AXProperty>& properties) { AccessibilityRole role = axObject.roleValue(); if (roleAllowsChecked(role)) { AccessibilityButtonState checked = axObject.checkboxOrRadioValue(); switch (checked) { case ButtonStateOff: p...
cwe
CWE-254
C/C++
public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset, int length) throws ShortBufferException { int space; if (ciphertextOffset > ciphertext.length) space = 0; else space = ciphertext.length - ciphertextOffset; if (keySpec == null) { /...
cwe
CWE-787
Java
/* * This file is part of Espruino, a JavaScript interpreter for Microcontrollers * * Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> * * 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...
cwe
CWE-125
C/C++
nfsd4_layout_verify(struct svc_export *exp, unsigned int layout_type) { if (!exp->ex_layout_types) { dprintk("%s: export does not support pNFS\n", __func__); return NULL; } if (!(exp->ex_layout_types & (1 << layout_type))) { dprintk("%s: layout type %d not supported\n", __func__, layout_type); return NUL...
cwe
CWE-129
C/C++
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* indices = GetInput(context, node, kIndices); const TfLiteTensor* updates = GetInput(context, node, kUpdates); const TfLiteTensor* shape = GetInput(context, node, kShape); TfLiteTensor* output = GetOutput(context, node, kOutputTens...
cwe
CWE-787
C/C++
/* Conexant cx24116/cx24118 - DVBS/S2 Satellite demod/tuner driver Copyright (C) 2006-2008 Steven Toth <stoth@hauppauge.com> Copyright (C) 2006-2007 Georg Acher Copyright (C) 2007-2008 Darron Broad March 2007 Fixed some bugs. Added diseqc support. Added corrected signal strength support...
cwe
CWE-119
C/C++
int attr_is_equal_ex(xmlAttrPtr node, char *name, char *ns) { if (name == NULL || strcmp((char*)node->name, name) == 0) { if (ns) { xmlNsPtr nsPtr = attr_find_ns(node); if (nsPtr) { return (strcmp((char*)nsPtr->href, ns) == 0); } else { return FALSE; } } return TRUE; } return FALSE; }
cwe
CWE-476
Unknown
static char *parsetree_to_sql(struct ldb_module *module, void *mem_ctx, const struct ldb_parse_tree *t) { struct ldb_context *ldb; const struct ldb_schema_attribute *a; struct ldb_val value, subval; char *wild_card_string; char *child, *tmp; char *ret = NULL; char *attr; unsigned int i; ldb ...
cwe
CWE-20
C/C++
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
static public function getInstanceOf($_usernfo, $_tid) { if (!isset(self::$tickets[$_tid])) { self::$tickets[$_tid] = new ticket($_usernfo, $_tid); } return self::$tickets[$_tid]; }
cwe
CWE-732
PHP
DeepTiledInputFile::initialize () { if (_data->partNumber == -1) if (_data->header.type() != DEEPTILE) throw IEX_NAMESPACE::ArgExc ("Expected a deep tiled file but the file is not deep tiled."); if(_data->header.version()!=1) { THROW(IEX_NAMESPACE::ArgExc, "Version " << _data->heade...
cwe
CWE-125
Unknown
def private_messages_for(user, type) options = @options options.reverse_merge!(per_page: per_page_setting) result = Topic.includes(:allowed_users) result = result.includes(:tags) if SiteSetting.tagging_enabled if type == :group result = result.joins( "INNER JOIN topic_a...
cwe
CWE-863
Ruby
_gdata_service_build_session (void) { SoupSession *session = soup_session_sync_new (); #ifdef HAVE_GNOME soup_session_add_feature_by_type (session, SOUP_TYPE_GNOME_FEATURES_2_26); #endif /* HAVE_GNOME */ /* Log all libsoup traffic if debugging's turned on */ if (_gdata_service_get_log_level () > GDATA_LOG_MESSAGE...
cwe
CWE-20
Unknown
package v0 import ( "context" "errors" "fmt" v0 "github.com/authzed/authzed-go/proto/authzed/api/v0" v1_api "github.com/authzed/authzed-go/proto/authzed/api/v1" "github.com/authzed/grpcutil" grpcmw "github.com/grpc-ecosystem/go-grpc-middleware" "github.com/rs/zerolog/log" "github.com/shopspring/decimal" "go...
cwe
CWE-20
Go
def update if @application.update(application_params) flash[:notice] = I18n.t(:notice, scope: i18n_scope(:update)) respond_to do |format| format.html { redirect_to oauth_application_url(@application) } format.json { render json: @application } end else re...
cwe
CWE-862
Ruby
do_page_fault(struct pt_regs *regs, unsigned long error_code) { struct vm_area_struct *vma; struct task_struct *tsk; unsigned long address; struct mm_struct *mm; int fault; int write = error_code & PF_WRITE; unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | (write ? FAULT_FLAG_WRITE : 0); ...
cwe
CWE-400
C/C++
static Status Compute(OpKernelContext* context, const typename TTypes<T, 1>::ConstTensor& values, const typename TTypes<T, 1>::ConstTensor& value_range, int32_t nbins, typename TTypes<Tout, 1>::Tensor& out) { const CPUDevice& d = context->eigen...
cwe
CWE-703
Unknown
static Image *ExtractPostscript(Image *image,const ImageInfo *image_info, MagickOffsetType PS_Offset,ssize_t PS_Size,ExceptionInfo *exception) { char postscript_file[MagickPathExtent]; const MagicInfo *magic_info; FILE *ps_file; ImageInfo *clone_info; Image *image2; un...
cwe
CWE-125
C/C++
lexer_process_char_literal (parser_context_t *context_p, /**< context */ const uint8_t *char_p, /**< characters */ size_t length, /**< length of string */ uint8_t literal_type, /**< final literal type */ bool...
cwe
CWE-476
Unknown
public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset, int length) throws ShortBufferException { int space; if (ciphertextOffset > ciphertext.length) space = 0; else space = ciphertext.length - ciphertextOffset; if (!haskey) { // The ke...
cwe
CWE-125
Java
hook_connect_gnutls_set_certificates (gnutls_session_t tls_session, const gnutls_datum_t *req_ca, int nreq, const gnutls_pk_algorithm_t *pk_algos, int pk_algos_len, gnu...
cwe
CWE-20
Unknown
file_check_mem(struct magic_set *ms, unsigned int level) { size_t len; if (level >= ms->c.len) { len = (ms->c.len += 20) * sizeof(*ms->c.li); ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ? malloc(len) : realloc(ms->c.li, len)); if (ms->c.li == NULL) { file_oomem(ms, len); ret...
cwe
CWE-119
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
static inline int xfrm_replay_verify_len(struct xfrm_replay_state_esn *replay_esn, struct nlattr *rp) { struct xfrm_replay_state_esn *up; if (!replay_esn || !rp) return 0; up = nla_data(rp); if (xfrm_replay_state_esn_len(replay_esn) != xfrm_replay_state_esn_len(up)) return -EINVAL; return 0; }
cwe
CWE-200
C/C++
/* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and t...
cwe
CWE-125
C/C++
int SSL_library_init(void) { #ifndef OPENSSL_NO_DES EVP_add_cipher(EVP_des_cbc()); EVP_add_cipher(EVP_des_ede3_cbc()); #endif #ifndef OPENSSL_NO_IDEA EVP_add_cipher(EVP_idea_cbc()); #endif #ifndef OPENSSL_NO_RC4 EVP_add_cipher(EVP_rc4()); #if !defined(OPENSSL_NO_MD5) && (defined(__x86_64) || defined(__x86_64__)) ...
cwe
CWE-310
Unknown
def get_first_ranked_month(db, scene, player): sql = "select date from ranks where scene='{}' and player='{}' order by date limit 1;".format(scene, player) res = db.exec(sql) date = res[0][0] return date
cwe
CWE-89
Python
def AsyncGetActionAllowAnyone(f: GetRequest => Future[Result]): mvc.Action[Unit] = PlainApiAction(cc.parsers.empty, NoRateLimits, allowAnyone = true).async(f)
cwe
CWE-613
Scala
static av_cold int vc2_encode_init(AVCodecContext *avctx) { Plane *p; SubBand *b; int i, j, level, o, shift; VC2EncContext *s = avctx->priv_data; s->picture_number = 0; /* Total allowed quantization range */ s->q_ceil = MAX_QUANT_INDEX; s->ver.major = 2; s->ver.minor = 0; s...
cwe
CWE-125
Unknown
int ssl3_accept(SSL *s) { BUF_MEM *buf; unsigned long l,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; else ...
cwe
CWE-310
Unknown
spnego_gss_wrap_iov(OM_uint32 *minor_status, gss_ctx_id_t context_handle, int conf_req_flag, gss_qop_t qop_req, int *conf_state, gss_iov_buffer_desc *iov, int iov_count) { OM_uint32 ret; ret = gss_wrap_iov(minor_status, context_handle, conf_req_flag, qop_req, ...
cwe
CWE-763
C/C++
VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::CreateVP8Picture() { scoped_refptr<VaapiDecodeSurface> va_surface = vaapi_dec_->CreateSurface(); if (!va_surface) return nullptr; return new VaapiVP8Picture(std::move(va_surface)); }
cwe
CWE-362
C/C++
bool HTMLFormElement::prepareForSubmission(Event* event) { Frame* frame = document().frame(); if (m_isSubmittingOrPreparingForSubmission || !frame) return m_isSubmittingOrPreparingForSubmission; m_isSubmittingOrPreparingForSubmission = true; m_shouldSubmit = false; if (!validateInterac...
cwe
CWE-399
C/C++
int cipso_v4_req_setattr(struct request_sock *req, const struct cipso_v4_doi *doi_def, const struct netlbl_lsm_secattr *secattr) { int ret_val = -EPERM; unsigned char *buf = NULL; u32 buf_len; u32 opt_len; struct ip_options *opt = NULL; struct inet_request_sock *req_inet; /* We allocate the maximum CIPS...
cwe
CWE-362
Unknown
NTSTATUS smb2cli_session_encryption_on(struct smbXcli_session *session) { if (session->smb2->should_encrypt) { return NT_STATUS_OK; } if (session->conn->protocol < PROTOCOL_SMB2_24) { return NT_STATUS_NOT_SUPPORTED; } if (session->conn->smb2.server.cipher == 0) { return NT_STATUS_NOT_SUPPORTED; } if (se...
cwe
CWE-20
Unknown
import { mapGetters } from 'vuex'; export default { computed: { ...mapGetters({ currentChat: 'getSelectedChat', accountId: 'getCurrentAccountId', }), attributes() { return this.$store.getters['attributes/getAttributesByModel']( this.attributeType ); }, customAttrib...
cwe
CWE-79
JavaScript
package saml import ( "bytes" "compress/flate" "context" "crypto/rsa" "crypto/tls" "crypto/x509" "encoding/base64" "encoding/xml" "errors" "fmt" "html/template" "io/ioutil" "net/http" "net/url" "regexp" "time" "github.com/beevik/etree" xrv "github.com/mattermost/xml-roundtrip-validator" dsig "githu...
cwe
CWE-770
Go
int hns_rcb_get_ring_sset_count(int stringset) { if (stringset == ETH_SS_STATS) return HNS_RING_STATIC_REG_NUM; return 0; }
cwe
CWE-703
Unknown
static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, char *offset_base, size_t IFDlength, size_t displacement, int section_index TSRMLS_DC) { int de; int NumDirEntries; int NextDirOffset; #ifdef EXIF_DEBUG exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process %s (x%04X(=%d))"...
cwe
CWE-119
Unknown
var { Cache, normalizePath, split, forEach } = require('./') var setCache = new Cache(512), getCache = new Cache(512) function makeSafe(path, param) { var result = param, parts = split(path), isLast forEach(parts, function(part, isBracket, isArray, idx, parts) { isLast = idx === parts.length - 1 ...
cwe
CWE-20
JavaScript
/* * card-tcos.c: Support for TCOS cards * * Copyright (C) 2011 Peter Koch <pk@opensc-project.org> * Copyright (C) 2002 g10 Code GmbH * Copyright (C) 2001 Juha Yrjölä <juha.yrjola@iki.fi> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General P...
cwe
CWE-119
C/C++
Controller::constructHeaderForSessionProtocol(Request *req, char * restrict buffer, unsigned int &size, const SessionProtocolWorkingState &state, string delta_monotonic) { char *pos = buffer; const char *end = buffer + size; pos += sizeof(boost::uint32_t); pos = appendData(pos, end, P_STATIC_STRING_WITH_NULL("RE...
cwe
CWE-476
C/C++