code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
void PngImage::readMetadata()
{
#ifdef DEBUG
std::cerr << "Exiv2::PngImage::readMetadata: Reading PNG file " << io_->path() << std::endl;
#endif
if (io_->open() != 0)
{
throw Error(kerDataSourceOpenFailed, io_->path(), strError());
}
IoCloser closer(*io_);
... | cwe | CWE-190 | C/C++ |
static int setup_ttydir_console(const struct lxc_rootfs *rootfs,
const struct lxc_console *console,
char *ttydir)
{
char path[MAXPATHLEN], lxcpath[MAXPATHLEN];
int ret;
/* create rootfs/dev/<ttydir> directory */
ret = snprintf(path, sizeof(path), "%s/dev/%s", rootfs->mount,
ttydir);
if (ret >= si... | cwe | CWE-59 | C/C++ |
DWORD UnprivilegedProcessDelegate::GetExitCode() {
DCHECK(main_task_runner_->BelongsToCurrentThread());
DWORD exit_code = CONTROL_C_EXIT;
if (worker_process_.IsValid()) {
if (!::GetExitCodeProcess(worker_process_, &exit_code)) {
LOG_GETLASTERROR(INFO)
<< "Failed to query the exit code of ... | cwe | CWE-399 | C/C++ |
void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
unsigned long end, unsigned long vmflag)
{
unsigned long addr;
/* do a global flush by default */
unsigned long base_pages_to_flush = TLB_FLUSH_ALL;
preempt_disable();
if (current->active_mm != mm)
goto out;
if (!current->mm) {
leave_mm(... | cwe | CWE-362 | Unknown |
static int http_connect(http_subtransport *t)
{
int error;
char *proxy_url;
if (t->connected &&
http_should_keep_alive(&t->parser) &&
t->parse_finished)
return 0;
if (t->io) {
git_stream_close(t->io);
git_stream_free(t->io);
t->io = NULL;
t->connected = 0;
}
if (t->connection_data.use_ssl) {
er... | cwe | CWE-284 | C/C++ |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
OpData* op_data = reinterpret_cast<OpData*>(node->user_data);
OpContext op_context(context, node);
if (IsConstantTensor(op_context.input) && op_data->float_input_initialized) {
return kTfLiteOk;
}
// Dequantize the input
TfLiteTensor* dequan... | cwe | CWE-125 | C/C++ |
fn load_constant64_full(&mut self, value: u64) -> Reg {
// If the top 32 bits are zero, use 32-bit `mov` operations.
let (num_half_words, size, negated) = if value >> 32 == 0 {
(2, OperandSize::Size32, (!value << 32) >> 32)
} else {
(4, OperandSize::Size64, !value)
... | cwe | CWE-682 | Rust |
/*
* File: ximabmp.cpp
* Purpose: Platform Independent BMP Image Class Loader and Writer
* 07/Aug/2001 Davide Pizzolato - www.xdp.it
* CxImage version 7.0.2 07/Feb/2011
*/
#include "ximabmp.h"
#if CXIMAGE_SUPPORT_BMP
#include "ximaiter.h"
#ifndef min
#define min(a,b) (((a)<(b))?(a):(b))
#endif
#ifndef max
#d... | cwe | CWE-787 | C/C++ |
static int __sys_sendmsg(struct socket *sock, struct msghdr __user *msg,
struct msghdr *msg_sys, unsigned flags,
struct used_address *used_address)
{
struct compat_msghdr __user *msg_compat =
(struct compat_msghdr __user *)msg;
struct sockaddr_storage address;
struct iovec iovstack[UIO_FASTIOV], *iov = ... | cwe | CWE-476 | C/C++ |
static void ExportIndexAlphaQuantum(const Image *image,
QuantumInfo *quantum_info,const MagickSizeType number_pixels,
const PixelPacket *magick_restrict p,
const IndexPacket *magick_restrict indexes,unsigned char *magick_restrict q,
ExceptionInfo *exception)
{
ssize_t
x;
ssize_t
bit;
if (image->... | cwe | CWE-190 | Unknown |
/**
* $Id: mxC4.js,v 1.5 2018/26/11 12:32:06 mate Exp $
* Copyright (c) 2006-2018, JGraph Ltd
*/
//**********************************************************************************************************************************************************
// Person
//***************************************************... | cwe | CWE-79 | Java |
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 part.models import Part
from .models import (Company, ManufacturerPart, ManufacturerPartAttachm... | cwe | CWE-434 | Python |
empe_mp_encrypted_parse (EMailParserExtension *extension,
EMailParser *parser,
CamelMimePart *part,
GString *part_id,
GCancellable *cancellable,
GQueue *out_mail_parts)
{
CamelCipherContext *con... | cwe | CWE-347 | Unknown |
sbd_config_table: function() {
if (!this.get("sbd_config")) {
return "no configuration obtained";
}
var out =
'<table class="darkdatatable"><tr><th>OPTION</th><th>VALUE</th></tr>\n';
var banned_options = ["SBD_OPTS", "SBD_WATCHDOG_DEV", "SBD_PACEMAKER"];
$.each(this.get("sbd_config"), fu... | cwe | CWE-79 | JavaScript |
static void vmsvga_fifo_run(struct vmsvga_state_s *s)
{
uint32_t cmd, colour;
int args, len, maxloop = 1024;
int x, y, dx, dy, width, height;
struct vmsvga_cursor_definition_s cursor;
uint32_t cmd_start;
len = vmsvga_fifo_length(s);
while (len > 0 && --maxloop > 0) {
/* May need to ... | cwe | CWE-129 | C/C++ |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
// Check for supported activation types.
auto* params =
reinterpret_cast<TfLiteFullyConnectedParams*>(node->builtin_data);
const TfLiteTensor* filter = GetInput(context, node, kWeightsTensor);
const TfLiteTensor* input = GetInput(context, no... | cwe | CWE-125 | C/C++ |
function ame_ajax_toggle_showinvisposts( status ) {
jQuery("#ame_toggle_showinvisposts").prop("value", ameAjaxL10n.pleaseWait);
var ame_sack = new sack( ajaxurl );
ame_sack.execute = 1;
ame_sack.method = 'POST';
ame_sack.setVar( "action", "ame_toggle_showinvisposts" );
ame_sack.setVar( "status", status );
ame_sa... | cwe | CWE-352 | JavaScript |
status_t BnGraphicBufferConsumer::onTransact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
switch(code) {
case ACQUIRE_BUFFER: {
CHECK_INTERFACE(IGraphicBufferConsumer, data, reply);
BufferItem item;
int64_t presentWhen = data.readInt64();
uint64_t maxFrameNumber = data.readUint... | cwe | CWE-200 | C/C++ |
package com.salesmanager.shop.admin.controller.merchant;
import com.salesmanager.core.business.services.content.ContentService;
import com.salesmanager.core.business.services.merchant.MerchantStoreService;
import com.salesmanager.core.business.services.reference.language.LanguageService;
import com.salesmanager.core.... | cwe | CWE-639 | Java |
function merge(source, target) {
for (var key in source) {
var value = source[key];
if (typeof value === 'object' && !Array.isArray(value)) {
target[key] = merge(value, target[key] || {});
} else {
target[key] = key in target ? target[key] : value;
}
}
return target;
} | cwe | CWE-915 | JavaScript |
public function display_sdm_other_details_meta_box($post) { //Other details metabox
$file_size = get_post_meta($post->ID, 'sdm_item_file_size', true);
$file_size = isset($file_size) ? $file_size : '';
$version = get_post_meta($post->ID, 'sdm_item_version', true);
$version = isset($version) ? $version : '';
echo ... | cwe | CWE-79 | PHP |
static void copyIPv6IfDifferent(void * dest, const void * src)
{
if(dest != src) {
memcpy(dest, src, sizeof(struct in6_addr));
}
} | cwe | CWE-476 | C/C++ |
TfLiteStatus SigmoidPrepare(TfLiteContext* context, TfLiteNode* node) {
OpData* data = reinterpret_cast<OpData*>(node->user_data);
TF_LITE_ENSURE_EQ(context, NumInputs(node), 1);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input = GetInput(context, node, 0);
TfLiteTensor* output = Ge... | cwe | CWE-125 | C/C++ |
struct clock_source *dcn10_clock_source_create(
struct dc_context *ctx,
struct dc_bios *bios,
enum clock_source_id id,
const struct dce110_clk_src_regs *regs,
bool dp_clk_src)
{
struct dce110_clk_src *clk_src =
kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL);
if (!clk_src)
return NULL;
if (dce112_clk_s... | cwe | CWE-703 | C/C++ |
int gnutls_x509_ext_import_proxy(const gnutls_datum_t * ext, int *pathlen,
char **policyLanguage, char **policy,
size_t * sizeof_policy)
{
ASN1_TYPE c2 = ASN1_TYPE_EMPTY;
int result;
gnutls_datum_t value = { NULL, 0 };
if ((result = asn1_create_element
(_gnutls_get_pkix(), "PKIX1.ProxyCertI... | cwe | CWE-415 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-125 | C/C++ |
function message() {
extend(UserControls, 'userControls', function (items, user) {
if (
app.session.user &&
app.session.user.id() !== user.id() &&
app.forum.attribute('canStartPrivateDiscussion') &&
(user.blocksPd() === false || (app.forum.attribute('canStartPrivateDiscussionWithBlockers')... | cwe | CWE-269 | JavaScript |
def crop_command
target = @attachment.instance
if target.cropping?(@attachment.name)
w = target.send :"#{@attachment.name}_crop_w"
h = target.send :"#{@attachment.name}_crop_h"
x = target.send :"#{@attachment.name}_crop_x"
y = target.send :"#{@attachment.name}_crop_y"
... | cwe | CWE-20 | Ruby |
static int sv_body(int s, int stype, unsigned char *context)
{
char *buf = NULL;
fd_set readfds;
int ret = 1, width;
int k, i;
unsigned long l;
SSL *con = NULL;
BIO *sbio;
struct timeval timeout;
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWAR... | cwe | CWE-399 | Unknown |
def index():
""" Index handler """
send = request.vars.send
if DEMO_MODE:
session.authorized = True
session.last_time = t0
if not send:
send = URL('site')
if session.authorized:
redirect(send)
elif failed_login_count() >= allowed_number_of_attempts:
time.... | cwe | CWE-601 | Python |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 3);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* indices = GetInput(context, node, kIndices);
const TfLiteTensor* updates = GetInput(context, node, kUpdates);
const TfLiteTenso... | cwe | CWE-787 | C/C++ |
function renderScmInstance(instance) {
return '<li class="instance">'
+ '<div title="' + instance.revision + '" class="revision"><span>Revision: </span>' + '<a href="' + instance.locator + '">' + instance.revision + '</a>' + ' </div>'
+ '<div class="usercomment wraptext">' + par... | cwe | CWE-79 | JavaScript |
function escapeArgBash(arg, interpolation, quoted) {
let result = arg.replace(/\0/gu, "");
if (interpolation) {
result = result
.replace(/\\/gu, "\\\\")
.replace(/\n/gu, " ")
.replace(/(^|\s)(~|#)/gu, "$1\\$2")
.replace(/(\*|\?)/gu, "\\$1")
.replace(/([$&;|])/gu, "\\$1")
.re... | cwe | CWE-1333 | JavaScript |
package com.hccake.ballcat.codegen.engine;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import java.util.Map;
/**
* 模板引擎的委托者
*
* @author hccake
*/
public class TemplateEngineDelegator {
public final Map<TemplateEngineTypeEnum, TemplateEngine> templateEngineMap;
public TemplateEngin... | cwe | CWE-20 | Java |
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
+---------... | cwe | CWE-787 | C/C++ |
static void libxsmm_sparse_csr_reader( const char* i_csr_file_in,
unsigned int** o_row_idx,
unsigned int** o_column_idx,
REALTYPE** o_values,
unsigned int* ... | cwe | CWE-119 | Unknown |
static int decompress_i(AVCodecContext *avctx, uint32_t *dst, int linesize)
{
SCPRContext *s = avctx->priv_data;
GetByteContext *gb = &s->gb;
int cx = 0, cx1 = 0, k = 0, clr = 0;
int run, r, g, b, off, y = 0, x = 0, z, ret;
unsigned backstep = linesize - avctx->width;
const int cxshift = s->cxsh... | cwe | CWE-119 | C/C++ |
"""Tornado handlers for the sessions web service."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import json
from tornado import web
from ...base.handlers import IPythonHandler, json_errors
from IPython.utils.jsonutil import date_default
from IPython.html.uti... | cwe | CWE-79 | Python |
xfs_dinode_verify(
struct xfs_mount *mp,
xfs_ino_t ino,
struct xfs_dinode *dip)
{
xfs_failaddr_t fa;
uint16_t mode;
uint16_t flags;
uint64_t flags2;
uint64_t di_size;
if (dip->di_magic != cpu_to_be16(XFS_DINODE_MAGIC))
return __this_address;
/* Verify v3 integrity information first */
if (dip->di_... | cwe | CWE-476 | C/C++ |
static __net_init int setup_net(struct net *net, struct user_namespace *user_ns)
{
/* Must be called with pernet_ops_rwsem held */
const struct pernet_operations *ops, *saved_ops;
int error = 0;
LIST_HEAD(net_exit_list);
refcount_set(&net->count, 1);
refcount_set(&net->passive, 1);
net->dev_base_seq = 1;
... | cwe | CWE-200 | C/C++ |
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { parseDate } = require('@/utils/parse-date');
const { art } = require('@/utils/render');
const path = require('path');
const categories = {
jxrb: '嘉兴日报',
nhwb: '南湖晚报',
};
module.exports = async (ctx) => {
const category = ctx.p... | cwe | CWE-918 | JavaScript |
private function doQueryErrorChecks() {
/**************************/
/* Parameter Error Checks */
/**************************/
$totalCategories = 0;
if ( is_array( $this->parameters->getParameter( 'category' ) ) ) {
foreach ( $this->parameters->getParameter( 'category' ) as $comparisonType => $operatorTyp... | cwe | CWE-400 | PHP |
import queryString from 'query-string';
export const frontendURL = (path, params) => {
const stringifiedParams = params ? `?${queryString.stringify(params)}` : '';
return `/app/${path}${stringifiedParams}`;
};
export const conversationUrl = ({
accountId,
activeInbox,
id,
label,
teamId,
conversationTyp... | cwe | CWE-79 | JavaScript |
import json
from tornado import web, gen
from ..base.handlers import IPythonHandler, json_errors
from ..utils import url_path_join
class TerminalRootHandler(IPythonHandler):
@web.authenticated
@json_errors
def get(self):
tm = self.terminal_manager
terms = [{'name': name} for name in tm.term... | cwe | CWE-79 | Python |
static int legacy_parse_param(struct fs_context *fc, struct fs_parameter *param)
{
struct legacy_fs_context *ctx = fc->fs_private;
unsigned int size = ctx->data_size;
size_t len = 0;
int ret;
ret = vfs_parse_fs_param_source(fc, param);
if (ret != -ENOPARAM)
return ret;
if (ctx->param_type == LEGACY_FS_MONOLI... | cwe | CWE-787 | Unknown |
void AppControllerImpl::GetArcAndroidId(
mojom::AppController::GetArcAndroidIdCallback callback) {
arc::GetAndroidId(base::BindOnce(
[](mojom::AppController::GetArcAndroidIdCallback callback, bool success,
int64_t android_id) {
std::move(callback).Run(success, base::NumberToString(androi... | cwe | CWE-416 | C/C++ |
parse_keyblock_image (iobuf_t iobuf, int pk_no, int uid_no,
const u32 *sigstatus, kbnode_t *r_keyblock)
{
gpg_error_t err;
PACKET *pkt;
kbnode_t keyblock = NULL;
kbnode_t node, *tail;
int in_cert, save_mode;
u32 n_sigs;
int pk_count, uid_count;
*r_keyblock = NULL;
pkt = xtrymal... | cwe | CWE-416 | Unknown |
# Generated by Django 2.2.9 on 2020-01-31 10:22
from django.db import migrations
import markdownx.models
class Migration(migrations.Migration):
dependencies = [
('part', '0025_auto_20191118_2316'),
]
operations = [
migrations.AlterField(
model_name='part',
name='... | cwe | CWE-400 | Python |
xmlStringGetNodeList(const xmlDoc *doc, const xmlChar *value) {
xmlNodePtr ret = NULL, last = NULL;
xmlNodePtr node;
xmlChar *val;
const xmlChar *cur = value;
const xmlChar *q;
xmlEntityPtr ent;
xmlBufPtr buf;
if (value == NULL) return(NULL);
buf = xmlBufCreateSize(0);
if (buf ... | cwe | CWE-20 | C/C++ |
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other 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 License at
*
* http://www.apach... | cwe | CWE-287 | Java |
/*
* Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available... | cwe | CWE-20 | Java |
'use strict'
const bindings = require('bindings')('ced.node')
module.exports = buf => {
return bindings.detectEncoding(buf)
}
| cwe | CWE-755 | C/C++ |
header_put_le_8byte (SF_PRIVATE *psf, sf_count_t x)
{ if (psf->headindex < SIGNED_SIZEOF (psf->header) - 8)
{ psf->header [psf->headindex++] = x ;
psf->header [psf->headindex++] = (x >> 8) ;
psf->header [psf->headindex++] = (x >> 16) ;
psf->header [psf->headindex++] = (x >> 24) ;
psf->header [psf->headindex++]... | cwe | CWE-119 | Unknown |
selaComputeCompositeParameters(const char *fileout)
{
char *str, *nameh1, *nameh2, *namev1, *namev2;
char buf[L_BUF_SIZE];
l_int32 size, size1, size2, len;
SARRAY *sa;
SELA *selabasic, *selacomb;
selabasic = selaAddBasic(NULL);
selacomb = selaAddDwaCombs(NULL);
sa = sarrayCreate(64);
for (... | cwe | CWE-787 | C/C++ |
_PUBLIC_ char *strupper_talloc_n_handle(struct smb_iconv_handle *iconv_handle,
TALLOC_CTX *ctx, const char *src, size_t n)
{
size_t size=0;
char *dest;
if (!src) {
return NULL;
}
/* this takes advantage of the fact that upper/lower can't
change the length of a character by more than 1 byte */
dest = ... | cwe | CWE-200 | Unknown |
static int create_problem_dir(GHashTable *problem_info, unsigned pid)
{
/* Exit if free space is less than 1/4 of MaxCrashReportsSize */
if (g_settings_nMaxCrashReportsSize > 0)
{
if (low_free_space(g_settings_nMaxCrashReportsSize, g_settings_dump_location))
exit(1);
}
/* Create... | cwe | CWE-200 | C/C++ |
def respond_error(self, context, exception):
context.respond_server_error()
stack = traceback.format_exc()
return """
<html>
<body>
<style>
body {
font-family: sans-serif;
color: #888;
... | cwe | CWE-79 | Python |
static void openpic_realize(DeviceState *dev, Error **errp)
{
SysBusDevice *d = SYS_BUS_DEVICE(dev);
OpenPICState *opp = OPENPIC(dev);
int i, j;
int list_count = 0;
static const MemReg list_le[] = {
{"glb", &openpic_glb_ops_le,
OPENPIC_GLB_REG_START, OPENPIC_GLB_REG_SIZE},
... | cwe | CWE-119 | Unknown |
/*
Copyright 2016 Christian Hoene, Symonics GmbH
*/
/* IV.A.1.b. Version 2 Data Object Header Prefix
00000030 4f 48 44 52 02 2d d3 18 2b 53 d3 18 2b 53 d3 18 |OHDR.-..+S..+S..|
00000040 2b 53 d3 18 2b 53 f4 01 02 22 00 00 00 00 |+S..+S..."......|
....
00000230 00 00 00 00 00 00 00 00 00 00 00 00... | cwe | CWE-122 | C/C++ |
static int report_tree(struct dquot *dquot, unsigned int blk, int depth,
char *bitmap,
int (*process_dquot) (struct dquot *, void *),
void *data)
{
int entries = 0, i;
dqbuf_t buf = getdqbuf();
__le32 *ref = (__le32 *) buf;
if (!buf)
return 0;
read_blk(dquot->dq_h, blk, buf);
if (de... | cwe | CWE-787 | Unknown |
#
# The Python Imaging Library
# $Id$
#
# map CSS3-style colour description strings to RGB
#
# History:
# 2002-10-24 fl Added support for CSS-style color strings
# 2002-12-15 fl Added RGBA support
# 2004-03-27 fl Fixed remaining int() problems for Python 1.5.2
# 2004-07-19 fl Fixed gray/grey spelling issues
# 2... | cwe | CWE-125 | Python |
static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
BDRVVPCState *s = bs->opaque;
int i;
VHDFooter *footer;
VHDDynDiskHeader *dyndisk_header;
uint8_t buf[HEADER_SIZE];
uint32_t checksum;
int disk_type = VHD_DYNAMIC;
int ret;
ret =... | cwe | CWE-20 | Unknown |
/*
* Builtin "git clone"
*
* Copyright (c) 2007 Kristian Høgsberg <krh@redhat.com>,
* 2008 Daniel Barkalow <barkalow@iabervon.org>
* Based on git-commit.sh by Junio C Hamano and Linus Torvalds
*
* Clone a repository into a different directory that does not yet exist.
*/
#define USE_THE_INDEX_VARIABLE
#includ... | cwe | CWE-22 | C/C++ |
static MYSQL *db_connect(char *host, char *database,
char *user, char *passwd)
{
MYSQL *mysql;
if (verbose)
fprintf(stdout, "Connecting to %s\n", host ? host : "localhost");
if (opt_use_threads && !lock_tables)
{
pthread_mutex_lock(&init_mutex);
if (!(mysql= mysql_init(NULL)... | cwe | CWE-319 | Unknown |
jbig2_parse_segment_header(Jbig2Ctx *ctx, uint8_t *buf, size_t buf_size, size_t *p_header_size)
{
Jbig2Segment *result;
uint8_t rtscarf;
uint32_t rtscarf_long;
uint32_t *referred_to_segments;
int referred_to_segment_count;
int referred_to_segment_size;
int pa_size;
int offset;
... | cwe | CWE-190 | C/C++ |
def publish(request, category_id=None):
if category_id:
get_object_or_404(
Category.objects.visible(),
pk=category_id)
user = request.user
form = TopicForm(
user=user,
data=post_data(request),
initial={'category': category_id})
cform = CommentForm... | cwe | CWE-601 | Python |
INLINE UWORD8 impeg2d_bit_stream_get_bit(stream_t *ps_stream)
{
UWORD32 u4_bit,u4_offset,u4_temp;
UWORD32 u4_curr_bit;
u4_offset = ps_stream->u4_offset;
u4_curr_bit = u4_offset & 0x1F;
u4_bit = ps_stream->u4_buf;
/* Move the current bit read from... | cwe | CWE-254 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-400 | C/C++ |
cr_tknzr_parse_rgb (CRTknzr * a_this, CRRgb ** a_rgb)
{
enum CRStatus status = CR_OK;
CRInputPos init_pos;
CRNum *num = NULL;
guchar next_bytes[3] = { 0 }, cur_byte = 0;
glong red = 0,
green = 0,
blue = 0,
i = 0;
gboolean is... | cwe | CWE-119 | Unknown |
int asn1_ber_decoder(const struct asn1_decoder *decoder,
void *context,
const unsigned char *data,
size_t datalen)
{
const unsigned char *machine = decoder->machine;
const asn1_action_t *actions = decoder->actions;
size_t machlen = decoder->machlen;
enum asn1_opcode op;
unsigned char tag = 0, ... | cwe | CWE-310 | C/C++ |
function filterTemplates()
{
var searchTerms = tmplSearchInput.value;
if (searchTerms == '')
{
resetTemplates();
return;
}
if (NewDialog.tagsList[templateFile] == null)
{
var tagsList = {};
for (var cat in categories)
{
var templateList = categories[cat];
for (var i = ... | cwe | CWE-94 | JavaScript |
TfLiteStatus PrepareMeanOrSum(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_OK(context, PrepareSimple(context, node));
OpData* data = reinterpret_cast<OpData*>(node->user_data);
// reduce_mean requires a buffer to store intermediate sum result.
OpContext op_context(context, node);
if (op_context... | cwe | CWE-125 | C/C++ |
AuthenticationFeature::AuthenticationFeature(application_features::ApplicationServer& server)
: ApplicationFeature(server, "Authentication"),
_userManager(nullptr),
_authCache(nullptr),
_authenticationUnixSockets(true),
_authenticationSystemOnly(true),
_localAuthentication(true),
... | cwe | CWE-613 | C/C++ |
uploads.upload = async function (socket, data) {
const methodToFunc = {
'user.uploadCroppedPicture': socketUser.uploadCroppedPicture,
'user.updateCover': socketUser.updateCover,
'groups.cover.update': socketGroup.cover.update,
};
if (!socket.uid || !data || !data.chunk || !data.params || !data.params.method ||... | cwe | CWE-79 | JavaScript |
autoLogin: shouldAutoLogin(m)
};
const isCaptchaValid = setCaptchaParams(m, params, fields);
if (!isCaptchaValid) {
return showMissingCaptcha(m, id);
}
if (databaseConnectionRequiresUsername(m)) {
if (signUpHideUsernameField(m)) {
const usernameValidation = databaseConnection(m... | cwe | CWE-79 | JavaScript |
do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
{
unsigned char arg[128];
int ret = 0;
unsigned int copylen;
struct net *net = sock_net(sk);
struct netns_ipvs *ipvs = net_ipvs(net);
BUG_ON(!net);
if (!capable(CAP_NET_ADMIN))
return -EPERM;
if (cmd < IP_VS_BASE_CTL || cmd > IP_VS_SO_G... | cwe | CWE-200 | C/C++ |
/* global _managed_objects: true */
/*****************************************************************************
*
* Copyright (C) Zenoss, Inc. 2014, all rights reserved.
*
* This content is made available according to terms specified in
* License.zenoss under the directory where your Zenoss product is installed... | cwe | CWE-79 | JavaScript |
void put_busid_priv(struct bus_id_priv *bid)
{
spin_unlock(&bid->busid_lock);
} | cwe | CWE-362 | C/C++ |
issuerAndThisUpdateCheck(
struct berval *in,
struct berval *is,
struct berval *tu,
void *ctx )
{
int numdquotes = 0;
struct berval x = *in;
struct berval ni = BER_BVNULL;
/* Parse GSER format */
enum {
HAVE_NONE = 0x0,
HAVE_ISSUER = 0x1,
HAVE_THISUPDATE = 0x2,
HAVE_ALL = ( HAVE_ISSUER | HAVE_THISUPDAT... | cwe | CWE-617 | C/C++ |
v*x.width+A),x.y+x.height-p)},function(x,p){var v=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",ja.prototype.position)));this.state.style.base=Math.round(Math.max(0,Math.min(x.width,p.x-x.x-v*x.width)))},!1)];mxUtils.getValue(c.style,mxConstants.STYLE_ROUNDED,!1)&&l.push(kb(c));return l},internalSt... | cwe | CWE-20 | JavaScript |
STATIC void GC_envfile_init(void)
{
# if defined(MSWIN32) || defined(MSWINCE) || defined(CYGWIN32)
HANDLE hFile;
char *content;
unsigned ofs;
unsigned len;
DWORD nBytesRead;
TCHAR path[_MAX_PATH + 0x10]; /* buffer for path + ext */
len = (unsigned)GetModuleFileName(NULL /* ... | cwe | CWE-119 | Unknown |
int inet6_csk_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl_unused)
{
struct ipv6_pinfo *np = inet6_sk(sk);
struct flowi6 fl6;
struct dst_entry *dst;
int res;
dst = inet6_csk_route_socket(sk, &fl6);
if (IS_ERR(dst)) {
sk->sk_err_soft = -PTR_ERR(dst);
sk->sk_route_caps = 0;
kfree_skb(skb);
r... | cwe | CWE-416 | Unknown |
static void h2_process_demux(struct h2c *h2c)
{
struct h2s *h2s;
if (h2c->st0 >= H2_CS_ERROR)
return;
if (unlikely(h2c->st0 < H2_CS_FRAME_H)) {
if (h2c->st0 == H2_CS_PREFACE) {
if (unlikely(h2c_frt_recv_preface(h2c) <= 0)) {
/* RFC7540#3.5: a GOAWAY frame MAY be omitted */
if (h2c->st0 == H2_CS_ERRO... | cwe | CWE-119 | Unknown |
$variable[$key] = self::filter($val);
}
} else {
// Prevent XSS abuse
$variable = preg_replace_callback('#</?([a-z]+)(\s.*)?/?>#i', function($matches) {
$tag = strtolower($matches[1]);
// Allowed tags
if (in_array($tag, array(
'b', 'strong', 'small', 'i', 'em', 'u', 's', 'sub', 'sup', 'a', ... | cwe | CWE-79 | PHP |
do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
{
unsigned char arg[128];
int ret = 0;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
if (*len < get_arglen[GET_CMDID(cmd)]) {
pr_err("get_ctl: len %u < %u\n",
*len, get_arglen[GET_CMDID(cmd)]);
return -EINVAL;
}
i... | cwe | CWE-119 | C/C++ |
static void esp_do_dma(ESPState *s)
{
uint32_t len;
int to_device;
len = s->dma_left;
if (s->do_cmd) {
trace_esp_do_dma(s->cmdlen, len);
s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], len);
return;
}
return;
} | cwe | CWE-787 | Unknown |
static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb,
struct scsi_cmnd *cmd)
{
char *buffer;
unsigned short use_sg;
int retvalue = 0, transfer_len = 0;
unsigned long flags;
struct CMD_MESSAGE_FIELD *pcmdmessagefld;
uint32_t controlcode = (uint32_t)cmd->cmnd[5] << 24 |
(uint32_t)cmd->cmnd[6] << 1... | cwe | CWE-119 | C/C++ |
PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
{
zval **ppid;
zval **data;
char *p, *value;
int nrand;
int lensess;
if (PS(use_only_cookies)) {
PS(apply_trans_sid) = 0;
} else {
PS(apply_trans_sid) = PS(use_trans_sid);
}
switch (PS(session_status)) {
case php_session_active:
php_error(E_NOTICE, "... | cwe | CWE-264 | Unknown |
static int fts3DoAutoincrmerge(
Fts3Table *p, /* FTS3 table handle */
const char *zParam /* Nul-terminated string containing boolean */
){
int rc = SQLITE_OK;
sqlite3_stmt *pStmt = 0;
p->nAutoincrmerge = fts3Getint(&zParam);
if( p->nAutoincrmerge==1 || p->nAutoincrmerge>FTS3_M... | cwe | CWE-787 | Unknown |
static inline int init_new_context(struct task_struct *tsk,
struct mm_struct *mm)
{
cpumask_clear(&mm->context.cpu_attach_mask);
atomic_set(&mm->context.attach_count, 0);
mm->context.flush_mm = 0;
mm->context.asce_bits = _ASCE_TABLE_LENGTH | _ASCE_USER_BITS;
mm->context.asce_bits |= _ASCE_TYPE_REGION3;
#ifd... | cwe | CWE-20 | C/C++ |
void qemu_input_event_send_key_delay(uint32_t delay_ms)
{
if (!kbd_timer) {
kbd_timer = timer_new_ms(QEMU_CLOCK_VIRTUAL, qemu_input_queue_process,
&kbd_queue);
}
qemu_input_queue_delay(&kbd_queue, kbd_timer,
delay_ms ? delay_ms : kbd_defaul... | cwe | CWE-772 | Unknown |
dname_pkt_hash(sldns_buffer* pkt, uint8_t* dname, hashvalue_type h)
{
uint8_t labuf[LDNS_MAX_LABELLEN+1];
uint8_t lablen;
int i;
/* preserve case of query, make hash label by label */
lablen = *dname++;
while(lablen) {
if(LABEL_IS_PTR(lablen)) {
/* follow pointer */
dname = sldns_buffer_at(pkt, PTR_OFFSE... | cwe | CWE-400 | Unknown |
/*
* 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-22 | Go |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-119 | C/C++ |
/*
* 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 n... | cwe | CWE-613 | Java |
/*
* Copyright © 2001-2011 Stéphane Raimbault <stephane.raimbault@gmail.com>
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*
* This library implements the Modbus protocol.
* http://libmodbus.org/
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <errno.h>
#include <limi... | cwe | CWE-787 | C/C++ |
enhanced_recursion(
const char *p,
TBOOLEAN brace,
char *fontname,
double fontsize,
double base,
TBOOLEAN widthflag,
TBOOLEAN showflag,
int overprint)
{
TBOOLEAN wasitalic, wasbold;
/* Keep track of the style of the font passed in at this recursion level */
wasitalic = (strs... | cwe | CWE-787 | Unknown |
/*
* libvirt-domain.c: entry points for virDomainPtr APIs
*
* Copyright (C) 2006-2015 Red Hat, Inc.
*
* 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 Software Foundation; either
* version 2.1 of the L... | cwe | CWE-862 | C/C++ |
/*
* mus_wm.c -- Midi Wavetable Processing library
*
* Copyright (C) WildMIDI Developers 2001-2016
*
* This file is part of WildMIDI.
*
* WildMIDI is free software: you can redistribute and/or modify the player
* under the terms of the GNU General Public License and you can redistribute
* and/or modify the lib... | cwe | CWE-125 | C/C++ |
import json
import logging
import pexpect
import pwd
import subprocess
import syslog
from jadi import component, service, interface
import aj
from aj.api.http import BaseHttpHandler
from aj.security.verifier import ClientCertificateVerificator
from aj.util import public
@public
class SudoError(Exception):
def __... | cwe | CWE-78 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.