code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
pickCopyFunc(TIFF* in, TIFF* out, uint16 bitspersample, uint16 samplesperpixel)
{
uint16 shortv;
uint32 w, l, tw, tl;
int bychunk;
(void) TIFFGetField(in, TIFFTAG_PLANARCONFIG, &shortv);
if (shortv != config && bitspersample != 8 && samplesperpixel > 1) {
fprintf(stderr,
"%s: Cannot handle different plana... | cwe | CWE-787 | Unknown |
apr_byte_t oidc_post_preserve_javascript(request_rec *r, const char *location,
char **javascript, char **javascript_method) {
if (oidc_cfg_dir_preserve_post(r) == 0)
return FALSE;
oidc_debug(r, "enter");
oidc_cfg *cfg = ap_get_module_config(r->server->module_config,
&auth_openidc_module);
const char *met... | cwe | CWE-79 | C/C++ |
static int fullTest(unsigned char *srcBuf, int w, int h, int subsamp,
int jpegQual, char *fileName)
{
char tempStr[1024], tempStr2[80];
FILE *file = NULL;
tjhandle handle = NULL;
unsigned char **jpegBuf = NULL, *yuvBuf = NULL, *tmpBuf = NULL, *srcPtr,
*srcPtr2;
double start, elapsed, e... | cwe | CWE-787 | Unknown |
void JBIG2Stream::readTextRegionSeg(unsigned int segNum, bool imm, bool lossless, unsigned int length, unsigned int *refSegs, unsigned int nRefSegs)
{
std::unique_ptr<JBIG2Bitmap> bitmap;
JBIG2HuffmanTable runLengthTab[36];
JBIG2HuffmanTable *symCodeTab = nullptr;
const JBIG2HuffmanTable *huffFSTable, *... | cwe | CWE-476 | C/C++ |
AXObjectInclusion AXLayoutObject::defaultObjectInclusion(
IgnoredReasons* ignoredReasons) const {
if (!m_layoutObject) {
if (ignoredReasons)
ignoredReasons->push_back(IgnoredReason(AXNotRendered));
return IgnoreObject;
}
if (m_layoutObject->style()->visibility() != EVisibility::kVisible) {
... | cwe | CWE-254 | C/C++ |
SplashBitmap::SplashBitmap(int widthA, int heightA, int rowPad,
SplashColorMode modeA, GBool alphaA,
GBool topDown) {
width = widthA;
height = heightA;
mode = modeA;
switch (mode) {
case splashModeMono1:
rowSize = (width + 7) >> 3;
break;
case splashModeMono8:
rowSize = width;
br... | cwe | CWE-189 | C/C++ |
static int rds_iw_laddr_check(__be32 addr)
{
int ret;
struct rdma_cm_id *cm_id;
struct sockaddr_in sin;
/* Create a CMA ID and try to bind it. This catches both
* IB and iWARP capable NICs.
*/
cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP, IB_QPT_RC);
if (IS_ERR(cm_id))
return PTR_ERR(cm_id);
memset(&si... | cwe | CWE-476 | C/C++ |
void SFS_Params(ScriptParser *parser)
{
u32 val;
if (parser->codec->LastError) return;
val = gf_bs_read_int(parser->bs, 1);
while (val) {
SFS_Expression(parser);
val = gf_bs_read_int(parser->bs, 1);
if(val) SFS_AddString(parser, ",");
}
} | cwe | CWE-476 | Unknown |
void Compute(OpKernelContext* ctx) override {
const Tensor* inputs;
const Tensor* labels_indices;
const Tensor* labels_values;
const Tensor* seq_len;
OP_REQUIRES_OK(ctx, ctx->input("inputs", &inputs));
OP_REQUIRES_OK(ctx, ctx->input("labels_indices", &labels_indices));
OP_REQUIRES_OK(ctx, ct... | cwe | CWE-665 | Unknown |
Unicode: function(name) {
var HD = this.GetBrackets(name), font;
if (HD) {
if (HD.replace(/ /g,"").match(/^(\d+(\.\d*)?|\.\d+),(\d+(\.\d*)?|\.\d+)$/))
{HD = HD.replace(/ /g,"").split(/,/); font = this.GetBrackets(name)}
else {font = HD; HD = null}
}
var n = this.tri... | cwe | CWE-79 | JavaScript |
import os
import re
import time
from html import escape
from urllib.parse import quote_plus as urlquote
import sqlite3 as sql
from hashlib import sha256
import asyncio
import mimetypes
from aiohttp import web, ClientSession
from kenny2automate.utils import DummyCtx
from kenny2automate.i18n import LANG, i18n
DISCORD_AP... | cwe | CWE-20 | Python |
static int output_frame(H264Context *h, AVFrame *dst, Picture *srcp)
{
AVFrame *src = &srcp->f;
int i;
int ret = av_frame_ref(dst, src);
if (ret < 0)
return ret;
av_dict_set(&dst->metadata, "stereo_mode", ff_h264_sei_stereo_mode(h), 0);
if (!srcp->crop)
return 0;
for (i = ... | cwe | CWE-703 | Unknown |
asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
unsigned int vlen, unsigned int flags,
struct compat_timespec __user *timeout)
{
int datagrams;
struct timespec ktspec;
if (flags & MSG_CMSG_COMPAT)
return -EINVAL;
if (COMPAT_USE_64BIT_TIME)
return __sys_recvmm... | cwe | CWE-20 | C/C++ |
new FileReader;m.onload=mxUtils.bind(this,function(q){try{this.openFileHandle(q.target.result,k.name,k,e)}catch(v){this.handleError(v)}});m.onerror=mxUtils.bind(this,function(q){this.spinner.stop();this.handleError(q);window.openFile=null});"image"!==k.type.substring(0,5)&&"application/pdf"!==k.type||"image/svg"===k.ty... | cwe | CWE-20 | JavaScript |
Status readUTF8String( StringData* out ) {
int sz;
if ( !readNumber<int>( &sz ) )
return makeError("invalid bson", _idElem);
if ( out ) {
*out = StringData( _buffer + _position, sz );
}
if ( !skip( ... | cwe | CWE-20 | Unknown |
static float *get_window(vorb *f, int len)
{
len <<= 1;
if (len == f->blocksize_0) return f->window[0];
if (len == f->blocksize_1) return f->window[1];
assert(0);
return NULL;
} | cwe | CWE-20 | C/C++ |
static bool pb_release_union_field(pb_istream_t *stream, pb_field_iter_t *field)
{
pb_field_iter_t old_field = *field;
pb_size_t old_tag = *(pb_size_t*)field->pSize; /* Previous which_ value */
pb_size_t new_tag = field->tag; /* New which_ value */
if (old_tag == 0)
return true; /* Ok, no old d... | cwe | CWE-763 | C/C++ |
static inline signed short ReadPropertyMSBShort(const unsigned char **p,
size_t *length)
{
union
{
unsigned short
unsigned_value;
signed short
signed_value;
} quantum;
int
c;
register ssize_t
i;
unsigned char
buffer[2];
unsigned short
value;
if (*length < 2)
... | cwe | CWE-190 | C/C++ |
void Document::detach(const AttachContext& context)
{
TRACE_EVENT0("blink", "Document::detach");
ASSERT(!m_frame || m_frame->tree().childCount() == 0);
if (!isActive())
return;
FrameNavigationDisabler navigationDisabler(*m_frame);
HTMLFrameOwnerElement::UpdateSuspendScope suspendWidget... | cwe | CWE-264 | C/C++ |
obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena)
{
int isinstance;
PyObject *tmp = NULL;
if (obj == Py_None) {
*out = NULL;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Module_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
... | cwe | CWE-125 | C/C++ |
bool DNP3_Base::AddToBuffer(Endpoint* endp, int target_len, const u_char** data, int* len)
{
if ( ! target_len )
return true;
int to_copy = min(*len, target_len - endp->buffer_len);
memcpy(endp->buffer + endp->buffer_len, *data, to_copy);
*data += to_copy;
*len -= to_copy;
endp->buffer_len += to_copy;
retu... | cwe | CWE-119 | C/C++ |
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* 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,... | cwe | CWE-287 | Java |
SchedulerObject::hold(std::string key, std::string &reason, std::string &text)
{
PROC_ID id = getProcByString(key.c_str());
if (id.cluster < 0 || id.proc < 0) {
dprintf(D_FULLDEBUG, "Hold: Failed to parse id: %s\n", key.c_str());
text = "Invalid Id";
retur... | cwe | CWE-20 | C/C++ |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
twisted.web.util and twisted.web.template merged to avoid cyclic deps
"""
import io
import linecache
import warnings
from collections import OrderedDict
from html import escape
from typing import (
IO,
Any,
AnyStr,
Callable,
... | cwe | CWE-79 | Python |
static int llcp_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
{
struct sock *sk = sock->sk;
struct nfc_llcp_sock *llcp_sock = nfc_llcp_sock(sk);
struct nfc_llcp_local *local;
struct nfc_dev *dev;
struct sockaddr_nfc_llcp llcp_addr;
int len, ret = 0;
if (!addr || alen < offsetofend(struct socka... | cwe | CWE-476 | C/C++ |
void t2p_read_tiff_size(T2P* t2p, TIFF* input){
uint64* sbc=NULL;
#if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
unsigned char* jpt=NULL;
tstrip_t i=0;
tstrip_t stripcount=0;
#endif
uint64 k = 0;
if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
#ifdef CCITT_SUPPORT
if(t2p->pdf_compression == T2P_COMP... | cwe | CWE-787 | Unknown |
var mxClient={VERSION:"20.2.8",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==docum... | cwe | CWE-79 | JavaScript |
/* Copyright (C) 2002-2012 by George Williams */
/*
* 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 conditions and the following... | cwe | CWE-119 | C/C++ |
pub fn ensure_ethereum_transaction<OuterOrigin>(o: OuterOrigin) -> Result<H160, &'static str>
where
OuterOrigin: Into<Result<RawOrigin, OuterOrigin>>,
{
match o.into() {
Ok(RawOrigin::EthereumTransaction(n)) => Ok(n),
_ => Err("bad origin: expected to be an Ethereum transaction"),
}
}
pub struct EnsureEthereumT... | cwe | CWE-20 | Rust |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-119 | C/C++ |
def check_action_permission!(skip_source = nil)
super(skip_source)
# only perform the following check, if we are called from
# BsRequest.permission_check_change_state! (that is, if
# skip_source is set to true). Always executing this check
# would be a regression, because this code is also executed
... | cwe | CWE-285 | Ruby |
const bootbox = require('bootbox');
require('../services/Requisitions');
const RequisitionNode = require('../model/RequisitionNode');
const RequisitionMetaDataEntry = require('../model/RequisitionMetaDataEntry');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(functi... | cwe | CWE-79 | Java |
_hivex_get_children (hive_h *h, hive_node_h node,
hive_node_h **children_ret, size_t **blocks_ret,
int flags)
{
if (!IS_VALID_BLOCK (h, node) || !block_id_eq (h, node, "nk")) {
SET_ERRNO (EINVAL, "invalid block or not an 'nk' block");
return -1;
}
struct ntreg_nk... | cwe | CWE-400 | Unknown |
OMX_ERRORTYPE omx_video::get_config(OMX_IN OMX_HANDLETYPE hComp,
OMX_IN OMX_INDEXTYPE configIndex,
OMX_INOUT OMX_PTR configData)
{
(void)hComp;
if (configData == NULL) {
DEBUG_PRINT_ERROR("ERROR: param is null");
return OMX_ErrorBadParameter;
}
if (m_state == OMX_StateInvalid) {... | cwe | CWE-20 | C/C++ |
function ame_ajax_title_save( cat_id, posttype ) {
var newtitle = jQuery("input#ame_title" + cat_id).prop('value');
var ame_sack = new sack( ajaxurl );
ame_sack.execute = 1;
ame_sack.method = 'POST';
ame_sack.setVar( "action", "ame_save_title" );
ame_sack.setVar( "category_id", cat_id );
ame_sack.setVar( "new_ti... | cwe | CWE-352 | JavaScript |
cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
uint32_t offs, cdf_property_info_t **info, size_t *count, size_t *maxcount)
{
const cdf_section_header_t *shp;
cdf_section_header_t sh;
const uint8_t *p, *q, *e;
int16_t s16;
int32_t s32;
uint32_t u32;
int64_t s64;
uint64_t u64;
cdf_tim... | cwe | CWE-703 | Unknown |
read_old_length(cdk_stream_t inp, int ctb, size_t * r_len, size_t * r_size)
{
int llen = ctb & 0x03;
if (llen == 0) {
*r_len = cdk_stream_getc(inp);
(*r_size)++;
} else if (llen == 1) {
*r_len = read_16(inp);
(*r_size) += 2;
} else if (llen == 2) {
*r_len = read_32(inp);
(*r_size) += 4;
} else {
*r_... | cwe | CWE-125 | C/C++ |
static void unpin_sdma_pages(struct sdma_mmu_node *node)
{
if (node->npages) {
unpin_vector_pages(node->pq->mm, node->pages, 0, node->npages);
atomic_sub(node->npages, &node->pq->n_locked);
}
} | cwe | CWE-416 | Unknown |
static int on_frame_recv_cb(nghttp2_session *ng2s,
const nghttp2_frame *frame,
void *userp)
{
h2_session *session = (h2_session *)userp;
h2_stream *stream;
apr_status_t rv = APR_SUCCESS;
if (APLOGcdebug(session->c)) {
char buffer[256];... | cwe | CWE-770 | Unknown |
static int channel_request_pty(LIBSSH2_CHANNEL *channel,
const char *term, unsigned int term_len,
const char *modes, unsigned int modes_len,
int width, int height,
int width_px, int height_px)
{
... | cwe | CWE-787 | Unknown |
package org.platformlambda.automation.servlets;
import com.google.api.client.http.*;
import com.google.api.client.http.javanet.NetHttpTransport;
import org.platformlambda.automation.util.Housekeeper;
import org.platformlambda.core.exception.AppException;
import org.platformlambda.core.models.AsyncHttpRequest;
import o... | cwe | CWE-611 | Java |
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
if (!value.length)
return NULL;
/* allocate destination string, it will be at most 3 times the source */
dst = talloc_array(mem_ctx, char, value.length * 3 + 1);
if ( ! dst) {
talloc_free(dst);
... | cwe | CWE-200 | C/C++ |
public PBEWithSHA256AESCBC192()
{
super(new CBCBlockCipher(new AESFastEngine()), PKCS12, SHA256, 192, 16);
} | cwe | CWE-310 | Java |
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
*
* Inspired by dwc3-of-simple.c
*/
#include <linux/acpi.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/clk.h>
#include <linux/irq.h>
#include <linux/of_clk.h>
#include <linux/module.h>
#include <li... | cwe | CWE-476 | C/C++ |
package de.presti.ree6.commands.impl.community;
import de.presti.ree6.commands.Category;
import de.presti.ree6.commands.CommandEvent;
import de.presti.ree6.commands.interfaces.Command;
import de.presti.ree6.commands.interfaces.ICommand;
import de.presti.ree6.main.Main;
import net.dv8tion.jda.api.Permission;
import net... | cwe | CWE-863 | Java |
static bool tipc_crypto_key_rcv(struct tipc_crypto *rx, struct tipc_msg *hdr)
{
struct tipc_crypto *tx = tipc_net(rx->net)->crypto_tx;
struct tipc_aead_key *skey = NULL;
u16 key_gen = msg_key_gen(hdr);
u16 size = msg_data_sz(hdr);
u8 *data = msg_data(hdr);
spin_lock(&rx->lock);
if (unlikely(rx->skey || (key_gen... | cwe | CWE-20 | C/C++ |
void operator()(OpKernelContext* ctx, const CPUDevice& d, int64 num_batches,
int64 samples_per_batch, int64 num_elements,
const BCastList<4>& bcast,
typename TTypes<T>::ConstFlat means,
typename TTypes<T>::ConstFlat stddevs,
typen... | cwe | CWE-754 | C/C++ |
async parse(code) {
let gql = await localRequire('graphql-tag', this.name);
return gql(code);
} | cwe | CWE-200 | JavaScript |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 1);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
// TODO(ahentz):... | cwe | CWE-787 | C/C++ |
// Copyright 2012-2020 (c) Peter Širka <petersirka@gmail.com>
//
// 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, cop... | cwe | CWE-94 | JavaScript |
static struct key *construct_key_and_link(struct keyring_search_context *ctx,
const char *callout_info,
size_t callout_len,
void *aux,
struct key *dest_keyring,
unsigned long flags)
{
struct key_user *user;
struct key *key;
int ret;
kenter("");
if (ctx->index_key.type == &key_t... | cwe | CWE-284 | Unknown |
bfad_im_get_stats(struct Scsi_Host *shost)
{
struct bfad_im_port_s *im_port =
(struct bfad_im_port_s *) shost->hostdata[0];
struct bfad_s *bfad = im_port->bfad;
struct bfad_hal_comp fcomp;
union bfa_port_stats_u *fcstats;
struct fc_host_statistics *hstats;
bfa_status_t rc;
unsigned long flags;
... | cwe | CWE-401 | C/C++ |
static Image *ReadMONOImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
Image
*image;
MagickBooleanType
status;
register IndexPacket
*indexes;
register PixelPacket
*q;
register ssize_t
x;
size_t
bit,
byte;
ssize_t
y;
/*
Open image file.
*/
as... | cwe | CWE-120 | C/C++ |
static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
char
command[MagickPathExtent],
*density,
filename[MagickPathExtent],
input_filename[MagickPathExtent],
message[MagickPathExtent],
*options,
postscript_filename[MagickPathExtent];
const char
*option;
... | cwe | CWE-91 | Unknown |
ins_compl_add_infercase(
char_u *str_arg,
int len,
int icase,
char_u *fname,
int dir,
int cont_s_ipos) // next ^X<> will set initial_pos
{
char_u *str = str_arg;
char_u *p;
int actual_len; // Take multi-byte characters
int actual_compl_length; // into account.
int mi... | cwe | CWE-787 | Unknown |
xsltCopyText(xsltTransformContextPtr ctxt, xmlNodePtr target,
xmlNodePtr cur, int interned)
{
xmlNodePtr copy;
if ((cur->type != XML_TEXT_NODE) &&
(cur->type != XML_CDATA_SECTION_NODE))
return(NULL);
if (cur->content == NULL)
return(NULL);
#ifdef WITH_XSLT_DEBUG_PROCESS
if (cur->type == XML_C... | cwe | CWE-416 | Unknown |
static Image *ReadXWDImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define CheckOverflowException(length,width,height) \
(((height) != 0) && ((length)/((size_t) height) != ((size_t) width)))
char
*comment;
Image
*image;
int
x_status;
MagickBooleanType
authentic_colormap;
... | cwe | CWE-125 | C/C++ |
# -*- coding: utf-8 -*-
from ._compat import get_external_sites
from ._compat import unescape
from ._compat import urljoin
from ._compat import urlparse
from posixpath import normpath
# This is the class we will patch:
from Products.CMFPlone.URLTool import URLTool
import re
import string
import unicodedata
# These ... | cwe | CWE-601 | Python |
public function scopeSearch(Builder $query, array $search = [])
{
if (empty($search)) {
return $query;
}
if (!array_intersect(array_keys($search), $this->searchable)) {
return $query;
}
return $query->where($search);
} | cwe | CWE-89 | PHP |
package image
import (
"bytes"
"context"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"fmt"
"io/ioutil"
"strings"
"github.com/containers/image/v5/docker/reference"
"github.com/containers/image/v5/manifest"
"github.com/containers/image/v5/pkg/blobinfocache/none"
"github.com/containers/image/v5/types"
"g... | cwe | CWE-400 | Go |
static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image,
ExceptionInfo *exception)
{
static const char
*const PostscriptProlog[]=
{
"%%%%BeginProlog",
"%%",
"%% Display a color image. The image is displayed in color on",
"%% Postscript viewers or printers tha... | cwe | CWE-401 | Unknown |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* cond_tensor =
GetInput(context, node, kInputConditionTensor);
TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
if (IsDynamicTensor(output)) {
TF_LITE_ENSURE_OK(context,
ResizeOutputTen... | cwe | CWE-787 | C/C++ |
xmlSchemaFormatItemForReport(xmlChar **buf,
const xmlChar *itemDes,
xmlSchemaBasicItemPtr item,
xmlNodePtr itemNode)
{
xmlChar *str = NULL;
int named = 1;
if (*buf != NULL) {
xmlFree(*buf);
*buf = NULL;
}
if (itemDes != NULL) {
*buf = xmlStrdup(itemDes);
} else if (item... | cwe | CWE-134 | Unknown |
/* Copyright 2013 Simo Sorce <simo@samba.org>, see COPYING for license */
/* This File implements the NTLM protocol as specified by:
* [MS-NLMP]: NT LAN Manager (NTLM) Authentication Protocol
*
* Additional cross checking with:
* http://davenport.sourceforge.net/ntlm.html
*/
#include <alloca.h>
#include <en... | cwe | CWE-763 | C/C++ |
long Segment::ParseCues(long long off, long long& pos, long& len) {
if (m_pCues)
return 0; // success
if (off < 0)
return -1;
long long total, avail;
const int status = m_pReader->Length(&total, &avail);
if (status < 0) // error
return status;
assert((total < 0) || (avail <= total));
pos = m_st... | cwe | CWE-20 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-125 | C/C++ |
INT_PTR CALLBACK NewVersionCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
char cmdline[] = APPLICATION_NAME " -w 150";
static char* filepath = NULL;
static int download_status = 0;
LONG i;
HWND hNotes;
STARTUPINFOA si;
PROCESS_INFORMATION pi;
HFONT hyperlink_font = NULL;
EXT_DECL(dl_ext, NUL... | cwe | CWE-345 | C/C++ |
/*
* 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++ |
long fuse_ioctl_common(struct file *file, unsigned int cmd,
unsigned long arg, unsigned int flags)
{
struct inode *inode = file_inode(file);
struct fuse_conn *fc = get_fuse_conn(inode);
if (!fuse_allow_current_process(fc))
return -EACCES;
if (is_bad_inode(inode))
return -EIO;
return fuse_do_ioctl(f... | cwe | CWE-459 | Unknown |
static void hidp_process_report(struct hidp_session *session,
int type, const u8 *data, int len, int intr)
{
if (len > HID_MAX_BUFFER_SIZE)
len = HID_MAX_BUFFER_SIZE;
memcpy(session->input_buf, data, len);
hid_input_report(session->hid, type, session->input_buf, len, intr);
} | cwe | CWE-787 | C/C++ |
'use strict';
const EventEmitter = require('events');
const { createHash } = require('crypto');
const { createServer, STATUS_CODES } = require('http');
const PerMessageDeflate = require('./permessage-deflate');
const WebSocket = require('./websocket');
const { format, parse } = require('./extension');
const { GUID, k... | cwe | CWE-400 | JavaScript |
ModuleLoader::Module* ModuleLoader::loadModule(const Firebird::PathName& modPath)
{
void* module = dlopen(modPath.nullStr(), FB_RTLD_MODE);
if (module == NULL)
{
#ifdef DEV_BUILD
// gds__log("loadModule failed loading %s: %s", modPath.c_str(), dlerror());
#endif
return 0;
}
#ifdef DEBUG_THREAD_IN_UNLOADED_LIBRA... | cwe | CWE-89 | Unknown |
static gint conv_jistoeuc(gchar *outbuf, gint outlen, const gchar *inbuf)
{
const guchar *in = inbuf;
gchar *out = outbuf;
JISState state = JIS_ASCII;
while (*in != '\0' && (out - outbuf) > outlen - 3) {
if (*in == ESC) {
in++;
if (*in == '$') {
if (*(in + 1) == '@' || *(in + 1) == 'B') {
state = ... | cwe | CWE-119 | C/C++ |
cf2_initGlobalRegionBuffer( CFF_Decoder* decoder,
CF2_UInt idx,
CF2_Buffer buf )
{
FT_ASSERT( decoder && decoder->globals );
FT_ZERO( buf );
idx += decoder->globals_bias;
if ( idx >= decoder->num_globals )
return TRUE... | cwe | CWE-20 | C/C++ |
def check_password(password, encoded, setter=None, preferred='default'):
"""
Returns a boolean of whether the raw password matches the three
part encoded digest.
If setter is specified, it'll be called when you need to
regenerate the password.
"""
if password is None or not is_password_usab... | cwe | CWE-200 | Python |
static int link_pipe(struct pipe_inode_info *ipipe,
struct pipe_inode_info *opipe,
size_t len, unsigned int flags)
{
struct pipe_buffer *ibuf, *obuf;
int ret = 0, i = 0, nbuf;
/*
* Potential ABBA deadlock, work around it by ordering lock
* grabbing by pipe info address. Otherwise two different pro... | cwe | CWE-416 | Unknown |
inline void* Zone::New(int size) {
ASSERT(scope_nesting_ > 0);
// Round up the requested size to fit the alignment.
size = RoundUp(size, kAlignment);
// If the allocation size is divisible by 8 then we return an 8-byte aligned
// address.
if (kPointerSize == 4 && kAlignment == 4) {
position_ += ((~size... | cwe | CWE-119 | Unknown |
static int fallocate_chunk(struct inode *inode, loff_t offset, loff_t len,
int mode)
{
struct gfs2_inode *ip = GFS2_I(inode);
struct buffer_head *dibh;
int error;
u64 start = offset >> PAGE_CACHE_SHIFT;
unsigned int start_offset = offset & ~PAGE_CACHE_MASK;
u64 end = (offset + len - 1) >> PAGE_CACHE_SHIFT;
... | cwe | CWE-119 | C/C++ |
void ocall_malloc(size_t size, uint8_t **ret) {
*ret = static_cast<uint8_t *>(malloc(size));
} | cwe | CWE-787 | C/C++ |
func doesPolicySignatureV2Match(formValues http.Header) APIErrorCode {
cred := globalActiveCred
accessKey := formValues.Get(xhttp.AmzAccessKeyID)
cred, _, s3Err := checkKeyValid(accessKey)
if s3Err != ErrNone {
return s3Err
}
policy := formValues.Get("Policy")
signature := formValues.Get(xhttp.AmzSignatureV2)
... | cwe | CWE-285 | Go |
function __construct() {
parent::__construct( 'GlobalNewFiles' );
} | cwe | CWE-20 | PHP |
static int rock_continue(struct rock_state *rs)
{
int ret = 1;
int blocksize = 1 << rs->inode->i_blkbits;
const int min_de_size = offsetof(struct rock_ridge, u);
kfree(rs->buffer);
rs->buffer = NULL;
if ((unsigned)rs->cont_offset > blocksize - min_de_size ||
(unsigned)rs->cont_size > blocksize ||
(uns... | cwe | CWE-399 | C/C++ |
void checkVerificationCodeUnexistingUser()
{
when(this.userReference.toString()).thenReturn("user:Foobar");
when(this.userManager.exists(this.userReference)).thenReturn(false);
String exceptionMessage = "User [user:Foobar] doesn't exist";
when(this.localizationManager.getTranslationP... | cwe | CWE-200 | Java |
static ::tensorflow::Status ValidateInputs(
std::vector<ConstFlatSplits> rt_nested_splits,
const Tensor& rt_dense_values_in) {
for (int i = 0; i < rt_nested_splits.size(); ++i) {
if (rt_nested_splits[i].size() == 0) {
return InvalidArgument("ragged splits may not be empty.");
}
... | cwe | CWE-125 | Unknown |
package db
import (
"database/sql"
"encoding/json"
"fmt"
"net/url"
"strconv"
"strings"
"sync"
"github.com/camptocamp/terraboard/config"
"github.com/camptocamp/terraboard/internal/terraform/addrs"
"github.com/camptocamp/terraboard/internal/terraform/states"
"github.com/camptocamp/terraboard/internal/terrafo... | cwe | CWE-89 | Go |
handleSequelizeMethod(smth, tableName, factory, options, prepend) {
if (smth instanceof Utils.Json) {
// Parse nested object
if (smth.conditions) {
const conditions = this.parseConditionObject(smth.conditions).map(condition =>
`${this.quoteIdentifier(condition.path[0])}->>'$.${_.tail(c... | cwe | CWE-89 | JavaScript |
schannel_connect_step1(struct Curl_easy *data, struct connectdata *conn,
int sockindex)
{
ssize_t written = -1;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
SecBuffer outbuf;
SecBufferDesc outbuf_desc;
SecBuffer inbuf;
SecBufferDesc inbuf_desc;
#ifdef HAS_ALPN
unsigned ... | cwe | CWE-290 | Unknown |
package query
import (
"context"
"fmt"
"net/http"
"time"
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/expr"
"github.com/grafana/grafana/pkg/infra/httpclient/httpclientprovider"
"github.com/grafana/grafana/pkg/infra/log"
"git... | cwe | CWE-200 | Go |
static int my_login(pTHX_ SV* dbh, imp_dbh_t *imp_dbh)
{
SV* sv;
HV* hv;
char* dbname;
char* host;
char* port;
char* user;
char* password;
char* mysql_socket;
int result;
D_imp_xxh(dbh);
/* TODO- resolve this so that it is set only if DBI is 1.607 */
#define TAKE_IMP_DATA_VERSION 1
#if TAKE_IMP... | cwe | CWE-416 | Unknown |
#include "queue.ih"
void queue_push(register Queue *qp, size_t extra_length, char const *info)
{
register char *cp;
size_t memory_length;
size_t available_length;
size_t begin_length;
size_t n_begin;
size_t q_length;
if (!extra_length)
return;
memory_length = qp->d_memory_e... | cwe | CWE-119 | C/C++ |
function toggleResolve(evt)
{
function doToggle()
{
var resolveActionLnk = evt.target;
resolveActionLnk.innerHTML = '';
comment.isResolved = !comment.isResolved;
mxUtils.write(resolveActionLnk, comment.isResolved? mxResources.get('reopen') : mxResources.get('resolve'));
var actionsD... | cwe | CWE-94 | JavaScript |
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build darwin dragonfly freebsd netbsd openbsd
// BSD system call wrappers shared by *BSD based systems
// including OS X (Darwin) and FreeBSD. Like the ot... | cwe | CWE-287 | Go |
unsigned long convert_rip_to_linear(struct task_struct *child, struct pt_regs *regs)
{
unsigned long addr, seg;
addr = regs->rip;
seg = regs->cs & 0xffff;
/*
* We'll assume that the code segments in the GDT
* are all zero-based. That is largely true: the
* TLS segments are used for data, and the PNPBIOS
*... | cwe | CWE-20 | Unknown |
bool PageCaptureSaveAsMHTMLFunction::RunAsync() {
params_ = SaveAsMHTML::Params::Create(*args_);
EXTENSION_FUNCTION_VALIDATE(params_.get());
AddRef(); // Balanced in ReturnFailure/ReturnSuccess()
#if defined(OS_CHROMEOS)
if (profiles::ArePublicSessionRestrictionsEnabled()) {
WebContents* web_contents = G... | cwe | CWE-863 | C/C++ |
public function gc($force = false)
{
if ($force || mt_rand(0, 1000000) < $this->gcProbability) {
$this->db->createCommand()
->delete($this->cacheTable, '[[expire]] > 0 AND [[expire]] < ' . time())
->execute();
}
} | cwe | CWE-330 | PHP |
import { mainPage } from "../../support/page_objects/mainPage";
import { isTestSuiteActive } from "../../support/page_objects/projectConstants";
export const genTest = (apiType, dbType) => {
if (!isTestSuiteActive(apiType, dbType)) return;
describe(`${apiType.toUpperCase()} api - Table: belongs to, link recor... | cwe | CWE-918 | JavaScript |
function empty(key) {
var char = key.charCodeAt(0);
return (char > 47 && char < 58) ? [] : {};
}
export function nestie(input, glue) {
glue = glue || '.';
var arr, tmp, output;
var i=0, k, key;
for (k in input) {
tmp = output; // reset
arr = k.split(glue);
for (i=0; i < arr.length;) {
key = arr[i++];
... | cwe | CWE-913 | JavaScript |
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator p... | cwe | CWE-732 | Java |
m=[];if(null!=b.sidebar.customEntries)for(var n=0;n<b.sidebar.customEntries.length;n++){for(var v=b.sidebar.customEntries[n],d={title:b.getResource(v.title),entries:[]},g=0;g<v.entries.length;g++){var k=v.entries[g];d.entries.push({id:k.id,title:b.getResource(k.title),desc:b.getResource(k.desc),image:k.preview})}m.push... | cwe | CWE-94 | JavaScript |
static int usb_enumerate_device_otg(struct usb_device *udev)
{
int err = 0;
#ifdef CONFIG_USB_OTG
/*
* OTG-aware devices on OTG-capable root hubs may be able to use SRP,
* to wake us after we've powered off VBUS; and HNP, switching roles
* "host" to "peripheral". The OTG descriptor helps figure this out.
*/... | cwe | CWE-703 | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.