code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
int venc_dev::venc_input_log_buffers(OMX_BUFFERHEADERTYPE *pbuffer, int fd, int plane_offset) { if (!m_debug.infile) { int size = snprintf(m_debug.infile_name, PROPERTY_VALUE_MAX, "%s/input_enc_%lu_%lu_%p.yuv", m_debug.log_loc, m_sVenc_cfg.input_width, m_sVenc_cfg.input_height...
cwe
CWE-200
C/C++
/* * Copyright (c) Facebook, Inc. and its affiliates. * * 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 applic...
cwe
CWE-770
Go
/* Copyright 2017 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-787
C/C++
package api import ( "context" "encoding/json" "errors" "fmt" "net/http" "sort" "strconv" "strings" "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana/pkg/api/datasource" "github.com/grafana/grafana/pkg/api/dtos" "github.com/grafana/grafana/pkg/api/response" "github.com/grafa...
cwe
CWE-200
Go
protected function _mkfile($path, $name) { $path = $this->_joinPath($path, $name); return $this->connect->put($path, '') ? $path : false; /* if ($this->tmp) { $path = $this->_joinPath($path, $name); $local = $this->getTempFile(); $res = touch($local) && $t...
cwe
CWE-78
PHP
TfLiteStatus LessEqualEval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input1 = GetInput(context, node, kInputTensor1); const TfLiteTensor* input2 = GetInput(context, node, kInputTensor2); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); bool requires_broadcast = !HaveSameShap...
cwe
CWE-125
C/C++
static int parse_exports_table(long long *table_start) { int res; int indexes = SQUASHFS_LOOKUP_BLOCKS(sBlk.s.inodes); long long export_index_table[indexes]; res = read_fs_bytes(fd, sBlk.s.lookup_table_start, SQUASHFS_LOOKUP_BLOCK_BYTES(sBlk.s.inodes), export_index_table); if(res == FALSE) { ERROR("parse_expo...
cwe
CWE-190
C/C++
file_continue(i_ctx_t *i_ctx_p) { os_ptr op = osp; es_ptr pscratch = esp - 2; file_enum *pfen = r_ptr(esp - 1, file_enum); int devlen = esp[-3].value.intval; gx_io_device *iodev = r_ptr(esp - 4, gx_io_device); uint len = r_size(pscratch); uint code; if (len < devlen) return_erro...
cwe
CWE-200
C/C++
define([ '../res/widgetTemplate.html', './Rule', './ConditionManager', './TestDataManager', './WidgetDnD', './eventHelpers', 'objectUtils', 'lodash', 'zepto', '@braintree/sanitize-url' ], function ( widgetTemplate, Rule, ConditionManager, TestDataManager, Widg...
cwe
CWE-79
JavaScript
void Scan::CreateParser(void) { ScanType type = m_pFrame->ScanTypeOf(); // assert(m_pParser == NULL); // switch(type) { case Baseline: m_pParser = new(m_pEnviron) class SequentialScan(m_pFrame,this, m_ucScanStart,m_ucScanStop, ...
cwe
CWE-476
Unknown
def authenticate(self, username, password): child = None try: child = pexpect.spawn('/bin/sh', ['-c', '/bin/su -c "/bin/echo SUCCESS" - %s' % username], timeout=5) child.expect('.*:') child.sendline(password) result = child.expect(['su: .*', 'SUCCESS']) ...
cwe
CWE-269
Python
/* Unix SMB/CIFS implementation. Files[] structure handling Copyright (C) Andrew Tridgell 1998 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 3 of the License, or ...
cwe
CWE-20
C/C++
/******************************************************************************* * This file is part of OpenNMS(R). * * Copyright (C) 2009-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-79
Java
TfLiteStatus LogicalImpl(TfLiteContext* context, TfLiteNode* node, bool (*func)(bool, bool)) { OpData* data = reinterpret_cast<OpData*>(node->user_data); const TfLiteTensor* input1 = GetInput(context, node, kInputTensor1); const TfLiteTensor* input2 = GetInput(context, node, kInputTensor...
cwe
CWE-787
C/C++
def main(): global logger result = 0 parser = argparse.ArgumentParser(description='Keycloak REST client', prog=prog_name, epilog=verbose_help.format(prog_name=prog_name), formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argume...
cwe
CWE-59
Python
/* Copyright (c) 2000-2008 MySQL AB, 2009 Sun Microsystems, Inc. Use is subject to license terms. 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; version 2 of the License. This pro...
cwe
CWE-362
C/C++
function clone( $container ) { var $last = $container.children( '.rwmb-clone' ).last(), $clone = $last.clone(), nextIndex = cloneIndex.nextIndex( $container ); // Reset value for fields var $inputs = $clone.find( rwmb.inputSelectors ); $inputs.each( cloneValue.reset ); // Insert Clone $clone.insertA...
cwe
CWE-79
JavaScript
def _remove_volume_from_volume_set(self, volume_name, vvs_name): self._cli_run('removevvset -f %s %s' % (vvs_name, volume_name), None)
cwe
CWE-78
Python
gql_eval_sels(agooErr err, gqlDoc doc, gqlRef ref, gqlField field, gqlSel sels, gqlValue result, int depth) { gqlSel sel; gqlField sf = NULL; // TBD if depth over max then return an error for (sel = sels; NULL != sel; sel = sel->next) { if (NULL != field) { if (NULL == sel->name) { sf = field;...
cwe
CWE-703
Unknown
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import from collections import OrderedDict import re import yaml from io import StringIO from configparser import ConfigParser, NoOptionError from .regex import URL_REGEX, HASH_REGEX from .dependencies import DependencyFile, Dependency from ...
cwe
CWE-400
Python
int mp4client_main(int argc, char **argv) { char c; const char *str; int ret_val = 0; u32 i, times[100], nb_times, dump_mode; u32 simulation_time_in_ms = 0; u32 initial_service_id = 0; Bool auto_exit = GF_FALSE; Bool logs_set = GF_FALSE; Bool start_fs = GF_FALSE; Bool use_rtix = GF_FALSE; Bool pause_at_first...
cwe
CWE-787
Unknown
keyid_from_fingerprint( const byte *fprint, size_t fprint_len, u32 *keyid ) { u32 dummy_keyid[2]; if( !keyid ) keyid = dummy_keyid; if (fprint_len != 20) { /* This is special as we have to lookup the key first. */ PKT_public_key pk; int rc; memset (&pk, 0, sizeof pk); rc ...
cwe
CWE-20
Unknown
static int drff_init(struct hid_device *hid) { struct drff_device *drff; struct hid_report *report; struct hid_input *hidinput = list_first_entry(&hid->inputs, struct hid_input, list); struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; struct input_dev *dev = hidinput->input...
cwe
CWE-787
C/C++
void SoftGSM::onQueueFilled(OMX_U32 /* portIndex */) { if (mSignalledError) { return; } List<BufferInfo *> &inQueue = getPortQueue(0); List<BufferInfo *> &outQueue = getPortQueue(1); while (!inQueue.empty() && !outQueue.empty()) { BufferInfo *inInfo = *inQueue.begin(); OMX_BUFFERHEADERTYPE *inHeader = ...
cwe
CWE-119
C/C++
def tile_by_id(id,path): ''' ''' conn = mysql_connection() mysql = conn.cursor(cursor_class=MySQLCursorDict) tms_path = '.'.join(path.split('.')[:-1]) bucket = aws_prefix+'stuff' opaque = False image = Image.new('RGBA', (256, 256), (0, 0, 0, 0)) if request.endpoint =...
cwe
CWE-89
Python
import os import requests import itertools from datetime import datetime from django.shortcuts import render, get_object_or_404 from django.contrib import messages from django.http import JsonResponse, HttpResponseRedirect, HttpResponse from django.urls import reverse from django_celery_beat.models import PeriodicTas...
cwe
CWE-330
JavaScript
/* * 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; either version...
cwe
CWE-120
C/C++
def makeJudge(judge): db.execute("UPDATE players SET Judge = 1 WHERE Name = '%s' COLLATE NOCASE" % (judge)) database.commit()
cwe
CWE-89
Python
child_setup_func (gpointer user_data) { ChildSetupData *data = (ChildSetupData *) user_data; FdMapEntry *fd_map = data->fd_map; sigset_t set; int i; flatpak_close_fds_workaround (3); if (data->instance_id_fd != -1) drop_cloexec (data->instance_id_fd); /* Unblock all signals */ sigemptyset (&set);...
cwe
CWE-94
Unknown
boost::optional<SaplingOutgoingPlaintext> SaplingOutgoingPlaintext::decrypt( const SaplingOutCiphertext &ciphertext, const uint256& ovk, const uint256& cv, const uint256& cm, const uint256& epk ) { auto pt = AttemptSaplingOutDecryption(ciphertext, ovk, cv, cm, epk); if (!pt) { return...
cwe
CWE-755
C/C++
/* * Copyright (c) 2015-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. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #inc...
cwe
CWE-20
C/C++
/* Copyright 2019 The Crossplane 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 agreed to in writing, ...
cwe
CWE-20
Go
function buildLogTable(data) { var rows = data.rows; var cols = []; var $table = $('<table class="sortable"></table>'); var $tBody, $tRow, $tCell; $('#logTable').html($table); var formatValue = function (name, value) { if (name == 'user_host') { ...
cwe
CWE-79
JavaScript
.5),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,l-v,x));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(l-v),x-p));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,x-p));return c};z.prototype.getConstraints=function(c,l,x){c=[];var p=x*Math.max(0,Math.min(1,parseFloat(mxUt...
cwe
CWE-20
JavaScript
void VP8XChunk::width(XMP_Uns32 val) { PutLE24(&this->data[4], val - 1); }
cwe
CWE-20
C/C++
/** * 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-91
Java
// --- BEGIN COPYRIGHT BLOCK --- // 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; version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT...
cwe
CWE-79
C/C++
dao_input_storing(void) { #if RPL_WITH_STORING uip_ipaddr_t dao_sender_addr; rpl_dag_t *dag; rpl_instance_t *instance; unsigned char *buffer; uint16_t sequence; uint8_t instance_id; uint8_t lifetime; uint8_t prefixlen; uint8_t flags; uint8_t subopt_type; /* uint8_t pathcontrol; uint8_t pat...
cwe
CWE-703
Unknown
pspdf_prepare_outpages() { int c, i, j; /* Looping vars */ int nup; /* Current number-up value */ page_t *page; /* Current page */ outpage_t *outpage; /* Current output page */ // Allocate an output page array... outpages = (outpage_t *)malloc(sizeof(outpage_t) * num_pages); memset(outpages, -1, si...
cwe
CWE-122
C/C++
xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI) { xsltTransformContextPtr tctxt; xmlURIPtr uri; xmlChar *fragment; xsltDocumentPtr idoc; /* document info */ xmlDocPtr doc; xmlXPathContextPtr xptrctxt = NULL; xmlXPathObjectPtr resObj = NULL; tctxt = xsltXPat...
cwe
CWE-119
C/C++
static int _assemble_line(FILE *f, char *buffer, int buf_len) { char *p = buffer; char *s, *os; int used = 0; /* loop broken with a 'break' when a non-'\\n' ended line is read */ D(("called.")); for (;;) { if (used >= buf_len) { /* Overflow */ D(("_assemble_line: overflow")); r...
cwe
CWE-119
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-22
Java
jio_vsnprintf(char * str, int n, const char * format, va_list args) { int result; Trc_SC_vsnprintf_Entry(str, n, format); #if defined(WIN32) && !defined(WIN32_IBMC) result = _vsnprintf( str, n, format, args ); #else result = vsprintf( str, format, args ); #endif Trc_SC_vsnprintf_Exit(result); return result; ...
cwe
CWE-119
C/C++
flatpak_proxy_client_init (FlatpakProxyClient *client) { init_side (client, &client->client_side); init_side (client, &client->bus_side); client->auth_end_offset = AUTH_END_INIT_OFFSET; client->rewrite_reply = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_object_unref); client->get_owner_repl...
cwe
CWE-284
Unknown
#include "common/http/header_map_impl.h" #include <cstdint> #include <list> #include <memory> #include <string> #include "common/common/assert.h" #include "common/common/dump_state_utils.h" #include "common/common/empty_string.h" #include "common/common/utility.h" #include "common/singleton/const_singleton.h" #inclu...
cwe
CWE-400
C/C++
gss_complete_auth_token (OM_uint32 *minor_status, const gss_ctx_id_t context_handle, gss_buffer_t input_message_buffer) { OM_uint32 status; gss_union_ctx_id_t ctx; gss_mechanism mech; if (context_handle == GSS_C_NO_CONTEXT) return GSS_S_NO_CONTEXT; /* * s...
cwe
CWE-415
C/C++
// imagew-jpeg.c // Part of ImageWorsener, Copyright (c) 2011 by Jason Summers. // For more information, see the readme.txt file. #include "imagew-config.h" #if IW_SUPPORT_JPEG == 1 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <setjmp.h> #include <jpeglib.h> #include <jerror...
cwe
CWE-125
C/C++
exo_open_launch_desktop_file (const gchar *arg) { #ifdef HAVE_GIO_UNIX GFile *gfile; gchar *contents; gsize length; gboolean result; GKeyFile *key_file; GDesktopAppInfo *appinfo; /* try to open a file from the arguments */ gfile = g_file_new_for_commandline...
cwe
CWE-94
Unknown
void cJSON_AddItemToArray( cJSON *array, cJSON *item ) { cJSON *c = array->child; if ( ! item ) return; if ( ! c ) { array->child = item; } else { while ( c && c->next ) c = c->next; suffix_object( c, item ); } }
cwe
CWE-120
C/C++
ScanLineInputFile::setFrameBuffer (const FrameBuffer &frameBuffer) { Lock lock (*_streamData); const ChannelList &channels = _data->header.channels(); for (FrameBuffer::ConstIterator j = frameBuffer.begin(); j != frameBuffer.end(); ++j) { ChannelList::ConstIterator i = channels.find (j.n...
cwe
CWE-125
Unknown
/* * GeoTools - The Open Source Java GIS Toolkit * http://geotools.org * * (C) 2002-2012, Open Source Geospatial Foundation (OSGeo) * * This library 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 ...
cwe
CWE-89
Java
NOEXPORT int verify_callback(int preverify_ok, X509_STORE_CTX *callback_ctx) { /* our verify callback function */ SSL *ssl; CLI *c; /* retrieve application specific data */ ssl=X509_STORE_CTX_get_ex_data(callback_ctx, SSL_get_ex_data_X509_STORE_CTX_idx()); c=SSL_get_ex_data(ssl, ind...
cwe
CWE-295
Unknown
""" This module provides a client interface for the node to communicate with the central server. """ import jwt import datetime from typing import Dict, Tuple from vantage6.common import WhoAmI from vantage6.client import ClientBase class NodeClient(ClientBase): """ Node interface to the central server.""" ...
cwe
CWE-613
Python
parse_attribute_subpkts (PKT_user_id * uid) { size_t n; int count = 0; struct user_attribute *attribs = NULL; const byte *buffer = uid->attrib_data; int buflen = uid->attrib_len; byte type; xfree (uid->attribs); while (buflen) { n = *buffer++; buflen--; if (n == 255) /* 4 byte l...
cwe
CWE-20
Unknown
bool AXObject::isMultiline() const { Node* node = this->getNode(); if (!node) return false; if (isHTMLTextAreaElement(*node)) return true; if (hasEditableStyle(*node)) return true; if (!isNativeTextControl() && !isNonNativeTextControl()) return false; return equalIgnoringCase(getAttri...
cwe
CWE-254
C/C++
ProcessIdToFilterMap* GetProcessIdToFilterMap() { static base::NoDestructor<ProcessIdToFilterMap> instance; return instance.get(); }
cwe
CWE-362
C/C++
"""DWC Network Server Emulator Copyright (C) 2014 polaris- Copyright (C) 2014 ToadKing Copyright (C) 2014 AdmiralCurtiss Copyright (C) 2015 Sepalani 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...
cwe
CWE-89
Python
static void opj_j2k_set_cinema_parameters(opj_cparameters_t *parameters, opj_image_t *image, opj_event_mgr_t *p_manager) { /* Configure cinema parameters */ int i; /* No tiling */ parameters->tile_size_on = OPJ_FALSE; parameters->cp_tdx = 1; parameters->cp_tdy = 1; /* One tile part...
cwe
CWE-416
C/C++
func (s *Service) loadCsvFile(fileName string) (*data.Frame, error) { validFileName := regexp.MustCompile(`([\w_]+)\.csv`) if !validFileName.MatchString(fileName) { return nil, fmt.Errorf("invalid csv file name: %q", fileName) } filePath := filepath.Join(s.cfg.StaticRootPath, "testdata", fileName) // Can igno...
cwe
CWE-22
Go
grepbuf (char const *beg, char const *lim) { int nlines, n; char const *p; size_t match_offset; size_t match_size; nlines = 0; p = beg; while ((match_offset = do_execute (p, lim - p, &match_size, NULL)) != (size_t) -1) { char const *b = p + match_offset; ...
cwe
CWE-189
Unknown
static int iovw_put(struct iovec_wrapper *iovw, void* data, size_t len) { if (!GREEDY_REALLOC(iovw->iovec, iovw->size_bytes, iovw->count + 1)) return log_oom(); iovw->iovec[iovw->count++] = IOVEC_MAKE(data, len); return 0; }
cwe
CWE-770
Unknown
void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, u64 delta_ns, const enum hrtimer_mode mode) { struct hrtimer_clock_base *base, *new_base; unsigned long flags; int leftmost; base = lock_hrtimer_base(timer, &flags); /* Remove an active timer from the queue: */ remove_hrtimer(timer, base, tr...
cwe
CWE-200
Unknown
foreach ($matches[1] as $index => $body) { $parts = explode('_', $body); $fileID = $parts[0]; $hash = $parts[1]; try { $file = erLhcoreClassModelChatFile::fetch($fileID); if (is_object($file) ...
cwe
CWE-116
PHP
package com.salesmanager.core.business.utils; import java.awt.AlphaComposite; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.Transparency; import java.awt.image.BufferedImage; /** * Utility class for image resize functions * @author Carl Samson * */ public class ProductImageSizeUtils ...
cwe
CWE-639
Java
/* * DBD::mysql - DBI driver for the mysql database * * Copyright (c) 2004-2014 Patrick Galbraith * Copyright (c) 2013-2014 Michiel Beijen * Copyright (c) 2004-2007 Alexey Stroganov * Copyright (c) 2003-2005 Rudolf Lippan * Copyright (c) 1997-2003 Jochen Wiedmann * * You may distribute this under th...
cwe
CWE-416
C/C++
parse_ipsecrequest(struct xfrm_policy *xp, struct sadb_x_ipsecrequest *rq) { struct net *net = xp_net(xp); struct xfrm_tmpl *t = xp->xfrm_vec + xp->xfrm_nr; int mode; if (xp->xfrm_nr >= XFRM_MAX_DEPTH) return -ELOOP; if (rq->sadb_x_ipsecrequest_mode == 0) return -EINVAL; t->id.proto = rq->sadb_x_ipsecreque...
cwe
CWE-416
Unknown
def cookies(self, jar: RequestsCookieJar): # <https://docs.python.org/3/library/cookielib.html#cookie-objects> stored_attrs = ['value', 'path', 'secure', 'expires'] self['cookies'] = {} for cookie in jar: self['cookies'][cookie.name] = { attname: getattr(cooki...
cwe
CWE-200
Python
void MessageService::OpenChannelToExtension( int source_process_id, int source_routing_id, int receiver_port_id, const std::string& source_extension_id, const std::string& target_extension_id, const std::string& channel_name) { content::RenderProcessHost* source = content::RenderProcessHost::Fro...
cwe
CWE-264
C/C++
function set(obj, path, value, doNotReplace){ if (typeof path === 'number') { path = [path]; } if (!path || path.length === 0) { return obj; } if (typeof path === 'string') { return set(obj, path.split('.').map(getKey), value, doNotReplace); } var curren...
cwe
CWE-843
JavaScript
int dd_delete(struct dump_dir *dd) { if (!dd->locked) { error_msg("unlocked problem directory %s cannot be deleted", dd->dd_dirname); return -1; } int r = delete_file_dir(dd->dd_dirname, /*skip_lock_file:*/ true); dd->locked = 0; /* delete_file_dir already removed .lock */ dd_cl...
cwe
CWE-20
Unknown
resp_new (const char *head) { const char *hdr; int count, size; struct response *resp = xnew0 (struct response); resp->data = head; if (*head == '\0') { /* Empty head means that we're dealing with a headerless (HTTP/0.9) response. In that case, don't set HEADERS at all. */ ...
cwe
CWE-20
Unknown
/** * 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
int expand_upwards(struct vm_area_struct *vma, unsigned long address) { struct mm_struct *mm = vma->vm_mm; int error = 0; if (!(vma->vm_flags & VM_GROWSUP)) return -EFAULT; /* Guard against wrapping around to address 0. */ if (address < PAGE_ALIGN(address+4)) address = PAGE_ALIGN(address+4); else return -...
cwe
CWE-119
Unknown
function errorMessage (er) { var short = [] var detail = [] switch (er.code) { case 'ENOAUDIT': short.push(['audit', er.message]) break case 'EAUDITNOPJSON': short.push(['audit', er.message]) break case 'EAUDITNOLOCK': short.push(['audit', er.message]) detail.push([...
cwe
CWE-532
JavaScript
create_face_from_contents (FontLoadJob *job, gchar **contents, GError **error) { FT_Error ft_error; FT_Face retval; ft_error = FT_New_Memory_Face (job->library, (const FT_Byte *) job->face_contents, ...
cwe
CWE-476
Unknown
void CZNC::ForceEncoding() { m_uiForceEncoding++; #ifdef HAVE_ICU for (Csock* pSock : GetManager()) { if (pSock->GetEncoding().empty()) { pSock->SetEncoding("UTF-8"); } } #endif }
cwe
CWE-20
C/C++
/* @flow */ import {MANIFEST_FIELDS} from '../../constants'; import type {Reporter} from '../../reporters/index.js'; import {isValidLicense} from './util.js'; import {normalizePerson, extractDescription} from './util.js'; import {hostedGitFragmentToGitUrl} from '../../resolvers/index.js'; import inferLicense from './i...
cwe
CWE-59
JavaScript
void Compute(OpKernelContext* context) override { const Tensor& diagonal = context->input(0); // MatrixDiag and MatrixDiagV2 both use this OpKernel. MatrixDiag only has // one input, so we have to check the number of inputs before reading // additional parameters in MatrixDiagV2. int32 lower_diag_i...
cwe
CWE-476
Unknown
// imagew-util.c // Part of ImageWorsener, Copyright (c) 2011 by Jason Summers. // For more information, see the readme.txt file. // This file is mainly for portability wrappers, and any code that // may require unusual header files (malloc.h, strsafe.h). #include "imagew-config.h" #include <stdio.h> #include <stdli...
cwe
CWE-19
C/C++
int addNodes(std::string link, std::vector<Proxy> &allNodes, int groupID, parse_settings &parse_set) { std::string &proxy = *parse_set.proxy, &subInfo = *parse_set.sub_info; string_array &exclude_remarks = *parse_set.exclude_remarks; string_array &include_remarks = *parse_set.include_remarks; RegexMatch...
cwe
CWE-434
C/C++
void LogRecordingSink::log(absl::string_view msg) { previous_delegate()->log(msg); messages_.push_back(std::string(msg)); }
cwe
CWE-400
Unknown
static void bond_setup(struct net_device *bond_dev) { struct bonding *bond = netdev_priv(bond_dev); /* initialize rwlocks */ rwlock_init(&bond->lock); rwlock_init(&bond->curr_slave_lock); bond->params = bonding_defaults; /* Initialize pointers */ bond->dev = bond_dev; INIT_LIST_HEAD(&bond->vlan_list); /* I...
cwe
CWE-264
Unknown
static void f2fs_put_super(struct super_block *sb) { struct f2fs_sb_info *sbi = F2FS_SB(sb); int i; f2fs_quota_off_umount(sb); /* prevent remaining shrinker jobs */ mutex_lock(&sbi->umount_mutex); /* * We don't need to do checkpoint when superblock is clean. * But, the previous checkpoint was not done by u...
cwe
CWE-20
C/C++
public function testAuth() { $restoreInstance = PMA_Response::getInstance(); // Case 1 $mockResponse = $this->getMockBuilder('PMA_Response') ->disableOriginalConstructor() ->setMethods(array('isAjax', 'isSuccess', 'addJSON')) ->getMock(); $mockRe...
cwe
CWE-200
PHP
void Compute(OpKernelContext* context) override { const Tensor& input = context->input(0); const float input_min = context->input(1).flat<float>()(0); const float input_max = context->input(2).flat<float>()(0); const Tensor& mean = context->input(3); const float mean_min = context->input(4).flat<flo...
cwe
CWE-125
C/C++
import namedavatar from 'namedavatar' import { i18nReady, t } from './i18n.js' import { Globalsettings } from '../api/globalsettings/globalsettings.js' const clientTimecards = new Mongo.Collection('clientTimecards') function getGlobalSetting(name) { return Globalsettings.findOne({ name }) ? Globalsettings.findOne({...
cwe
CWE-79
JavaScript
public byte[] engineDoFinal( byte[] input, int inputOffset, int inputLen) throws IllegalBlockSizeException, BadPaddingException { if (inputLen != 0) { buffer.write(input, inputOffset, inputLen); } byte[] in = buffer.toByteArray(); ...
cwe
CWE-310
Java
static Image *ReadVIDImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define ClientName "montage" char **filelist, *label, **list; Image *image, *images, *montage_image, *next_image, *thumbnail_image; ImageInfo *read_info; int number_files; MagickBoo...
cwe
CWE-476
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-190
JavaScript
if (!ORYX.Plugins) ORYX.Plugins = {}; if (!ORYX.Config) ORYX.Config = {}; ORYX.Plugins.JPDLMigration = Clazz.extend({ construct: function(facade){ this.facade = facade; if(!(ORYX.READONLY == true || ORYX.VIEWLOCKED == true)) { this.facade.offer({ 'name':ORYX.I18N.View.mig...
cwe
CWE-611
Java
async exec (args) { if (args.length === 0) { args = ['.'] } if (args.length !== 1) { throw this.usageError() } log.verbose('publish', replaceInfo(args)) const unicode = this.npm.config.get('unicode') const dryRun = this.npm.config.get('dry-run') const json = this.npm.config...
cwe
CWE-200
JavaScript
protected Object extractPrincipalFromWebToken(Jwt jwt) { Map body = (Map) jwt.getBody(); String base64Principal = (String) body.get("serialized-principal"); byte[] serializedPrincipal = Base64.decode(base64Principal); Object principal; ClassLoader loader = Thread.currentThread()....
cwe
CWE-347
Java
# -*- coding: utf-8 -*- # Copyright 2018 New Vector Ltd # # 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-79
Python
long Track::GetFirst(const BlockEntry*& pBlockEntry) const { const Cluster* pCluster = m_pSegment->GetFirst(); for (int i = 0;;) { if (pCluster == NULL) { pBlockEntry = GetEOS(); return 1; } if (pCluster->EOS()) { #if 0 if (m_pSegment->Unparsed() <= 0) { //all clusters have been loa...
cwe
CWE-20
C/C++
parse_codes(struct archive_read *a) { int i, j, val, n, r; unsigned char bitlengths[MAX_SYMBOLS], zerocount, ppmd_flags; unsigned int maxorder; struct huffman_code precode; struct rar *rar = (struct rar *)(a->format->data); struct rar_br *br = &(rar->br); free_codes(a); /* Skip to the next byte */ r...
cwe
CWE-119
C/C++
/* Copyright The containerd 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 agreed to...
cwe
CWE-668
Go
static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, netdev_features_t features) { struct sk_buff *segs = ERR_PTR(-EINVAL); unsigned int mss; unsigned int unfrag_ip6hlen, unfrag_len; struct frag_hdr *fptr; u8 *packet_start, *prevhdr; u8 nexthdr; u8 frag_hdr_sz = sizeof(struct frag_hdr); int offse...
cwe
CWE-189
C/C++
static int writeBufferToContigTiles (TIFF* out, uint8* buf, uint32 imagelength, uint32 imagewidth, tsample_t spp, struct dump_opts* dump) { uint16 bps; uint32 tl, tw; uint32 row, col, nrow, ncol; uint32 src_rowsize, col_offset; uint32 tile_rowsize = TIFFTi...
cwe
CWE-125
Unknown
/* * JBoss, Home of Professional Open Source. * Copyright 2017 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * 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 Licen...
cwe
CWE-404
Java
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 2); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); OpContext op_context(context, node); TF_LITE_ENSURE_OK(context, InitializeTemporaries(context, node, &op_context)); OpData* op_data = reinterpret_c...
cwe
CWE-125
C/C++