code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define SkipLinesOp 0x01
#define SetColorOp 0x02
#define SkipPixelsOp 0x03
#define ByteDataOp 0x05
#define RunDataOp 0x06
#define EOFOp 0x07
char
magick[12];
Image
*image;
IndexPacket
index;
int
opcode,
... | cwe | CWE-119 | Unknown |
parse_toshiba_packet(FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf,
int *err, gchar **err_info)
{
union wtap_pseudo_header *pseudo_header = &phdr->pseudo_header;
char line[TOSHIBA_LINE_LENGTH];
int num_items_scanned;
guint pkt_len;
int pktnum, hr, min, sec, csec;
char channel[10], direction[10];
int ... | cwe | CWE-20 | C/C++ |
int CephxSessionHandler::_calc_signature(Message *m, uint64_t *psig)
{
const ceph_msg_header& header = m->get_header();
const ceph_msg_footer& footer = m->get_footer();
// optimized signature calculation
// - avoid temporary allocated buffers from encode_encrypt[_enc_bl]
// - skip the leading 4 byte wrapper ... | cwe | CWE-287 | C/C++ |
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, mobconf = require('./routes/mobileconfig')
, http = require('http')
, path = require('path');
var cookieParser = require('cookie-parser')
var app = express();
// all environments
app.set('port', process.env.... | cwe | CWE-74 | JavaScript |
xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr tree,
int skipRoot) {
xmlNodePtr cur;
int ret = 0;
int i, start;
if ((doc == NULL) || (tree == NULL) || (tree->type == XML_NAMESPACE_DECL))
return(-1);
if ((skipRoot) && (tree->children == NULL))
r... | cwe | CWE-416 | Unknown |
TfLiteStatus PopulateQuantizedLstmParams8x8_8(
TfLiteContext* context, TfLiteNode* node,
lstm_eval::IntegerLstmParameter* integer_lstm_param) {
// Get all tensors.
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
const TfLiteTensor* input_to_input_weights =
GetOptionalInputTensor(c... | cwe | CWE-125 | Unknown |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-399 | C/C++ |
WandPrivate MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand,
const char *option,const char *arg1n,const char *arg2n)
{
const char /* percent escaped versions of the args */
*arg1,
*arg2;
Image
*new_images;
MagickStatusType
status;
ssize_t
parse;
#define _image_info (... | cwe | CWE-401 | Unknown |
open_cmdwin(void)
{
bufref_T old_curbuf;
win_T *old_curwin = curwin;
bufref_T bufref;
win_T *wp;
int i;
linenr_T lnum;
int histtype;
garray_T winsizes;
int save_restart_edit = restart_edit;
int save_State = State;
int save_exmode = exmode_active;
#ifdef FEAT_R... | cwe | CWE-122 | Unknown |
static int neigh_fill_info(struct sk_buff *skb, struct neighbour *n,
u32 pid, u32 seq, int event, unsigned int flags)
{
unsigned long now = jiffies;
unsigned char *b = skb->tail;
struct nda_cacheinfo ci;
int locked = 0;
u32 probes;
struct nlmsghdr *nlh = NLMSG_NEW(skb, pid, seq, event,
sizeof(struct n... | cwe | CWE-200 | Unknown |
inline static bool jas_safe_size_add(size_t x, size_t y, size_t *result)
{
if (y > SIZE_MAX - x) {
*result = 0;
return false;
}
*result = x + y;
return true;
} | cwe | CWE-119 | Unknown |
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-787 | C/C++ |
static int kvm_s390_get_cmma(struct kvm *kvm, struct kvm_s390_cmma_log *args,
u8 *res, unsigned long bufsize)
{
unsigned long mem_end, cur_gfn, next_gfn, hva, pgstev;
struct kvm_memslots *slots = kvm_memslots(kvm);
struct kvm_memory_slot *ms;
cur_gfn = kvm_s390_next_dirty_cmma(slots, args->start_gfn);
ms ... | cwe | CWE-416 | C/C++ |
package tar
import (
"archive/tar"
"fmt"
"io"
"os"
gopath "path"
fp "path/filepath"
"strings"
)
type Extractor struct {
Path string
Progress func(int64) int64
// SanitizePathFunc can be provided if you wish to inspect and/or modify the source path
// returning an error from this function will abort ex... | cwe | CWE-22 | Go |
def authorize_and_redirect(request):
if not request.GET.get("redirect"):
return HttpResponse("You need to pass a url to ?redirect=", status=401)
if not request.META.get("HTTP_REFERER"):
return HttpResponse('You need to make a request that includes the "Referer" header.', status=400)
referer... | cwe | CWE-601 | Python |
package com.salesmanager.shop.admin.model.orders;
import com.salesmanager.core.model.common.Billing;
import com.salesmanager.core.model.common.Delivery;
import com.salesmanager.core.model.order.orderstatus.OrderStatus;
import javax.persistence.Embedded;
import java.io.Serializable;
import java.util.Arrays;
import jav... | cwe | CWE-639 | Java |
const BlockEntry* Cluster::GetEntry(const Track* pTrack,
long long time_ns) const {
assert(pTrack);
if (m_pSegment == NULL) // this is the special EOS cluster
return pTrack->GetEOS();
#if 0
LoadBlockEntries();
if ((m_entries == NULL) || (m_entries_count <= 0))
return NULL; //return EOS ... | cwe | CWE-20 | C/C++ |
#
# common calls to get product and entitlemnt info for gui/tui
#
# Copyright (c) 2010 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 FITNES... | cwe | CWE-264 | Python |
@computed("destinationChannelId")
get disableMoveButton() {
return isBlank(this.destinationChannelId);
} | cwe | CWE-79 | JavaScript |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-369 | C/C++ |
asn1_get_integer(
unsigned char **buffer, /* IO - Pointer in buffer */
unsigned char *bufend, /* I - End of buffer */
unsigned length) /* I - Length of value */
{
int value; /* Integer value */
if (length > sizeof(int))
{
(*buffer) += length;
return (0);
}
for (value = (**b... | cwe | CWE-120 | Unknown |
dot24_print_page (gx_device_printer *pdev, gp_file *prn_stream, char *init_string, int init_len)
{
int xres = (int)pdev->x_pixels_per_inch;
int yres = (int)pdev->y_pixels_per_inch;
int x_high = (xres == 360);
int y_high = (yres == 360);
int bits_per_column = (y_high ? 48 : 24);
uint line_size = gdev_prn_ras... | cwe | CWE-369 | C/C++ |
/** \ingroup header
* \file lib/header.c
*/
/* RPM - Copyright (C) 1995-2002 Red Hat Software */
/* Data written to file descriptors is in network byte order. */
/* Data read from file descriptors is expected to be in */
/* network byte order and is converted on the fly to host order. */
#include "syst... | cwe | CWE-125 | C/C++ |
/*
zip_dirent.c -- read directory entry (local or central), clean dirent
Copyright (C) 1999-2016 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP archives.
The authors can be contacted at <libzip@nih.at>
Redistribution and use in source and binary forms, with or with... | cwe | CWE-416 | C/C++ |
#include <linux/kernel.h>
#include <linux/skbuff.h>
#include <linux/export.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/if_vlan.h>
#include <net/ip.h>
#include <net/ipv6.h>
#include <linux/igmp.h>
#include <linux/icmp.h>
#include <linux/sctp.h>
#include <linux/dccp.h>
#include <linux/if_tunnel.h>
#i... | cwe | CWE-20 | C/C++ |
hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval)
{
unsigned long orun = 1;
ktime_t delta;
delta = ktime_sub(now, timer->expires);
if (delta.tv64 < 0)
return 0;
if (interval.tv64 < timer->base->resolution.tv64)
interval.tv64 = timer->base->resolution.tv64;
if (unlikely(delta.tv64 >= in... | cwe | CWE-189 | Unknown |
// © 2017 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html#License
package com.ibm.icu.impl.number;
import java.math.BigDecimal;
import java.math.BigInteger;
/**
* A DecimalQuantity with internal storage as a 64-bit BCD, with fallback to a byte array for numbers
... | cwe | CWE-190 | Java |
TfLiteStatus EvalFloat(TfLiteContext* context, TfLiteNode* node,
TfLiteFullyConnectedParams* params, OpData* data,
const TfLiteTensor* input, const TfLiteTensor* filter,
const TfLiteTensor* bias, TfLiteTensor* output) {
float output_activation_min, ... | cwe | CWE-787 | C/C++ |
public Response attachTaskFile(@PathParam("courseId") Long courseId, @PathParam("nodeId") String nodeId,
@Context HttpServletRequest request) {
ICourse course = CoursesWebService.loadCourse(courseId);
CourseEditorTreeNode parentNode = getParentNode(course, nodeId);
if(course == null) {
return Response.serv... | cwe | CWE-23 | Java |
TfLiteStatus CheckInputTensorDimensions(TfLiteContext* context,
TfLiteNode* node, int n_input,
int n_output, int n_cell,
bool use_layer_norm, bool is_integer) {
const auto* params = static_cast<TfLi... | cwe | CWE-125 | C/C++ |
/* $Id$ */
/*
* 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; eith... | cwe | CWE-787 | C/C++ |
inline typename V::VectorType FBUnserializer<V>::unserializeList() {
p_ += CODE_SIZE;
// the list size is written so we can reserve it in the vector
// in future. Skip past it for now.
unserializeInt64();
typename V::VectorType ret = V::createVector();
size_t code = nextCode();
while (code != FB_SERIAL... | cwe | CWE-674 | C/C++ |
/* Copyright 2020 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-119 | C/C++ |
bool DL_Dxf::handleLWPolylineData(DL_CreationInterface* /*creationInterface*/) {
// Allocate LWPolyline vertices (group code 90):
if (groupCode==90) {
maxVertices = toInt(groupValue);
if (maxVertices>0) {
if (vertices!=NULL) {
delete[] vertices;
}
... | cwe | CWE-191 | C/C++ |
static void nlmclnt_unlock_callback(struct rpc_task *task, void *data)
{
struct nlm_rqst *req = data;
u32 status = ntohl(req->a_res.status);
if (RPC_ASSASSINATED(task))
goto die;
if (task->tk_status < 0) {
dprintk("lockd: unlock failed (err = %d)\n", -task->tk_status);
goto retry_rebind;
}
if (status == N... | cwe | CWE-399 | Unknown |
void bpf_int_jit_compile(struct bpf_prog *prog)
{
struct bpf_binary_header *header = NULL;
int proglen, oldproglen = 0;
struct jit_context ctx = {};
u8 *image = NULL;
int *addrs;
int pass;
int i;
if (!bpf_jit_enable)
return;
if (!prog || !prog->len)
return;
addrs = kmalloc(prog->len * sizeof(*addrs), G... | cwe | CWE-17 | C/C++ |
static bool set_sockaddr(sockaddr_storage &sa_storage, req::ptr<Socket> sock,
const String& addr, int port,
struct sockaddr *&sa_ptr, size_t &sa_size) {
// Always zero it out:
// - fields are added over time; zeroing it out is future-proofing; for
// example, so... | cwe | CWE-787 | C/C++ |
atmarp_print(netdissect_options *ndo,
const u_char *bp, u_int length, u_int caplen)
{
const struct atmarp_pkthdr *ap;
u_short pro, hrd, op;
ap = (const struct atmarp_pkthdr *)bp;
ND_TCHECK(*ap);
hrd = ATMHRD(ap);
pro = ATMPRO(ap);
op = ATMOP(ap);
if (!ND_TTEST2(*aar_tpa(ap), ATMTPROTO_LEN(ap))) {
ND_... | cwe | CWE-787 | Unknown |
static inline Quantum ClampToQuantum(const MagickRealType value)
{
#if defined(MAGICKCORE_HDRI_SUPPORT)
return((Quantum) value);
#else
if (value <= 0.0f)
return((Quantum) 0);
if (value >= (MagickRealType) QuantumRange)
return(QuantumRange);
return((Quantum) (value+0.5f));
#endif
} | cwe | CWE-190 | Unknown |
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this fi... | cwe | CWE-674 | Java |
static int ldb_kv_add_internal(struct ldb_module *module,
struct ldb_kv_private *ldb_kv,
const struct ldb_message *msg,
bool check_single_value)
{
struct ldb_context *ldb = ldb_module_get_ctx(module);
int ret = LDB_SUCCESS;
unsigned int i;
for (i=0;i<msg->num_elements;i++) {
struct ... | cwe | CWE-20 | Unknown |
# -*- coding: utf-8 -*-
# rdiffweb, A web interface to rdiff-backup repositories
# Copyright (C) 2012-2021 rdiffweb contributors
#
# 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-521 | Python |
int tls1_process_ticket(SSL *s, unsigned char *session_id, int len,
const unsigned char *limit, SSL_SESSION **ret)
{
/* Point after session ID in client hello */
const unsigned char *p = session_id + len;
unsigned short i;
*ret = NULL;
s->tlsext_ticket_expected = 0;
/*
... | cwe | CWE-190 | Unknown |
static int connect_to_db(char *host, char *user,char *passwd)
{
char buff[20+FN_REFLEN];
DBUG_ENTER("connect_to_db");
verbose_msg("-- Connecting to %s...\n", host ? host : "localhost");
mysql_init(&mysql_connection);
if (opt_compress)
mysql_options(&mysql_connection,MYSQL_OPT_COMPRESS,NullS);
#ifdef HAVE... | cwe | CWE-319 | Unknown |
/* 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-369 | C/C++ |
ffi_prep_closure_loc (ffi_closure *closure,
ffi_cif* cif,
void (*fun)(ffi_cif*,void*,void**,void*),
void *user_data,
void *codeloc)
{
if (cif->abi != FFI_SYSV)
return FFI_BAD_ABI;
void (*start)(void);
if (cif->flags & ... | cwe | CWE-787 | C/C++ |
/*
* 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-125 | C/C++ |
int i915_gem_context_open(struct drm_i915_private *i915,
struct drm_file *file)
{
struct drm_i915_file_private *file_priv = file->driver_priv;
struct i915_gem_context *ctx;
int err;
idr_init(&file_priv->context_idr);
mutex_lock(&i915->drm.struct_mutex);
ctx = i915_gem_create_context(i915);
if (IS_ERR(ctx... | cwe | CWE-416 | Unknown |
bool NormalPageArena::coalesce() {
if (m_promptlyFreedSize < 1024 * 1024)
return false;
if (getThreadState()->sweepForbidden())
return false;
ASSERT(!hasCurrentAllocationArea());
TRACE_EVENT0("blink_gc", "BaseArena::coalesce");
m_freeList.clear();
size_t freedSize = 0;
for (NormalPage* page = s... | cwe | CWE-787 | C/C++ |
OMX_ERRORTYPE omx_vdec::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
OMX_IN OMX_INDEXTYPE paramIndex,
OMX_INOUT OMX_PTR paramData)
{
(void) hComp;
OMX_ERRORTYPE eRet = OMX_ErrorNone;
DEBUG_PRINT_LOW("get_parameter:");
if (m_state == OMX_StateInvalid) {
DEBUG_PRINT_ERROR("Get Pa... | cwe | CWE-20 | C/C++ |
send_parameters(struct iperf_test *test)
{
int r = 0;
cJSON *j;
j = cJSON_CreateObject();
if (j == NULL) {
i_errno = IESENDPARAMS;
r = -1;
} else {
if (test->protocol->id == Ptcp)
cJSON_AddTrueToObject(j, "tcp");
else if (test->protocol->id == Pudp)
cJSON_AddTrueToObject(j, "udp");
c... | cwe | CWE-120 | C/C++ |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-354 | C/C++ |
MONGO_EXPORT bson_type bson_iterator_next( bson_iterator *i ) {
int ds;
if ( i->first ) {
i->first = 0;
return ( bson_type )( *i->cur );
}
switch ( bson_iterator_type( i ) ) {
case BSON_EOO:
return BSON_EOO; /* don't advance */
case BSON_UNDEFINED:
case BSON_NULL:
... | cwe | CWE-190 | Unknown |
func ParseRouteDistinguisher(rd string) (RouteDistinguisherInterface, error) {
elems, err := parseRdAndRt(rd)
if err != nil {
return nil, err
}
assigned, _ := strconv.Atoi(elems[10])
ip := net.ParseIP(elems[1])
switch {
case ip.To4() != nil:
return NewRouteDistinguisherIPAddressAS(elems[1], uint16(assigned))... | cwe | CWE-681 | Go |
void color_esycc_to_rgb(opj_image_t *image)
{
int y, cb, cr, sign1, sign2, val;
unsigned int w, h, max, i;
int flip_value = (1 << (image->comps[0].prec-1));
int max_value = (1 << image->comps[0].prec) - 1;
if(image->numcomps < 3) return;
w = image->comps[0].w;
h = image->comps[0].h;
sign1 = (int)image->co... | cwe | CWE-119 | C/C++ |
virtual void ComputeWithReservedSpace(OpKernelContext* context,
bool use_reserved_space) {
Tensor x = context->input(0);
const Tensor& scale = context->input(1);
const Tensor& offset = context->input(2);
const Tensor& estimated_mean = context->input(3);
const ... | cwe | CWE-476 | 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-200 | Java |
QPDF::checkHPageOffset(std::list<std::string>& errors,
std::list<std::string>& warnings,
std::vector<QPDFObjectHandle> const& pages,
std::map<int, int>& shared_idx_to_obj)
{
// Implementation note 126 says Acrobat always sets
// delta_content_offset and delta_content_length in the pag... | cwe | CWE-787 | Unknown |
function jsonMarkup(doc, styleFile) {
var indent = '';
var style = Stylize(styleFile);
var forEach = function (list, start, end, fn) {
if (!list.length) return start + ' ' + end;
var out = start + '\n';
indent += INDENT;
list.forEach(function (key, i) {
out += indent + fn(key) + (i < list... | cwe | CWE-79 | JavaScript |
/**
* 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 |
// SPDX-License-Identifier: BSD-2-Clause
/*
* Copyright (c) 2015-2016, Linaro Limited
* Copyright (c) 2014, STMicroelectronics International N.V.
*/
#include <assert.h>
#include <bench.h>
#include <compiler.h>
#include <initcall.h>
#include <io.h>
#include <kernel/linker.h>
#include <kernel/msg_param.h>
#include <k... | cwe | CWE-787 | C/C++ |
checkprobe() {
let that = this;
let win = that.createWin({
title: LANG['probedb']['title'],
width: 350,
height: 400,
});
const func_mapping = {
// PHP
'mysql_close': 'MYSQL',
'mysqli_close': 'MYSQLI',
'mssql_close': 'MSSQL',
'sqlsrv_close': 'SQLSRV',
... | cwe | CWE-79 | JavaScript |
/*
* Copyright (c) 2004-2021, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
* list of cond... | cwe | CWE-918 | Java |
check_entry_size_and_hooks(struct ip6t_entry *e,
struct xt_table_info *newinfo,
const unsigned char *base,
const unsigned char *limit,
const unsigned int *hook_entries,
const unsigned int *underflows,
unsigned int valid_hooks)
{
unsigned int h;
int err;
if ((unsigned long)e % __a... | cwe | CWE-119 | C/C++ |
pq_getmessage(StringInfo s, int maxlen)
{
int32 len;
resetStringInfo(s);
/* Read message length word */
if (pq_getbytes((char *) &len, 4) == EOF)
{
ereport(COMMERROR,
(errcode(ERRCODE_PROTOCOL_VIOLATION),
errmsg("unexpected EOF within message length word")));
return EOF;
}
len = ntohl(len);
if... | cwe | CWE-89 | Unknown |
static int src_parser_trans_stage_1_2_3(const int tmp_fd, const char *src, const struct trans_config cfg)
{
struct parser_buf pbuf = {
.f_indx = 0,
.tmp_indx = 0,
.f_read_size = 0
};
int write_count = 0;
int src_fd;
int p_state = P_STATE_CODE;
src_fd = open(src, O_RDONL... | cwe | CWE-120 | Unknown |
static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
{
struct nlattr *attrs[CRYPTOCFGA_MAX+1];
const struct crypto_link *link;
int type, err;
type = nlh->nlmsg_type;
if (type > CRYPTO_MSG_MAX)
return -EINVAL;
type -= CRYPTO_MSG_BASE;
link = &crypto_dispatch[type];
if (!capable(CAP_NET_... | cwe | CWE-264 | Unknown |
static int read_tfra(MOVContext *mov, AVIOContext *f)
{
MOVFragmentIndex* index = NULL;
int version, fieldlength, i, j;
int64_t pos = avio_tell(f);
uint32_t size = avio_rb32(f);
void *tmp;
if (avio_rb32(f) != MKBETAG('t', 'f', 'r', 'a')) {
return 1;
}
av_log(mov->fc, AV_LOG_VERB... | cwe | CWE-834 | C/C++ |
function renderDeletedPipeline(node) {
var gui = '';
gui += '<h3 title="' + node.name + '" class="deleted">' + node.name + '</h3>';
if (node.message) {
gui += '<div class="message deleted"><span>' + node.message + '</span></div>';
}
gui += '<div class="actions deleted... | cwe | CWE-79 | JavaScript |
static MagickBooleanType load_level(Image *image,XCFDocInfo *inDocInfo,
XCFLayerInfo *inLayerInfo,ExceptionInfo *exception)
{
int
destLeft = 0,
destTop = 0;
Image*
tile_image;
MagickBooleanType
status;
MagickOffsetType
saved_pos,
offset,
offset2;
register ssize_t
i;
si... | cwe | CWE-770 | C/C++ |
##############################################################################
#
# Copyright (c) 2007 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | cwe | CWE-1321 | Python |
static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd, u16 cmd_len, u8 *data)
{
struct l2cap_conf_req *req = (struct l2cap_conf_req *) data;
u16 dcid, flags;
u8 rsp[64];
struct sock *sk;
int len;
dcid = __le16_to_cpu(req->dcid);
flags = __le16_to_cpu(req->flags);
BT_DBG("dcid ... | cwe | CWE-200 | Unknown |
'use strict';
const Stream = require('stream').Stream;
const fetch = require('../fetch');
const crypto = require('crypto');
const shared = require('../shared');
/**
* XOAUTH2 access_token generator for Gmail.
* Create client ID for web applications in Google API console to use it.
* See Offline Access for receivin... | cwe | CWE-74 | Java |
struct json_object* json_tokener_parse_ex(struct json_tokener *tok,
const char *str, int len)
{
struct json_object *obj = NULL;
char c = '\1';
#ifdef HAVE_SETLOCALE
char *oldlocale=NULL, *tmplocale;
tmplocale = setlocale(LC_NUMERIC, NULL);
if (tmplocale) oldlocale = strdup(tmplocale);
setlocale(LC_N... | cwe | CWE-310 | Unknown |
'use strict';
/**
* Module dependencies.
*/
const assign = require('lodash.assign');
const exec = require('child_process').exec;
const child_process = require('child_process');
const fs = require('fs');
const tmpdir = require('os').tmpdir(); // let the os take care of removing zombie tmp files
const uuid = require('... | cwe | CWE-77 | JavaScript |
static int samldb_lockout_time(struct samldb_ctx *ac)
{
struct ldb_context *ldb = ldb_module_get_ctx(ac->module);
NTTIME lockoutTime;
struct ldb_message_element *el;
struct ldb_message *tmp_msg;
int ret;
ret = dsdb_get_expected_new_values(ac,
ac->msg,
"lockoutTime",
&el,
ac->req->... | cwe | CWE-200 | Unknown |
dns_cache_lookup(struct module_env* env,
uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass,
uint16_t flags, struct regional* region, struct regional* scratch,
int no_partial, uint8_t* dpname, size_t dpnamelen)
{
struct lruhash_entry* e;
struct query_info k;
hashvalue_type h;
time_t now = *env->now... | cwe | CWE-703 | Unknown |
/**
* Copyright (C) 2014, Oliver Salzburg
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, p... | cwe | CWE-400 | JavaScript |
/* Copyright (c) 2013-2018 the Civetweb developers
* Copyright (c) 2004-2013 Sergey Lyubka
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limita... | cwe | CWE-200 | C/C++ |
hstore_from_array(PG_FUNCTION_ARGS)
{
ArrayType *in_array = PG_GETARG_ARRAYTYPE_P(0);
int ndims = ARR_NDIM(in_array);
int count;
int32 buflen;
HStore *out;
Pairs *pairs;
Datum *in_datums;
bool *in_nulls;
int in_count;
int i;
Assert(ARR_ELEMTYPE(in_array) == TEXTOID);
switch (ndims)
... | cwe | CWE-189 | C/C++ |
/*
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2002-2016, 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 |
static int on_part_data_end(multipart_parser *parser)
{
multipart_parser_data_t *data = NULL;
ogs_assert(parser);
data = multipart_parser_get_data(parser);
ogs_assert(data);
data->num_of_part++;
return 0;
} | cwe | CWE-476 | Unknown |
QPDF::decryptString(std::string& str, int objid, int generation)
{
if (objid == 0)
{
return;
}
bool use_aes = false;
if (this->m->encp->encryption_V >= 4)
{
switch (this->m->encp->cf_string)
{
case e_none:
return;
case e_aes:
use_aes = true;
break;
case e_aesv3:
... | cwe | CWE-787 | Unknown |
GetCode_(gdIOCtx *fd, CODE_STATIC_DATA *scd, int code_size, int flag, int *ZeroDataBlockP)
{
int i, j, ret;
unsigned char count;
if(flag) {
scd->curbit = 0;
scd->lastbit = 0;
scd->last_byte = 0;
scd->done = FALSE;
return 0;
}
if((scd->curbit + code_size) >= scd->lastbit) {
if(scd->done) {
if(scd->... | cwe | CWE-119 | C/C++ |
void Compute(OpKernelContext* context) override {
// Get inputs
const Tensor& input_tensor = context->input(0);
const auto input_tensor_flat = input_tensor.flat<int32>();
const Tensor& input_splits = context->input(1);
const auto input_splits_flat = input_splits.flat<SPLITS_TYPE>();
// Since we... | cwe | CWE-787 | C/C++ |
void FdInStream::readBytes(void* data, int length)
{
if (length < MIN_BULK_SIZE) {
InStream::readBytes(data, length);
return;
}
U8* dataPtr = (U8*)data;
int n = end - ptr;
if (n > length) n = length;
memcpy(dataPtr, ptr, n);
dataPtr += n;
length -= n;
ptr += n;
while (length > 0) {
n... | cwe | CWE-122 | C/C++ |
icmp6_print(netdissect_options *ndo,
const u_char *bp, u_int length, const u_char *bp2, int fragmented)
{
const struct icmp6_hdr *dp;
const struct ip6_hdr *ip;
const struct ip6_hdr *oip;
const struct udphdr *ouh;
int dport;
const u_char *ep;
u_int prot;
dp = (const struct icmp6_hdr *)bp;
ip = (con... | cwe | CWE-125 | C/C++ |
kg_unseal_v1_iov(krb5_context context,
OM_uint32 *minor_status,
krb5_gss_ctx_id_rec *ctx,
gss_iov_buffer_desc *iov,
int iov_count,
size_t token_wrapper_len,
int *conf_state,
gss_qop_t *qop_state,
... | cwe | CWE-119 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% M M AAA TTTTT L AAA BBBB ... | cwe | CWE-416 | C/C++ |
static Image *ReadAVSImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
Image
*image;
MagickBooleanType
status;
register PixelPacket
*q;
register ssize_t
x;
register unsigned char
*p;
size_t
height,
width;
ssize_t
count,
y;
unsigned char
*pixels;... | cwe | CWE-120 | C/C++ |
# (c) 2012, 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) any lat... | cwe | CWE-20 | Python |
static RzList *symbols(RzBinFile *bf) {
if (!bf) {
return NULL;
}
LuacBinInfo *bin_info_obj = GET_INTERNAL_BIN_INFO_OBJ(bf);
if (!bin_info_obj) {
return NULL;
}
return bin_info_obj->symbol_list;
} | cwe | CWE-787 | Unknown |
unserialize_uep(bufinfo_T *bi, int *error, char_u *file_name)
{
int i;
u_entry_T *uep;
char_u **array;
char_u *line;
int line_len;
uep = (u_entry_T *)U_ALLOC_LINE(sizeof(u_entry_T));
if (uep == NULL)
return NULL;
vim_memset(uep, 0, sizeof(u_entry_T));
#ifdef U_DEBUG
uep->ue_magic... | cwe | CWE-190 | C/C++ |
/* PLAYLIST CREATION AND MANAGEMENT */
var ManagedPlaylist = function(playlistManager, playlist, options){
this.playlistManager = playlistManager;
this.id = options.id;
this.name = options.name;
this.closable = options.closable;
this.public = options.public;
this.owner = options.owner;
th... | cwe | CWE-22 | Python |
void usb_ep_combine_input_packets(USBEndpoint *ep)
{
USBPacket *p, *u, *next, *prev = NULL, *first = NULL;
USBPort *port = ep->dev->port;
int totalsize;
assert(ep->pipeline);
assert(ep->pid == USB_TOKEN_IN);
QTAILQ_FOREACH_SAFE(p, &ep->queue, queue, next) {
/* Empty the queue on a halt... | cwe | CWE-770 | C/C++ |
size_t c_shquote_strncspn(const char *string,
size_t n_string,
const char *reject) {
bool buffer[UCHAR_MAX] = {};
if (strlen(reject) == 1) {
const char *p;
p = memchr(string, reject[0], n_string);
if (!... | cwe | CWE-787 | Unknown |
void wait_for_other(int fd) {
//****************************
// wait for the parent to be initialized
//****************************
char childstr[BUFLEN + 1];
int newfd = fcntl(fd, F_DUPFD_CLOEXEC, 0);
if (newfd == -1)
errExit("fcntl");
FILE* stream;
stream = fdopen(newfd, "r");
*childstr = '\0';
if (fgets... | cwe | CWE-269 | Unknown |
cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
struct nameidata *nd)
{
int xid;
int rc = 0; /* to get around spurious gcc warning, set to zero here */
__u32 oplock = enable_oplocks ? REQ_OPLOCK : 0;
__u16 fileHandle = 0;
bool posix_open = false;
struct cifs_sb_info *cifs_sb;
struct tco... | cwe | CWE-20 | C/C++ |
header_read (SF_PRIVATE *psf, void *ptr, int bytes)
{ int count = 0 ;
if (psf->headindex >= SIGNED_SIZEOF (psf->header))
return psf_fread (ptr, 1, bytes, psf) ;
if (psf->headindex + bytes > SIGNED_SIZEOF (psf->header))
{ int most ;
most = SIGNED_SIZEOF (psf->header) - psf->headend ;
psf_fread (psf->header... | cwe | CWE-119 | C/C++ |
function uploadFile($file_array, $destination_directory, $destination_filename = null)
{
if ((! isset($file_array['name'])) || (! isset($file_array['tmp_name'])) || (! isset($file_array['error']))) {
throw new Exception(_('Ungültiges Array übergeben!'));
}
//Dont allow to upload a PHP file.
if(... | cwe | CWE-78 | PHP |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.