code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
func securityConfigureGenerator(s *specgen.SpecGenerator, g *generate.Generator, newImage *libimage.Image, rtc *config.Config) error { var ( caplist []string err error ) // HANDLE CAPABILITIES // NOTE: Must happen before SECCOMP if s.Privileged { g.SetupPrivileged(true) caplist, err = capabilities.Boun...
cwe
CWE-276
Go
/* * Copyright 2010 Red Hat, Inc. and/or 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 ap...
cwe
CWE-611
Java
d.getGlobalVariable=function(S){return"page"==S&&null!=k&&null!=k[l]?k[l].getAttribute("name"):"pagenumber"==S?l+1:"pagecount"==S?null!=k?k.length:1:p.apply(this,arguments)};d.getLinkForCell=function(){return null};Editor.MathJaxRender&&d.addListener(mxEvent.SIZE,mxUtils.bind(this,function(S,Y){b.editor.graph.mathEnabl...
cwe
CWE-94
JavaScript
package org.joget.plugin.enterprise; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Locale; import java.util.Map; import java.util.TreeMap; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.Htt...
cwe
CWE-79
Java
/* ██████ ██  ██ ███████ ███  ██ ████████  ██      ██  ██ ██      ████  ██    ██     ██  ██  ██ █████  ██ ██  ██  ██  ██  ██  ██ ██     ██  ██ ██  ██  ██████ ███████ ██ ███████ ██   ████  ██  */ /** * MiroTalk P2P - Client component * * @link GitHub: https://github.co...
cwe
CWE-79
JavaScript
static MagickBooleanType ReadDXT3(Image *image, DDSInfo *dds_info, ExceptionInfo *exception) { DDSColors colors; ssize_t j, y; PixelPacket *q; register ssize_t i, x; unsigned char alpha; size_t a0, a1, bits, code; unsigned short c0, c1; for (y...
cwe
CWE-20
C/C++
// Copyright (c) 2018-2022, Sylabs Inc. All rights reserved. // This software is licensed under a 3-clause BSD license. Please consult the // LICENSE.md file distributed with the sources of this project regarding your // rights to use or distribute this software. package client import ( "context" "errors" "fmt" "...
cwe
CWE-522
Go
load_msg(RES* ssl, sldns_buffer* buf, struct worker* worker) { struct regional* region = worker->scratchpad; struct query_info qinf; struct reply_info rep; char* s = (char*)sldns_buffer_begin(buf); unsigned int flags, qdcount, security, an, ns, ar; long long ttl; size_t i; int go_on = 1; regional_free_all(reg...
cwe
CWE-703
Unknown
/* * 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++
TfLiteStatus ResizeOutput(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input = GetInput(context, node, kInputTensor); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); const TfLiteTensor* multipliers = GetInput(context, node, kInputMultipliers); const int num_dimensions = NumDi...
cwe
CWE-787
C/C++
@mod.route('/like/<int:msg_id>', methods=['GET', 'POST']) def like(msg_id): if request.method == 'GET': user_id = session['logged_id'] c_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S') sql = "INSERT INTO like_msg(msg_id, user_id,c_time) " + \ "VALUES(%d,'%s','%s');" % (ms...
cwe
CWE-89
Python
userauth_password(LIBSSH2_SESSION *session, const char *username, unsigned int username_len, const unsigned char *password, unsigned int password_len, LIBSSH2_PASSWD_CHANGEREQ_FUNC((*passwd_change_cb))) { unsigned char *s; static const unsigned char reply_co...
cwe
CWE-787
Unknown
void cJSON_DeleteItemFromArray( cJSON *array, int which ) { cJSON_Delete( cJSON_DetachItemFromArray( array, which ) ); }
cwe
CWE-120
C/C++
# Copyright (c) 2013-2017 by Ron Frederick <ronf@timeheart.net>. # All rights reserved. # # This program and the accompanying materials are made available under # the terms of the Eclipse Public License v1.0 which accompanies this # distribution and is available at: # # http://www.eclipse.org/legal/epl-v10.html # #...
cwe
CWE-287
Python
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-122
C/C++
Object.keys(req.query as any).length ? validateOrReject(Object.assign(new Validators.Query(), req.query as any), validatorOptions) : null ])
cwe
CWE-1321
JavaScript
package v1 import ( "context" "errors" v1 "github.com/authzed/authzed-go/proto/authzed/api/v1" grpcmw "github.com/grpc-ecosystem/go-grpc-middleware" grpcvalidate "github.com/grpc-ecosystem/go-grpc-middleware/validator" "github.com/jzelinskie/stringz" "github.com/rs/zerolog/log" "github.com/shopspring/decimal"...
cwe
CWE-20
Go
static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image, ExceptionInfo *exception) { BMPInfo bmp_info; const char *option; const StringInfo *profile; MagickBooleanType have_color_info, status; MagickOffsetType scene; MemoryInfo *pixel_info; regis...
cwe
CWE-190
C/C++
static int ssl_parse_client_key_exchange( ssl_context *ssl ) { int ret; size_t i, n = 0; SSL_DEBUG_MSG( 2, ( "=> parse client key exchange" ) ); if( ( ret = ssl_read_record( ssl ) ) != 0 ) { SSL_DEBUG_RET( 1, "ssl_read_record", ret ); return( ret ); } if( ssl->in_msgtype !...
cwe
CWE-310
Unknown
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-119
Unknown
package org.jenkinsci.plugins.api; import java.io.IOException; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URL; import java.util.logging.Logger; import org.acegisecurity.userdetails.UserDetails; import org.apache.commons.collect...
cwe
CWE-352
Java
$body .= sprintf('&nbsp;(<a href="%s?index=%s" onclick="target=\'backtrace\';">%s</a>)', '../tools/unserialize.php',$error,$display); else $body .= sprintf('&nbsp;(%s)',$display); } $body .= '</small></td></tr>'; $body .= "\n"; if (isset($line['file'])) $last['file'] = $line['file']; }...
cwe
CWE-79
PHP
/** * 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
void Compute(OpKernelContext* context) override { // Here's the basic idea: // Batch and depth dimension are independent from row and col dimension. And // because FractionalAvgPool currently only support pooling along row and // col, we can basically think of this 4D tensor backpropagation as // op...
cwe
CWE-125
C/C++
"""Core API v2 views.""" import logging from django.utils.html import escape from django.utils.translation import ugettext as _ from django.utils.datastructures import MultiValueDictKeyError from django.contrib.auth import login from drf_spectacular.utils import extend_schema from rest_framework import response, st...
cwe
CWE-305
Python
import Context from './Context'; import optional from './rules/optional'; function v8n() { return typeof Proxy !== 'undefined' ? proxyContext(new Context()) : proxylessContext(new Context()); } // Custom rules let customRules = {}; v8n.extend = function(newRules) { Object.assign(customRules, newRules); }...
cwe
CWE-400
JavaScript
/** * (c) jSuites Javascript Web Components * * Website: https://jsuites.net * Description: Create amazing web based applications. * * MIT License * */ ;(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' ...
cwe
CWE-79
JavaScript
import re from enum import Enum, auto from typing import Any, List, Optional, Tuple, Union from vyper.address_space import AddrSpace from vyper.codegen.types import BaseType, NodeType, ceil32 from vyper.compiler.settings import VYPER_COLOR_OUTPUT from vyper.evm.opcodes import get_ir_opcodes from vyper.exceptions impor...
cwe
CWE-190
Python
TEE_Result syscall_cipher_init(unsigned long state, const void *iv, size_t iv_len) { TEE_Result res; struct tee_cryp_state *cs; struct tee_ta_session *sess; struct tee_obj *o; struct tee_cryp_obj_secret *key1; struct user_ta_ctx *utc; res = tee_ta_get_current_session(&sess); if (res != TEE_SUCCESS) return...
cwe
CWE-327
Unknown
private function formatMessage($message) { if ($this->timezone) { $graylogTime = new DateTime($message['message']['timestamp']); $offset = $this->timezone->getOffset($graylogTime); $timeInterval = DateInterval::createFromDateString((string) $offset . 'seconds'); ...
cwe
CWE-79
PHP
private function setColumnOption(&$column, string $name, string $key, bool $isWidget, bool $allowEmpty) { $newValue = $this->request->request->get($name . '-' . $key); if ($isWidget) { if (!empty($newValue) || $allowEmpty) { $column['children'][0][$key] = $newValue; ...
cwe
CWE-79
PHP
static int proc_sys_readdir(struct file *file, struct dir_context *ctx) { struct ctl_table_header *head = grab_header(file_inode(file)); struct ctl_table_header *h = NULL; struct ctl_table *entry; struct ctl_dir *ctl_dir; unsigned long pos; if (IS_ERR(head)) return PTR_ERR(head); ctl_dir = container_of(head,...
cwe
CWE-20
C/C++
epsc_print_page(gx_device_printer * pdev, gp_file * prn_stream) { static int graphics_modes_9[5] = { -1, 0 /*60 */ , 1 /*120 */ , -1, DD + 3 /*240 */ }; static int graphics_modes_24[7] = { -1, 32 /*60 */ , 33 /*120 */ , 39 /*180 */ , -1, -1, DD + 40 /*360 */ }; int y_24pin =...
cwe
CWE-120
C/C++
EXPORTED time_t calc_compile_time(const char *time, const char *date) { struct tm tm; char month[4]; const char *monthname[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; memset(&tm, 0, sizeof(struct tm)); tm.tm_isdst = -1; sscanf(time, "%02d:%0...
cwe
CWE-787
Unknown
// SPDX-License-Identifier: GPL-2.0-only /* * Simple NUMA memory policy for the Linux kernel. * * Copyright 2003,2004 Andi Kleen, SuSE Labs. * (C) Copyright 2005 Christoph Lameter, Silicon Graphics, Inc. * * NUMA policy allows the user to give hints in which node(s) memory should * be allocated. * * Support fo...
cwe
CWE-787
C/C++
TPM2B_DATA_Marshal(TPM2B_DATA *source, BYTE **buffer, INT32 *size) { UINT16 written = 0; written += TPM2B_Marshal(&source->b, buffer, size); return written; }
cwe
CWE-787
Unknown
void create_empty_file_as_root(const char *fname, mode_t mode) { assert(fname); mode &= 07777; struct stat s; if (stat(fname, &s)) { if (arg_debug) printf("Creating empty %s file\n", fname); /* coverity[toctou] */ // don't fail if file already exists. This can be the case in a race // condition, when tw...
cwe
CWE-94
Unknown
def rebuild_time required_parameters :repository, :arch load_packages_mainpage @repository = params[:repository] @arch = params[:arch] @hosts = begin Integer(params[:hosts] || '40') rescue 40 end @scheduler = params[:scheduler] || 'needed' bdep = find_cached(BuilddepInfo, :project => @proje...
cwe
CWE-94
Ruby
int squidclamav_check_preview_handler(char *preview_data, int preview_data_len, ci_request_t * req) { ci_headers_list_t *req_header; struct http_info httpinf; av_req_data_t *data = ci_service_data(req); char *clientip; struct hostent *clientname; unsigned long ip; char *username; ...
cwe
CWE-119
Unknown
static NTSTATUS update_uint32_t_value(TALLOC_CTX *mem_ctx, struct ldb_context *sam_ldb, struct ldb_message *orig, struct ldb_message *dest, const char *attribute, uint32_t value, uint32_t *orig_value) { const struct ldb_val *orig_val; uint32_t orig_uint = 0;...
cwe
CWE-200
Unknown
/** * 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 m...
cwe
CWE-918
Java
// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2015 Tim Theede <pez2001@voyagerproject.de> * 2015 Terry Cain <terry@terrys-home.co.uk> */ #include <linux/kernel.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/init.h> #include <linux/hid.h> #include "razercommon....
cwe
CWE-125
Python
static struct mnt_namespace *dup_mnt_ns(struct mnt_namespace *mnt_ns, struct user_namespace *user_ns, struct fs_struct *fs) { struct mnt_namespace *new_ns; struct vfsmount *rootmnt = NULL, *pwdmnt = NULL; struct mount *p, *q; struct mount *old = mnt_ns->root; struct mount *new; int copy_flags; new_ns = alloc_...
cwe
CWE-264
C/C++
static int masq_inet_event(struct notifier_block *this, unsigned long event, void *ptr) { struct net_device *dev = ((struct in_ifaddr *)ptr)->ifa_dev->dev; struct netdev_notifier_info info; netdev_notifier_info_init(&info, dev); return masq_device_event(this, event, &info); }
cwe
CWE-399
Unknown
SWFInput_readSBits(SWFInput input, int number) { int num = SWFInput_readBits(input, number); if ( num & (1<<(number-1)) ) return num - (1<<number); else return num; }
cwe
CWE-703
Unknown
int SeekHead::GetCount() const { return m_entry_count; }
cwe
CWE-119
C/C++
def read_configuration return unless File.exist?(configuration_file) YAML.load(File.open(configuration_file)) end
cwe
CWE-502
Ruby
struct dst_entry *fib6_rule_lookup(struct net *net, struct flowi6 *fl6, const struct sk_buff *skb, int flags, pol_lookup_t lookup) { struct rt6_info *rt; rt = lookup(net, net->ipv6.fib6_main_tbl, fl6, skb, flags); if (rt->dst.error == -EAGAIN) { ip6_rt_put_flags(rt, flags); rt = net->ipv6.ip6_null...
cwe
CWE-755
C/C++
void isor_reader_get_sample(ISOMChannel *ch) { GF_Err e; u32 sample_desc_index; if (ch->sample) return; if (ch->next_track) { ch->track = ch->next_track; ch->next_track = 0; } if (ch->to_init) { init_reader(ch); sample_desc_index = ch->last_sample_desc_index; } else if (ch->speed < 0) { if (ch->last_...
cwe
CWE-835
Unknown
function p(H,F,J,R,W){function O(Q,P,T){var X=document.createElement("li");X.className="geCommentAction";var ba=document.createElement("a");ba.className= "geCommentActionLnk";mxUtils.write(ba,Q);X.appendChild(ba);mxEvent.addListener(ba,"click",function(ja){P(ja,H);ja.preventDefault();mxEvent.consume(ja)});S.appendChild...
cwe
CWE-94
JavaScript
static int Downmix_Command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize, void *pCmdData, uint32_t *replySize, void *pReplyData) { downmix_module_t *pDwmModule = (downmix_module_t *) self; downmix_object_t *pDownmixer; if (pDwmModule == NULL || pDwmModule->context.state == DOWNMIX_STATE_UNINITIALIZED) ...
cwe
CWE-200
C/C++
copy_to_fd (const char *from, int tofd) { int fromfd; ssize_t i; if ((fromfd = safe_open (from, O_RDONLY | O_BINARY, 0)) < 0) pfatal ("Can't reopen file %s", quotearg (from)); while ((i = read (fromfd, buf, bufsize)) != 0) { if (i == (ssize_t) -1) read_fatal (); if (full_write (tofd, buf, ...
cwe
CWE-59
Unknown
/** @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-284
JavaScript
const createCommand = ({ ref, path }: Input) => { return `git show ${ref}:${path}`; };
cwe
CWE-78
JavaScript
static my_bool sql_connect(MYSQL *mysql, uint wait) { my_bool info=0; for (;;) { if (mysql_connect_ssl_check(mysql, host, user, opt_password, NullS, tcp_port, unix_port, CLIENT_REMEMBER_OPTIONS, opt_ssl_required)) { mysql->reconnect= 1...
cwe
CWE-319
Unknown
public function column_description( $item ) { $return = $item->object_name; switch ( $item->object_type ) { case 'Post' : $return = sprintf( '<a href="%s">%s</a>', get_edit_post_link( $item->object_id ), $item->object_name ); break; case 'Taxonomy' : if ( ! empty( $item->object_id ) ) ...
cwe
CWE-79
PHP
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); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); auto* params = ...
cwe
CWE-125
C/C++
static void sctp_close(struct sock *sk, long timeout) { struct net *net = sock_net(sk); struct sctp_endpoint *ep; struct sctp_association *asoc; struct list_head *pos, *temp; unsigned int data_was_unread; pr_debug("%s: sk:%p, timeout:%ld\n", __func__, sk, timeout); lock_sock(sk); sk->sk_shutdown = SHUTDOWN_MA...
cwe
CWE-362
C/C++
void btm_sec_pin_code_request (UINT8 *p_bda) { tBTM_SEC_DEV_REC *p_dev_rec; tBTM_CB *p_cb = &btm_cb; #ifdef PORCHE_PAIRING_CONFLICT UINT8 default_pin_code_len = 4; PIN_CODE default_pin_code = {0x30, 0x30, 0x30, 0x30}; #endif BTM_TRACE_EVENT ("btm_sec_pin_code_request() State: %s, BDA...
cwe
CWE-264
C/C++
static inline void kvm_memslot_delete(struct kvm_memslots *slots, struct kvm_memory_slot *memslot) { struct kvm_memory_slot *mslots = slots->memslots; int i; if (WARN_ON(slots->id_to_index[memslot->id] == -1)) return; slots->used_slots--; for (i = slots->id_to_index[memslot->id]; i < slots->used_slo...
cwe
CWE-416
C/C++
/** @file compression.c * @brief Functions handling compression * * Copyright (c) 2014 Bartek Fabiszewski * http://www.fabiszewski.net * * This file is part of libmobi. * Licensed under LGPL, either version 3, or any later. * See <http://www.gnu.org/licenses/> */ #include <string.h> #include "compression.h" ...
cwe
CWE-119
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 build.models import Build from company.models import Company, SupplierPart from order.models imp...
cwe
CWE-1236
Python
$value = str_replace($originalName, $cleanedName, $value); } unset($value); } $result = hash_equals(GeneralUtility::hmac(serialize($fieldChangeFunctions)), $this->parameters['fieldChangeFuncHash']); } return $result; }
cwe
CWE-502
PHP
CallResult<PseudoHandle<>> JSObject::getComputedWithReceiver_RJS( Handle<JSObject> selfHandle, Runtime *runtime, Handle<> nameValHandle, Handle<> receiver) { // Try the fast-path first: no "index-like" properties and the "name" already // is a valid integer index. if (selfHandle->flags_.fastIndexP...
cwe
CWE-125
C/C++
IMPEG2D_ERROR_CODES_T impeg2d_dec_pic_hdr(dec_state_t *ps_dec) { stream_t *ps_stream; ps_stream = &ps_dec->s_bit_stream; impeg2d_bit_stream_flush(ps_stream,START_CODE_LEN); /* Flush temporal reference */ impeg2d_bit_stream_get(ps_stream,10); /* Picture type */ ps_dec->e_pic_type = (e_pic_type_t)imp...
cwe
CWE-254
C/C++
package com.salesmanager.shop.mapper.catalog; import javax.inject.Inject; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.springframework.stereotype.Component; import com.salesmanager.core.business.services.catalog.product.ProductService; import com.salesmanager.core...
cwe
CWE-79
Java
/* * linux/mm/slab.c * Written by Mark Hemment, 1996/97. * (markhe@nextd.demon.co.uk) * * kmem_cache_destroy() + some cleanup - 1999 Andrea Arcangeli * * Major cleanup, different bufctl logic, per-cpu arrays * (c) 2000 Manfred Spraul * * Cleanup, make the head arrays unconditional, preparation for NUMA * (c...
cwe
CWE-189
C/C++
ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh, struct ext2_xattr_header *header) { struct super_block *sb = inode->i_sb; struct buffer_head *new_bh = NULL; int error; if (header) { new_bh = ext2_xattr_cache_find(inode, header); if (new_bh) { /* We found an identical block in the cache. *...
cwe
CWE-19
C/C++
if(null!=d&&d==c)return a}for(a=a.firstChild;null!=a;){d=mxUtils.findNode(a,b,c);if(null!=d)return d;a=a.nextSibling}return null},getFunctionName:function(a){var b=null;null!=a&&(null!=a.name?b=a.name:(b=mxUtils.trim(a.toString()),/^function\s/.test(b)&&(b=mxUtils.ltrim(b.substring(9)),a=b.indexOf("("),0<a&&(b=b.substr...
cwe
CWE-94
JavaScript
function PMA_getQueryFromSelected($what, $db, $table, $selected, $action, $views) { $reload = null; $full_query_views = null; $full_query = ''; if ($what == 'drop_tbl') { $full_query_views = ''; } $selected_cnt = count($selected); $i = 0; foreach ($selected as $sval) { ...
cwe
CWE-79
PHP
void __vma_link_rb(struct mm_struct *mm, struct vm_area_struct *vma, struct rb_node **rb_link, struct rb_node *rb_parent) { /* Update tracking information for the gap following the new vma. */ if (vma->vm_next) vma_gap_update(vma->vm_next); else mm->highest_vm_end = vma->vm_end; /* * vma->vm_prev wasn't kn...
cwe
CWE-119
Unknown
int main(int argc, char *argv[]) { int32_t ret = GPMF_OK; GPMF_stream metadata_stream, *ms = &metadata_stream; double metadatalength; uint32_t *payload = NULL; //buffer to store GPMF samples from the MP4. // get file return data if (argc != 2) { printf("usage: %s <file_with_GPMF>\n", argv[0]); return -1; ...
cwe
CWE-125
C/C++
/* * 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
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.core.doctype.report.report import is_prepared_report_disabled from frappe.model.document import Document class RolePerm...
cwe
CWE-79
Python
public function renameUser($new_name) { // Rename only if a new name is really new if ($this->userName != $new_name) { // Save old name $old_name = $this->userName; // Rename user $this->userName = $new_name; $this->save(); // ...
cwe
CWE-79
PHP
snmp_engine_get_bulk(snmp_header_t *header, snmp_varbind_t *varbinds, uint32_t *varbinds_length) { snmp_mib_resource_t *resource; uint32_t i, j, original_varbinds_length; uint32_t oid[SNMP_MAX_NR_VALUES][SNMP_MSG_OID_MAX_LEN]; uint8_t repeater; /* * A local copy of the requested oids must be kept since ...
cwe
CWE-125
C/C++
/* ** vm.c - virtual machine for mruby ** ** See Copyright Notice in mruby.h */ #include <mruby.h> #include <mruby/array.h> #include <mruby/class.h> #include <mruby/hash.h> #include <mruby/irep.h> #include <mruby/numeric.h> #include <mruby/proc.h> #include <mruby/range.h> #include <mruby/string.h> #include <mruby/vari...
cwe
CWE-416
C/C++
function escapeShellArgWithInterpolation(arg, shell) { let result = arg .replace(/\u{0}/gu, "") .replace(/\\/g, "\\\\") .replace(/^(~|#)/g, "\\$1") .replace(/(\*|\?)/gu, "\\$1") .replace(/(\$|\;|\&|\|)/g, "\\$1") .replace(/(\(|\)|\<|\>)/g, "\\$1") .replace(/("|'|`)/g, "\\$1"); if (shell...
cwe
CWE-200
JavaScript
struct posix_acl *fuse_get_acl(struct inode *inode, int type) { struct fuse_conn *fc = get_fuse_conn(inode); int size; const char *name; void *value = NULL; struct posix_acl *acl; if (!fc->posix_acl || fc->no_getxattr) return NULL; if (type == ACL_TYPE_ACCESS) name = XATTR_NAME_POSIX_ACL_ACCESS; else if (...
cwe
CWE-459
Unknown
find_help_tags( char_u *arg, int *num_matches, char_u ***matches, int keep_lang) { char_u *s, *d; int i; // Specific tags that either have a specific replacement or won't go // through the generic rules. static char *(except_tbl[][2]) = { {"*", "star"}, {"g*", "gstar"}, {"[*"...
cwe
CWE-787
C/C++
static int cJSON_strcasecmp( const char *s1, const char *s2 ) { if ( ! s1 ) return ( s1 == s2 ) ? 0 : 1; if ( ! s2 ) return 1; for ( ; tolower(*s1) == tolower(*s2); ++s1, ++s2) if( *s1 == 0 ) return 0; return tolower(*(const unsigned char *)s1) - tolower(*(const unsigned char *)s2); }
cwe
CWE-120
C/C++
static int Adapter_output(AdapterObject *self, const char *data, int length, int exception_when_aborted) { int i = 0; int n = 0; apr_status_t rv; request_rec *r; #if defined(MOD_WSGI_WITH_DAEMONS) if (wsgi_inactivity_timeout) { apr_thread_mutex_lock(wsgi_shutdown_l...
cwe
CWE-200
C/C++
var EE = require('events').EventEmitter var parse = require('url').parse var http = require('http') var path = require('path') var fs = require('fs') var fileExists = require('utils-fs-exists') var htmlls = require('html-ls') var filed = require('filed') var xtend = require('xtend') var defaults = require('./lib/conf...
cwe
CWE-22
JavaScript
static inline int r_sys_mkdirp(char *dir) { int ret = 1; const char slash = DIRSEP; char *path = dir; char *ptr = path; if (*ptr == slash) { ptr++; } #if __SDB_WINDOWS__ char *p = strstr (ptr, ":\\"); if (p) { ptr = p + 2; } #endif while ((ptr = strchr (ptr, slash))) { *ptr = 0; if (!r_sys_mkdir (path...
cwe
CWE-78
Unknown
proc_lambda(mrb_state *mrb, mrb_value self) { mrb_value blk; struct RProc *p; mrb_get_args(mrb, "&", &blk); if (mrb_nil_p(blk)) { mrb_raise(mrb, E_ARGUMENT_ERROR, "tried to create Proc object without a block"); } if (!mrb_proc_p(blk)) { mrb_raise(mrb, E_ARGUMENT_ERROR, "not a proc"); } p = mrb_...
cwe
CWE-190
Unknown
function Glance(options) { EE.call(this) options = xtend(defaults, options || {}) this.port = options.port this.hideindex = options.hideindex this.indices = options.indices this.dir = path.normalize(options.dir) this.nodot = options.nodot return this }
cwe
CWE-22
JavaScript
void Compute(OpKernelContext* context) override { const Tensor& input = context->input(0); const Tensor& filter_sizes = context->input(1); const Tensor& out_backprop = context->input(2); OP_REQUIRES( context, TensorShapeUtils::IsVector(filter_sizes.shape()), errors::InvalidArgument( ...
cwe
CWE-787
Unknown
- (NSArray *) _fetchFields: (NSArray *) fields forComponentOfType: (NSString *) component { NSEnumerator *folders, *currentInfos; SOGoAppointmentFolder *currentFolder; NSMutableDictionary *newInfo; NSMutableArray *infos; NSNull *marker; SOGoAppointmentFolders *clientObject; SOGoUser *ownerUser; NSStrin...
cwe
CWE-79
JavaScript
error_t tcpAddOption(TcpHeader *segment, uint8_t kind, const void *value, uint8_t length) { uint_t i; size_t paddingSize; TcpOption *option; //Length of the complete option field length += sizeof(TcpOption); //Make sure there is enough space to add the specified option if((segment->dataOffset ...
cwe
CWE-20
C/C++
static int sgi_timer_set(struct k_itimer *timr, int flags, struct itimerspec * new_setting, struct itimerspec * old_setting) { unsigned long when, period, irqflags; int err = 0; cnodeid_t nodeid; struct mmtimer *base; struct rb_node *n; if (old_setting) sgi_timer_get(timr, old_setting); sgi_timer_del(timr)...
cwe
CWE-189
C/C++
void CL_InitRef( void ) { refimport_t ri; refexport_t *ret; #ifdef USE_RENDERER_DLOPEN GetRefAPI_t GetRefAPI; char dllName[MAX_OSPATH]; #endif Com_Printf( "----- Initializing Renderer ----\n" ); #ifdef USE_RENDERER_DLOPEN cl_renderer = Cvar_Get("cl_renderer", "opengl2", CVAR_ARCHIVE | CVAR_LATCH); Com_spri...
cwe
CWE-269
Unknown
auto ReferenceHandle::Get(Local<Value> key_handle, MaybeLocal<Object> maybe_options) -> Local<Value> { return ThreePhaseTask::Run<async, GetRunner>(*isolate, *this, key_handle, maybe_options, inherit); }
cwe
CWE-913
Unknown
/* -*- mode: c; c-basic-offset: 8; -*- * vim: noexpandtab sw=8 ts=8 sts=0: * * file.c * * File open, close, extend, truncate * * Copyright (C) 2002, 2004 Oracle. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * Lic...
cwe
CWE-399
C/C++
$stmt->bindValue(":$field", $domain, SQLITE3_TEXT); if($bindcomment) { $stmt->bindValue(":comment", $comment, SQLITE3_TEXT); } if($stmt->execute() && $stmt->reset()) $num++; else { $stmt->close(); if($returnnum) return $num; else { if($num === 1) $plural = ""; else $pl...
cwe
CWE-862
PHP
compile_lock_unlock( lval_T *lvp, char_u *name_end, exarg_T *eap, int deep, void *coookie) { cctx_T *cctx = coookie; int cc = *name_end; char_u *p = lvp->ll_name; int ret = OK; size_t len; char_u *buf; isntype_T isn = ISN_EXEC; if (cctx->ctx_skip == SKIP_Y...
cwe
CWE-122
Unknown
bufferedReadPixels (InputFile::Data* ifd, int scanLine1, int scanLine2) { // // bufferedReadPixels reads each row of tiles that intersect the // scan-line range (scanLine1 to scanLine2). The previous row of // tiles is cached in order to prevent redundent tile reads when // accessing scanlines seque...
cwe
CWE-770
Unknown
MagickExport MagickBooleanType GammaImage(Image *image,const double gamma, ExceptionInfo *exception) { #define GammaImageTag "Gamma/Image" CacheView *image_view; MagickBooleanType status; MagickOffsetType progress; Quantum *gamma_map; register ssize_t i; ssize_t y; /* ...
cwe
CWE-369
Unknown
static struct fsnotify_group *inotify_new_group(struct user_struct *user, unsigned int max_events) { struct fsnotify_group *group; group = fsnotify_alloc_group(&inotify_fsnotify_ops); if (IS_ERR(group)) return group; group->max_events = max_events; spin_lock_init(&group->inotify_data.idr_lock); idr_init...
cwe
CWE-399
C/C++
@NSManaged public internal(set) var securityLevel: ZMConversationSecurityLevel @NSManaged private var primitiveLegalHoldStatus: NSNumber /// Indicates that we need verify that our local knowledge of clients matches the clients known to the backend. @NSManaged public internal(set) var needsToVerifyLega...
cwe
CWE-345
Swift
static Exit_status safe_connect() { mysql= mysql_init(NULL); if (!mysql) { error("Failed on mysql_init."); return ERROR_STOP; } #ifdef HAVE_OPENSSL if (opt_use_ssl) { mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, opt_ssl_capath, opt_ssl_cipher); mysql_option...
cwe
CWE-295
C/C++