code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
static int set_register(pegasus_t *pegasus, __u16 indx, __u8 data) { int ret; ret = usb_control_msg(pegasus->usb, usb_sndctrlpipe(pegasus->usb, 0), PEGASUS_REQ_SET_REG, PEGASUS_REQT_WRITE, data, indx, &data, 1, 1000); if (ret < 0) netif_dbg(pegasus, drv, pegasus->net, "%s returned %d\n", __...
cwe
CWE-284
Unknown
/* $Id$ */ /* * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * * 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; eit...
cwe
CWE-120
C/C++
0,Wa,bb,$a);Na.pageSelector=!1;Na.mathEnabled=!1;ua.checked&&(Na.isCellVisible=function(Xa){return Ha.isCellSelected(Xa)});Wa=p.getCurrentFile();null!=Wa&&(Na.title=Wa.getTitle());var ib=Na.writeHead;Na.writeHead=function(Xa){ib.apply(this,arguments);if(mxClient.IS_GC||mxClient.IS_SF)Xa.writeln('<style type="text/css">...
cwe
CWE-20
JavaScript
create_principal3_2_svc(cprinc3_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; restriction_t ...
cwe
CWE-772
C/C++
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ //===----------------------------------------------------------------------===// /// \file /// ES7 22.2 TypedArray //===---------...
cwe
CWE-843
C/C++
static MagickBooleanType WriteJPEGImage(const ImageInfo *image_info, Image *image,ExceptionInfo *exception) { const char *option, *sampling_factor, *value; ErrorManager error_manager; Image *volatile volatile_image; int colorspace, quality; JSAMPLE *volatile jpeg_pixels; ...
cwe
CWE-119
Unknown
formatItem: function(data) { var s = data[options.nameKey]; if (options.descKey) { s += " <span>(" + data[options.descKey] + ")</span>"; } return s; },
cwe
CWE-79
JavaScript
package node import ( "bytes" "context" "fmt" "net" "net/http" _ "net/http/pprof" // nolint: gosec // securely exposed on separate, optional port "os" "strings" "time" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "githu...
cwe
CWE-787
Go
void virtqueue_map_sg(struct iovec *sg, hwaddr *addr, size_t num_sg, int is_write) { unsigned int i; hwaddr len; for (i = 0; i < num_sg; i++) { len = sg[i].iov_len; sg[i].iov_base = cpu_physical_memory_map(addr[i], &len, is_write); if (sg[i].iov_base == NULL || len != sg[i].iov_...
cwe
CWE-20
Unknown
/* * Copyright 2021 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-79
Java
package com.salesmanager.shop.admin.controller.products; import com.salesmanager.core.business.services.catalog.product.ProductService; import com.salesmanager.core.business.services.catalog.product.attribute.ProductAttributeService; import com.salesmanager.core.business.services.catalog.product.attribute.ProductOptio...
cwe
CWE-639
Java
static int treo_attach(struct usb_serial *serial) { struct usb_serial_port *swap_port; /* Only do this endpoint hack for the Handspring devices with * interrupt in endpoints, which for now are the Treo devices. */ if (!((le16_to_cpu(serial->dev->descriptor.idVendor) == HANDSPRING_VENDOR_ID) || (le16_to_cp...
cwe
CWE-703
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
static void init_once(void *foo) { struct ext4_inode_info *ei = (struct ext4_inode_info *) foo; INIT_LIST_HEAD(&ei->i_orphan); init_rwsem(&ei->xattr_sem); init_rwsem(&ei->i_data_sem); inode_init_once(&ei->vfs_inode); }
cwe
CWE-362
C/C++
void Context::onUpstreamConnectionClose(PeerType peer_type) { if (wasm_->onUpstreamConnectionClose_) { wasm_->onUpstreamConnectionClose_(this, id_, static_cast<uint32_t>(peer_type)); } }
cwe
CWE-476
C/C++
static int wddx_stack_destroy(wddx_stack *stack) { register int i; if (stack->elements) { for (i = 0; i < stack->top; i++) { if (((st_entry *)stack->elements[i])->data) { zval_ptr_dtor(&((st_entry *)stack->elements[i])->data); } if (((st_entry *)stack->elements[i])->varname) { efree(((st_ent...
cwe
CWE-416
Unknown
// Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: AuthorizeResponder) // Package internal is a generated GoMock package. package internal import ( http "net/http" url "net/url" reflect "reflect" gomock "github.com/golang/mock/gomock" ) // MockAuthorizeResponder is a mock o...
cwe
CWE-287
Go
protected function parseChunkedRequest(Request $request) { $index = $request->get('qqpartindex'); $total = $request->get('qqtotalparts'); $uuid = $request->get('qquuid'); $orig = $request->get('qqfilename'); $last = ((int) $total - 1) === (int) $index; return [$last,...
cwe
CWE-22
PHP
window._load_metadata = function(ev, viewport) { /* Image details */ var tmp = viewport.getMetadata(); $('#wblitz-image-name').html(tmp.imageName); $('#wblitz-image-description-content').html(tmp.imageDescription.replace(/\n/g, '<br />')); $('#wblitz-image-author').html(tmp.imag...
cwe
CWE-79
JavaScript
STATIC void * GC_debug_generic_malloc(size_t lb, int knd, GC_EXTRA_PARAMS) { void * result = GC_generic_malloc(lb + DEBUG_BYTES, knd); if (NULL == result) { GC_err_printf( "GC_debug_generic_malloc(%lu, %d) returning NULL (%s:%d)\n", (unsigned long)lb, knd, s, i); ...
cwe
CWE-119
Unknown
// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. package github import ( "context" "errors" "fmt" "net/http" "github.com/go-vela/server/random" "github.com/go-vela/types/library" "github.com/sirupsen/logrus" ) /...
cwe
CWE-285
Go
static int ssi_sd_load(QEMUFile *f, void *opaque, int version_id) { SSISlave *ss = SSI_SLAVE(opaque); ssi_sd_state *s = (ssi_sd_state *)opaque; int i; if (version_id != 1) return -EINVAL; s->mode = qemu_get_be32(f); s->cmd = qemu_get_be32(f); for (i = 0; i < 4; i++) s->cmda...
cwe
CWE-94
C/C++
Mac_Read_POST_Resource( FT_Library library, FT_Stream stream, FT_Long *offsets, FT_Long resource_cnt, FT_Long face_index, FT_Face *aface ) { FT_Error error = FT_Err...
cwe
CWE-119
Unknown
static void aead_release(void *private) { struct aead_tfm *tfm = private; crypto_free_aead(tfm->aead); kfree(tfm); }
cwe
CWE-20
Unknown
def get_monthly_ranks_for_scene(db, scene, tag): sql = "SELECT date, rank FROM ranks WHERE scene='{}' AND player='{}'".format(scene, tag) res = db.exec(sql) res = [r for r in res if played_during_month(db, scene, tag, get_previous_month(r[0]))] # Build up a dict of {date: rank} ranks = {} for...
cwe
CWE-89
Python
AP4_Processor::Process(AP4_ByteStream& input, AP4_ByteStream& output, AP4_ByteStream* fragments, ProgressListener* listener, AP4_AtomFactory& atom_factory) { // read all atoms. // keep all atoms except [mdat] ...
cwe
CWE-703
C/C++
package com.salesmanager.shop.admin.controller.orders; import com.salesmanager.core.business.services.catalog.product.PricingService; import com.salesmanager.core.business.services.customer.CustomerService; import com.salesmanager.core.business.services.order.OrderService; import com.salesmanager.core.business.service...
cwe
CWE-639
Java
def _run_ssh(self, command, check_exit_code=True, attempts=1): if not self.sshpool: password = self.configuration.san_password privatekey = self.configuration.san_private_key min_size = self.configuration.ssh_min_pool_conn max_size = self.configuration.ssh_max_poo...
cwe
CWE-78
Python
int connect_n_handle_errors(struct st_command *command, MYSQL* con, const char* host, const char* user, const char* pass, const char* db, int port, const char* sock) { DYNAMIC_STRING *ds; int failed_attempts= 0; ds= &ds_res; /...
cwe
CWE-319
Unknown
int EncryptionUtil::encrypt(EncryptionMode mode, const unsigned char* source, uint32_t source_length, const unsigned char* key, uint32_t key_length, const unsigned char* iv, bool padding, unsigned char* encrypt) { const EVP_CIPHER* cipher = get_evp_type(mode);...
cwe
CWE-200
Unknown
_getConfig(config) { config = { ...this.constructor.Default, ...$(this.element).data(), ...typeof config === 'object' && config ? config : {} } if (typeof config.delay === 'number') { config.delay = { show: config.delay, hide: config.delay } } if (type...
cwe
CWE-79
JavaScript
const got = require('@/utils/got'); const cheerio = require('cheerio'); const iconv = require('iconv-lite'); const timezone = require('@/utils/timezone'); const { parseDate } = require('@/utils/parse-date'); module.exports = async (ctx) => { const rootUrl = ctx.path.split('/').slice(1, 4).join('/'); const curr...
cwe
CWE-918
JavaScript
int read_next_sample(int ifd, int action, int curr, char *file, int *rtype, int tab, struct file_magic *file_magic, struct file_activity *file_actlst, struct tm *rectime, struct tm *loctime, int oneof) { int rc; char rec_hdr_tmp[MAX_RECORD_HEADER_SIZE]; /* Read current record */ if ((rc = read_record...
cwe
CWE-125
Unknown
/* Basic authentication token and access key management * * Copyright (C) 2004-2008 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.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...
cwe
CWE-255
C/C++
OMX_ERRORTYPE SoftAMRWBEncoder::internalGetParameter( OMX_INDEXTYPE index, OMX_PTR params) { switch (index) { case OMX_IndexParamAudioPortFormat: { OMX_AUDIO_PARAM_PORTFORMATTYPE *formatParams = (OMX_AUDIO_PARAM_PORTFORMATTYPE *)params; if (formatParams->nPortInd...
cwe
CWE-119
C/C++
/* $OpenBSD: doas.c,v 1.57 2016/06/19 19:29:43 martijn Exp $ */ /* * Copyright (c) 2015 Ted Unangst <tedu@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice app...
cwe
CWE-20
C/C++
package fasthttp import ( "bytes" "errors" "fmt" "html" "io" "io/ioutil" "mime" "net/http" "os" "path/filepath" "sort" "strings" "sync" "time" "github.com/andybalholm/brotli" "github.com/klauspost/compress/gzip" "github.com/valyala/bytebufferpool" ) // ServeFileBytesUncompressed returns HTTP respons...
cwe
CWE-22
Go
App.Actions.WEB.update_ftp_path_hint = function(elm, hint) { if (hint.trim() == '') { $(elm).parent().find('.v-ftp-path-hint').html(''); } if (hint[0] != '/') { hint = '/' + hint; } hint = hint.replace(/\/(\/+)/g, '/'); $(elm).parent().find('.v-ftp-path-hint').text(hint); }
cwe
CWE-79
JavaScript
// Copyright (C) 2007 Manu Garg. // Author: Manu Garg <manugarg@gmail.com> // // pacparser is a library that provides methods to parse proxy auto-config // (PAC) files. Please read README file included with this package for more // information about this library. // // pacparser is free software; you can redistribute i...
cwe
CWE-119
C/C++
void X509Certificate::SubjectAltName(const FunctionCallbackInfo<Value>& args) { Environment* env = Environment::GetCurrent(args); X509Certificate* cert; ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder()); BIOPointer bio(BIO_new(BIO_s_mem())); Local<Value> ret; if (GetInfoString<NID_subject_alt_name>(env, bio, ce...
cwe
CWE-295
Unknown
mux_session_confirm(int id, int success, void *arg) { struct mux_session_confirm_ctx *cctx = arg; const char *display; Channel *c, *cc; int i; Buffer reply; if (cctx == NULL) fatal("%s: cctx == NULL", __func__); if ((c = channel_by_id(id)) == NULL) fatal("%s: no channel for id %d", __func__, id); if ((cc =...
cwe
CWE-287
C/C++
static block_t *Encode( encoder_t *p_enc, picture_t *p_pic ) { encoder_sys_t *p_sys = p_enc->p_sys; block_t *p_block, *p_output_chain = NULL; SchroFrame *p_frame; bool b_go = true; if( !p_pic ) { if( !p_sys->started || p_sys->b_eos_pulled ) return NULL; if( !p_sys->b_eo...
cwe
CWE-787
C/C++
static Image *ReadCLIPBOARDImage(const ImageInfo *image_info, ExceptionInfo *exception) { Image *image; register ssize_t x; register PixelPacket *q; ssize_t y; assert(image_info != (const ImageInfo *) NULL); assert(image_info->signature == MagickSignature); if (image_info->debug != M...
cwe
CWE-120
C/C++
DECLAREreadFunc(readContigTilesIntoBuffer) { int status = 1; tsize_t tilesize = TIFFTileSize(in); tdata_t tilebuf; uint32 imagew = TIFFScanlineSize(in); uint32 tilew = TIFFTileRowSize(in); int iskew = imagew - tilew; uint8* bufp = (uint8*) buf; uint32 tw, tl; uint32 row; (void) spp; tilebuf = _TIFFmalloc(t...
cwe
CWE-119
Unknown
void CommandData::ParseArg(wchar *Arg) { if (IsSwitch(*Arg) && !NoMoreSwitches) if (Arg[1]=='-' && Arg[2]==0) NoMoreSwitches=true; else ProcessSwitch(Arg+1); else if (*Command==0) { wcsncpy(Command,Arg,ASIZE(Command)); *Command=toupperw(*Command); // 'I' and 'S' comma...
cwe
CWE-787
C/C++
xmlParseReference(xmlParserCtxtPtr ctxt) { xmlEntityPtr ent; xmlChar *val; int was_checked; xmlNodePtr list = NULL; xmlParserErrors ret = XML_ERR_OK; if (RAW != '&') return; /* * Simple case of a CharRef */ if (NXT(1) == '#') { int i = 0; xmlChar out[10]; int hex ...
cwe
CWE-264
C/C++
func (m *Timestamp) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTimestamp } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ ...
cwe
CWE-129
Go
read_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id, uint32_t offset, uint32_t length, uint8_t *frubuf) { uint32_t off = offset, tmp, finish; struct ipmi_rs * rsp; struct ipmi_rq req; uint8_t msg_data[4]; if (offset > fru->size) { lprintf(LOG_ERR, "Read FRU Area offset incorrect: %d > %d"...
cwe
CWE-120
C/C++
package helm import ( "fmt" "io/ioutil" "net/url" "os" "os/exec" "strings" "github.com/ghodss/yaml" "github.com/argoproj/argo-cd/v2/util/config" executil "github.com/argoproj/argo-cd/v2/util/exec" pathutil "github.com/argoproj/argo-cd/v2/util/io/path" ) type HelmRepository struct { Creds Name strin...
cwe
CWE-20
Go
/* * 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-416
C/C++
/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\...
cwe
CWE-119
C/C++
Sidebar.prototype.refresh = function() { var graph = this.editorUi.editor.graph; this.graph.stylesheet.styles = mxUtils.clone(graph.stylesheet.styles); this.container.innerHTML = ''; this.palettes = new Object(); this.init(); };
cwe
CWE-94
JavaScript
$this->{$callback[0]}->{$callback[1]}($objPage, $objLayout, $this); } } $headBag = $this->responseContext->get(HtmlHeadBag::class); // Set the page title and description AFTER the modules have been generated $this->Template->mainTitle = $objPage->rootPageTitle; $this->Template->pageTitle = htmlspecialcha...
cwe
CWE-79
PHP
TPMI_DH_ENTITY_Unmarshal(TPMI_DH_ENTITY *target, BYTE **buffer, INT32 *size, BOOL allowNull) { TPM_RC rc = TPM_RC_SUCCESS; if (rc == TPM_RC_SUCCESS) { rc = TPM_HANDLE_Unmarshal(target, buffer, size); } if (rc == TPM_RC_SUCCESS) { BOOL isNotOwner = *target != TPM_RH_OWNER; BOOL isNotEndorsement = *...
cwe
CWE-787
Unknown
bool AXNodeObject::isChecked() const { Node* node = this->getNode(); if (!node) return false; if (isHTMLInputElement(*node)) return toHTMLInputElement(*node).shouldAppearChecked(); switch (ariaRoleAttribute()) { case CheckBoxRole: case MenuItemCheckBoxRole: case MenuItemRadioRole: ca...
cwe
CWE-254
C/C++
static void ProcessCanonMakerNoteDir(unsigned char * DirStart, unsigned char * OffsetBase, unsigned ExifLength) { int de; int a; int NumDirEntries; NumDirEntries = Get16u(DirStart); #define DIR_ENTRY_ADDR(Start, Entry) (Start+2+12*(Entry)) { unsigned char * DirEnd; Dir...
cwe
CWE-703
Unknown
void ConnectionManagerImpl::doEndStream(ActiveStream& stream) { // The order of what happens in this routine is important and a little complicated. We first see // if the stream needs to be reset. If it needs to be, this will end up invoking reset callbacks // and then moving the stream to the deferred destructio...
cwe
CWE-416
Unknown
public String getStringParameterSQL(String param) { return "'" + param + "'"; }
cwe
CWE-89
Java
int ha_myisam::repair(THD *thd, MI_CHECK &param, bool do_optimize) { int error=0; uint local_testflag=param.testflag; bool optimize_done= !do_optimize, statistics_done=0; const char *old_proc_info=thd->proc_info; char fixed_name[FN_REFLEN]; MYISAM_SHARE* share = file->s; ha_rows rows= file->state->records...
cwe
CWE-362
C/C++
html: new CKEDITOR.template('<div style="text-align:center;"></div>').output() } ]; } /* Dialog */ return { title: editor.lang.common.image, minWidth: 450, minHeight: 180, onLoad: function () { /* Get image preview element */ imgPreview = this.getContentElement('tab-source', 'preview'); /* Con...
cwe
CWE-434
JavaScript
static int truemotion1_decode_header(TrueMotion1Context *s) { int i, ret; int width_shift = 0; int new_pix_fmt; struct frame_header header; uint8_t header_buffer[128] = { 0 }; /* logical maximum size of the header */ const uint8_t *sel_vector_table; header.header_size = ((s->buf[0] >> 5) |...
cwe
CWE-703
Unknown
package at.hgz.vocabletrainer; import java.io.File; import java.io.FileNotFoundException; import android.content.ContentProvider; import android.content.ContentValues; import android.database.Cursor; import android.net.Uri; import android.os.ParcelFileDescriptor; import android.util.Log; public class VocableTrainerP...
cwe
CWE-22
Java
int khugepaged_enter_vma_merge(struct vm_area_struct *vma) { unsigned long hstart, hend; if (!vma->anon_vma) /* * Not yet faulted in so we will register later in the * page fault if needed. */ return 0; if (vma->vm_file || vma->vm_ops) /* khugepaged not yet working on file or special mappings */ ret...
cwe
CWE-399
Unknown
static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep) { struct dwc3_gadget_ep_cmd_params params; struct dwc3_request *req; int starting; int ret; u32 cmd; if (!dwc3_calc_trbs_left(dep)) return 0; starting = !(dep->flags & DWC3_EP_BUSY); dwc3_prepare_trbs(dep); req = next_request(&dep->star...
cwe
CWE-667
C/C++
bool PackLinuxElf32::calls_crt1(Elf32_Rel const *rel, int sz) { if (!dynsym || !dynstr) { return false; } for (unsigned relnum= 0; 0 < sz; (sz -= sizeof(Elf32_Rel)), ++rel, ++relnum) { unsigned const symnum = get_te32(&rel->r_info) >> 8; char const *const symnam = get_dynsym_name(sym...
cwe
CWE-190
C/C++
void ModifiablePixelBuffer::fillRect(const Rect& r, const void* pix) { int stride; U8 *buf; int w, h, b; w = r.width(); h = r.height(); b = format.bpp/8; if (h == 0) return; buf = getBufferRW(r, &stride); if (b == 1) { while (h--) { memset(buf, *(const U8*)pix, w); buf += strid...
cwe
CWE-119
C/C++
$resp = $this->asEditor()->get($entity->getUrl('/export/html')); $resp->assertDontSee('window.donkey'); $resp->assertDontSee('script'); $resp->assertSee('.my-test-class { color: red; }'); }
cwe
CWE-79
PHP
static void perf_syscall_exit(void *ignore, struct pt_regs *regs, long ret) { struct syscall_metadata *sys_data; struct syscall_trace_exit *rec; struct hlist_head *head; int syscall_nr; int rctx; int size; syscall_nr = trace_get_syscall_nr(current, regs); if (syscall_nr < 0) return; if (!test_bit(syscall_nr...
cwe
CWE-476
Unknown
function services(srv, callback) { // fallback - if only callback is given if (util.isFunction(srv) && !callback) { callback = srv; srv = ''; } return new Promise((resolve) => { process.nextTick(() => { if (typeof srv !== "string") { if (callback) { callback([]); } return res...
cwe
CWE-78
JavaScript
import dayjs from 'dayjs' import customParseFormat from 'dayjs/plugin/customParseFormat' import { t } from './i18n.js' import Projects from '../api/projects/projects.js' import projectUsers from '../api/users/users.js' import { periodToDates } from './periodHelpers.js' import { getGlobalSetting, getUserSetting } from '...
cwe
CWE-1236
JavaScript
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-125
C/C++
MediaRecorder::MediaRecorder(ExecutionContext* context, MediaStream* stream, const MediaRecorderOptions* options, ExceptionState& exception_state) : PausableObject(context), stream_(stream), mime_type_(options->hasMim...
cwe
CWE-787
C/C++
soup_ntlm_parse_challenge (const char *challenge, char **nonce, char **default_domain, gboolean *ntlmv2_session) { gsize clen; NTLMString domain; guchar *chall; guint32 flags; chall = g_base64_decode (challenge, &clen); if (clen < NTLM_CHALLENGE_DOMAIN_STRING_OFFSET || clen < N...
cwe
CWE-125
C/C++
S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state, regnode ** node_p, UV * code_point_p, int * cp_count, I32 * flagp, const bool strict, const U32 depth ) { /* This routine teases apart the various meanings of \N and retu...
cwe
CWE-125
C/C++
TEST_F(OAuth2Test, OAuthBearerTokenFlowFromHeader) { Http::TestRequestHeaderMapImpl request_headers_before{ {Http::Headers::get().Path.get(), "/test?role=bearer"}, {Http::Headers::get().Host.get(), "traffic.example.com"}, {Http::Headers::get().Method.get(), Http::Headers::get().MethodValues.Get}, ...
cwe
CWE-416
Unknown
void Compute(OpKernelContext* context) override { const Tensor& input = context->input(0); const TensorShape& input_shape = input.shape(); const Tensor& out_backprop = context->input(2); const TensorShape& out_backprop_shape = out_backprop.shape(); TensorShape filter_shape; if (takes_shape_) {...
cwe
CWE-369
Unknown
// The Inflector transforms words from singular to plural, class names to table names, modularized class names to ones without, // and class names to foreign keys. The default inflections for pluralization, singularization, and uncountable words are kept // in inflections.coffee // // If you discover an incorrect infle...
cwe
CWE-400
JavaScript
def userLogin(self): sqlName="select count(*) from users where name='%s' and \ password='%s';"%(self.name,self.password) checkName=sql.queryDB(self.conn,sqlName) result=checkName[0][0] if result == 0: self.clean() return False else: ...
cwe
CWE-89
Python
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 1); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* input = GetInput(context, node, kInputTensor); TfLiteIntArray* input_dims = input->dims; int input_dims_size = input_dims->size;...
cwe
CWE-787
C/C++
static Image *ReadPWPImage(const ImageInfo *image_info,ExceptionInfo *exception) { char filename[MagickPathExtent]; FILE *file; Image *image, *next_image, *pwp_image; ImageInfo *read_info; int c, unique_file; MagickBooleanType status; register Image *p; reg...
cwe
CWE-252
C/C++
ATPostAlterTypeCleanup(List **wqueue, AlteredTableInfo *tab, LOCKMODE lockmode) { ObjectAddress obj; ListCell *def_item; ListCell *oid_item; /* * Re-parse the index and constraint definitions, and attach them to the * appropriate work queue entries. We do this before dropping because in * the case of a F...
cwe
CWE-362
Unknown
verify: function(digest, d) { // remove padding d = _decodePkcs1_v1_5(d, key, true); // d is ASN.1 BER-encoded DigestInfo var obj = asn1.fromDer(d); // compare the given digest to the decrypted one return digest === obj.value[1].value; }
cwe
CWE-347
JavaScript
/* * GPAC - Multimedia Framework C SDK * * Authors: Cyril Concolato / Jean Le Feuvre * Copyright (c) Telecom ParisTech 2005-2020 * All rights reserved * * This file is part of GPAC / ISO Media File Format sub-project * * GPAC is free software; you can redistribute it and/or modify * it und...
cwe
CWE-476
C/C++
from django.contrib import admin import import_export.widgets as widgets from import_export.admin import ImportExportModelAdmin from import_export.fields import Field from import_export.resources import ModelResource from .models import (PurchaseOrder, PurchaseOrderExtraLine, PurchaseOrderLineIte...
cwe
CWE-434
Python
/********************************************************************** regparse.c - Oniguruma (regular expression library) **********************************************************************/ /*- * Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> * All rights reserved. * * Redistribution an...
cwe
CWE-787
C/C++
void check_file_actlst(int *ifd, char *dfile, struct activity *act[], struct file_magic *file_magic, struct file_header *file_hdr, struct file_activity **file_actlst, unsigned int id_seq[], int ignore, int *endian_mismatch, int *arch_64) { int i, j, k, p; struct file_activity *fal; void *b...
cwe
CWE-125
Unknown
int rsa_rsaes_oaep_encrypt( rsa_context *ctx, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, const unsigned char *label, size_t label_len, size_t ilen, ...
cwe
CWE-310
Unknown
{% load i18n %} {% load inventree_extras %} {% load status_codes %} /* globals attachSelect, closeModal, constructField, constructFormBody, getFormFieldValue, global_settings, handleFormErrors, imageHoverIcon, inventreeDelete, inventreeGet, inventreePut, launchModalForm,...
cwe
CWE-434
Python
static int _hostsock_getpeername( oe_fd_t* sock_, struct oe_sockaddr* addr, oe_socklen_t* addrlen) { int ret = -1; sock_t* sock = _cast_sock(sock_); oe_socklen_t addrlen_in = 0; oe_errno = 0; if (!sock) OE_RAISE_ERRNO(OE_EINVAL); if (addrlen) addrlen_in = *addrlen;...
cwe
CWE-552
Unknown
function updateObject($object, $table, $where=null, $identifier='id', $is_revisioned=false) { if ($is_revisioned) { $object->revision_id++; //if ($table=="text") eDebug($object); $res = $this->insertObject($object, $table); //if ($table=="text") eDebug($object,tr...
cwe
CWE-89
PHP
de_dotdot( char* file ) { char* cp; char* cp2; int l; /* Collapse any multiple / sequences. */ while ( ( cp = strstr( file, "//") ) != (char*) 0 ) { for ( cp2 = cp + 2; *cp2 == '/'; ++cp2 ) continue; (void) strcpy( cp + 1, cp2 ); } /* Remove leading ./ and any /./ sequences. */ ...
cwe
CWE-119
C/C++
FileList={ useUndo:true, update:function(fileListHtml) { $('#fileList').empty().html(fileListHtml); }, addFile:function(name,size,lastModified,loading){ var img=(loading)?OC.imagePath('core', 'loading.gif'):OC.imagePath('core', 'filetypes/file.png'); var html='<tr data-type="file" data-size="'+size+'">'; if...
cwe
CWE-79
JavaScript
void bandwidth_pid(pid_t pid, const char *command, const char *dev, int down, int up) { EUID_ASSERT(); //************************ // verify sandbox //************************ EUID_ROOT(); char *comm = pid_proc_comm(pid); EUID_USER(); if (!comm) { fprintf(stderr, "Error: cannot find sandbox\n"); exit(1); } ...
cwe
CWE-269
Unknown
// // 数据库管理模块 // // TODO: 数据管理模块目前的代码存在大量冗余,后期会考虑将 数据库驱动 与 core 分成两个块来做 // import React from 'react'; // import ReactDOM from 'react-dom'; // import AceEditor from 'react-ace'; const LANG = antSword['language']['database']; const LANG_T = antSword['language']['toastr']; class Database { constructor(opt) { this...
cwe
CWE-79
JavaScript
function refresh() { changed = true; if (plugins.length == 0) { inner.innerHTML = mxUtils.htmlEntities(mxResources.get('noPlugins')); } else { inner.innerHTML = ''; for (var i = 0; i < plugins.length; i++) { var span = document.createElement('span'); span.style.whiteSpace = 'nowrap...
cwe
CWE-94
JavaScript
public Controller execute(FolderComponent fc, UserRequest ureq, WindowControl windowControl, Translator trans) { this.folderComponent = fc; this.translator = trans; this.fileSelection = new FileSelection(ureq, fc.getCurrentContainerPath()); VelocityContainer main = new VelocityContainer("mc", VELOCITY_ROOT...
cwe
CWE-23
Java
static int mxf_read_index_entry_array(AVIOContext *pb, MXFIndexTableSegment *segment) { int i, length; segment->nb_index_entries = avio_rb32(pb); length = avio_rb32(pb); if (!(segment->temporal_offset_entries=av_calloc(segment->nb_index_entries, sizeof(*segment->temporal_offset_entries))) || ...
cwe
CWE-703
Unknown
// # Post Model const _ = require('lodash'); const uuid = require('uuid'); const moment = require('moment'); const Promise = require('bluebird'); const {sequence} = require('@tryghost/promise'); const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); const nql = require('@tryghost/nql'); const...
cwe
CWE-284
JavaScript
/** * OLAT - Online Learning and Training<br> * http://www.olat.org * <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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unl...
cwe
CWE-22
Java
/* * Copyright © 2015-2018 Aeneas Rekkas <aeneas+oss@aeneas.io> * * 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...
cwe
CWE-754
Go