code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
/* eslint-disable indent */ export function getDeviceIcon(device) { const baseUrl = 'assets/img/devices/'; switch (device.AppName || device.Client) { case 'Samsung Smart TV': return baseUrl + 'samsung.svg'; case 'Xbox One': return baseUrl + '...
cwe
CWE-79
JavaScript
this.canvas.end=this.originalEnd;this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(Q){return new u(Q,Editor.createRoughCanvas(Q),this)};var E=mxShape.prototype.createHandJiggle;mxShape.prototype.createHa...
cwe
CWE-20
JavaScript
/* * oracle.c * * Copyright (C) 2013 Remy Mudingay <mudingay@ill.fr> * * This module 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 3 of the License, or * (at your option) any la...
cwe
CWE-125
C/C++
/* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) | +---------...
cwe
CWE-787
C/C++
function trySendNEWKEYS(kex) { if (!kex._sentNEWKEYS) { kex._protocol._debug && kex._protocol._debug( 'Outbound: Sending NEWKEYS' ); const p = kex._protocol._packetRW.write.allocStartKEX; const packet = kex._protocol._packetRW.write.alloc(1, true); packet[p] = MESSAGE.NEWKEYS; kex._proto...
cwe
CWE-354
JavaScript
nfsd_create_locked(struct svc_rqst *rqstp, struct svc_fh *fhp, char *fname, int flen, struct iattr *iap, int type, dev_t rdev, struct svc_fh *resfhp) { struct dentry *dentry, *dchild; struct inode *dirp; __be32 err; __be32 err2; int host_err; dentry = fhp->fh_dentry; dirp = d_inode(dentry); dchild = dg...
cwe
CWE-732
Unknown
exsltCryptoRc4EncryptFunction (xmlXPathParserContextPtr ctxt, int nargs) { int key_len = 0, key_size = 0; int str_len = 0, bin_len = 0, hex_len = 0; xmlChar *key = NULL, *str = NULL, *padkey = NULL; xmlChar *bin = NULL, *hex = NULL; xsltTransformContextPtr tctxt = NULL; if (nargs != 2) { ...
cwe
CWE-119
C/C++
"""Parameters viewsets.""" from drf_spectacular.utils import extend_schema, OpenApiParameter from rest_framework import response, viewsets from rest_framework.decorators import action from modoboa.lib.throttle import GetThrottleViewsetMixin from . import serializers from ... import tools class ParametersViewSet(Ge...
cwe
CWE-285
Python
bool PermissionsContainsFunction::RunImpl() { scoped_ptr<Contains::Params> params(Contains::Params::Create(*args_)); scoped_refptr<PermissionSet> permissions = helpers::UnpackPermissionSet(params->permissions, &error_); if (!permissions.get()) return false; results_ = Contains::Results::Create...
cwe
CWE-264
C/C++
static int pad_basic(bn_t m, int *p_len, int m_len, int k_len, int operation) { uint8_t pad = 0; int result = RLC_OK; bn_t t; RLC_TRY { bn_null(t); bn_new(t); switch (operation) { case RSA_ENC: case RSA_SIG: case RSA_SIG_HASH: /* EB = 00 | FF | D. */ bn_zero(m); bn_lsh(m, m, 8); bn_...
cwe
CWE-327
C/C++
void dvb_usb_device_exit(struct usb_interface *intf) { struct dvb_usb_device *d = usb_get_intfdata(intf); const char *name = "generic DVB-USB module"; usb_set_intfdata(intf, NULL); if (d != NULL && d->desc != NULL) { name = d->desc->name; dvb_usb_exit(d); } info("%s successfully deinitialized and disconnecte...
cwe
CWE-416
Unknown
/******************************************************************************* * This file is part of OpenNMS(R). * * Copyright (C) 2002-2020 The OpenNMS Group, Inc. * OpenNMS(R) is Copyright (C) 1999-2020 The OpenNMS Group, Inc. * * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. * * OpenNMS(...
cwe
CWE-352
Java
xcalloc (size_t num, size_t size) { void *ptr = malloc(num * size); if (ptr) { memset (ptr, '\0', (num * size)); } return ptr; }
cwe
CWE-190
C/C++
func (a *APIs) PostLogin(v *PostLoginReq) *kongchuanhujiao.Response { if v.Code != account.GetCode(v.ID) || v.Code == "" { // FIXME datahub 鉴权 return kongchuanhujiao.GenerateErrResp(1, "验证码有误") } now := time.Now() t, err := jwt.NewTokenWithClaims(jwt.SigningMethodES256, jwt.MapClaims{ "iss": config.GetJWTConf...
cwe
CWE-305
Go
function chat_start_for_user( $group_id, $requested_operator, $visitor_id, $visitor_name, $referrer, $info ) { // Get user info $remote_host = get_remote_host(); $user_browser = $_SERVER['HTTP_USER_AGENT']; // Check connection limit if (Thread::connectionLimitReached($remote...
cwe
CWE-79
PHP
cmd_starttls_next(struct smtp_server_cmd_ctx *cmd, void *context ATTR_UNUSED) { struct smtp_server_connection *conn = cmd->conn; struct smtp_server_command *command = cmd->cmd; const struct smtp_server_callbacks *callbacks = conn->callbacks; int ret; smtp_server_connection_set_state(conn, SMTP_SERVER_STATE_STARTT...
cwe
CWE-77
Unknown
/* * Copyright (c) 2018-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #include <fizz/record/PlaintextRecordLayer.h> #include <folly/String.h> namespace fizz { using Conte...
cwe
CWE-131
C/C++
public function view($id = FALSE) { $this->template->header->this_page = 'reports'; $this->template->content = new View('reports/detail'); // Load Akismet API Key (Spam Blocker) $api_akismet = Kohana::config('settings.api_akismet'); // Sanitize the report id before proceeding $id = intval($id); if ($i...
cwe
CWE-79
PHP
/************************************************************************ * 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
vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { struct inode *inode = file_inode(file); struct vc_data *vc; long pos; long attr, size, written; char *con_buf0; int col, maxcol, viewed; u16 *org0 = NULL, *org = NULL; size_t ret; char *con_buf; con_buf = (char *) __get_free_p...
cwe
CWE-125
C/C++
QPDF::processXRefStream(qpdf_offset_t xref_offset, QPDFObjectHandle& xref_obj) { QPDFObjectHandle dict = xref_obj.getDict(); QPDFObjectHandle W_obj = dict.getKey("/W"); QPDFObjectHandle Index_obj = dict.getKey("/Index"); if (! (W_obj.isArray() && (W_obj.getArrayNItems() >= 3) && W_obj.getArrayIt...
cwe
CWE-787
Unknown
int ath6kl_wmi_delete_pstream_cmd(struct wmi *wmi, u8 if_idx, u8 traffic_class, u8 tsid) { struct sk_buff *skb; struct wmi_delete_pstream_cmd *cmd; u16 active_tsids = 0; int ret; if (traffic_class > 3) { ath6kl_err("invalid traffic class: %d\n", traffic_class); return -EINVAL; } skb = ath6kl_wmi_get_...
cwe
CWE-125
Unknown
def _do_get_well_known(self, server_name): """Actually fetch and parse a .well-known, without checking the cache :param server_name: Name of the server, from the requested url :type server_name: bytes :returns a tuple of (result, cache period), where result is one of: - the...
cwe
CWE-20
Python
/* * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appea...
cwe
CWE-787
C/C++
package com.salesmanager.shop.admin.model.permission; import java.io.Serializable; import java.util.List; import javax.validation.Valid; import com.salesmanager.core.model.user.Group; public class GroupDetails implements Serializable { /** * */ private static final long serialVersionUID = 1L; @Valid priva...
cwe
CWE-639
Java
mldv2_report_print(netdissect_options *ndo, const u_char *bp, u_int len) { const struct icmp6_hdr *icp = (const struct icmp6_hdr *) bp; u_int group, nsrcs, ngroups; u_int i, j; /* Minimum len is 8 */ if (len < 8) { ND_PRINT((ndo," [invalid len %d]", len)); return; } ...
cwe
CWE-125
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-476
Python
static long pmcraid_ioctl_passthrough( struct pmcraid_instance *pinstance, unsigned int ioctl_cmd, unsigned int buflen, unsigned long arg ) { struct pmcraid_passthrough_ioctl_buffer *buffer; struct pmcraid_ioarcb *ioarcb; struct pmcraid_cmd *cmd; struct pmcraid_cmd *cancel_cmd; unsigned long request_buffer; u...
cwe
CWE-189
C/C++
static uint64_t unpack_timestamp(const struct efi_time *timestamp) { uint64_t val = 0; uint16_t year = le32_to_cpu(timestamp->year); /* pad1, nanosecond, timezone, daylight and pad2 are meant to be zero */ val |= ((uint64_t) timestamp->pad1 & 0xFF) << 0; val |= ((uint64_t) timestamp->second & 0xFF) << (1*8); val...
cwe
CWE-681
C/C++
static llparse_state_t llhttp__internal__run( llhttp__internal_t* state, const unsigned char* p, const unsigned char* endp) { int match; switch ((llparse_state_t) (intptr_t) state->_current) { case s_n_llhttp__internal__n_closed: s_n_llhttp__internal__n_closed: { if (p == endp) { r...
cwe
CWE-444
Unknown
/* * Copyright (c) 2008-2015, Dave Benson and the protobuf-c authors. * 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 copyr...
cwe
CWE-190
C/C++
p11_rpc_buffer_get_attribute (p11_buffer *buffer, size_t *offset, CK_ATTRIBUTE *attr) { uint32_t type, length; unsigned char validity; p11_rpc_attribute_serializer *serializer; p11_rpc_value_type value_type; /* The attribute type */ if (!p11_rpc_buffer_get_uint32 (buffer, offset, &type)) retu...
cwe
CWE-787
C/C++
static int sockfs_setattr(struct dentry *dentry, struct iattr *iattr) { int err = simple_setattr(dentry, iattr); if (!err && (iattr->ia_valid & ATTR_UID)) { struct socket *sock = SOCKET_I(d_inode(dentry)); sock->sk->sk_uid = iattr->ia_uid; } return err; }
cwe
CWE-362
C/C++
package cz.metacentrum.perun.core.impl; import com.zaxxer.hikari.HikariDataSource; import cz.metacentrum.perun.core.api.Attribute; import cz.metacentrum.perun.core.api.AttributeDefinition; import cz.metacentrum.perun.core.api.BeansUtils; import cz.metacentrum.perun.core.api.Destination; import cz.metacentrum.perun.cor...
cwe
CWE-732
Java
void TestJlCompress::extractDir() { QFETCH(QString, zipName); QFETCH(QStringList, fileNames); QDir curDir; if (!curDir.mkpath("jlext/jldir")) { QFAIL("Couldn't mkpath jlext/jldir"); } if (!createTestFiles(fileNames)) { QFAIL("Couldn't create test files"); } if (!createTes...
cwe
CWE-22
C/C++
static int whereKeyStats( Parse *pParse, /* Database connection */ Index *pIdx, /* Index to consider domain of */ UnpackedRecord *pRec, /* Vector of values to consider */ int roundUp, /* Round up if true. Round down if false */ tRowcnt *aStat /* O...
cwe
CWE-129
C/C++
/* p_lx_elf.cpp -- This file is part of the UPX executable compressor. Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Laszlo Molnar Copyright (C) 2000-2020 John F. Reiser All Rights Reserved. UPX and the UCL library are free software; you can redistribute them...
cwe
CWE-125
C/C++
static void sixpack_close(struct tty_struct *tty) { struct sixpack *sp; write_lock_irq(&disc_data_lock); sp = tty->disc_data; tty->disc_data = NULL; write_unlock_irq(&disc_data_lock); if (!sp) return; /* * We have now ensured that nobody can start using ap from now on, but * we have to wait for all exist...
cwe
CWE-703
Unknown
static void cpia2_usb_disconnect(struct usb_interface *intf) { struct camera_data *cam = usb_get_intfdata(intf); usb_set_intfdata(intf, NULL); DBG("Stopping stream\n"); cpia2_usb_stream_stop(cam); mutex_lock(&cam->v4l2_lock); DBG("Unregistering camera\n"); cpia2_unregister_camera(cam); v4l2_device_disconnect(...
cwe
CWE-416
C/C++
#include "rar.hpp" #define MBFUNCTIONS #if defined(_UNIX) && defined(MBFUNCTIONS) static bool WideToCharMap(const wchar *Src,char *Dest,size_t DestSize,bool &Success); static void CharToWideMap(const char *Src,wchar *Dest,size_t DestSize,bool &Success); // In Unix we map high ASCII characters which cannot be convert...
cwe
CWE-787
C/C++
import dayjs from 'dayjs' import utc from 'dayjs/plugin/utc' import { saveAs } from 'file-saver' import { FlowRouter } from 'meteor/ostrio:flow-router-extra' import { NullXlsx } from '@neovici/nullxlsx' import './periodtimetable.html' import './pagination.js' import './limitpicker.js' import { i18nReady, t } from '../....
cwe
CWE-1236
JavaScript
/******************************************************************************* * This file is part of OpenNMS(R). * * Copyright (C) 2002-2014 The OpenNMS Group, Inc. * OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc. * * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. * * OpenNMS(...
cwe
CWE-352
Java
static int prepend_path(const struct path *path, const struct path *root, char **buffer, int *buflen) { struct dentry *dentry; struct vfsmount *vfsmnt; struct mount *mnt; int error = 0; unsigned seq, m_seq = 0; char *bptr; int blen; rcu_read_lock(); restart_mnt: read_seqbegin_or_lock(&mount_lock, &m_seq...
cwe
CWE-254
C/C++
def nofollowify_links(string) if this_blog.dofollowify string else string.gsub(/<a(.*?)>/i, '<a\1 rel="nofollow">') end end
cwe
CWE-79
Ruby
function guestUsers() { const tokenValidation = AuthTokenValidation.findOne({ connectionId: this.connection.id }); if (!tokenValidation || tokenValidation.validationStatus !== ValidationStates.VALIDATED) { Logger.warn(`Publishing GuestUser was requested by unauth connection ${this.connection.id}`); return ...
cwe
CWE-918
JavaScript
/* 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-476
Python
static u16 read_16(cdk_stream_t s) { byte buf[2]; size_t nread; assert(s != NULL); stream_read(s, buf, 2, &nread); if (nread != 2) return (u16) - 1; return buf[0] << 8 | buf[1]; }
cwe
CWE-125
C/C++
require('dotenv').config() const User = require('../../model/user') const Org = require('../../model/org') const logger = require('../../middleware/logger') const argon2 = require('argon2') const CONSTANTS = require('../../constants') const cryptoRandomString = require('crypto-random-string') const uuid = require('uuid...
cwe
CWE-863
JavaScript
static PrimitiveInfo *TraceStrokePolygon(const DrawInfo *draw_info, const PrimitiveInfo *primitive_info) { typedef struct _LineSegment { double p, q; } LineSegment; LineSegment dx, dy, inverse_slope, slope, theta; MagickBooleanType closed_path; double delta_t...
cwe
CWE-119
Unknown
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { OpData* data = reinterpret_cast<OpData*>(node->user_data); TF_LITE_ENSURE_EQ(context, NumInputs(node), 2); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* input1 = GetInput(context, node, kInputTensor1); const TfLiteTensor...
cwe
CWE-125
C/C++
function networkStatsSingle(iface) { function parseLinesWindowsPerfData(sections) { let perfData = []; for (let i in sections) { if ({}.hasOwnProperty.call(sections, i)) { if (sections[i].trim() !== '') { let lines = sections[i].trim().split('\r\n'); perfData.push({ ...
cwe
CWE-78
JavaScript
static double ipow( double n, int exp ) { double r; if ( exp < 0 ) return 1.0 / ipow( n, -exp ); r = 1; while ( exp > 0 ) { if ( exp & 1 ) r *= n; exp >>= 1; n *= n; } return r; }
cwe
CWE-120
C/C++
virtual void ComputeWithReservedSpace(OpKernelContext* context, bool use_reserved_space) { Tensor x = context->input(0); const Tensor& scale = context->input(1); const Tensor& offset = context->input(2); const Tensor& estimated_mean = context->input(3); const ...
cwe
CWE-476
Unknown
xps_load_sfnt_name(xps_font_t *font, char *namep) { byte *namedata; int offset, length; /*int format;*/ int count, stringoffset; int found; int i, k; found = 0; strcpy(namep, "Unknown"); offset = xps_find_sfnt_table(font, "name", &length); if (offset < 0 || length < 6) { ...
cwe
CWE-125
C/C++
""" HTTP basic auth downloader middleware See documentation in docs/topics/downloader-middleware.rst """ from w3lib.http import basic_auth_header from scrapy import signals class HttpAuthMiddleware(object): """Set Basic HTTP Authorization header (http_user and http_pass spider class attributes)""" @cl...
cwe
CWE-522
Python
PHP_FUNCTION( msgfmt_parse_message ) { UChar *spattern = NULL; int spattern_len = 0; char *pattern = NULL; size_t pattern_len = 0; const char *slocale = NULL; size_t slocale_len = 0; char *source = NULL; size_t src_len = 0; MessageFormatter_object mf; MessageFormatter_o...
cwe
CWE-119
C/C++
int lookup(struct sip_msg* _m, char* _t, char* _f, char* _s) { unsigned int flags; urecord_t* r; str aor, uri; ucontact_t* ptr,*it; int res; int ret; str path_dst; str flags_s; pv_value_t val; int_str istr; str sip_instance = {0,0},call_id = {0,0}; flags = 0; if (_f && _f[0]!=0) { if (fixup_get_svalue( ...
cwe
CWE-835
Unknown
public function delete(){ $item_id = I("item_id/d"); $id = I("id/d"); $login_user = $this->checkLogin(); $uid = $login_user['uid'] ; if(!$this->checkItemEdit($uid , $item_id)){ $this->sendError(10303); return ; } $ret = D("ItemVariabl...
cwe
CWE-352
PHP
lldp_decode(struct lldpd *cfg, char *frame, int s, struct lldpd_hardware *hardware, struct lldpd_chassis **newchassis, struct lldpd_port **newport) { struct lldpd_chassis *chassis; struct lldpd_port *port; const char lldpaddr[] = LLDP_MULTICAST_ADDR; const char dot1[] = LLDP_TLV_ORG_DOT1; const char dot3[]...
cwe
CWE-703
Unknown
/* * Copyright 2020 ThoughtWorks, 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 agr...
cwe
CWE-668
Java
define([ './summary-widget.html', '@braintree/sanitize-url' ], function ( summaryWidgetTemplate, urlSanitizeLib ) { const WIDGET_ICON_CLASS = 'c-sw__icon js-sw__icon'; function SummaryWidgetView(domainObject, openmct) { this.openmct = openmct; this.domainObject = domainObject; ...
cwe
CWE-79
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 / BIFS codec sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser Gener...
cwe
CWE-476
C/C++
long Chapters::Edition::Parse(IMkvReader* pReader, long long pos, long long size) { const long long stop = pos + size; while (pos < stop) { long long id, size; long status = ParseElementHeader(pReader, pos, stop, id, size); if (status < 0) // error return status; if (size == 0) // weird continue; if (id ...
cwe
CWE-20
C/C++
int ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb, int (*output)(struct net *, struct sock *, struct sk_buff *)) { struct sk_buff *frag; struct rt6_info *rt = (struct rt6_info *)skb_dst(skb); struct ipv6_pinfo *np = skb->sk && !dev_recursion_level() ? inet6_sk(skb->sk) : NULL; struct ipv...
cwe
CWE-125
C/C++
function peg$parsereference() { var s0, s1, s2, s3, s4; peg$silentFails++; s0 = peg$currPos; s1 = peg$parseld(); if (s1 !== peg$FAILED) { s2 = peg$parseidentifier(); if (s2 !== peg$FAILED) { s3 = peg$parsefilters(); if (s3 !== peg$FAILED) { ...
cwe
CWE-1321
JavaScript
static Image *ReadYCBCRImage(const ImageInfo *image_info, ExceptionInfo *exception) { const unsigned char *pixels; Image *canvas_image, *image; MagickBooleanType status; MagickOffsetType scene; QuantumInfo *quantum_info; QuantumType quantum_type; register const Quantum ...
cwe
CWE-772
C/C++
"""Django settings for InvenTree project. In practice the settings in this file should not be adjusted, instead settings can be configured in the config.yaml file located in the top level project directory. This allows implementation configuration to be hidden from source control, as well as separate configuration pa...
cwe
CWE-400
Python
nfsd4_encode_getdeviceinfo(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_getdeviceinfo *gdev) { struct xdr_stream *xdr = &resp->xdr; const struct nfsd4_layout_ops *ops = nfsd4_layout_ops[gdev->gd_layout_type]; u32 starting_len = xdr->buf->len, needed_len; __be32 *p; dprintk("%s: err %d\n", __fun...
cwe
CWE-129
C/C++
/* Copyright 1996-2006 Han The Thanh <thanh@pdftex.org> Copyright 2006-2009 Taco Hoekwater <taco@luatex.org> This file is part of LuaTeX. LuaTeX 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 ...
cwe
CWE-119
C/C++
static Image *ReadMIFFImage(const ImageInfo *image_info, ExceptionInfo *exception) { #define BZipMaxExtent(x) ((x)+((x)/100)+600) #define LZMAMaxExtent(x) ((x)+((x)/3)+128) #define ZipMaxExtent(x) ((x)+(((x)+7) >> 3)+(((x)+63) >> 6)+11) #if defined(MAGICKCORE_BZLIB_DELEGATE) bz_stream bzip_info; #endif c...
cwe
CWE-770
Unknown
static int hci_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags) { int noblock = flags & MSG_DONTWAIT; struct sock *sk = sock->sk; struct sk_buff *skb; int copied, err; BT_DBG("sock %p, sk %p", sock, sk); if (flags & (MSG_OOB)) return -EOPNOTSUPP; if (sk...
cwe
CWE-269
Unknown
@mod.route('/edit', methods=['GET', 'POST']) def edit(): sql = "SELECT * FROM users where email = '%s';" % (session['logged_email']) cursor.execute(sql) u = cursor.fetchone() if request.method == 'POST': sql = "UPDATE users SET nickname = '%s' where email = '%s'" \ % (request.form['nickn...
cwe
CWE-89
Python
static pj_bool_t ssock_on_accept_complete (pj_ssl_sock_t *ssock_parent, pj_sock_t newsock, void *newconn, const pj_sockaddr_t *src_addr, int src_addr_len, pj_status_t accept_status) { pj_ssl_sock_t *ssock; #ifndef SSL_SOCK_IMP_USE_OWN_NETWORK pj_activesock_cb asock_cb; #e...
cwe
CWE-362
C/C++
file_extension(const char *s) /* I - Filename or URL */ { const char *extension; /* Pointer to directory separator */ static char buf[1024]; /* Buffer for files with targets */ if (s == NULL) return (NULL); else if (!strncmp(s, "data:image/bmp;", 15)) return ("bmp"); else if (!strncmp(s, "data:image...
cwe
CWE-476
C/C++
authreadkeys( const char *file ) { FILE *fp; char *line; char *token; keyid_t keyno; int keytype; char buf[512]; /* lots of room for line */ u_char keystr[32]; /* Bug 2537 */ size_t len; size_t j; /* * Open file. Complain and return if it can't be opened. */ fp = fopen(file, "r"); if (fp == NULL) ...
cwe
CWE-835
C/C++
function initialize(){destroy();if(!window.Clipboard){pasteCatcher=document.createElement('div');pasteCatcher.id='screenshot-pastezone';pasteCatcher.contentEditable=!0;pasteCatcher.style.opacity=0;pasteCatcher.style.position='fixed';pasteCatcher.style.top=0;pasteCatcher.style.right=0;pasteCatcher.style.width=0;document...
cwe
CWE-79
JavaScript
protected function shouldRedirect(Request $request, Shop $shop) { return //for example: template preview, direct shop selection via url ( $request->isGet() && $request->getQuery('__shop') !== null && $request->getQuery('__shop') != $shop->getId() ...
cwe
CWE-601
PHP
public function getSection() { global $db; if (expTheme::inAction()) { if (isset($_REQUEST['section'])) { $section = $this->url_style=="sef" ? $this->getPageByName($_REQUEST['section'])->id : intval($_REQUEST['section']) ; } else { $section = (exp...
cwe
CWE-89
PHP
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { // This function only checks the types. Additional shape validations are // performed in the reference implementation called during Eval(). const TfLiteConcatenationParams* params = reinterpret_cast<TfLiteConcatenationParams*>(node->builtin_da...
cwe
CWE-125
C/C++
def _modify_3par_iscsi_host(self, hostname, iscsi_iqn): # when using -add, you can not send the persona or domain options self.common._cli_run('createhost -iscsi -add %s %s' % (hostname, iscsi_iqn), None)
cwe
CWE-78
Python
/* * Soft: Keepalived is a failover program for the LVS project * <www.linuxvirtualserver.org>. It monitor & manipulate * a loadbalanced server pool using multi-layer checks. * * Part: Main program structure. * * Author: Alexandre Cassen, <acassen@linux-vs.org> * * ...
cwe
CWE-200
C/C++
static Image *ReadTIFFImage(const ImageInfo *image_info, ExceptionInfo *exception) { #define MaxPixelChannels 32 #define ThrowTIFFException(severity,message) \ { \ if (pixel_info != (MemoryInfo *) NULL) \ pixel_info=RelinquishVirtualMemory(pixel_info); \ if (quantum_info != (QuantumInfo *) NULL) \ quantu...
cwe
CWE-401
Unknown
/** @file read.c * @brief Functions for reading and parsing of MOBI document * * Copyright (c) 2014 Bartek Fabiszewski * http://www.fabiszewski.net * * This file is part of libmobi. * Licensed under LGPL, either version 3, or any later. * See <http://www.gnu.org/licenses/> */ #include <stdio.h> #include <st...
cwe
CWE-125
C/C++
int nntp_add_group(char *line, void *data) { struct NntpServer *nserv = data; struct NntpData *nntp_data = NULL; char group[LONG_STRING]; char desc[HUGE_STRING] = ""; char mod; anum_t first, last; if (!nserv || !line) return 0; if (sscanf(line, "%s " ANUM " " ANUM " %c %[^\n]", group, &last, &firs...
cwe
CWE-787
Unknown
H.x+" "+H.y;S="";c=[];for(U=2;U<v.length;U+=2)H=N(U),S+=" L"+H.x+" "+H.y,c.push(H);d.setAttribute("d",t+S)}m&&(H=b.view.translate,b.scrollRectToVisible((new mxRectangle(J.x-H.x,J.y-H.y)).grow(20)));E.consume()}}),mouseUp:mxUtils.bind(this,function(J,E){d&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(y(E.getEv...
cwe
CWE-20
JavaScript
/** * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse....
cwe
CWE-611
Java
package config import ( "errors" "fmt" "reflect" "runtime" "github.com/libp2p/go-libp2p-core/pnet" "github.com/libp2p/go-libp2p-core/connmgr" "github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/transport" ) var errorType = reflect.TypeOf((*error)(nil)).Elem() // checks if a function r...
cwe
CWE-400
Go
private List<GHPoint> getPointsFromRequest(HttpServletRequest httpServletRequest, String profile) { String url = httpServletRequest.getRequestURI(); url = url.replaceFirst("/navigate/directions/v5/gh/" + profile + "/", ""); url = url.replaceAll("\\?[*]", ""); String[] pointStrings = ur...
cwe
CWE-400
Java
/***************************************************************** | | AP4 - sample entries | | Copyright 2002-2008 Axiomatic Systems, LLC | | | This file is part of Bento4/AP4 (MP4 Atom Processing Library). | | Unless you have obtained Bento4 under a difference license, | this version of Bento4 is Bento...
cwe
CWE-843
C/C++
void Compute(OpKernelContext* context) override { // Here's the basic idea: // Batch and depth dimension are independent from row and col dimension. And // because FractionalAvgPool currently only support pooling along row and // col, we can basically think of this 4D tensor backpropagation as // op...
cwe
CWE-476
C/C++
// Copyright (c) 2015-2021 MinIO, Inc. // // This file is part of MinIO Object Storage stack // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (...
cwe
CWE-269
Go
NO_INLINE JsVar *jspeFactor() { if (lex->tk==LEX_ID) { JsVar *a = jspGetNamedVariable(jslGetTokenValueAsString(lex)); JSP_ASSERT_MATCH(LEX_ID); #ifndef SAVE_ON_FLASH if (lex->tk==LEX_TEMPLATE_LITERAL) jsExceptionHere(JSET_SYNTAXERROR, "Tagged template literals not supported"); else if (lex->tk==...
cwe
CWE-119
Unknown
void determinization(ctx_t &ctx) { const uint32_t INITIAL_TAGS = init_tag_versions(ctx); // initial state const clos_t c0(ctx.nfa.root, 0, INITIAL_TAGS, HROOT, HROOT); ctx.reach.push_back(c0); tagged_epsilon_closure(ctx); find_state(ctx); // iterate while new kernels are added: for each al...
cwe
CWE-787
Unknown
/** shave - Shave is a javascript plugin that truncates multi-line text within a html element based on set max height @version v2.5.2 @link https://github.com/dollarshaveclub/shave#readme @author Jeff Wainwright <yowainwright@gmail.com> (jeffry.in) @license MIT **/ function shave(target, maxHeight) { var op...
cwe
CWE-79
JavaScript
def markAllNotfsAsSeen(): Action[JsValue] = PostJsonAction(RateLimits.MarkNotfAsSeen, 200) { request => request.dao.markAllNotfsAsSeen(request.theUserId) loadNotificationsImpl(request.theUserId, upToWhen = None, request) } def markNotificationAsSeen(): Action[JsValue] = PostJsonAction(RateLimits.M...
cwe
CWE-613
Scala
static int ntop_generate_csrf_value(lua_State* vm) { char random_a[32], random_b[32], csrf[33]; Redis *redis = ntop->getRedis(); ntop->getTrace()->traceEvent(TRACE_INFO, "%s() called", __FUNCTION__); #ifdef __OpenBSD__ snprintf(random_a, sizeof(random_a), "%d", arc4random()); snprintf(random_b, sizeof(rando...
cwe
CWE-254
Unknown
bool IDNSpoofChecker::SafeToDisplayAsUnicode(base::StringPiece16 label, bool is_tld_ascii) { UErrorCode status = U_ZERO_ERROR; int32_t result = uspoof_check(checker_, label.data(), base::checked_cast<int32_t>(label.size()), NULL, &status); if (...
cwe
CWE-20
C/C++
/* Copyright 2018-2020 Accenture Technology 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 la...
cwe
CWE-611
Java
std::string queueloader::get_filename(const std::string& str) { std::string fn = ctrl->get_dlpath(); if (fn[fn.length()-1] != NEWSBEUTER_PATH_SEP[0]) fn.append(NEWSBEUTER_PATH_SEP); char buf[1024]; snprintf(buf, sizeof(buf), "%s", str.c_str()); char * base = basename(buf); if (!base || strlen(base) == 0) { c...
cwe
CWE-78
C/C++
package server import ( "fmt" "net/http" "strconv" "github.com/usememos/memos/api" "github.com/usememos/memos/common" "github.com/gorilla/sessions" "github.com/labstack/echo-contrib/session" "github.com/labstack/echo/v4" ) var ( userIDContextKey = "user-id" ) func getUserIDContextKey() string { return us...
cwe
CWE-319
Go