code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
/* libcomps - C alternative to yum.comps library
* Copyright (C) 2013 Jindrich Luza
*
* 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
* any later versio... | cwe | CWE-416 | C/C++ |
void ArthurOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
int *maskColors, GBool inlineImg)
{
unsigned char *buffer;
unsigned int *dest;
int x, y;
ImageStream *imgStr;
Guchar *pix;
int i;
double *ctm;
QMatrix matrix;
int... | cwe | CWE-189 | C/C++ |
PHP_FUNCTION(locale_accept_from_http)
{
UEnumeration *available;
char *http_accept = NULL;
int http_accept_len;
UErrorCode status = 0;
int len;
char resultLocale[INTL_MAX_LOCALE_LEN+1];
UAcceptResult outResult;
if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s", &http_accept, &http_accept_len) == FAILURE... | cwe | CWE-125 | Unknown |
REGEXP *
Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
OP *expr, const regexp_engine* eng, REGEXP *old_re,
bool *is_bare_re, const U32 orig_rx_flags, const U32 pm_flags)
{
dVAR;
REGEXP *Rx; /* Capital 'R' means points to a REGEXP */
STRLEN plen;
char *exp;
regnod... | cwe | CWE-120 | Unknown |
/*
* Copyright 2008-2017 by Emeric Vernat
*
* This file is part of Java Melody.
*
* 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... | cwe | CWE-611 | Java |
xmlPushInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr input) {
int ret;
if (input == NULL) return(-1);
if (xmlParserDebugEntities) {
if ((ctxt->input != NULL) && (ctxt->input->filename))
xmlGenericError(xmlGenericErrorContext,
"%s(%d): ", ctxt->input->filename,
ctxt->input->line);
xmlGen... | cwe | CWE-835 | Unknown |
/** @file
Somfy io-homecontrol.
Copyright (C) 2021 Christian W. Zuckschwerdt <zany@triq.net>
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
... | cwe | CWE-787 | C/C++ |
/* 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-617 | C/C++ |
// SPDX-License-Identifier: GPL-2.0-only
/*
* Kernel-based Virtual Machine driver for Linux
*
* derived from drivers/kvm/kvm_main.c
*
* Copyright (C) 2006 Qumranet, Inc.
* Copyright (C) 2008 Qumranet, Inc.
* Copyright IBM Corporation, 2008
* Copyright 2010 Red Hat, Inc. and/or its affiliates.
*
* Authors:
* ... | cwe | CWE-665 | C/C++ |
@Override
public File provide() throws IOException
{
File f = File.createTempFile(_prefix, _suffix);
f.deleteOnExit();
return f;
} | cwe | CWE-668 | Java |
/**
* 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 |
function onRequest(request, response) {
var frontUrl = '';
if(request.url === '/favicon.ico') return;
for(var key in conf.serv) {
if(request.headers.host.indexOf(key) !== -1) {
host = conf.serv[key];
}
}
var nowTemp = (host.frondend + (request.url.replace('/', '') || host.baseTe... | cwe | CWE-22 | JavaScript |
function anonymizeHtml(html)
{
div.innerHTML = html;
replaceTextContent(div);
return div.innerHTML;
} | cwe | CWE-79 | JavaScript |
def set_inboxes
@inbox_ids = if params[:inbox_id]
current_account.inboxes.where(id: params[:inbox_id])
else
@current_user.assigned_inboxes.pluck(:id)
end | cwe | CWE-269 | Ruby |
# -*- coding: utf-8 -*-
from django import forms
from django.contrib.auth import authenticate, get_backends, get_user_model
from django.contrib.sites.shortcuts import get_current_site
from django.core.exceptions import ImproperlyConfigured
from django.shortcuts import resolve_url
from django.utils.translation import ug... | cwe | CWE-522 | Python |
delete (position p, position_set *s)
{
int i;
for (i = 0; i < s->nelem; ++i)
if (p.index == s->elems[i].index)
break;
if (i < s->nelem)
for (--s->nelem; i < s->nelem; ++i)
s->elems[i] = s->elems[i + 1];
} | cwe | CWE-189 | Unknown |
"""Generic models which provide extra functionality over base Django model types."""
import logging
import os
import re
from datetime import datetime
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import User
from django.contrib.contenttypes.models impo... | cwe | CWE-79 | Python |
Track::Track(
Segment* pSegment,
long long element_start,
long long element_size) :
m_pSegment(pSegment),
m_element_start(element_start),
m_element_size(element_size),
content_encoding_entries_(NULL),
content_encoding_entries_end_(NULL)
{
} | cwe | CWE-119 | C/C++ |
/*
* Copyright (c) SAS Institute, 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-20 | Go |
/* 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-787 | Python |
@check_document_access_permission()
def edit_workflow(request):
workflow_id = request.GET.get('workflow')
if workflow_id:
wid = {}
if workflow_id.isdigit():
wid['id'] = workflow_id
else:
wid['uuid'] = workflow_id
doc = Document2.objects.get(type='oozie-workflow2', **wid)
workflow ... | cwe | CWE-79 | Python |
ast_for_for_stmt(struct compiling *c, const node *n0, bool is_async)
{
const node * const n = is_async ? CHILD(n0, 1) : n0;
asdl_seq *_target, *seq = NULL, *suite_seq;
expr_ty expression;
expr_ty target, first;
const node *node_target;
int end_lineno, end_col_offset;
/* for_stmt: 'for' exprl... | cwe | CWE-125 | C/C++ |
public DefaultFileSystemResourceLoader() {
this.baseDirPath = Optional.empty();
} | cwe | CWE-22 | Java |
Graph.prototype.createTagsDialog = function(isEnabled, invert, addFn)
{
var graph = this;
var allTags = graph.hiddenTags.slice();
var div = document.createElement('div');
div.style.userSelect = 'none';
div.style.overflow = 'hidden';
div.style.padding = '10px';
div.style.height = '100%';
var tagCl... | cwe | CWE-94 | JavaScript |
// SPDX-License-Identifier: GPL-2.0
/*
* linux/arch/arm/mach-footbridge/personal-pci.c
*
* PCI bios-type initialisation for PCI machines
*
* Bits taken from various places.
*/
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <asm/irq.h>
#include <asm/mach/pci.h>
#include <asm/mac... | cwe | CWE-125 | C/C++ |
public function rules()
{
$ignore = Rule::unique('users')->ignore($this->id ?? 0, 'id');
return [
'email' => [
$ignore,
],
'username' => [
$ignore,
],
];
} | cwe | CWE-190 | PHP |
static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename, zend_bool raw_output_default) /* {{{ */
{
char *algo, *data, *digest, *key, *K;
int algo_len, data_len, key_len;
zend_bool raw_output = raw_output_default;
const php_hash_ops *ops;
void *context;
php_stream *stream = NULL;
if (zend_... | cwe | CWE-20 | Unknown |
suggest_trie_walk(
suginfo_T *su,
langp_T *lp,
char_u *fword,
int soundfold)
{
char_u tword[MAXWLEN]; // good word collected so far
trystate_T stack[MAXWLEN];
char_u preword[MAXWLEN * 3]; // word found with proper case;
// concatenation of prefix compound
// words an... | cwe | CWE-787 | C/C++ |
protected function gdImageBackground($image, $bgcolor){
if( $bgcolor == 'transparent' ){
imagesavealpha($image,true);
$bgcolor1 = imagecolorallocatealpha($image, 255, 255, 255, 127);
}else{
list($r, $g, $b) = sscanf($bgcolor, "#%02x%02x%02x");
$bgcolor1 = imagecolorallocate($image, $r, $g, $b);
}
... | cwe | CWE-89 | JavaScript |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-772 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-835 | C/C++ |
int64_t qcow2_alloc_clusters(BlockDriverState *bs, int64_t size)
{
int64_t offset;
int ret;
BLKDBG_EVENT(bs->file, BLKDBG_CLUSTER_ALLOC);
offset = alloc_clusters_noref(bs, size);
if (offset < 0) {
return offset;
}
ret = update_refcount(bs, offset, size, 1, QCOW2_DISCARD_NEVER);
... | cwe | CWE-190 | Unknown |
mesh_state_create(struct module_env* env, struct query_info* qinfo,
struct respip_client_info* cinfo, uint16_t qflags, int prime,
int valrec)
{
struct regional* region = alloc_reg_obtain(env->alloc);
struct mesh_state* mstate;
int i;
if(!region)
return NULL;
mstate = (struct mesh_state*)regional_alloc(region, ... | cwe | CWE-703 | Unknown |
/*
* Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
*
* Author: zccrs <zccrs@live.com>
*
* Maintainer: zccrs <zhangjide@deepin.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 Foun... | cwe | CWE-59 | C/C++ |
synchronize: function(requisition, errorHandler) {
/**
* @param {object} requisition The requisition object
* @param {string} rescanExisting true to perform a full scan, false to only add/remove nodes without scan, dbonly for all DB operations without scan
*/
var doSynchronize = ... | cwe | CWE-79 | JavaScript |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite/handler/oauth2 (interfaces: AuthorizeCodeStrategy)
// Package internal is a generated GoMock package.
package internal
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
fosite "github.com/ory/fosite"
)
... | cwe | CWE-345 | Go |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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
# (at your option) an... | cwe | CWE-330 | Python |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
auto* params = reinterpret_cast<TfLiteAddParams*>(node->builtin_data);
OpData* data = reinterpret_cast<OpData*>(node->user_data);
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTens... | cwe | CWE-787 | C/C++ |
void *ztrycalloc_usable(size_t size, size_t *usable) {
void *ptr = calloc(1, size+PREFIX_SIZE);
if (ptr == NULL) return NULL;
#ifdef HAVE_MALLOC_SIZE
size = zmalloc_size(ptr);
update_zmalloc_stat_alloc(size);
if (usable) *usable = size;
return ptr;
#else
*((size_t*)ptr) = size;
update_z... | cwe | CWE-190 | Unknown |
/*
* 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-190 | C/C++ |
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appea... | cwe | CWE-787 | C/C++ |
void gdImageJpegCtx (gdImagePtr im, gdIOCtx * outfile, int quality)
{
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr jerr;
int i, j, jidx;
/* volatile so we can gdFree it on return from longjmp */
volatile JSAMPROW row = 0;
JSAMPROW rowptr[1];
jmpbuf_wrapper jmpbufw;
JDIMENSION nlines;
char comment[2... | cwe | CWE-415 | C/C++ |
static void ov511_mode_init_regs(struct sd *sd)
{
struct gspca_dev *gspca_dev = (struct gspca_dev *)sd;
int hsegs, vsegs, packet_size, fps, needed;
int interlaced = 0;
struct usb_host_interface *alt;
struct usb_interface *intf;
intf = usb_ifnum_to_if(sd->gspca_dev.dev, sd->gspca_dev.iface);
alt = usb_altnum_to_... | cwe | CWE-476 | C/C++ |
const matrix = node.getScreenCTM();
if (res && matrix) {
const [x, y, content] = res;
const t = tooltip();
t.style.opacity = "1";
t.innerHTML = content;
t.style.left = `${window.scrollX + x + matrix.e}px`;
t.style.top = `${window.scrollY + y + matrix.f - 15}px`;
} else {
... | cwe | CWE-79 | JavaScript |
"12px";var ka=X.getRealtimeError();X=X.getRealtimeState();var ja=mxResources.get("realtimeCollaboration");1==X?(ea.src=Editor.syncImage,ja+=" ("+mxResources.get("online")+")"):(ea.src=Editor.syncProblemImage,ja=null!=ka&&null!=ka.message?ja+(" ("+ka.message+")"):ja+(" ("+mxResources.get("disconnected")+")"));ea.setAttr... | cwe | CWE-94 | JavaScript |
TfLiteStatus Prepare(KernelType kernel_type, TfLiteContext* context,
TfLiteNode* node) {
auto* params = reinterpret_cast<TfLiteConvParams*>(node->builtin_data);
OpData* data = reinterpret_cast<OpData*>(node->user_data);
bool has_bias = node->inputs->size == 3;
// Check number of inputs/out... | cwe | CWE-125 | C/C++ |
ExtensionsGuestViewMessageFilter::FrameNavigationHelper::FrameNavigationHelper(
RenderFrameHost* plugin_rfh,
int32_t guest_instance_id,
int32_t element_instance_id,
bool is_full_page_plugin,
ExtensionsGuestViewMessageFilter* filter)
: content::WebContentsObserver(
content::WebContents:... | cwe | CWE-362 | C/C++ |
package io.onedev.server.product;
import java.util.EnumSet;
import javax.inject.Inject;
import javax.servlet.DispatcherType;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
import org.apache.shiro.web.env.EnvironmentLoader;
import org.apache.shiro.web.env.EnvironmentLoaderL... | cwe | CWE-74 | Java |
hostkey_method_ssh_dss_sig_verify(LIBSSH2_SESSION * session,
const unsigned char *sig,
size_t sig_len,
const unsigned char *m,
size_t m_len, void **abstract)
{
libssh2_dsa_ctx *dsa... | cwe | CWE-787 | Unknown |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2021
* 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 under the terms of the GNU L... | cwe | CWE-119 | C/C++ |
PHP_FUNCTION(openssl_seal)
{
zval *pubkeys, **pubkey, *sealdata, *ekeys;
HashTable *pubkeysht;
HashPosition pos;
EVP_PKEY **pkeys;
long * key_resources; /* so we know what to cleanup */
int i, len1, len2, *eksl, nkeys;
unsigned char *buf = NULL, **eks;
char * data; int data_len;
char *method =NULL;
int method... | cwe | CWE-754 | C/C++ |
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11,
# andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh,
# falgh1, grunjol, csitk... | cwe | CWE-352 | JavaScript |
static char *get_pid_environ_val(pid_t pid,char *val){
char temp[500];
int i=0;
int foundit=0;
FILE *fp;
sprintf(temp,"/proc/%d/environ",pid);
fp=fopen(temp,"r");
if(fp==NULL)
return NULL;
for(;;){
temp[i]=fgetc(fp);
if(foundit==1 && (temp[i]==0 || temp[i]=='\0' || temp[i]==EOF)){... | cwe | CWE-119 | C/C++ |
spnego_gss_verify_mic_iov(OM_uint32 *minor_status, gss_ctx_id_t context_handle,
gss_qop_t *qop_state, gss_iov_buffer_desc *iov,
int iov_count)
{
return gss_verify_mic_iov(minor_status, context_handle, qop_state, iov,
iov_count);
} | cwe | CWE-763 | C/C++ |
static void handle_page_specs(QPDF& pdf, Options& o)
{
// Parse all page specifications and translate them into lists of
// actual pages.
// Handle "." as a shortcut for the input file
for (std::vector<PageSpec>::iterator iter = o.page_specs.begin();
iter != o.page_specs.end(); ++iter)
{
... | cwe | CWE-787 | Unknown |
static void parseRedirect(HttpRoute *route, cchar *key, MprJson *prop)
{
MprJson *child;
cchar *from, *status, *to;
int ji;
if (prop->type & MPR_JSON_STRING) {
if (smatch(prop->value, "secure") ||smatch(prop->value, "https://")) {
httpAddRouteCondition(route, "secu... | cwe | CWE-476 | C/C++ |
static int do_siocgstamp(struct net *net, struct socket *sock,
unsigned int cmd, void __user *up)
{
mm_segment_t old_fs = get_fs();
struct timeval ktv;
int err;
set_fs(KERNEL_DS);
err = sock_do_ioctl(net, sock, cmd, (unsigned long)&ktv);
set_fs(old_fs);
if (!err)
err = compat_put_timeval(up, &ktv);
... | cwe | CWE-399 | C/C++ |
static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoPtr, char **pszEncoding, char *szValuePtr, int ByteCount)
{
int a;
char *decode;
size_t len;
*pszEncoding = NULL;
/* Copy the comment */
if (ByteCount>=8) {
const zend_encoding *from, *to;
if (!memcmp(szValuePtr, "UNICODE\0", 8... | cwe | CWE-125 | Unknown |
/**
* 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-23 | Java |
bytesPerDeepLineTable (const Header &header,
int minY, int maxY,
const char* base,
int xStride,
int yStride,
vector<size_t> &bytesPerLine)
{
const Box2i &dataWindow = header.dataWindow();
const Cha... | cwe | CWE-190 | C/C++ |
RCoreSymCacheElement *r_coresym_cache_element_new(RBinFile *bf, RBuffer *buf, ut64 off, int bits, char * file_name) {
RCoreSymCacheElement *result = NULL;
ut8 *b = NULL;
RCoreSymCacheElementHdr *hdr = r_coresym_cache_element_header_new (buf, off, bits);
if (!hdr) {
return NULL;
}
if (hdr->version != 1) {
epri... | cwe | CWE-122 | C/C++ |
parse_encoding( T1_Face face,
T1_Loader loader )
{
T1_Parser parser = &loader->parser;
FT_Byte* cur;
FT_Byte* limit = parser->root.limit;
PSAux_Service psaux = (PSAux_Service)face->psaux;
T1_Skip_Spaces( parser );
cur = parser->root.cursor;
if ( cur >= limit... | cwe | CWE-399 | C/C++ |
xmlParserEntityCheck(xmlParserCtxtPtr ctxt, size_t size,
xmlEntityPtr ent)
{
size_t consumed = 0;
if ((ctxt == NULL) || (ctxt->options & XML_PARSE_HUGE))
return (0);
if (ctxt->lastError.code == XML_ERR_ENTITY_LOOP)
return (1);
if (size != 0) {
/*
* ... | cwe | CWE-119 | Unknown |
one_one_mapping(const char *mapping)
{
bool result = TRUE;
if (VALID_STRING(mapping)) {
int n = 0;
while (mapping[n] != '\0') {
if (isLine(mapping[n]) &&
mapping[n] != mapping[n + 1]) {
result = FALSE;
break;
}
n += 2;
}
}
return result;
} | cwe | CWE-125 | Unknown |
/* Copyright 2018 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 |
jas_matrix_t *jas_seq2d_input(FILE *in)
{
jas_matrix_t *matrix;
int i;
int j;
long x;
int numrows;
int numcols;
int xoff;
int yoff;
if (fscanf(in, "%d %d", &xoff, &yoff) != 2)
return 0;
if (fscanf(in, "%d %d", &numcols, &numrows) != 2)
return 0;
if (!(matrix = jas_seq2d_create(xoff, yoff, xoff + numcols... | cwe | CWE-20 | C/C++ |
lys_restr_dup(struct lys_module *mod, struct lys_restr *old, int size, int shallow, struct unres_schema *unres)
{
struct lys_restr *result;
int i;
if (!size) {
return NULL;
}
result = calloc(size, sizeof *result);
LY_CHECK_ERR_RETURN(!result, LOGMEM(mod->ctx), NULL);
for (i = 0; i... | cwe | CWE-476 | Unknown |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-401 | C/C++ |
function addPieChart() {
var width = elem.width();
var height = ctrl.height - getLegendHeight(ctrl.height);
var size = Math.min(width, height);
var plotCanvas = $('<div></div>');
var plotCss = {
margin: 'auto',
position: 'relative',
paddingBottom: 20 + 'px',
height: size + ... | cwe | CWE-79 | JavaScript |
OMX_ERRORTYPE SoftVPXEncoder::internalSetParameter(OMX_INDEXTYPE index,
const OMX_PTR param) {
const int32_t indexFull = index;
switch (indexFull) {
case OMX_IndexParamVideoBitrate:
return internalSetBitrateParams(
(const OMX_VIDEO_PARAM_BITRATETYPE *)param);
... | cwe | CWE-119 | C/C++ |
static ssize_t hid_debug_events_read(struct file *file, char __user *buffer,
size_t count, loff_t *ppos)
{
struct hid_debug_list *list = file->private_data;
int ret = 0, len;
DECLARE_WAITQUEUE(wait, current);
mutex_lock(&list->read_mutex);
while (ret == 0) {
if (list->head == list->tail) {
add_wait_queue(&... | cwe | CWE-835 | C/C++ |
c.style.width="300px";c.style.display="inline-flex";c.style.justifyContent="center";c.style.alignItems="center";c.style.position="absolute";var e=document.createElement("img");e.onload=function(){function B(){k.model.setStyle(v,x+u())}k=new Graph(g);k.autoExtend=!1;k.autoScroll=!1;k.setGridEnabled(!1);k.setEnabled(!0);... | cwe | CWE-20 | JavaScript |
#
# 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 of... | cwe | CWE-264 | Python |
function us(e,t){try{var n="",r=t;do{n+=$(r),r=r.return}while(r);var i=n}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i}} | cwe | CWE-79 | JavaScript |
function Br(e){return B.List.isList(e)?e:I()(e)?Object(B.fromJS)(e):Object(B.List)()} | cwe | CWE-601 | JavaScript |
public static String getPropertyDef(InputSpec inputSpec, Map<String, Integer> indexes,
String pattern, DefaultValueProvider defaultValueProvider) {
int index = indexes.get(inputSpec.getName());
StringBuffer buffer = new StringBuffer();
inputSpec.appendField(buffer, index, "String");
inputSpec.appendCommonAn... | cwe | CWE-74 | Java |
psutil_ppid_map(PyObject *self, PyObject *args) {
PyObject *py_pid = NULL;
PyObject *py_ppid = NULL;
PyObject *py_retdict = PyDict_New();
HANDLE handle = NULL;
PROCESSENTRY32 pe = {0};
pe.dwSize = sizeof(PROCESSENTRY32);
if (py_retdict == NULL)
return NULL;
handle = CreateToolhe... | cwe | CWE-415 | Unknown |
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
{
AVFilterContext *ctx = inlink->dst;
FPSContext *s = ctx->priv;
AVFilterLink *outlink = ctx->outputs[0];
int64_t delta;
int i, ret;
s->frames_in++;
/* discard frames until we get the first timestamp */
if (s->pt... | cwe | CWE-399 | C/C++ |
ngx_http_auth_spnego_handler(
ngx_http_request_t * r)
{
ngx_int_t ret = NGX_DECLINED;
ngx_http_auth_spnego_ctx_t *ctx;
ngx_http_auth_spnego_loc_conf_t *alcf;
alcf = ngx_http_get_module_loc_conf(r, ngx_http_auth_spnego_module);
if (alcf->protect == 0) {
return NGX_DECLINED;
}
... | cwe | CWE-287 | C/C++ |
static long acrn_dev_ioctl(struct file *filp, unsigned int cmd,
unsigned long ioctl_param)
{
struct acrn_vm *vm = filp->private_data;
struct acrn_vm_creation *vm_param;
struct acrn_vcpu_regs *cpu_regs;
struct acrn_ioreq_notify notify;
struct acrn_ptdev_irq *irq_info;
struct acrn_ioeventfd ioeventfd;
struct... | cwe | CWE-401 | C/C++ |
t.toDataURL();if(z.length<g.length){var L=document.createElement("canvas");L.width=I;L.height=O;var C=L.toDataURL();z!==C&&(g=z,y=I,A=O)}}}catch(D){}k(g,y,A)};EditorUi.prototype.extractGraphModelFromPng=function(d){return Editor.extractGraphModelFromPng(d)};EditorUi.prototype.loadImage=function(d,g,k){try{var l=new Ima... | cwe | CWE-20 | JavaScript |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite (interfaces: AuthorizeEndpointHandler)
// Package internal is a generated GoMock package.
package internal
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
fosite "github.com/ory/fosite"
)
// MockAuth... | cwe | CWE-287 | Go |
static int qh_core(int sd, char *buf, unsigned int len)
{
char *space;
if (*buf == 0 || !strcmp(buf, "help")) {
nsock_printf_nul(sd,
"Query handler for manipulating nagios core.\n"
"Available commands:\n"
" loadctl Print information about current load control settings\n"
" loadctl <option... | cwe | CWE-476 | Unknown |
'use strict';
// @ts-check
// ==================================================================================
// internet.js
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
// Copyright: (c) 2014 - ... | cwe | CWE-78 | JavaScript |
static void put_prev_task(struct rq *rq, struct task_struct *prev)
{
if (prev->se.on_rq)
update_rq_clock(rq);
rq->skip_clock_update = 0;
prev->sched_class->put_prev_task(rq, prev);
} | cwe | CWE-835 | Unknown |
/*
* Copyright (C) 2003, 2004, 2005 Joe Walnes.
* Copyright (C) 2006, 2007, 2010, 2011, 2013, 2018 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
* style license a copy of which has been included with this distribution in
* the LICENSE.txt file... | cwe | CWE-502 | Java |
bool ChromeWebUIControllerFactory::HasWebUIScheme(const GURL& url) const {
return url.SchemeIs(chrome::kChromeDevToolsScheme) ||
url.SchemeIs(chrome::kChromeInternalScheme) ||
url.SchemeIs(chrome::kChromeUIScheme);
} | cwe | CWE-264 | C/C++ |
static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
BMPInfo
bmp_info;
Image
*image;
MagickBooleanType
status;
MagickOffsetType
offset,
start_position;
MemoryInfo
*pixel_info;
Quantum
index;
register Quantum
*q;
register ssize_t
i,... | cwe | CWE-787 | C/C++ |
package envoyconfig
import (
"context"
"encoding/base64"
"fmt"
"net"
"net/url"
"strings"
"time"
envoy_config_cluster_v3 "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3"
envoy_config_core_v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
envoy_config_endpoint_v3 "github.com/env... | cwe | CWE-200 | Go |
/* 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-681 | Python |
def images_from_fig
fig_services = YAML.load(fig_yml) || {}
fig_services.map { |name, service_def| image_from_fig_service(name, service_def) }
end | cwe | CWE-502 | Ruby |
/* import-globals-from ../src/jsmime.jsm */
/* globals define, module */
(function(root, fn) {
if (typeof define === "function" && define.amd) {
define(fn);
} else if (typeof module !== "undefined" && module.exports) {
module.exports = fn();
} else {
root.jsmime = fn();
}
})(this, function() {
va... | cwe | CWE-295 | JavaScript |
package goa
import (
"context"
"fmt"
"io"
"log"
"net"
"net/http"
"net/url"
"os"
"path/filepath"
"sort"
"strings"
"sync"
"github.com/dimfeld/httptreemux"
)
type (
// Service is the data structure supporting goa services.
// It provides methods for configuring a service and running it.
// At the basic ... | cwe | CWE-22 | Go |
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/* kdc/do_tgs_req.c - KDC Routines to deal with TGS_REQ's */
/*
* Copyright 1990, 1991, 2001, 2007, 2008, 2009, 2013, 2014 by the
* Massachusetts Institute of Technology. All Rights Reserved.
*
* Export of this software from the United States of Ameri... | cwe | CWE-617 | C/C++ |
void Compute(OpKernelContext* context) override {
const Tensor& input = context->input(0);
const Tensor& filter = context->input(1);
// Determine relevant sizes from input and filters.
int stride_rows = 0, stride_cols = 0;
int rate_rows = 0, rate_cols = 0;
int64 pad_top = 0, pad_left = 0;
i... | cwe | CWE-787 | Unknown |
__acquires(kernel_lock)
{
struct buffer_head *bh;
struct ext4_super_block *es = NULL;
struct ext4_sb_info *sbi;
ext4_fsblk_t block;
ext4_fsblk_t sb_block = get_sb_block(&data);
ext4_fsblk_t logical_sb_block;
unsigned long offset = 0;
unsigned long journal_devnum = 0;
unsigned long def_mount_opts;
struct inode... | cwe | CWE-703 | Unknown |
int jpc_bitstream_putbits(jpc_bitstream_t *bitstream, int n, long v)
{
int m;
/* We can reliably put at most 31 bits since ISO/IEC 9899 only
guarantees that a long can represent values up to 2^31-1. */
assert(n >= 0 && n < 32);
/* Ensure that only the bits to be output are nonzero. */
assert(!(v & (~JAS_ONES(n... | cwe | CWE-703 | Unknown |
jbig2_page_add_result(Jbig2Ctx *ctx, Jbig2Page *page, Jbig2Image *image, int x, int y, Jbig2ComposeOp op)
{
/* ensure image exists first */
if (page->image == NULL) {
jbig2_error(ctx, JBIG2_SEVERITY_WARNING, -1, "page info possibly missing, no image defined");
return 0;
}
/* grow the ... | cwe | CWE-119 | C/C++ |
static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * value_ptr, int value_len, char *offset_base, size_t IFDlength, size_t displacement)
{
size_t i;
int de, section_index = SECTION_MAKERNOTE;
int NumDirEntries, old_motorola_intel;
#ifdef KALLE_0
int offset_diff;
#endif
const maker_note_type ... | cwe | CWE-125 | Unknown |
/* 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-401 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.