code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
changeValue:function(val){ $('#akSelectValueStatic_'+val).html( $('#akSelectValueField_'+val).val() ); this.editValue(val) },
cwe
CWE-79
JavaScript
static PyObject *__pyx_pf_17clickhouse_driver_6varint_2read_varint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f) { Py_ssize_t __pyx_v_shift; Py_ssize_t __pyx_v_result; unsigned char __pyx_v_i; PyObject *__pyx_v_read_one = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__py...
cwe
CWE-120
C/C++
ipmi_sdr_print_sensor_generic_locator(struct sdr_record_generic_locator *dev) { char desc[17]; memset(desc, 0, sizeof (desc)); snprintf(desc, (dev->id_code & 0x1f) + 1, "%s", dev->id_string); if (!verbose) { if (csv_output) printf("%s,00h,ns,%d.%d\n", dev->id_code ? desc : "", dev->entity...
cwe
CWE-120
Unknown
/** * <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
/* 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-617
Python
var vm = require('vm'); var isPlainObject = require('lodash.isplainobject'); var getValue = function(obj, key) { var o = obj; var keys = Array.isArray(key) ? key : key.split('.'); for (var x = 0; x < keys.length -1; ++x) { var k = keys[x]; if (!o[k]) return; o = o[k]; } return o[keys[keys.lengt...
cwe
CWE-1321
JavaScript
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
cwe
CWE-79
Python
goa_http_client_check (GoaHttpClient *client, const gchar *uri, const gchar *username, const gchar *password, GCancellable *cancellable, GAsyncReadyCallback callback, ...
cwe
CWE-310
Unknown
/* * Copyright (C) Igor Sysoev * Copyright (C) NGINX, Inc. */ #include <njs_main.h> njs_function_t * njs_function_alloc(njs_vm_t *vm, njs_function_lambda_t *lambda, njs_bool_t async) { size_t size; njs_object_t *proto; njs_function_t *function; size = sizeof(njs_function_t) + l...
cwe
CWE-416
C/C++
/* * Copyright (c) 2009, The MilkyTracker Team. * 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 o...
cwe
CWE-787
C/C++
/* * Client routines for the CUPS scheduler. * * Copyright 2007-2015 by Apple Inc. * Copyright 1997-2007 by Easy Software Products, all rights reserved. * * This file contains Kerberos support code, copyright 2006 by * Jelmer Vernooij. * * These coded instructions, statements, and computer programs are the * ...
cwe
CWE-254
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-125
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- # wger from wger.settings_global import * # Third Party import environ env = environ.Env( # set casting, default value DJANGO_DEBUG=(bool, False) ) # Use 'DEBUG = True' to get more details for server errors DEBUG = env("DJANGO_DEBUG") ADMINS = ( ('Your nam...
cwe
CWE-307
Python
PHP_FUNCTION(imagepsloadfont) { char *file; int file_len, f_ind, *font; #ifdef PHP_WIN32 struct stat st; #endif if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) { return; } #ifdef PHP_WIN32 if (VCWD_STAT(file, &st) < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fo...
cwe
CWE-20
Unknown
static int __ip6_append_data(struct sock *sk, struct flowi6 *fl6, struct sk_buff_head *queue, struct inet_cork *cork, struct inet6_cork *v6_cork, struct page_frag *pfrag, int getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb), v...
cwe
CWE-20
C/C++
/* * fs/userfaultfd.c * * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org> * Copyright (C) 2008-2009 Red Hat, Inc. * Copyright (C) 2015 Red Hat, Inc. * * This work is licensed under the terms of the GNU GPL, version 2. See * the COPYING file in the top-level directory. * * Some part derive...
cwe
CWE-119
C/C++
crypto_scrypt(const uint8_t * passwd, size_t passwdlen, const uint8_t * salt, size_t saltlen, uint64_t N, uint32_t r, uint32_t p, uint8_t * buf, size_t buflen) { void * B0, * V0, * XY0; uint8_t * B; uint32_t * V; uint32_t * XY; uint32_t i; /* Sanity-check parameters. */ if (buflen > (((uint64_t)(...
cwe
CWE-122
C/C++
static int ext4_write_end(struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned copied, struct page *page, void *fsdata) { handle_t *handle = ext4_journal_current_handle(); struct inode *inode = mapping->host; loff_t old_size = inode->i_size; int ret = 0, ret2; int i_s...
cwe
CWE-200
Unknown
static void LoadOpenCLDevices(MagickCLEnv clEnv) { cl_context_properties properties[3]; cl_device_id *devices; cl_int status; cl_platform_id *platforms; cl_uint i, j, next, number_devices, number_platforms; size_t length; number_platforms=0; if (openCL_libra...
cwe
CWE-476
C/C++
$ret[$key] = sprintf( $format, ++$i, $err[0], $err[1], $err[2], $err[3] ); } return $ret; }
cwe
CWE-79
PHP
public UploadFileResponse getCloudUrl(String contextPath, String uri, String finalFilePath, HttpServletRequest request) { UploadFileResponse uploadFileResponse = new UploadFileResponse(); // try push to cloud Map<String, String[]> map = new HashMap<>(); map.put("fileInfo", new String[]{f...
cwe
CWE-863
Java
gogo.Terminal_ctor = function(div, width, height) { var query0 = "w=" + width + "&h=" + height; var query1 = query0 + "&k="; var buf = ""; var timeout; var error_timeout; var keybuf = []; var sending = 0; var rmax = 1; var force = 1; var dstat = document.createElement('pre'); var sled...
cwe
CWE-287
JavaScript
long ContentEncoding::ParseEncryptionEntry( long long start, long long size, IMkvReader* pReader, ContentEncryption* encryption) { assert(pReader); assert(encryption); long long pos = start; const long long stop = start + size; while (pos < stop) { long long id, size; const long...
cwe
CWE-119
C/C++
void Compute(OpKernelContext* context) override { // Checks what we're remapping and inverts the relevant remapping Tensors to // be maps with key = old ID, value = new ID. std::unordered_map<int64_t, int64_t> old_row_to_new_row_map; std::vector<bool> row_id_present; const Tensor* row_remapping_t; ...
cwe
CWE-703
C/C++
void MakeUsernameForAccount(const base::DictionaryValue* result, base::string16* gaia_id, wchar_t* username, DWORD username_length, wchar_t* domain, DWORD domain_length, ...
cwe
CWE-284
C/C++
static int rsi_init_usb_interface(struct rsi_hw *adapter, struct usb_interface *pfunction) { struct rsi_91x_usbdev *rsi_dev; int status; rsi_dev = kzalloc(sizeof(*rsi_dev), GFP_KERNEL); if (!rsi_dev) return -ENOMEM; adapter->rsi_dev = rsi_dev; rsi_dev->usbdev = interface_to_usbdev(pfunction); rsi_dev->...
cwe
CWE-415
C/C++
/** @odoo-module **/ import { registry } from "@web/core/registry"; import { Many2ManyTagsAvatarUserField, KanbanMany2ManyTagsAvatarUserField, many2ManyTagsAvatarUserField, kanbanMany2ManyTagsAvatarUserField, listMany2ManyTagsAvatarUserField, } from "@mail/web/fields/many2many_avatar_user_field/man...
cwe
CWE-287
JavaScript
MediaStreamImpl::~MediaStreamImpl() { DCHECK(!peer_connection_handler_); if (dependency_factory_.get()) dependency_factory_->ReleasePeerConnectionFactory(); if (network_manager_) { if (chrome_worker_thread_.IsRunning()) { chrome_worker_thread_.message_loop()->PostTask(FROM_HERE, base::Bind( ...
cwe
CWE-399
C/C++
/* radare - LGPL - Copyright 2014-2019 - Fedor Sakharov */ #include <r_bin.h> #include <sdb/ht_uu.h> #include "coff/coff.h" static Sdb* get_sdb(RBinFile *bf) { struct r_bin_coff_obj *bin = (struct r_bin_coff_obj *) R_UNWRAP3 (bf, o, bin_obj); return bin? bin->kv: NULL; } static bool r_coff_is_stripped(struct r_bi...
cwe
CWE-400
C/C++
bool SharedMemory::Create(const SharedMemoryCreateOptions& options) { DCHECK(!options.executable); DCHECK(!mapped_file_); if (options.size == 0) return false; uint32 rounded_size = (options.size + 0xffff) & ~0xffff; name_ = ASCIIToWide(options.name == NULL ? "" : *options.name); mapped_file_ = Creat...
cwe
CWE-189
C/C++
xmlParsePI(xmlParserCtxtPtr ctxt) { xmlChar *buf = NULL; int len = 0; int size = XML_PARSER_BUFFER_SIZE; int cur, l; const xmlChar *target; xmlParserInputState state; int count = 0; if ((RAW == '<') && (NXT(1) == '?')) { xmlParserInputPtr input = ctxt->input; state = ctxt->instate; ...
cwe
CWE-125
Unknown
QPDFFormFieldObjectHelper::getChoices() { std::vector<std::string> result; if (! isChoice()) { return result; } QPDFObjectHandle opt = getInheritableFieldValue("/Opt"); if (opt.isArray()) { size_t n = opt.getArrayNItems(); for (size_t i = 0; i < n; ++i) { ...
cwe
CWE-787
Unknown
/* 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-125
Python
bool mkvparser::Match(IMkvReader* pReader, long long& pos, unsigned long id_, unsigned char*& buf, size_t& buflen) { assert(pReader); assert(pos >= 0); long long total, available; long status = pReader->Length(&total, &available); assert(status >= 0); assert((total < 0) || (available <...
cwe
CWE-20
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-20
C/C++
parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret, int *flags) { parser_state *ps; node *n; int started = 0; growable_int_array type_ignores; if (!growable_int_array_init(&type_ignores, 10)) { err_ret->error = E_NOMEM; Ta3Tokenizer_Free(tok); ...
cwe
CWE-125
C/C++
*/ static int kex_method_diffie_hellman_group_exchange_sha1_key_exchange (LIBSSH2_SESSION * session, key_exchange_state_low_t * key_state) { unsigned long p_len, g_len; int ret = 0; int rc; if(key_state->state == libssh2_NB_state_idle) { key_state->p = _libssh2_bn_init_from_bin(); key_s...
cwe
CWE-787
Unknown
TfLiteStatus ReverseSequenceImpl(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input = GetInput(context, node, kInputTensor); const TfLiteTensor* seq_lengths_tensor = GetInput(context, node, kSeqLengthsTensor); const TS* seq_lengths = GetTensorData<TS>(seq_lengths_tensor); auto* params ...
cwe
CWE-787
C/C++
static jobject Bitmap_createFromParcel(JNIEnv* env, jobject, jobject parcel) { if (parcel == NULL) { SkDebugf("-------- unparcel parcel is NULL\n"); return NULL; } android::Parcel* p = android::parcelForJavaObject(env, parcel); const bool isMutable = p->readInt32() != 0; const SkColorType colorType =...
cwe
CWE-189
C/C++
/** * Copyright (c) 2006-2021, JGraph Ltd * Copyright (c) 2006-2021, draw.io AG */ // urlParams is null when used for embedding window.urlParams = window.urlParams || {}; // isLocalStorage controls access to local storage window.isLocalStorage = window.isLocalStorage || false; // Disables loading settings in conf...
cwe
CWE-79
JavaScript
def allowed_for_superuser(session) $logger.debug( "permission check superuser username=#{session[:username]} groups=#{session[:groups]}" ) if SUPERUSER != session[:username] $logger.debug('permission denied') return false end $logger.debug('permission granted for superuser') return true end
cwe
CWE-384
Ruby
void BaseAudioContext::Initialize() { if (IsDestinationInitialized()) return; FFTFrame::Initialize(); audio_worklet_ = AudioWorklet::Create(this); if (destination_node_) { destination_node_->Handler().Initialize(); listener_ = AudioListener::Create(*this); } }
cwe
CWE-416
C/C++
/* 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-369
Python
static int hhf_init(struct Qdisc *sch, struct nlattr *opt, struct netlink_ext_ack *extack) { struct hhf_sched_data *q = qdisc_priv(sch); int i; sch->limit = 1000; q->quantum = psched_mtu(qdisc_dev(sch)); q->perturbation = prandom_u32(); INIT_LIST_HEAD(&q->new_buckets); INIT_LIST_HEAD(&q->old_buckets); /...
cwe
CWE-330
Unknown
static void dns_resolver_describe(const struct key *key, struct seq_file *m) { seq_puts(m, key->description); if (key_is_instantiated(key)) { int err = PTR_ERR(key->payload.data[dns_key_error]); if (err) seq_printf(m, ": %d", err); else seq_printf(m, ": %u", key->datalen); } }
cwe
CWE-20
Unknown
/* Copyright 2019 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-835
C/C++
BasicWriter<Char>::prepare_int_buffer( unsigned num_digits, const Spec &spec, const char *prefix, unsigned prefix_size) { unsigned width = spec.width(); Alignment align = spec.align(); Char fill = internal::CharTraits<Char>::cast(spec.fill()); if (spec.precision() > static_cast<int>(num_digits)) { /...
cwe
CWE-787
C/C++
function onRequest (req, res) { // If a 'hostname' string is specified, deny requests with a 'Host' // header that does not match the origin of the torrent server to prevent // DNS rebinding attacks. if (opts.hostname && req.headers.host !== `${opts.hostname}:${server.address().port}`) { return re...
cwe
CWE-79
JavaScript
import json from io import BytesIO import requests from cookbook.helper.ingredient_parser import IngredientParser from cookbook.integration.integration import Integration from cookbook.models import Ingredient, Recipe, Step class RecipeSage(Integration): def get_recipe_from_file(self, file): recipe = ...
cwe
CWE-918
Python
int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to) { int tooff = 0, fromoff = 0; int size; if (to->start > from->start) fromoff = to->start - from->start; else tooff = from->start - to->start; size = to->len - tooff; if (size > (int) (from->len - fromoff)) size = from->len - fromoff; ...
cwe
CWE-200
Unknown
ExecWithCheckOptions(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate) { ExprContext *econtext; ListCell *l1, *l2; /* * We will use the EState's per-tuple context for evaluating constraint * expressions (creating it if it's not already there). */ econtext = GetPerTupleExprCont...
cwe
CWE-209
Unknown
/* * Yerase's TNEF Stream Reader Library * Copyright (C) 2003 Randall E. Hand * * 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 * (at your ...
cwe
CWE-125
C/C++
onShow: function () { /* Remove preview */ imgPreview.getElement().setHtml(''); (t = this), (orgWidth = null), (orgHeight = null), (imgScal = 1), (lock = true); /* selected image or null */ selectedImg = editor.getSelection(); if (selectedImg) selectedImg = selectedImg.getSelectedElement(); if (!...
cwe
CWE-434
JavaScript
// Copyright 2016 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "core/fxge/cfx_renderdevice.h" #include <algorithm> #include <memory...
cwe
CWE-190
C/C++
# # GUI Module for standalone subscription-manager cli # # Copyright (c) 2010 Red Hat, Inc. # # Authors: Pradeep Kilambi <pkilambi@redhat.com> # # 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 impli...
cwe
CWE-264
Python
static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image) { char buffer[MaxTextExtent], format, magick[MaxTextExtent]; const char *value; IndexPacket index; MagickBooleanType status; MagickOffsetType scene; QuantumAny pixel; QuantumInfo *qua...
cwe
CWE-787
Unknown
protected function deleteFileInStorage(Attachment $attachment) { $storage = $this->getStorage(); $dirPath = dirname($attachment->path); $storage->delete($attachment->path); if (count($storage->allFiles($dirPath)) === 0) { $storage->deleteDirectory($dirPath); } ...
cwe
CWE-22
PHP
static void umd_cleanup(struct subprocess_info *info) { struct umd_info *umd_info = info->data; /* cleanup if umh_setup() was successful but exec failed */ if (info->retval) { fput(umd_info->pipe_to_umh); fput(umd_info->pipe_from_umh); put_pid(umd_info->tgid); umd_info->tgid = NULL; } }
cwe
CWE-401
C/C++
/* putil-merge ------------------------ (c) 2017-present Panates This file may be freely distributed under the MIT license. */ const isObjectOrClass = (v) => v && ( (typeof v === 'object' && !Array.isArray(v)) || (typeof v === 'function' && v.prototype && v.prototype.constructor)); /** * * @param {Objec...
cwe
CWE-1321
JavaScript
/* radare - LGPL - Copyright 2018 - pancake */ #include <r_types.h> #include <r_util.h> #include <r_lib.h> #include <r_bin.h> #include <ht_uu.h> #include "../i/private.h" #include "mach0/coresymbolication.h" // enable debugging messages #define D if (0) #define R_UUID_LENGTH 33 typedef struct symbols_header_t { ut3...
cwe
CWE-476
C/C++
/* * Copyright 2019 LINE Corporation * * LINE Corporation licenses this file to you 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: * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
cwe
CWE-74
Java
evtchn_port_t evtchn_from_irq(unsigned irq) { if (WARN(irq >= nr_irqs, "Invalid irq %d!\n", irq)) return 0; return info_for_irq(irq)->evtchn; }
cwe
CWE-416
C/C++
#ifndef JSI_LITE_ONLY #ifndef JSI_AMALGAMATION #include "jsiInt.h" #endif #if JSI__MUSL==1 || defined(__FreeBSD__) #define NO_QSORT_R 1 #endif static uint jsi_SizeOfArray(Jsi_Interp *interp, Jsi_Obj *obj) { if (!obj || !obj->arr) return 0; return obj->arrCnt; } static Jsi_RC jsi_ArrayPushCmd(Jsi_Inte...
cwe
CWE-190
C/C++
int gnutls_error_to_alert(int err, int *level) { int ret, _level = -1; switch (err) { /* send appropriate alert */ case GNUTLS_E_DECRYPTION_FAILED: /* GNUTLS_A_DECRYPTION_FAILED is not sent, because * it is not defined in SSL3. Note that we must * not distinguish Decryption failures from mac * check fai...
cwe
CWE-310
Unknown
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-119
Unknown
static int multiSelect( Parse *pParse, /* Parsing context */ Select *p, /* The right-most of SELECTs to be coded */ SelectDest *pDest /* What to do with query results */ ){ int rc = SQLITE_OK; /* Success code from a subroutine */ Select *pPrior; /* Another SELECT immediately to o...
cwe
CWE-476
C/C++
public function setRssValues($rss) { $this->set('rsstitle', \App\Purifier::purifyByType((string) $rss->title, 'Text')); $this->set('url', $rss->link); }
cwe
CWE-79
PHP
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
cwe
CWE-20
Python
import CustomFields from '../customfields.js' import { checkAuthentication } from '../../../utils/server_method_helpers' Meteor.methods({ addCustomField: function addCustomField({ classname, name, desc, type, possibleValues, }) { check(classname, String) check(name, String) check(type, String) ...
cwe
CWE-285
JavaScript
main (int argc, char *argv[]) { struct gengetopt_args_info args_info; char *line = NULL; size_t linelen = 0; char *p, *r; uint32_t *q; unsigned cmdn = 0; int rc; setlocale (LC_ALL, ""); set_program_name (argv[0]); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); if (cmdline_parser (a...
cwe
CWE-125
C/C++
// // Copyright 2021 The Sigstore 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 ...
cwe
CWE-770
Go
ld86r(argc, argv) int argc; char ** argv; #endif { char buf[128]; FILE * fd, * ifd; struct stat st; int ar, libarg=0, need_o = 0, got_o = 0; for(ar=1; ar<argc; ar++) if( argv[ar][0] == '-' ) { if( argv[ar][1] == 'r' ) need_o = 1; if( argv[ar][1] == 'o' ) { got_o++; libarg = 0; } } e...
cwe
CWE-787
C/C++
elseif ( $columns['TITLE'] ) { $id_new = DBSeqNextID( 'school_marking_periods_marking_period_id_seq' ); $sql = "INSERT INTO SCHOOL_MARKING_PERIODS "; $fields = "MARKING_PERIOD_ID,MP,SYEAR,SCHOOL_ID,"; $values = "'" . $id_new . "','" . $_REQUEST['mp_term'] . "','" . UserSyear() . "','" . UserSchool() . ...
cwe
CWE-89
PHP
int CCITTFaxStream::lookChar() { int code1, code2, code3; int b1i, blackPixels, i, bits; GBool gotEOL; if (buf != EOF) { return buf; } // read the next row if (outputBits == 0) { // if at eof just return EOF if (eof) { return EOF; } err = gFalse; // 2-D encoding if (...
cwe
CWE-119
Unknown
tile_make_weights (PixopsFilterDimension *dim, double scale) { int n = ceil (1 / scale + 1); double *pixel_weights = g_malloc_n (sizeof (double) * SUBSAMPLE, n); int offset; int i; dim->n = n; dim->offset = 0; dim->weights = pixel_weights; for (offset = 0; offset < SUBSAMPLE; offs...
cwe
CWE-119
Unknown
void PrintPreviewUI::OnDidPreviewPage(int page_number, int preview_request_id) { DCHECK_GE(page_number, 0); base::FundamentalValue number(page_number); StringValue ui_identifier(preview_ui_addr_str_); base::FundamentalValue request_id(preview_request_id); web_ui()->C...
cwe
CWE-200
C/C++
PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents) : PrintManager(web_contents), printing_rfh_(nullptr), printing_succeeded_(false), inside_inner_message_loop_(false), #if !defined(OS_MACOSX) expecting_first_page_(true), #endif queue_(g_browser_process->p...
cwe
CWE-254
C/C++
/* * jabberd - Jabber Open Source Server * Copyright (c) 2002 Jeremie Miller, Thomas Muldowney, * Ryan Eatmon, Robert Norris * * 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 Found...
cwe
CWE-287
C/C++
package com.salesmanager.shop.admin.controller.products; import com.fasterxml.jackson.databind.ObjectMapper; import com.salesmanager.core.business.services.catalog.category.CategoryService; import com.salesmanager.core.business.services.catalog.product.ProductService; import com.salesmanager.core.business.services.cat...
cwe
CWE-639
Java
package io.swagger.client.api; import io.swagger.client.ApiException; import io.swagger.client.ApiClient; import io.swagger.client.ApiResponse; import io.swagger.client.Configuration; import io.swagger.client.Pair; import javax.ws.rs.core.GenericType; import io.swagger.client.model.Client; import java.util.ArrayLis...
cwe
CWE-732
Java
static struct ldb_parse_tree *ldb_parse_simple(TALLOC_CTX *mem_ctx, const char **s) { char *attr, *value; struct ldb_parse_tree *ret; enum ldb_parse_op filtertype; ret = talloc(mem_ctx, struct ldb_parse_tree); if (!ret) { errno = ENOMEM; return NULL; } filtertype = ldb_parse_filtertype(ret, &attr, &value, ...
cwe
CWE-125
Unknown
char *auth_server(int f_in, int f_out, int module, const char *host, const char *addr, const char *leader) { char *users = lp_auth_users(module); char challenge[MAX_DIGEST_LEN*2]; char line[BIGPATHBUFLEN]; char **auth_uid_groups = NULL; int auth_uid_groups_cnt = -1; const char *err = NULL; int group_match = ...
cwe
CWE-354
C/C++
const std::string& AppControllerImpl::MaybeGetAndroidPackageName( const std::string& app_id) { const auto& package_name_it = android_package_map_.find(app_id); if (package_name_it != android_package_map_.end()) { return package_name_it->second; } ArcAppListPrefs* arc_prefs_ = ArcAppListPrefs::Get(pro...
cwe
CWE-416
C/C++
# # Copyright (c) 2013 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 FITNESS # FOR A PARTICULAR PURPOSE. You should have received a copy ...
cwe
CWE-264
Python
void preproc_build_firejail_dir(void) { struct stat s; // CentOS 6 doesn't have /run directory if (stat(RUN_FIREJAIL_BASEDIR, &s)) { create_empty_dir_as_root(RUN_FIREJAIL_BASEDIR, 0755); } if (stat(RUN_FIREJAIL_DIR, &s)) { create_empty_dir_as_root(RUN_FIREJAIL_DIR, 0755); } if (stat(RUN_FIREJAIL_NETWORK_D...
cwe
CWE-269
Unknown
/* * Swagger Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator p...
cwe
CWE-732
Java
HandleRFBServerMessage(rfbClient* client) { rfbServerToClientMsg msg; if (client->serverPort==-1) client->vncRec->readTimestamp = TRUE; if (!ReadFromRFBServer(client, (char *)&msg, 1)) return FALSE; switch (msg.type) { case rfbSetColourMapEntries: { /* TODO: int i; uint16_t rgb[3]; ...
cwe
CWE-835
C/C++
int tcp_disconnect(struct sock *sk, int flags) { struct inet_sock *inet = inet_sk(sk); struct inet_connection_sock *icsk = inet_csk(sk); struct tcp_sock *tp = tcp_sk(sk); int err = 0; int old_state = sk->sk_state; if (old_state != TCP_CLOSE) tcp_set_state(sk, TCP_CLOSE); /* ABORT function of RFC793 */ if (o...
cwe
CWE-369
C/C++
/* SCTP kernel implementation * (C) Copyright IBM Corp. 2001, 2004 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. * Copyright (c) 2001-2003 Intel Corp. * Copyright (c) 2001-2002 Nokia, Inc. * Copyright (c) 2001 La Monte H.P. Yarroll * * This file is part of the SCTP kernel implem...
cwe
CWE-416
C/C++
createBoard({ commit }, boardData) { apiClient.createBoard(boardData) .then((board) => { commit('addBoard', board) }) }
cwe
CWE-20
JavaScript
import './allprojectschart.html' import { FlowRouter } from 'meteor/ostrio:flow-router-extra' import { getUserSetting, getUserTimeUnitVerbose } from '../../utils/frontend_helpers' Template.allprojectschart.onCreated(function allprojectschartCreated() { this.topTasks = new ReactiveVar() this.projectStats = new Reac...
cwe
CWE-79
JavaScript
horAcc8(TIFF* tif, uint8* cp0, tmsize_t cc) { tmsize_t stride = PredictorState(tif)->stride; unsigned char* cp = (unsigned char*) cp0; assert((cc%stride)==0); if (cc > stride) { /* * Pipeline the most common cases. */ if (stride == 3) { unsigned int cr = cp[0]; unsigned int cg = cp[1]; unsigned...
cwe
CWE-119
C/C++
package org.hl7.fhir.igtools.publisher; /*- * #%L * org.hl7.fhir.publisher.core * %% * Copyright (C) 2014 - 2019 Health Level 7 * %% * 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 * ...
cwe
CWE-22
Java
/** * @license * Copyright The Closure Library Authors. * SPDX-License-Identifier: Apache-2.0 */ /** * @fileoverview Simple utilities for dealing with URI strings. * * This is intended to be a lightweight alternative to constructing goog.Uri * objects. Whereas goog.Uri adds several kilobytes to the binary reg...
cwe
CWE-20
Java
def create_cluster(params, request, session) if not allowed_for_superuser(session) return 403, 'Permission denied' end if set_corosync_conf(params, request, session) cluster_start(params, request, session) else return "Failed" end end
cwe
CWE-384
Ruby
public function get_messages($search_criteria="UNSEEN", $date_format="Y-m-d H:i:s") { global $htmlmsg,$plainmsg,$attachments; // If our imap connection failed earlier, return no messages if($this->imap_stream == false) { return array(); } // Use imap_search() to find the 'UNSEEN' messages....
cwe
CWE-79
PHP
static int aa_read_header(AVFormatContext *s) { int i, j, idx, largest_idx = -1; uint32_t nkey, nval, toc_size, npairs, header_seed = 0, start; char key[128], val[128], codec_name[64] = {0}; uint8_t output[24], dst[8], src[8]; int64_t largest_size = -1, current_size = -1, chapter_pos; struct toc...
cwe
CWE-908
Unknown
void CLASS smal_decode_segment (unsigned seg[2][2], int holes) { uchar hist[3][13] = { { 7, 7, 0, 0, 63, 55, 47, 39, 31, 23, 15, 7, 0 }, { 7, 7, 0, 0, 63, 55, 47, 39, 31, 23, 15, 7, 0 }, { 3, 3, 0, 0, 63, 47, 31, 15, 0 } }; int low, high=0xff, carry=0, nbits=8; int pix, s, count, bin, n...
cwe
CWE-129
C/C++
bool PrintRenderFrameHelper::PrintPagesNative(blink::WebLocalFrame* frame, int page_count) { const PrintMsg_PrintPages_Params& params = *print_pages_params_; const PrintMsg_Print_Params& print_params = params.params; std::vector<int> printed_pages = GetPrintedPages(p...
cwe
CWE-787
C/C++
setElementContent($element, content) { const html = this.config.html if (typeof content === 'object' && (content.nodeType || content.jquery)) { // Content is a DOM node or a jQuery if (html) { if (!$(content).parent().is($element)) { $element.empty().append(content) } ...
cwe
CWE-79
JavaScript