code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
int32_t PepperFlashRendererHost::OnNavigate( ppapi::host::HostMessageContext* host_context, const ppapi::URLRequestInfoData& data, const std::string& target, bool from_user_action) { content::PepperPluginInstance* plugin_instance = host_->GetPluginInstance(pp_instance()); if (!plugin_instance...
cwe
CWE-399
C/C++
static int ssl_parse_server_key_exchange( ssl_context *ssl ) { #if defined(POLARSSL_DHM_C) int ret; size_t n; unsigned char *p, *end; unsigned char hash[64]; md5_context md5; sha1_context sha1; int hash_id = SIG_RSA_RAW; unsigned int hashlen = 0; #endif SSL_DEBUG_MSG( 2, ( "=> parse...
cwe
CWE-310
Unknown
/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +---------...
cwe
CWE-476
C/C++
Jsi_Value *jsi_ValueObjKeyAssign(Jsi_Interp *interp, Jsi_Value *target, Jsi_Value *keyval, Jsi_Value *value, int flag) { int arrayindex = -1; if (keyval->vt == JSI_VT_NUMBER && Jsi_NumberIsInteger(keyval->d.num) && keyval->d.num >= 0) { arrayindex = (int)keyval->d.num; } /* TODO: array["1"] als...
cwe
CWE-190
C/C++
public function __get($name) { $forbidden = array( 'admin', 'staff', 'due_free', 'appears_in_list', 'active', 'row_classes', 'oldness', 'duplicate' ); if (!defined('GALETTE_TESTS')) { $forbidden[] = 'password'; //keep that for tests only } ...
cwe
CWE-79
PHP
inline bool ShapeIsVector(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* shape = GetInput(context, node, kShapeTensor); return (shape->dims->size == 1 && shape->type == kTfLiteInt32); }
cwe
CWE-125
C/C++
int al_segment_cwd_prefix(char** prompt, unsigned int* prompt_len, int* is_first, int* last_bg, int orientation) { char text[16]; char prefix[16]; char home[64]; char cwd[512]; char *base = cwd; if (al_get_home(home, 64) != 0) { return -1; } if (al_get_cwd(cwd, 512) != 0) { ...
cwe
CWE-119
C/C++
/* * . .o8 oooo * .o8 "888 `888 * .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo * 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P' * 888 888 888 888 8...
cwe
CWE-79
JavaScript
sec_recv(RD_BOOL * is_fastpath) { uint8 fastpath_hdr, fastpath_flags; uint16 sec_flags; uint16 channel; STREAM s; while ((s = mcs_recv(&channel, is_fastpath, &fastpath_hdr)) != NULL) { if (*is_fastpath == True) { /* If fastpath packet is encrypted, read data signature and decrypt */ /* F...
cwe
CWE-119
C/C++
package pluginproxy import ( "encoding/json" "net/http" "net/http/httputil" "net/url" "github.com/grafana/grafana/pkg/bus" "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/plugins" "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/util" "github.com/grafana/grafa...
cwe
CWE-79
Go
public function testDeleteTemplateAction() { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $fixture = new InvoiceTemplateFixtures(); $template = $this->importFixture($fixture); $id = $template[0]->getId(); $this->request($client, '/invoice/template/' . $...
cwe
CWE-352
PHP
/* * NFS support driver - based on etherboot and U-BOOT's tftp.c * * Masami Komiya <mkomiya@sonare.it> 2004 * */ /* NOTE: the NFS code is heavily inspired by the NetBSD netboot code (read: * large portions are copied verbatim) as distributed in OSKit 0.97. A few * changes were necessary to adapt the code to Et...
cwe
CWE-125
C/C++
void Compute(OpKernelContext* context) override { const int64 axis_input = context->input(0).scalar<int64>()(); const Tensor& input_indices = context->input(1); const Tensor& input_values = context->input(2); const Tensor& input_shape = context->input(3); OP_REQUIRES(context, TensorShapeUtils::IsMa...
cwe
CWE-369
C/C++
upgrade_deploy_data (GBytes *deploy_data, GFile *deploy_dir, FlatpakDecomposed *ref, OstreeRepo *repo, GCancellable *cancellable, GError **error) { VarDeployDataR...
cwe
CWE-269
C/C++
TfLiteStatus lstm_eval(TfLiteContext* context, TfLiteNode* node, Logger* logger, ErrorReporter* error_reporter) { const auto* params = static_cast<TfLiteLSTMParams*>(node->builtin_data); const TfLiteTensor* input = GetInput(context, node, ops::builtin::lstm::full::kInputTensor); con...
cwe
CWE-787
C/C++
/*! * assign-deep <https://github.com/jonschlinkert/assign-deep> * * Copyright (c) 2017-present, Jon Schlinkert. * Released under the MIT License. */ 'use strict'; const assignSymbols = require('assign-symbols'); const toString = Object.prototype.toString; const assign = module.exports = (target, ...args) => { ...
cwe
CWE-1321
Java
/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2017 The PHP Group | +---------...
cwe
CWE-200
C/C++
dwg_decode_add_object (Dwg_Data *restrict dwg, Bit_Chain *dat, Bit_Chain *hdl_dat, long unsigned int address) { long unsigned int objpos, restartpos; Bit_Chain abs_dat = { NULL }; unsigned char previous_bit; Dwg_Object *restrict obj; BITCODE_BL num = dwg->num_objects; int error = 0; ...
cwe
CWE-703
Unknown
GURL SiteInstance::GetSiteForURL(BrowserContext* browser_context, const GURL& real_url) { if (real_url.SchemeIs(kGuestScheme)) return real_url; GURL url = SiteInstanceImpl::GetEffectiveURL(browser_context, real_url); url::Origin origin = url::Origin::Create(url); auto* pol...
cwe
CWE-285
C/C++
ExtensionFunction::ResponseAction BluetoothSocketSendFunction::Run() { DCHECK_CURRENTLY_ON(work_thread_id()); auto params = bluetooth_socket::Send::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params.get()); io_buffer_size_ = params->data.size(); io_buffer_ = new net::WrappedIOBuffer(params->data....
cwe
CWE-416
Unknown
private static function sign($input, $key, $algo = 'HS256') { switch ($algo) { case 'HS256': return hash_hmac('sha256', $input, $key, true); case 'HS384': return hash_hmac('sha384', $input, $key, true); case 'HS512': retu...
cwe
CWE-20
PHP
def data @data ||= YAML.load(File.read(path)) end
cwe
CWE-502
Ruby
renderCoTable(struct table *tbl, int maxlimit) { struct readbuffer obuf; struct html_feed_environ h_env; struct environment envs[MAX_ENV_LEVEL]; struct table *t; int i, col, row; int indent, maxwidth; for (i = 0; i < tbl->ntable; i++) { t = tbl->tables[i].ptr; col = tbl->tables[i].col; r...
cwe
CWE-119
C/C++
PHP_FUNCTION(openssl_seal) { zval *pubkeys, *pubkey, *sealdata, *ekeys, *iv = NULL; HashTable *pubkeysht; EVP_PKEY **pkeys; zend_resource ** key_resources; /* so we know what to cleanup */ int i, len1, len2, *eksl, nkeys, iv_len; unsigned char iv_buf[EVP_MAX_IV_LENGTH + 1], *buf = NULL, **eks; char * data; size...
cwe
CWE-754
Unknown
#include "pgenheaders.h" #include "metagrammar.h" #include "grammar.h" #include "pgen.h" static arc arcs_0_0[3] = { {2, 0}, {3, 0}, {4, 1}, }; static arc arcs_0_1[1] = { {0, 1}, }; static state states_0[2] = { {3, arcs_0_0}, {1, arcs_0_1}, }; static arc arcs_1_0[1] = { {5, 1}, }; static arc...
cwe
CWE-125
Python
const _ = require('lodash'); const errors = require('@tryghost/errors'); const logging = require('@tryghost/logging'); const tpl = require('@tryghost/tpl'); const DomainEvents = require('@tryghost/domain-events'); const {MemberCreatedEvent, SubscriptionCreatedEvent, MemberSubscribeEvent, SubscriptionCancelledEvent} = r...
cwe
CWE-284
JavaScript
/* * MPEG4 encoder. * Copyright (c) 2000,2001 Fabrice Bellard * Copyright (c) 2002-2010 Michael Niedermayer <michaelni@gmx.at> * * This file is part of FFmpeg. * * FFmpeg 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 ...
cwe
CWE-20
C/C++
def gate_process HistoryHelper.keep_last(request) @login_user = User.find_by_id(session[:login_user_id]) begin if @login_user.nil? \ or @login_user.time_zone.nil? or @login_user.time_zone.empty? unless THETIS_USER_TIMEZONE_DEFAULT.nil? or THETIS_USER_TIMEZONE_DEFAULT.empty? ...
cwe
CWE-89
Ruby
/* * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * * 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-20
C/C++
int cipso_v4_sock_setattr(struct sock *sk, 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_sock *sk_inet; struct inet_connection_sock *sk_conn; /* In t...
cwe
CWE-362
Unknown
static bool caller_is_in_ancestor(pid_t pid, const char *contrl, const char *cg, char **nextcg) { char fnam[PROCLEN]; FILE *f; bool answer = false; char *line = NULL; size_t len = 0; int ret; ret = snprintf(fnam, PROCLEN, "/proc/%d/cgroup", pid); if (ret < 0 || ret >= PROCLEN) return false; if (!(f = fop...
cwe
CWE-264
C/C++
DeepScanLineInputFile::DeepScanLineInputFile(InputPartData* part) { _data = new Data(part->numThreads); _data->_deleteStream=false; _data->_streamData = part->mutex; _data->memoryMapped = _data->_streamData->is->isMemoryMapped(); _data->version = part->version; initialize(part->header); ...
cwe
CWE-125
Unknown
def get_configs(params, request, session) if not allowed_for_local_cluster(session, Permissions::FULL) return 403, 'Permission denied' end if not $cluster_name or $cluster_name.empty? return JSON.generate({'status' => 'not_in_cluster'}) end if params[:cluster_name] != $cluster_name return JSON.gen...
cwe
CWE-384
Ruby
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
cwe
CWE-617
Python
sort_key: (tagset_id ? all_tags[tagset_id].t.toLowerCase() : '') + text.toLowerCase() }; var div = $(create_tag_html( text, description, my_name, new_tag_counter, tagset ? tagset.attr('data-id') : null)); div.addClass('ui-sel...
cwe
CWE-116
JavaScript
WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op) { /* ! */ dec_struct_t * ps_dec = (dec_struct_t *)(dec_hdl->pv_codec_handle); WORD32 i4_err_status = 0; UWORD8 *pu1_buf = NULL; WORD32 buflen; UWORD32 u4_max_ofst, u4_length_of_start_code = 0; UWORD32 bytes_consumed...
cwe
CWE-119
Unknown
/* * 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-787
C/C++
static void check_user_password(struct pdf_struct *pdf, int R, const char *O, const char *U, int32_t P, int EM, unsigned length, unsigned oulen) { unsigned i; uint8_t result[16]; char data[32]; cli_md5_ctx md5; struct arc4_state arc4; unsigned password_empty = 0; dbg_printhex("U: ",...
cwe
CWE-189
Unknown
static Image *ReadTIMImage(const ImageInfo *image_info,ExceptionInfo *exception) { typedef struct _TIMInfo { size_t id, flag; } TIMInfo; TIMInfo tim_info; Image *image; int bits_per_pixel, has_clut; MagickBooleanType status; register IndexPacket *indexes; ...
cwe
CWE-401
Unknown
/* * Copyright (c) 2004-2021, University of Oslo * 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 copyright notice, this * list of cond...
cwe
CWE-918
Java
results_differ(const char *testname, const char *resultsfile, const char *default_expectfile) { char expectfile[MAXPGPATH]; char diff[MAXPGPATH]; char cmd[MAXPGPATH * 3]; char best_expect_file[MAXPGPATH]; FILE *difffile; int best_line_count; int i; int l; const char *platform_expectfile; /* * ...
cwe
CWE-119
Unknown
"120px",k.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",k.style.backgroundPosition="center 65%",k.style.backgroundRepeat="no-repeat",D=document.createElement("div"),D.style.position="absolute",D.style.width="420px",D.style.top="58%",D.style.textAlign="center",D.style.fontSize="18px",D.style.color="#a0c3f...
cwe
CWE-20
JavaScript
// Copyright 2011 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. package template import ( "bytes" "fmt" "strings" "unicode/utf8" ) // htmlNospaceEscaper escapes for inclusion in unquoted attribute values. func htmlNosp...
cwe
CWE-74
Go
package io.swagger.codegen.languages; import static java.util.Collections.sort; import com.google.common.collect.LinkedListMultimap; import io.swagger.codegen.*; import io.swagger.codegen.languages.features.BeanValidationFeatures; import io.swagger.codegen.languages.features.GzipFeatures; import io.swagger.codegen.la...
cwe
CWE-200
Java
int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MpegEncContext *s = avctx->priv_data; int ret; int slice_ret = 0; AVFrame *pict = data; /* no suppleme...
cwe
CWE-20
Unknown
/* radare2 - LGPL3 - 2015-2022 - deepakchethan */ #include "qnx/qnx.h" #include "../i/private.h" static int lmf_header_load(lmf_header *lmfh, RBuffer *buf, Sdb *db) { if (r_buf_size (buf) < sizeof (lmf_header)) { return false; } if (r_buf_fread_at (buf, QNX_HEADER_ADDR, (ut8 *) lmfh, "iiiiiiiicccciiiicc", 1) < Q...
cwe
CWE-400
C/C++
static ssize_t store_int_with_restart(struct device *s, struct device_attribute *attr, const char *buf, size_t size) { ssize_t ret = device_store_int(s, attr, buf, size); mce_restart(); return ret; }
cwe
CWE-362
Unknown
static int jp2_pclr_getdata(jp2_box_t *box, jas_stream_t *in) { jp2_pclr_t *pclr = &box->data.pclr; int lutsize; unsigned int i; unsigned int j; int_fast32_t x; pclr->lutdata = 0; if (jp2_getuint16(in, &pclr->numlutents) || jp2_getuint8(in, &pclr->numchans)) { return -1; } lutsize = pclr->numluten...
cwe
CWE-476
C/C++
/* * 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++
/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\...
cwe
CWE-415
C/C++
modify_policy_2_svc(mpol_arg *arg, struct svc_req *rqstp) { static generic_ret ret; char *prime_arg; gss_buffer_desc client_name, service_name; OM_uint32 minor_stat; kadm5_server_handle_t handle; cons...
cwe
CWE-772
C/C++
/* * Copyright (C) 2009-2010 Julien BLACHE <jb@jblache.org> * * Some code included below is in the public domain, check comments * in the file. * * Pieces of code adapted from mt-daapd: * Copyright (C) 2003-2007 Ron Pedde (ron@pedde.com) * * This program is free software; you can redistribute it and/or modify ...
cwe
CWE-416
C/C++
static vpx_image_t *img_alloc_helper(vpx_image_t *img, vpx_img_fmt_t fmt, unsigned int d_w, unsigned int d_h, unsigned int buf_align, unsigned int stride_align, unsigned char *img_data) { unsigned int h, w, s, xcs, ycs, bps; unsigned int stride_in_bytes; int align; /* Treat align==0 like align==1 */ if (!buf_...
cwe
CWE-20
C/C++
const fs = require('fs') const fsProm = require('fs/promises'); const os = require('os'); const path = require('path') const url = require('url') const {Menu: menu, shell, dialog, clipboard, nativeImage, ipcMain, app, BrowserWindow} = require('electron') const crc = require('crc'); const zlib = require('zlib'); const...
cwe
CWE-79
JavaScript
processDataRcvd(ptcpsess_t *const __restrict__ pThis, char **buff, const int buffLen, struct syslogTime *stTime, const time_t ttGenTime, multi_submit_t *pMultiSub, unsigned *const __restrict__ pnMsgs) { DEFiRet; char c = **buff; int octatesToCopy, octatesToDiscard; uchar *propPeerName = NULL; int lenPeerName...
cwe
CWE-787
Unknown
xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size) { xmlParserCtxtPtr ctxt = NULL; xmlDocPtr ret; /* xmlInitParser(); */ */ ctxt = xmlCreateMemoryParserCtxt(buf, buf_size); if (ctxt) { ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace; ctxt->sax-...
cwe
CWE-611
C/C++
int ext4_orphan_del(handle_t *handle, struct inode *inode) { struct list_head *prev; struct ext4_inode_info *ei = EXT4_I(inode); struct ext4_sb_info *sbi; __u32 ino_next; struct ext4_iloc iloc; int err = 0; if (!EXT4_SB(inode->i_sb)->s_journal) return 0; mutex_lock(&EXT4_SB(inode->i_sb)->s_orphan_lock...
cwe
CWE-399
C/C++
EC_GROUP *EC_GROUP_new(const EC_METHOD *meth) { EC_GROUP *ret; if (meth == NULL) { ECerr(EC_F_EC_GROUP_NEW, EC_R_SLOT_FULL); return NULL; } if (meth->group_init == 0) { ECerr(EC_F_EC_GROUP_NEW, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return NULL; } ret = OPENSSL_malloc(sizeof *ret); if (ret == NULL)...
cwe
CWE-320
Unknown
static int kvm_vm_ioctl_get_pit2(struct kvm *kvm, struct kvm_pit_state2 *ps) { int r = 0; mutex_lock(&kvm->arch.vpit->pit_state.lock); memcpy(ps->channels, &kvm->arch.vpit->pit_state.channels, sizeof(ps->channels)); ps->flags = kvm->arch.vpit->pit_state.flags; mutex_unlock(&kvm->arch.vpit->pit_state.lock); ret...
cwe
CWE-200
Unknown
def read(*args) while documents = pending_replies.shift reply = Moped::Protocol::Reply.allocate.tap do |reply| documents = [documents] unless documents.is_a? Array reply.documents = documents reply.count = documents.length end reply.serialize(@buffer.string) ...
cwe
CWE-20
Ruby
GC_API GC_ATTR_MALLOC void * GC_CALL GC_memalign(size_t align, size_t lb) { size_t new_lb; size_t offset; ptr_t result; if (align <= GRANULE_BYTES) return GC_malloc(lb); if (align >= HBLKSIZE/2 || lb >= HBLKSIZE/2) { if (align > HBLKSIZE) { return (*GC_get_oom_fn())(LONG_MAX-1024)...
cwe
CWE-119
Unknown
void initializeFilter(HeaderMode mode, bool inject_route_config_headers) { config_helper_.addConfigModifier( [&](envoy::extensions::filters::network::http_connection_manager::v3::HttpConnectionManager& hcm) { // Overwrite default config with our own. TestUtility::loadFrom...
cwe
CWE-22
Unknown
parseInt(u.getAttribute("height"))+6),E=u.getAttribute("viewBox"),null!=E&&0<E.length&&(E=E.split(" "),3<E.length&&(w=parseFloat(E[2])+6,h=parseFloat(E[3])+6,u.setAttribute("viewBox",E[0]+" "+E[1]+" "+w+" "+h))))));return Q};Graph.prototype.setShadowVisible=function(u,E){mxClient.IS_SVG&&!mxClient.IS_SF&&(E=null!=E?E:!...
cwe
CWE-20
JavaScript
const log = require('../services/log'); const fileUploadService = require('./api/files'); const scriptService = require('../services/script'); const cls = require('../services/cls'); const sql = require("../services/sql"); const becca = require("../becca/becca"); function handleRequest(req, res) { // express puts ...
cwe
CWE-79
JavaScript
function c(B,G,M,H,F,J,R,W,O){try{if(b.spinner.stop(),null==G||"image/"==G.substring(0,6))if(null==B&&null!=R||null==z[B]){var V=function(){P.innerHTML="";P.style.cursor="pointer";P.style.whiteSpace="nowrap";P.style.textOverflow="ellipsis";mxUtils.write(P,null!=T.title&&0<T.title.length?T.title:mxResources.get("untitle...
cwe
CWE-94
JavaScript
int fscrypt_get_encryption_info(struct inode *inode) { struct fscrypt_info *ci = inode->i_crypt_info; if (!ci || (ci->ci_keyring_key && (ci->ci_keyring_key->flags & ((1 << KEY_FLAG_INVALIDATED) | (1 << KEY_FLAG_REVOKED) | (1 << KEY_FLAG_DEAD))))) return fscrypt_get_crypt_info(inode); ...
cwe
CWE-416
Unknown
InputSource::findLast(char const* start_chars, qpdf_offset_t offset, size_t len, Finder& finder) { bool found = false; qpdf_offset_t after_found_offset = 0; qpdf_offset_t cur_offset = offset; size_t cur_len = len; while (this->findFirst(start_chars, cur_of...
cwe
CWE-787
Unknown
static pyc_object *get_list_object(RBuffer *buffer) { pyc_object *ret = NULL; bool error = false; ut32 n = 0; n = get_ut32 (buffer, &error); if (n > ST32_MAX) { eprintf ("bad marshal data (list size out of range)\n"); return NULL; } if (error) { return NULL; } ret = get_array_object_generic (buffer, n);...
cwe
CWE-119
Unknown
public function createTag($name, $options = NULL) { $this->run('tag', $options, $name); return $this; }
cwe
CWE-88
PHP
""" Defender - Protects your community with automod features and empowers the staff and users you trust with advanced moderation tools Copyright (C) 2020-present Twentysix (https://github.com/Twentysix26/) This program is free software: you can redistribute it and/or modify it under the terms of ...
cwe
CWE-269
Python
package com.salesmanager.shop.admin.model.catalog; import com.salesmanager.core.model.catalog.product.availability.ProductAvailability; import com.salesmanager.core.model.catalog.product.price.ProductPriceDescription; import javax.validation.Valid; import java.util.ArrayList; import java.util.List; public class Prod...
cwe
CWE-639
Java
def add_language(self, language): """"Add new language for item translations.""" if self.connection: self.cursor.execute('insert into itemlanguage (language) values ("%s")' % language[0]) self.connection.commit()
cwe
CWE-89
Python
/*! Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved. rebuild is dual-licensed under commercial and open source licenses (GPLv3). See LICENSE and COMMERCIAL in the project root for license information. */ package com.rebuild.core.support.general; import cn.devezhao.commons.Objec...
cwe
CWE-89
Java
#include "PipeSocketHandler.hpp" namespace et { PipeSocketHandler::PipeSocketHandler() {} int PipeSocketHandler::connect(const SocketEndpoint& endpoint) { lock_guard<std::recursive_mutex> mutexGuard(globalMutex); string pipePath = endpoint.name(); sockaddr_un remote; int sockFd = ::socket(AF_UNIX, SOCK_STRE...
cwe
CWE-120
C/C++
static int jpc_pi_nextrpcl(register jpc_pi_t *pi) { int rlvlno; jpc_pirlvl_t *pirlvl; jpc_pchg_t *pchg; int prchind; int prcvind; int *prclyrno; int compno; jpc_picomp_t *picomp; int xstep; int ystep; uint_fast32_t r; uint_fast32_t rpx; uint_fast32_t rpy; uint_fast32_t trx0; uint_fast32_t try0; pchg = ...
cwe
CWE-190
C/C++
// @flow // A database adapter that works with data exported from the hosted // Parse database. // @flow-disable-next import { Parse } from 'parse/node'; // @flow-disable-next import _ from 'lodash'; // @flow-disable-next import intersect from 'intersect'; // @flow-disable-next import deepcopy from 'deepcopy'; import...
cwe
CWE-200
JavaScript
/* * * Copyright 2019 Asylo 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 agree...
cwe
CWE-125
C/C++
void gfs2_clear_rgrpd(struct gfs2_sbd *sdp) { struct rb_node *n; struct gfs2_rgrpd *rgd; struct gfs2_glock *gl; while ((n = rb_first(&sdp->sd_rindex_tree))) { rgd = rb_entry(n, struct gfs2_rgrpd, rd_node); gl = rgd->rd_gl; rb_erase(n, &sdp->sd_rindex_tree); if (gl) { spin_lock(&gl->gl_lockref.lock); ...
cwe
CWE-416
C/C++
QUtil::toUTF8(unsigned long uval) { std::string result; // A UTF-8 encoding of a Unicode value is a single byte for // Unicode values <= 127. For larger values, the first byte of // the UTF-8 encoding has '1' as each of its n highest bits and // '0' for its (n+1)th highest bit where n is the total...
cwe
CWE-787
Unknown
function toString(stringify) { if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify; var query , url = this , protocol = url.protocol; if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':'; var result = protocol + ((url.protocol && url.slashes) |...
cwe
CWE-639
JavaScript
XpmCreateDataFromXpmImage( char ***data_return, XpmImage *image, XpmInfo *info) { /* calculation variables */ int ErrorStatus; char buf[BUFSIZ]; char **header = NULL, **data, **sptr, **sptr2, *s; unsigned int header_size, header_nlines; unsigned int data_size, data_nlines; un...
cwe
CWE-119
C/C++
void readBytes(void* data, int length) { U8* dataPtr = (U8*)data; U8* dataEnd = dataPtr + length; while (dataPtr < dataEnd) { int n = check(1, dataEnd - dataPtr); memcpy(dataPtr, ptr, n); ptr += n; dataPtr += n; } }
cwe
CWE-787
C/C++
httpLocalRequest(ObjectPtr object, int method, int from, int to, HTTPRequestPtr requestor, void *closure) { if(object->requestor == NULL) object->requestor = requestor; if(!disableLocalInterface && urlIsSpecial(object->key, object->key_size)) return httpSpecialRequest(object, m...
cwe
CWE-617
Unknown
/** Onion HTTP server library Copyright (C) 2010-2021 David Moreno Montero and others This library is free software; you can redistribute it and/or modify it under the terms of, at your choice: a. the Apache License Version 2.0. b. the GNU General Public License as published by the Free Software Founda...
cwe
CWE-404
C/C++
void impeg2d_next_code(dec_state_t *ps_dec, UWORD32 u4_start_code_val) { stream_t *ps_stream; ps_stream = &ps_dec->s_bit_stream; impeg2d_bit_stream_flush_to_byte_boundary(ps_stream); while ((impeg2d_bit_stream_nxt(ps_stream,START_CODE_LEN) != u4_start_code_val) && (ps_dec->s_bit_stream.u4_offs...
cwe
CWE-254
C/C++
static inline void brcmf_fweh_process_skb(struct brcmf_pub *drvr, struct sk_buff *skb) { struct brcmf_event *event_packet; u16 usr_stype; /* only process events when protocol matches */ if (skb->protocol != cpu_to_be16(ETH_P_LINK_CTL)) return; if ((skb->len + ETH_HLEN) < sizeof(*event_packet)) return;...
cwe
CWE-20
Unknown
/* * rfbserver.c - deal with server-side of the RFB protocol. */ /* * Copyright (C) 2009-2019 D. R. Commander. All Rights Reserved. * Copyright (C) 2010 University Corporation for Atmospheric Research. * All Rights Reserved. * Copyright (C) 2005-2008 Sun Microsystems, Inc. All Rights Res...
cwe
CWE-787
C/C++
static void save_bt_to_dump_dir(const char *bt, const char *exe, const char *reason) { time_t t = time(NULL); const char *iso_date = iso_date_string(&t); /* dump should be readable by all if we're run with -x */ uid_t my_euid = (uid_t)-1L; mode_t mode = DEFAULT_DUMP_DIR_MODE | S_IROTH; /* and re...
cwe
CWE-200
Unknown
void MAPIPrint(MAPIProps *p) { int j, i, index, h, x; DDWORD *ddword_ptr; DDWORD ddword_tmp; dtr thedate; MAPIProperty *mapi; variableLength *mapidata; variableLength vlTemp; int found; for (j = 0; j < p->count; j++) { mapi = &(p->properties[j]); printf(" #%i: Type: [", j); switch (PROP...
cwe
CWE-190
C/C++
static int ldb_kv_rename(struct ldb_kv_context *ctx) { struct ldb_module *module = ctx->module; void *data = ldb_module_get_private(module); struct ldb_kv_private *ldb_kv = talloc_get_type(data, struct ldb_kv_private); struct ldb_request *req = ctx->req; struct ldb_message *msg; int ret = LDB_SUCCESS; struc...
cwe
CWE-20
Unknown
static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y, const uint8_t *src, int src_size) { int width, height; int hdr, zsize, npal, tidx = -1, ret; int i, j; const uint8_t *src_end = src + src_size; uint8_t pal[768], transp[3]; uLongf dlen = (c->tile_wid...
cwe
CWE-119
Unknown
dwg_encode_add_object (Dwg_Object *restrict obj, Bit_Chain *restrict dat, unsigned long address) { int error = 0; unsigned long oldpos; unsigned long end_address = address + obj->size; oldpos = bit_position (dat); assert (address); dat->byte = address; dat->bit = 0; LOG_INFO ("O...
cwe
CWE-835
Unknown
function renderBreadcrumb() { var bcDiv = _$('.odFilesBreadcrumb'); if (bcDiv == null) return; bcDiv.innerHTML = ''; for (var i = 0; i < breadcrumb.length - 1; i++) { var folder = document.createElement('span'); folder.className = 'odBCFolder'; folder.innerHTML = mxUtils.htmlEntities(bread...
cwe
CWE-94
JavaScript
label (const uint8_t * src, size_t srclen, uint8_t * dst, size_t * dstlen, int flags) { size_t plen; uint32_t *p; int rc; size_t tmpl; if (_idn2_ascii_p (src, srclen)) { if (flags & IDN2_ALABEL_ROUNDTRIP) /* FIXME implement this MAY: If the input to this procedure appears to be an A-la...
cwe
CWE-20
C/C++
static int skfp_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { struct s_smc *smc = netdev_priv(dev); skfddi_priv *lp = &smc->os; struct s_skfp_ioctl ioc; int status = 0; if (copy_from_user(&ioc, rq->ifr_data, sizeof(struct s_skfp_ioctl))) return -EFAULT; switch (ioc.cmd) { case SKFP_GET_STATS: /*...
cwe
CWE-264
Unknown
/** * FreeRDP: A Remote Desktop Protocol Implementation * Drawing Orders * * Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com> * Copyright 2016 Armin Novak <armin.novak@thincast.com> * Copyright 2016 Thincast Technologies GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * yo...
cwe
CWE-681
C/C++
/******************************************************************************* * * This file contains the Linux/SCSI LLD virtual SCSI initiator driver * for emulated SAS initiator ports * * © Copyright 2011 RisingTide Systems LLC. * * Licensed to the Linux Foundation under the General Public License (GPL) vers...
cwe
CWE-119
C/C++
fn collect_conflicts_between_fragments( &self, conflicts: &mut Vec<Conflict>, fragment_name1: &'a str, fragment_name2: &'a str, mutually_exclusive: bool, ctx: &ValidatorContext<'a, S>, ) where S: ScalarValue, { // Early return on fragment recursion...
cwe
CWE-674
Rust
""" Functions for generating and verifying JSON Web Tokens. """ from datetime import datetime, timedelta from calendar import timegm from os import urandom from jwcrypto.jws import JWS, JWSHeaderRegistry from jwcrypto.common import base64url_encode, base64url_decode, \ json_encode, json_dec...
cwe
CWE-290
Python
import { loginPage, projectsPage } from "../../support/page_objects/navigation"; import { mainPage } from "../../support/page_objects/mainPage"; import { isPostgres, isXcdb, roles, staticProjects, } from "../../support/page_objects/projectConstants"; import { isTestSuiteActive } from "../../support/page...
cwe
CWE-400
JavaScript