code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
SessionStartupPref StartupBrowserCreator::GetSessionStartupPref( const base::CommandLine& command_line, Profile* profile) { DCHECK(profile); PrefService* prefs = profile->GetPrefs(); SessionStartupPref pref = SessionStartupPref::GetStartupPref(prefs); #if defined(OS_CHROMEOS) const bool is_first_run = ...
cwe
CWE-79
Unknown
Status Examples::CreateSparseFeatureRepresentation( const DeviceBase::CpuWorkerThreads& worker_threads, const int num_examples, const int num_sparse_features, const ModelWeights& weights, const OpInputList& sparse_example_indices_inputs, const OpInputList& sparse_feature_indices_inputs, const OpInpu...
cwe
CWE-476
Unknown
int ssl3_send_alert(SSL *s, int level, int desc) { /* Map tls/ssl alert value to correct one */ desc = s->method->ssl3_enc->alert_value(desc); if (s->version == SSL3_VERSION && desc == SSL_AD_PROTOCOL_VERSION) desc = SSL_AD_HANDSHAKE_FAILURE; /* SSL 3.0 does not have ...
cwe
CWE-200
Unknown
static ssize_t o2nm_node_num_store(struct config_item *item, const char *page, size_t count) { struct o2nm_node *node = to_o2nm_node(item); struct o2nm_cluster *cluster = to_o2nm_cluster_from_node(node); unsigned long tmp; char *p = (char *)page; int ret = 0; tmp = simple_strtoul(p, &p, 0); if (!p || (*p...
cwe
CWE-476
Unknown
package com.salesmanager.shop.admin.controller.tax; import com.salesmanager.core.business.services.reference.country.CountryService; import com.salesmanager.core.business.services.reference.zone.ZoneService; import com.salesmanager.core.business.services.tax.TaxClassService; import com.salesmanager.core.business.servic...
cwe
CWE-79
Java
/* * Dragonfly - Runtime dependency management library * Copyright (c) 2021 Joshua Sing <joshua@hypera.dev> * * 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, in...
cwe
CWE-611
Java
// 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 darwin,arm64,!go1.12 package unix func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { return 0, ENOSYS } // Copyright 2019 ...
cwe
CWE-287
Go
package org.openmrs.module.appointmentscheduling; import org.openmrs.BaseOpenmrsData; import org.openmrs.Patient; import org.openmrs.Provider; import java.util.Date; /** * persisted object that reflects a request by a provider (or other user) for a scheduler to schedule a patient for a future appointment; * has an...
cwe
CWE-79
Java
static bool snd_ctl_remove_numid_conflict(struct snd_card *card, unsigned int count) { struct snd_kcontrol *kctl; list_for_each_entry(kctl, &card->controls, list) { if (kctl->id.numid < card->last_numid + 1 + count && kctl->id.numid + kctl->count > card->last_numid + 1) { card->last_numid...
cwe
CWE-190
C/C++
/** * <a href="http://www.openolat.org"> * OpenOLAT - Online Learning and Training</a><br> * <p> * Licensed under the Apache License, Version 2.0 (the "License"); <br> * you may not use this file except in compliance with the License.<br> * You may obtain a copy of the License at the * <a href="http://www.apache...
cwe
CWE-91
Java
tabstop_set(char_u *var, int **array) { int valcount = 1; int t; char_u *cp; if (var[0] == NUL || (var[0] == '0' && var[1] == NUL)) { *array = NULL; return OK; } for (cp = var; *cp != NUL; ++cp) { if (cp == var || cp[-1] == ',') { char_u *end; if (strtol((char *...
cwe
CWE-787
Unknown
_libssh2_channel_flush(LIBSSH2_CHANNEL *channel, int streamid) { if(channel->flush_state == libssh2_NB_state_idle) { LIBSSH2_PACKET *packet = _libssh2_list_first(&channel->session->packets); channel->flush_refund_bytes = 0; channel->flush_flush_bytes = 0; while(packet) {...
cwe
CWE-787
Unknown
decode_bundle(bool load, const struct nx_action_bundle *nab, const struct vl_mff_map *vl_mff_map, uint64_t *tlv_bitmap, struct ofpbuf *ofpacts) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); struct ofpact_bundle *bundle; uint32_t slave_type; size_t slaves_si...
cwe
CWE-125
C/C++
/* bcon.c */ /* Copyright 2009-2012 10gen Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by...
cwe
CWE-190
C/C++
const openpgp = require('../openpgpjs/dist/openpgp.js'); const nacl = require('../tweetnacljs/nacl.js'); const sha256 = require('../fast-sha256-js'); var TogaTech = {}; function tEnvoy(openpgpRef = openpgp, naclRef = nacl, sha256Ref = sha256) { let _openpgp = openpgpRef; let _nacl = naclRef; let _sha256 = sha256Re...
cwe
CWE-347
JavaScript
public void resetPassword(UserReference userReference, String newPassword) throws ResetPasswordException { this.checkUserReference(userReference); XWikiContext context = this.contextProvider.get(); DocumentUserReference documentUserReference = (DocumentUserReference) userReference; ...
cwe
CWE-640
Java
function workspaceEndpoints(app) { if (!app) return; app.post("/workspace/new", [validatedRequest], async (request, response) => { try { const user = await userFromSession(request, response); const { name = null } = reqBody(request); const { workspace, message } = await Workspace.new(name, us...
cwe
CWE-305
JavaScript
public void doFilter(ServletRequest srequest, ServletResponse response, FilterChain filterChain) throws IOException, ServletException { /* HttpServletRequest request = (HttpServletRequest) srequest; //final String realIp = request.getHeader(X_FORWARDED_FOR); //if (realIp != null) { filterChain.doFilte...
cwe
CWE-79
Java
static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce) { long datalen; datalen = parse_iv2((*p) + 2, p); (*p) += 2; if (datalen < 0 || (*p) + datalen >= max) { zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %ld present", datalen, (long)(max - (*p))); return 0...
cwe
CWE-189
Unknown
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-22
PHP
############################################################################## # # Copyright (c) 2001 Zope Foundation and Contributors # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this # distribution. # THIS SOFTWARE IS PROVIDED "AS ...
cwe
CWE-200
Python
# -*- 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-521
Python
toomany(struct magic_set *ms, const char *name, uint16_t num) { if (file_printf(ms, ", too many %s header sections (%u)", name, num ) == -1) return -1; return 0; }
cwe
CWE-399
C/C++
PepperMediaDeviceManager* PepperMediaDeviceManager::GetForRenderFrame( RenderFrame* render_frame) { PepperMediaDeviceManager* handler = PepperMediaDeviceManager::Get(render_frame); if (!handler) handler = new PepperMediaDeviceManager(render_frame); return handler; }
cwe
CWE-399
C/C++
size_t OpenMP4SourceUDTA(char *filename) { mp4object *mp4 = (mp4object *)malloc(sizeof(mp4object)); if (mp4 == NULL) return 0; memset(mp4, 0, sizeof(mp4object)); #ifdef _WINDOWS fopen_s(&mp4->mediafp, filename, "rb"); #else mp4->mediafp = fopen(filename, "rb"); #endif if (mp4->mediafp) { uint32_t qttag, qts...
cwe
CWE-369
Unknown
static const char *lua_authz_parse(cmd_parms *cmd, const char *require_line, const void **parsed_require_line) { const char *provider_name; lua_authz_provider_spec *spec; apr_pool_userdata_get((void**)&provider_name, AUTHZ_PROVIDER_NAME_NOTE, ...
cwe
CWE-863
C/C++
import logging from pathlib import Path from shutil import which from elasticsearch.exceptions import RequestError from flask import Flask from flask_compress import Compress from flask_login import LoginManager from archivy import helpers from archivy.api import api_bp from archivy.models import User from archivy.co...
cwe
CWE-352
Python
func prepareRootfs(pipe io.ReadWriter, iConfig *initConfig) (err error) { config := iConfig.Config if err := prepareRoot(config); err != nil { return fmt.Errorf("error preparing rootfs: %w", err) } mountConfig := &mountConfig{ root: config.Rootfs, label: config.MountLabel, cgroup2Path:...
cwe
CWE-190
Go
dns_stricmp(const char* str1, const char* str2) { char c1, c2; *----------------------------------------------------------------------------*/ /* DNS variables */ static struct udp_pcb *dns_pcb; static u8_t dns_seqno; static struct dns_table_entry dns_table[DNS_TABLE_SIZE]; static str...
cwe
CWE-345
C/C++
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * lsquic_mini_conn.c -- Mini connection. * * Mini connection is only used in server mode -- this assumption is relied * upon by the code in this file. * * The purpose of this connection is to process incoming handshakes using * minimal ...
cwe
CWE-476
C/C++
function validateBaseUrl(url: string) { // from this MIT-licensed gist: https://gist.github.com/dperini/729294 return /^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-...
cwe
CWE-1333
JavaScript
static long ext4_zero_range(struct file *file, loff_t offset, loff_t len, int mode) { struct inode *inode = file_inode(file); handle_t *handle = NULL; unsigned int max_blocks; loff_t new_size = 0; int ret = 0; int flags; int credits; int partial_begin, partial_end; loff_t start, end; ext4_lblk_t lblk; ...
cwe
CWE-17
C/C++
slapi_pblock_clone(Slapi_PBlock *pb) { /* * This is used only in psearch, with an access pattern of * ['13:3', '191:28', '47:18', '2001:1', '115:3', '503:3', '196:10', '52:18', '1930:3', '133:189', '112:13', '57:1', '214:91', '70:93', '193:14', '49:10', '403:6', '117:2', '1001:1', '130:161', '109:2', '198...
cwe
CWE-415
Unknown
on_unregister_handler(TCMUService1HandlerManager1 *interface, GDBusMethodInvocation *invocation, gchar *subtype, gpointer user_data) { struct tcmur_handler *handler = find_handler_by_subtype(subtype); struct dbus_info *info = handler ? handler->opaque : NULL; if (!handler) { g_dbus_method_...
cwe
CWE-476
C/C++
// Copyright 2019 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
cwe
CWE-134
Go
static int update_modify_options(struct libmnt_update *upd, struct libmnt_lock *lc) { struct libmnt_table *tb = NULL; int rc = 0, u_lc = -1; struct libmnt_fs *fs; assert(upd); assert(upd->fs); DBG(UPDATE, mnt_debug_h(upd, "%s: modify options", upd->filename)); fs = upd->fs; if (lc) mnt_lock_file(lc); els...
cwe
CWE-399
Unknown
dse_bind(Slapi_PBlock *pb) /* JCM There should only be one exit point from this function! */ { ber_tag_t method; /* The bind method */ struct berval *cred; /* The bind credentials */ Slapi_Value **bvals; struct dse *pdse; Slapi_Attr *attr; Slapi_DN *sdn = NULL; Slapi_Entry *ec = NULL; ...
cwe
CWE-203
C/C++
/* * Copyright (C) 2016 Southern Storm Software, Pty Ltd. * * 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-119
Java
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2021 * All rights reserved * * This file is part of GPAC / mp4box application * * GPAC 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++
/*** x509 modules for lua-openssl binding create and manage x509 certificate @module x509 @usage x509 = require'openssl'.x509 */ #include "openssl.h" #include "private.h" #define CRYPTO_LOCK_REF #include "sk.h" #define MYNAME "x509" #define MYVERSION MYNAME " library for " LUA_VERSION " / Nov 2014 / "\ "based ...
cwe
CWE-295
C/C++
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this fi...
cwe
CWE-74
Java
# -*- coding: utf-8 -*- # This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web) # Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11, # andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh, # falgh1, grunjol, csitk...
cwe
CWE-284
JavaScript
/* Jsi commands to access C-data. http://jsish.org */ #ifndef JSI_LITE_ONLY #ifndef JSI_AMALGAMATION #include "jsiInt.h" #endif #ifndef JSI_OMIT_CDATA #include <fcntl.h> #include <limits.h> #include <stdio.h> #include <string.h> #include <assert.h> #include <stdlib.h> #include <time.h> #include <ctype.h> #include <un...
cwe
CWE-190
C/C++
import re import secrets from typing import Any, Dict, Optional, Tuple from urllib.parse import urlparse from django.conf import settings from django.http import HttpRequest, JsonResponse from django.views.decorators.csrf import csrf_exempt from rest_framework import status from sentry_sdk import capture_exception fro...
cwe
CWE-601
Python
static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport) { struct sock *sk = skb->sk; struct ipv6_pinfo *np = inet6_sk(sk); struct flowi6 fl6; memset(&fl6, 0, sizeof(fl6)); fl6.flowi6_proto = sk->sk_protocol; /* Fill in the dest address from the route entry passed with the skb * and the...
cwe
CWE-310
Unknown
static int lz4_uncompress(const char *source, char *dest, int osize) { const BYTE *ip = (const BYTE *) source; const BYTE *ref; BYTE *op = (BYTE *) dest; BYTE * const oend = op + osize; BYTE *cpy; unsigned token; size_t length; size_t dec32table[] = {0, 3, 2, 3, 0, 0, 0, 0}; #if LZ4_ARCH64 size_t dec64table[] ...
cwe
CWE-20
C/C++
int main(int argc, char* argv[]) { QUtil::setLineBuf(stdout); if ((whoami = strrchr(argv[0], '/')) == NULL) { whoami = argv[0]; } else { ++whoami; } // For libtool's sake.... if (strncmp(whoami, "lt-", 3) == 0) { whoami += 3; } if (argc != 2) { usage(); } ...
cwe
CWE-125
Unknown
static uint32_t color_string_to_rgba(const char *p, int len) { uint32_t ret = 0xFF000000; const ColorEntry *entry; char color_name[100]; if (*p == '#') { p++; len--; if (len == 3) { ret |= (hex_char_to_number(p[2]) << 4) | (hex_char_to_numbe...
cwe
CWE-119
C/C++
const http = require('http'); const https = require('https'); const url = require('url'); /** Mounts a proxy at `basePath` such that requests of the form * `${basePath}/http://www.example.com?queryString=value` will be converted to * `http://www.example.com?queryString=value`, preserving any request headers. * The ...
cwe
CWE-918
JavaScript
static unsigned create_oops_dump_dirs(GList *oops_list, unsigned oops_cnt) { unsigned countdown = MAX_DUMPED_DD_COUNT; /* do not report hundreds of oopses */ log_notice("Saving %u oopses as problem dirs", oops_cnt >= countdown ? countdown : oops_cnt); char *cmdline_str = xmalloc_fopen_fgetline_fclose("/pr...
cwe
CWE-200
C/C++
TEST_F(AllowMissingInAndOfOrListTest, GoodAndBadJwts) { EXPECT_CALL(mock_cb_, onComplete(Status::Ok)); // Use the token with example.com issuer for x-other. auto headers = Http::TestRequestHeaderMapImpl{{kExampleHeader, GoodToken}, {kOtherHeader, GoodToken}}; context_ = Verifier::createContext(headers, pa...
cwe
CWE-703
Unknown
QPDF::writeHSharedObject(BitWriter& w) { HSharedObject& t = this->m->shared_object_hints; w.writeBits(t.first_shared_obj, 32); // 1 w.writeBits(t.first_shared_offset, 32); // 2 w.writeBits(t.nshared_first_page, 32); // 3 w.writeBits(t.nshared_total, 32); // 4 w.writeBits(t....
cwe
CWE-787
Unknown
############################################################################# # # Copyright (c) 2002 Zope Foundation and Contributors. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS...
cwe
CWE-1321
Python
package migrations import ( "encoding/json" "fmt" "github.com/answerdev/answer/internal/base/data" "github.com/answerdev/answer/internal/entity" "github.com/answerdev/answer/internal/service/permission" "golang.org/x/crypto/bcrypt" "xorm.io/xorm" ) const ( defaultSEORobotTxt = `User-agent: * Disallow: /admin...
cwe
CWE-862
Go
sraSpanRemove(sraSpan *span) { span->_prev->_next = span->_next; span->_next->_prev = span->_prev; }
cwe
CWE-476
C/C++
z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, const char *permission) { i_ctx_t *i_ctx_p = get_minst_from_memory(mem)->i_ctx_p; gs_parsed_file_name_t pname; const char *permitgroup = permission[0] == 'r' ? "PermitFileReading" : "PermitFileWriting"; int code = gs_parse_file...
cwe
CWE-200
C/C++
from dataclasses import dataclass from typing import Dict, List, Optional, Type import graphene from django.core.exceptions import ValidationError from django.db import transaction from django.db.models import Model from ...core.permissions import MenuPermissions, SitePermissions from ...core.tracing import traced_at...
cwe
CWE-20
Python
VOID ixheaacd_esbr_radix4bfly(const WORD32 *w, WORD32 *x, WORD32 index1, WORD32 index) { int i; WORD32 l1, l2, h2, fft_jmp; WORD32 xt0_0, yt0_0, xt1_0, yt1_0, xt2_0, yt2_0; WORD32 xh0_0, xh1_0, xh20_0, xh21_0, xl0_0, xl1_0, xl20_0, xl21_0; WORD32 x_0, x_1, x_l1_0, x_l1_1, x_...
cwe
CWE-787
C/C++
static inline signed int ReadPropertySignedLong(const EndianType endian, const unsigned char *buffer) { union { unsigned int unsigned_value; signed int signed_value; } quantum; unsigned int value; if (endian == LSBEndian) { value=(unsigned int) ((buffer[3] << 24) | (buff...
cwe
CWE-125
Unknown
static int parse_multipart( ogs_sbi_message_t *message, ogs_sbi_http_message_t *http) { char *boundary = NULL; int i; multipart_parser_settings settings; multipart_parser_data_t data; multipart_parser *parser = NULL; ogs_assert(message); ogs_assert(http); memset(&settings, 0,...
cwe
CWE-476
Unknown
"""Transport related viewsets.""" from drf_spectacular.utils import extend_schema from rest_framework import permissions, response, viewsets from . import serializers from ... import backends class TransportViewSet(viewsets.ViewSet): """Viewset for Transport.""" permissions = (permissions.IsAuthenticated, ...
cwe
CWE-305
Python
function ae(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+K(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defau...
cwe
CWE-79
JavaScript
void h2_mplx_task_done(h2_mplx *m, h2_task *task, h2_task **ptask) { H2_MPLX_ENTER_ALWAYS(m); task_done(m, task); --m->tasks_active; if (m->join_wait) { apr_thread_cond_signal(m->join_wait); } if (ptask) { /* caller wants another task */ *ptask = next_stream_task(m)...
cwe
CWE-770
Unknown
def list_editor_workflows(request): workflows = [d.content_object.to_dict() for d in Document.objects.get_docs(request.user, Document2, extra='workflow2')] return render('editor/list_editor_workflows.mako', request, { 'workflows_json': json.dumps(workflows) })
cwe
CWE-79
Python
_XkbSetDeviceInfo(ClientPtr client, DeviceIntPtr dev, xkbSetDeviceInfoReq * stuff) { char *wire; wire = (char *) &stuff[1]; if (stuff->change & XkbXI_ButtonActionsMask) { if (!dev->button) { client->errorValue = _XkbErrCode2(XkbErr_BadClass, ButtonClass); r...
cwe
CWE-94
Unknown
/* ** vm.c - virtual machine for mruby ** ** See Copyright Notice in mruby.h */ #include <mruby.h> #include <mruby/array.h> #include <mruby/class.h> #include <mruby/hash.h> #include <mruby/irep.h> #include <mruby/numeric.h> #include <mruby/proc.h> #include <mruby/range.h> #include <mruby/string.h> #include <mruby/vari...
cwe
CWE-416
C/C++
package com.salesmanager.shop.model.catalog.product.attribute; public class ReadableProductOptionValue extends ProductOptionValue { /** * */ private static final long serialVersionUID = 1L; private String price; private String image; private String name; public String getName() { return name; } pu...
cwe
CWE-79
Java
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-119
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-908
C/C++
import AppCache from './cache'; import Parse from 'parse/node'; import auth from './Auth'; import Config from './Config'; import ClientSDK from './ClientSDK'; import defaultLogger from './logger'; export const DEFAULT_ALLOWED_HEADERS = 'X-Parse-Master-Key, X-Parse-REST-API-Key, X-Parse-Javascript-Key, X-Parse-Applic...
cwe
CWE-863
JavaScript
/* * Copyright (c) 2009-2012, 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 are met: * * * Redistributions of source code must retain the above co...
cwe
CWE-680
C/C++
bash_filename_stat_hook (dirname) char **dirname; { char *local_dirname, *new_dirname, *t; int should_expand_dirname, return_value; int global_nounset; WORD_LIST *wl; struct stat sb; local_dirname = *dirname; should_expand_dirname = return_value = 0; if (t = mbschr (local_dirname, '$')) should...
cwe
CWE-20
Unknown
bool TLSWrap::InvokeQueued(int status, const char* error_str) { Debug(this, "InvokeQueued(%d, %s)", status, error_str); if (!write_callback_scheduled_) return false; if (current_write_ != nullptr) { WriteWrap* w = current_write_; current_write_ = nullptr; w->Done(status, error_str); } return...
cwe
CWE-416
Unknown
void * adminchild(struct clientparam* param) { int i, res; char * buf; char username[256]; char *sb; char *req = NULL; struct printparam pp; int contentlen = 0; int isform = 0; pp.inbuf = 0; pp.cp = param; buf = myalloc(LINESIZE); if(!buf) {RETURN(555);} i = sockgetlinebuf(param, CLIENT, (unsigned ...
cwe
CWE-787
C/C++
function flexibleAddSighting(clicked, type, attribute_id, event_id, value, page, placement) { var $clicked = $(clicked); var hoverbroken = false; $clicked.off('mouseleave.temp').on('mouseleave.temp', function() { hoverbroken = true; }); setTimeout(function() { $clicked.off('mouseleav...
cwe
CWE-79
JavaScript
// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2009 * Sergey Kubushyn, himself, ksi@koi8.net * * Changes for unified multibus/multiadapter I2C support. * * (C) Copyright 2001 * Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com. */ /* * I2C Functions similar to the standard memory functions. * * T...
cwe
CWE-787
C/C++
static Image *ReadGROUP4Image(const ImageInfo *image_info, ExceptionInfo *exception) { char filename[MagickPathExtent]; FILE *file; Image *image; ImageInfo *read_info; int c, unique_file; MagickBooleanType status; size_t length; ssize_t offset, strip_offs...
cwe
CWE-252
C/C++
print_timer(struct seq_file *m, struct hrtimer *taddr, struct hrtimer *timer, int idx, u64 now) { #ifdef CONFIG_TIMER_STATS char tmp[TASK_COMM_LEN + 1]; #endif SEQ_printf(m, " #%d: ", idx); print_name_offset(m, taddr); SEQ_printf(m, ", "); print_name_offset(m, timer->function); SEQ_printf(m, ", S:%02x", time...
cwe
CWE-200
Unknown
func p224Contract(out, in *p224FieldElement) { copy(out[:], in[:]) for i := 0; i < 7; i++ { out[i+1] += out[i] >> 28 out[i] &= bottom28Bits } top := out[7] >> 28 out[7] &= bottom28Bits out[0] -= top out[3] += top << 12 // We may just have made out[i] negative. So we carry down. If we made // out[0] nega...
cwe
CWE-682
Go
static int xt_osf_add_callback(struct net *net, struct sock *ctnl, struct sk_buff *skb, const struct nlmsghdr *nlh, const struct nlattr * const osf_attrs[], struct netlink_ext_ack *extack) { struct xt_osf_user_finger *f; struct xt_osf_finger *kf = NULL, *sf; int err = 0; if (!osf_attr...
cwe
CWE-862
Unknown
VP8XChunk::VP8XChunk(Container* parent) : Chunk(parent, kChunk_VP8X) { this->needsRewrite = true; this->size = 10; this->data.resize(this->size); this->data.assign(this->size, 0); XMP_Uns8* bitstream = (XMP_Uns8*)parent->chunks[WEBP_CHUNK_IMAGE][0]->data.data(); XMP_Uns32 width = ((...
cwe
CWE-476
Unknown
# # Async wrapper module for managerlib methods, with glib integration # # 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...
cwe
CWE-264
Python
function s(){o.detach().trigger("closed.bs.alert").remove()}
cwe
CWE-79
JavaScript
/* * Copyright 2013-2019 Amazon Technologies, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://aws.amazon.com/apache2.0 * * This file is distributed on an "AS IS" ...
cwe
CWE-918
Java
SecureVector<byte> EME_PKCS1v15::unpad(const byte in[], size_t inlen, size_t key_len) const { if(inlen != key_len / 8 || inlen < 10 || in[0] != 0x02) throw Decoding_Error("PKCS1::unpad"); size_t seperator = 0; for(size_t j = 0; j != inlen; ++j) if(in[j] ==...
cwe
CWE-200
Unknown
static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) { char explicit_vr[MagickPathExtent], implicit_vr[MagickPathExtent], magick[MagickPathExtent], photometric[MagickPathExtent]; DCMStreamInfo *stream_info; Image *image; int *bluemap, datum, *gr...
cwe
CWE-20
C/C++
def set_image Log.add_info(request, params.inspect) created = false if params[:id].nil? or params[:id].empty? @item = Item.new_info(0) @item.attributes = params[:item] @item.user_id = @login_user.id @item.title = t('paren.no_title') [:image0, :image1].each do |img| ...
cwe
CWE-89
Ruby
def _parse_www_authenticate(headers, headername="www-authenticate"): """Returns a dictionary of dictionaries, one dict per auth_scheme.""" retval = {} if headername in headers: try: authenticate = headers[headername].strip() www_auth = ( USE_WWW_AUTH_STRI...
cwe
CWE-400
Python
JsVar *jswrap_graphics_createArrayBuffer(int width, int height, int bpp, JsVar *options) { if (width<=0 || height<=0 || width>32767 || height>32767) { jsExceptionHere(JSET_ERROR, "Invalid Size"); return 0; } if (!isValidBPP(bpp)) { jsExceptionHere(JSET_ERROR, "Invalid BPP"); return 0; } JsVar...
cwe
CWE-125
Unknown
dissect_usb_video_control_interface_descriptor(proto_tree *parent_tree, tvbuff_t *tvb, guint8 descriptor_len, packet_info *pinfo, usb_conv_info_t *usb_conv_info) { video_conv_info_t *video_conv_info = NULL; video_entity_t *entity = NULL; proto_item ...
cwe
CWE-476
Unknown
static int _lldp_send(struct lldpd *global, struct lldpd_hardware *hardware, u_int8_t c_id_subtype, char *c_id, int c_id_len, u_int8_t p_id_subtype, char *p_id, int p_id_len, int shutdown) { struct lldpd_port *port; struct lldpd_chassis *chassis; struct lldpd_frame *frame; int length...
cwe
CWE-703
Unknown
static void rtl8139_transfer_frame(RTL8139State *s, uint8_t *buf, int size, int do_interrupt, const uint8_t *dot1q_buf) { struct iovec *iov = NULL; struct iovec vlan_iov[3]; if (!size) { DPRINTF("+++ empty ethernet frame\n"); return; } if (dot1q_buf && size >= ETH_ALEN * 2)...
cwe
CWE-835
C/C++
TfLiteStatus EluEval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input = GetInput(context, node, 0); TfLiteTensor* output = GetOutput(context, node, 0); switch (input->type) { case kTfLiteFloat32: { optimized_ops::Elu(GetTensorShape(input), GetTensorData<float>(input), ...
cwe
CWE-125
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
package com.salesmanager.shop.admin.model.catalog; import javax.validation.constraints.NotEmpty; import java.io.Serializable; /** * Post keyword from the admin * @author Carl Samson * */ public class Keyword implements Serializable { /** * */ private static final long serialVersionUID = 1L; private lon...
cwe
CWE-639
Java
/* * Cantata * * Copyright (c) 2011-2018 Craig Drummond <craig.p.drummond@gmail.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 Foundation; either version 2 of the License, or * (a...
cwe
CWE-20
C/C++
function AJchangeUserGroupPrivs() { global $user; $node = processInputVar("activeNode", ARG_NUMERIC); if(! checkUserHasPriv("userGrant", $user["id"], $node)) { $text = "You do not have rights to modify user privileges at this node."; print "alert('$text');"; return; } $newusergrpid = processInputVar("item", ...
cwe
CWE-20
PHP
static void vpc_close(BlockDriverState *bs) { BDRVVPCState *s = bs->opaque; g_free(s->pagetable); #ifdef CACHE g_free(s->pageentry_u8); #endif migrate_del_blocker(s->migration_blocker); error_free(s->migration_blocker); }
cwe
CWE-20
Unknown
def loadVoters(postId: PostId, voteType: Int): Action[Unit] = GetAction { request => import request.{dao, requester} val pageMeta: PageMeta = dao.getThePageMetaForPostId(postId) val categoriesRootLast = dao.getAncestorCategoriesRootLast(pageMeta.categoryId) throwNoUnless(Authz.maySeePage( pageMe...
cwe
CWE-613
Scala
const exec = require('async-execute'); /** * List the output lines from command * @return {string[]} */ module.exports = async function list(command) { const output = await exec(command); return output .split('\n') .map(item => item.trim()) .filter(Boolean) ; }; const exec = require('async-execute'); /**...
cwe
CWE-88
JavaScript