code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static PHP_FUNCTION(gzopen)
{
char *filename;
char *mode;
int filename_len, mode_len;
int flags = REPORT_ERRORS;
php_stream *stream;
long use_include_path = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &filename, &filename_len, &mode, &mode_len, &use_include_path) == FAIL... | cwe | CWE-254 | C/C++ |
static void copy_recurse_data(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend,
int type, int stackptr, int stacktop, BOOL has_quit)
{
delayed_mem_copy_status status;
PCRE2_SPTR alternative;
sljit_sw private_srcw[2];
sljit_sw shared_srcw[3];
sljit_sw kept_shared_srcw[2];
int private_count, shared_count, kept_... | cwe | CWE-703 | Unknown |
crypto_retrieve_X509_sans(krb5_context context,
pkinit_plg_crypto_context plgctx,
pkinit_req_crypto_context reqctx,
X509 *cert,
krb5_principal **princs_ret,
krb5_principal **upn_ret,
... | cwe | CWE-287 | 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 |
def get_ports(self):
# First get the active FC ports
out = self._cli_run('showport', None)
# strip out header
# N:S:P,Mode,State,----Node_WWN----,-Port_WWN/HW_Addr-,Type,
# Protocol,Label,Partner,FailoverState
out = out[1:len(out) - 2]
ports = {'FC': [], 'iSCSI'... | cwe | CWE-78 | Python |
WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info,
const int argc,const char **argv,Image **images,ExceptionInfo *exception)
{
ChannelType
channel;
const char
*option;
ImageInfo
*mogrify_info;
MagickStatusType
status;
QuantizeInfo
*quantize_info;
register ssize_t... | cwe | CWE-399 | C/C++ |
static int decomp(unsigned char *srcBuf, unsigned char **jpegBuf,
unsigned long *jpegSize, unsigned char *dstBuf, int w, int h,
int subsamp, int jpegQual, char *fileName, int tilew,
int tileh)
{
char tempStr[1024], sizeStr[24] = "\0", qualStr[13] = "\0", *ptr;
F... | cwe | CWE-787 | C/C++ |
MagickExport Image *SpliceImage(const Image *image,
const RectangleInfo *geometry,ExceptionInfo *exception)
{
#define SpliceImageTag "Splice/Image"
CacheView
*image_view,
*splice_view;
Image
*splice_image;
MagickBooleanType
status;
MagickOffsetType
progress;
RectangleInfo
spli... | cwe | CWE-125 | C/C++ |
def self.publish_unread(post)
return unless post.topic.regular?
# TODO at high scale we are going to have to defer this,
# perhaps cut down to users that are around in the last 7 days as well
group_ids =
if post.post_type == Post.types[:whisper]
[Group::AUTO_GROUPS[:staff]]
else
... | cwe | CWE-200 | Ruby |
/*
* Copyright (C) 2003, 2004, 2005, 2006 Joe Walnes.
* Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2020, 2021 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
* style license a copy of which has bee... | cwe | CWE-400 | Java |
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11,
# andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh,
# falgh1, grunjol, csitk... | cwe | CWE-352 | Python |
/*
* 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 |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node, bool is_arg_max) {
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
const TfLiteTensor* axis = GetInput(context, node, kAxis);
TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
if (IsDynamicTensor(output)) {
TF_LITE_... | cwe | CWE-787 | C/C++ |
function Ws(e){Us=e} | cwe | CWE-79 | JavaScript |
static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi,
bool reconnect, bool suppress_warnings)
{
int slave_was_killed= 0;
int last_errno= -2; // impossible error
ulong err_count=0;
char llbuff[22];
char password[MAX_PASSWORD_LENGTH + 1];
... | cwe | CWE-295 | C/C++ |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
TfLiteType output_type = GetOutput(context, node, kOutputTensor)->type;
switch (output_type) { // Already know in/outtypes are same.
case kTfLiteFloat32:
EvalUnquantized<float>(context, node);
break;
case kTfLiteInt32:
EvalUnq... | cwe | CWE-787 | C/C++ |
void ImageLoader::DoUpdateFromElement(BypassMainWorldBehavior bypass_behavior,
UpdateFromElementBehavior update_behavior,
const KURL& url,
ReferrerPolicy referrer_policy,
... | cwe | CWE-19 | C/C++ |
static int get_crl_sk(X509_STORE_CTX *ctx, X509_CRL **pcrl, X509_CRL **pdcrl,
X509 **pissuer, int *pscore, unsigned int *preasons,
STACK_OF(X509_CRL) *crls)
{
int i, crl_score, best_score = *pscore;
unsigned int reasons, best_reasons = 0;
X509 *x = ctx->current_ce... | cwe | CWE-476 | Unknown |
/*
* FreeRTOS Kernel V10.4.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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, includ... | cwe | CWE-190 | C/C++ |
int fuse_set_acl(struct inode *inode, struct posix_acl *acl, int type)
{
struct fuse_conn *fc = get_fuse_conn(inode);
const char *name;
int ret;
if (!fc->posix_acl || fc->no_setxattr)
return -EOPNOTSUPP;
if (type == ACL_TYPE_ACCESS)
name = XATTR_NAME_POSIX_ACL_ACCESS;
else if (type == ACL_TYPE_DEFAULT)
na... | cwe | CWE-459 | Unknown |
/*******************************************************************************
* Copyright 2018 The MIT Internet Trust Consortium
*
* Portions copyright 2011-2013 The MITRE Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the L... | cwe | CWE-915 | Java |
hash_link_ref(const uint8_t *link_ref, size_t length)
{
size_t i;
unsigned int hash = 0;
for (i = 0; i < length; ++i)
hash = tolower(link_ref[i]) + (hash << 6) + (hash << 16) - hash;
return hash;
} | cwe | CWE-327 | C/C++ |
public ProductServletConfigurator(ServerConfig serverConfig, ShiroFilter shiroFilter, GitFilter gitFilter,
GitPreReceiveCallback preReceiveServlet, GitPostReceiveCallback postReceiveServlet,
WicketServlet wicketServlet, WebSocketManager webSocketManager,
AttachmentUploadServlet attachmentUploadServlet, Serv... | cwe | CWE-502 | JavaScript |
function H(ia){if(ba!=ia||P!=da)A(),Aa.scrollTop=0,ea.innerHTML="",ha.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults"))+' "'+mxUtils.htmlEntities(ia)+'"',va=null,Z?F(ia):d&&(ia?(Ha.spin(ea),U=!1,V=!0,d(ia,ua,function(){z(mxResources.get("searchFailed"));
ua([])},P?null:n)):I(P)),ba=ia,da=P} | cwe | CWE-94 | JavaScript |
/* Library for accessing X3F Files
----------------------------------------------------------------
BSD-style License
----------------------------------------------------------------
* Copyright (c) 2010, Roland Karlsson (roland@proxel.se)
* All rights reserved.
*
* Redistribution and use in source and binary forms, w... | cwe | CWE-125 | C/C++ |
Status InferenceContext::Multiply(DimensionHandle first,
DimensionOrConstant second,
DimensionHandle* out) {
const int64_t first_value = Value(first);
const int64_t second_value = Value(second);
// Special cases.
if (first_value == 0) {
*ou... | cwe | CWE-190 | C/C++ |
static int renameUnmapSelectCb(Walker *pWalker, Select *p){
Parse *pParse = pWalker->pParse;
int i;
if( pParse->nErr ) return WRC_Abort;
if( ALWAYS(p->pEList) ){
ExprList *pList = p->pEList;
for(i=0; i<pList->nExpr; i++){
if( pList->a[i].zName ){
sqlite3RenameTokenRemap(pParse, 0, (void*)p... | cwe | CWE-787 | Unknown |
int GetU8 (int nPos, bool *pbSuccess)
{
//*pbSuccess = true;
if ( nPos < 0 || nPos >= m_nLen )
{
*pbSuccess = false;
return 0;
}
return m_sFile[ nPos ];
} | cwe | CWE-787 | C/C++ |
/** @odoo-module **/
import { registry } from "@web/core/registry";
import {
Many2OneAvatarUserField,
KanbanMany2OneAvatarUserField,
many2OneAvatarUserField,
kanbanMany2OneAvatarUserField,
} from "@mail/web/fields/many2one_avatar_user_field/many2one_avatar_user_field";
export class Many2OneAvatarEmplo... | cwe | CWE-20 | C/C++ |
static void can_can_gw_rcv(struct sk_buff *skb, void *data)
{
struct cgw_job *gwj = (struct cgw_job *)data;
struct can_frame *cf;
struct sk_buff *nskb;
int modidx = 0;
/*
* Do not handle CAN frames routed more than 'max_hops' times.
* In general we should never catch this delimiter which is intended
* to co... | cwe | CWE-787 | C/C++ |
function(){A()}),1E3)});mxEvent.addListener(q,"click",mxUtils.bind(this,function(L){var M=mxEvent.getSource(L);M!=v&&M!=x?(null!=g&&g(),A(),mxEvent.consume(L)):z()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(q.style,"transform","translate(-50%,0%)")}),500);window.setTimeout(z,3E4);m=!0}re... | cwe | CWE-20 | JavaScript |
$this->run('rm', $item, '-r');
}
return $this;
} | cwe | CWE-88 | PHP |
/*
* 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++ |
hufUncompress (const char compressed[],
int nCompressed,
unsigned short raw[],
int nRaw)
{
//
// need at least 20 bytes for header
//
if (nCompressed < 20 )
{
if (nRaw != 0)
notEnoughData();
return;
}
int im = readUInt (compressed);
int iM = readUInt (com... | cwe | CWE-190 | Unknown |
static int scsi_disk_emulate_command(SCSIDiskReq *r, uint8_t *outbuf)
{
SCSIRequest *req = &r->req;
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, req->dev);
uint64_t nb_sectors;
int buflen = 0;
switch (req->cmd.buf[0]) {
case TEST_UNIT_READY:
if (s->tray_open || !bdrv_is_in... | cwe | CWE-119 | C/C++ |
import namedavatar from 'namedavatar'
import { QuillDeltaToHtmlConverter } from 'quill-delta-to-html'
import './projectchart.html'
import Projects, { ProjectStats } from '../../api/projects/projects.js'
import projectUsers from '../../api/users/users.js'
import { getUserSetting, getUserTimeUnitVerbose } from '../../uti... | cwe | CWE-79 | JavaScript |
Compute(OpKernelContext* context, bool sorted, int k,
const typename TTypes<T, 2>::ConstTensor& input, const int64 num_rows,
const int64 num_cols, typename TTypes<T, 2>::Tensor values,
typename TTypes<int, 2>::Tensor indices) {
const CPUDevice& d = context->eigen_device<CPUDevice>();
... | cwe | CWE-197 | Unknown |
write_message( RenderState state )
{
ADisplay adisplay = (ADisplay)state->display.disp;
if ( state->message == NULL )
{
FontFace face = &state->faces[state->face_index];
int idx, total;
idx = face->index;
total = 1;
while ( total + state->face_index < state->nu... | cwe | CWE-120 | C/C++ |
_Unpickler_MemoGet(UnpicklerObject *self, Py_ssize_t idx)
{
if (idx < 0 || idx >= self->memo_size)
return NULL;
return self->memo[idx];
} | cwe | CWE-190 | C/C++ |
COMPAT_SYSCALL_DEFINE5(waitid,
int, which, compat_pid_t, pid,
struct compat_siginfo __user *, infop, int, options,
struct compat_rusage __user *, uru)
{
struct rusage ru;
struct waitid_info info = {.status = 0};
long err = kernel_waitid(which, pid, &info, options, uru ? &ru : NULL);
int signo = 0;
if (err > ... | cwe | CWE-20 | Unknown |
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholiqu... | cwe | CWE-119 | C/C++ |
WebstoreBindings::WebstoreBindings(ScriptContext* context)
: ObjectBackedNativeHandler(context) {
RouteFunction("Install",
base::Bind(&WebstoreBindings::Install, base::Unretained(this)));
} | cwe | CWE-284 | C/C++ |
void WebPageSerializerImpl::openTagToString(Element* element,
SerializeDomParam* param)
{
bool needSkip;
StringBuilder result;
result.append(preActionBeforeSerializeOpenTag(element, param, &needSkip));
if (needSkip)
return;
result.append('<');
... | cwe | CWE-20 | C/C++ |
/*
* SPDX-License-Identifier: Apache-2.0
*/
// Copyright (c) ONNX Project Contributors.
// Licensed under the MIT license.
#include "onnx/common/path.h"
namespace ONNX_NAMESPACE {
std::string path_join(const std::string& origin, const std::string& append) {
if (origin.find_last_of(k_preferred_path_separator) !=... | cwe | CWE-22 | Python |
package restapi
import (
"errors"
"runtime"
"strings"
"github.com/go-openapi/swag"
"github.com/minio/console/models"
"github.com/minio/madmin-go"
)
var (
// ErrorGeneric is a generic error message
ErrorGeneric = errors.New("an error occurred, please try again")
errInvalidCredentials = err... | cwe | CWE-306 | Go |
WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info,
const int argc,const char **argv,Image **images,ExceptionInfo *exception)
{
const char
*option;
ImageInfo
*mogrify_info;
MagickStatusType
status;
PixelInterpolateMethod
interpolate_method;
QuantizeInfo
*quantize_info... | cwe | CWE-399 | Unknown |
/*
* Copyright (C) 2011, 2012, 2013 Citrix Systems
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, thi... | cwe | CWE-682 | C/C++ |
(function($) {
var code = null;
$.get('/version?_=' + new Date().getTime(), function(p) {
$('#connector-version').text('v' + p);
$.get('https://cdn.auth0.com/connector/windows/latest.json?_=' + new Date().getTime(), function(data) {
var tab = $('#update-tab');
if (tab.length > 0) {
tab.show();
ta... | cwe | CWE-352 | JavaScript |
bool Unpack::UnpackLargeBlock(UnpackThreadData &D)
{
if (!D.TableRead)
{
D.TableRead=true;
if (!ReadTables(D.Inp,D.BlockHeader,D.BlockTables))
{
D.DamagedData=true;
return false;
}
}
if (D.Inp.InAddr>D.BlockHeader.HeaderSize+D.BlockHeader.BlockSize)
{
D.DamagedData=true;
r... | cwe | CWE-787 | C/C++ |
static Maybe<bool> IncludesValueImpl(Isolate* isolate,
Handle<JSObject> receiver,
Handle<Object> value,
uint32_t start_from, uint32_t length) {
DCHECK(JSObject::PrototypeHasNoElements(isolate, *receiver));
bool search_for_hole = value->IsUndefined(isolate);
if (!search_for_hole) {
Maybe<bool> result = Nothin... | cwe | CWE-704 | C/C++ |
function Ae(e,a){var i,t,n=e.__data__;return("string"==(t=typeof(i=a))||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==i:null===i)?n["string"==typeof a?"string":"hash"]:n.map} | cwe | CWE-79 | JavaScript |
INTERNAL void vterm_allocator_free(VTerm *vt, void *ptr)
{
(*vt->allocator->free)(ptr, vt->allocdata);
} | cwe | CWE-476 | Unknown |
/* radare - LGPL3 - Copyright 2016-2020 - Matthieu (c0riolis) Tardy - l0stb1t*/
#include <r_io.h>
#include <r_bin.h>
#include "marshal.h"
#include "pyc_magic.h"
// avoiding using r2 internals asserts
#define if_true_return(cond,ret) if(cond){return(ret);}
static ut32 magic_int;
static ut32 symbols_ordinal = 0;
stat... | cwe | CWE-416 | C/C++ |
public TMap readMapBegin() throws TException {
int size = readVarint32();
byte keyAndValueType = size == 0 ? 0 : readByte();
return new TMap(
getTType((byte) (keyAndValueType >> 4)), getTType((byte) (keyAndValueType & 0xf)), size);
} | cwe | CWE-770 | Java |
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);
TF_LITE_ENSURE_... | cwe | CWE-787 | C/C++ |
long ssl2_ctrl(SSL *s, int cmd, long larg, void *parg)
{
int ret=0;
switch(cmd)
{
case SSL_CTRL_GET_SESSION_REUSED:
ret=s->hit;
break;
default:
break;
}
return(ret);
} | cwe | CWE-310 | Unknown |
main (
int argc,
char *argv[]
)
{
int exit_val;
fribidi_boolean file_found;
char *s;
FILE *IN;
text_width = default_text_width;
do_break = true;
do_pad = true;
do_mirror = true;
do_clean = false;
do_reorder_nsm = false;
show_input = false;
show_visual = true;
show_basedir = false;
show_... | cwe | CWE-787 | Unknown |
function simplePurifier(
text,
bHtml = false,
bSvg = false,
bSvgFilters = false
)
{
return DOMPurify.sanitize(
sanitizeDom(text)
.replaceAll('<', '<')
.replaceAll('<', '<')
.replaceAll('<', '<')
.replaceAll('>', '>')
... | cwe | CWE-116 | JavaScript |
export function parse(data: string, params?: IParseConfig): IIniObject {
const {
delimiter = '=',
comment = ';',
nothrow = false,
autoTyping = true,
dataSections = [],
} = { ...params };
let typeParser: ICustomTyping;
if (typeof autoTyping === 'function') {
typeParser = autoTyping;
} e... | cwe | CWE-1321 | JavaScript |
void Compute(OpKernelContext* context) override {
// Input tensor is of the following dimensions:
// [ batch, in_z, in_y, in_x, in_channels ]
const Tensor& input = context->input(0);
// Input filter is of the following dimensions:
// [ filter_z, filter_y, filter_x, in_channels, out_channels]
co... | cwe | CWE-369 | Unknown |
png_error_callback(png_structp png_read_ptr,
png_const_charp error_msg)
{
LoadContext* lc;
lc = png_get_error_ptr(png_read_ptr);
lc->fatal_error_occurred = TRUE;
/* I don't trust libpng to call the error callback only once,
* so check for al... | cwe | CWE-20 | Unknown |
error_t getHostByName(NetInterface *interface,
const char_t *name, IpAddr *ipAddr, uint_t flags)
{
error_t error;
HostType type;
HostnameResolver protocol;
//Default address type depends on TCP/IP stack configuration
#if (IPV4_SUPPORT == ENABLED)
type = HOST_TYPE_IPV4;
#elif (IPV6_SUPPORT == ENABLED)... | cwe | CWE-20 | C/C++ |
_nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
char *buffer, size_t buflen, int *errnop,
int *herrnop, int32_t *ttlp)
{
if (__res_maybe_init (&_res, 0) == -1)
return NSS_STATUS_UNAVAIL;
/*
* if there aren't any dots, it could be a user-level alias.
* this is also do... | cwe | CWE-476 | Unknown |
handle_get_connection (GVfsDBusDaemon *object,
GDBusMethodInvocation *invocation,
gpointer user_data)
{
GVfsDaemon *daemon = G_VFS_DAEMON (user_data);
GDBusServer *server;
GError *error;
gchar *address1;
NewConnectionData *data;
char *socket_dir;
gchar *guid;
... | cwe | CWE-276 | Unknown |
static VALUE cState_indent_set(VALUE self, VALUE indent)
{
unsigned long len;
GET_STATE(self);
Check_Type(indent, T_STRING);
len = RSTRING_LEN(indent);
if (len == 0) {
if (state->indent) {
ruby_xfree(state->indent);
state->indent = NULL;
state->indent_len ... | cwe | CWE-119 | Unknown |
Status genTableRowsForSqliteTable(const fs::path& sqlite_db,
const std::string& sqlite_query,
TableRows& results,
bool respect_locking) {
sqlite3* db = nullptr;
if (!pathExists(sqlite_db).ok()) {
return Status(... | cwe | CWE-77 | Unknown |
struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
struct sctp_chunk *asconf)
{
sctp_addiphdr_t *hdr;
union sctp_addr_param *addr_param;
sctp_addip_param_t *asconf_param;
struct sctp_chunk *asconf_ack;
__be16 err_code;
int length = 0;
int chunk_len;
__u32 serial;
int all_param_p... | cwe | CWE-20 | C/C++ |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
// TODO(b/137042749): TFLite infrastructure (converter, delegate) doesn't
// fully support 0-output ops yet. Currently it works if we manually crfat
// a TFLite graph that contains variable ops. Note... | cwe | CWE-125 | C/C++ |
__mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
mpt_ioctl_header __user *uhdr = (void __user *) arg;
mpt_ioctl_header khdr;
int iocnum;
unsigned iocnumX;
int nonblock = (file->f_flags & O_NONBLOCK);
int ret;
MPT_ADAPTER *iocp = NULL;
if (copy_from_user(&khdr, uhdr, sizeof(khdr))) {
... | cwe | CWE-369 | C/C++ |
/* Copyright 2016 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-20 | C/C++ |
static void fuse_evict_inode(struct inode *inode)
{
struct fuse_inode *fi = get_fuse_inode(inode);
truncate_inode_pages_final(&inode->i_data);
clear_inode(inode);
if (inode->i_sb->s_flags & SB_ACTIVE) {
struct fuse_conn *fc = get_fuse_conn(inode);
if (FUSE_IS_DAX(inode))
fuse_dax_inode_cleanup(inode);
if... | cwe | CWE-459 | Unknown |
BGD_DECLARE(void *) gdImageWebpPtrEx (gdImagePtr im, int *size, int quality)
{
void *rv;
gdIOCtx *out = gdNewDynamicCtx(2048, NULL);
if (out == NULL) {
return NULL;
}
gdImageWebpCtx(im, out, quality);
rv = gdDPExtractData(out, size);
out->gd_free(out);
return rv;
} | cwe | CWE-415 | Unknown |
plan_a (char const *filename)
{
char const *s;
char const *lim;
char const **ptr;
char *buffer;
lin iline;
size_t size = instat.st_size;
/* Fail if the file size doesn't fit in a size_t,
or if storage isn't available. */
if (! (size == instat.st_size
&& (buffer = malloc (size ? size : (size_t) ... | cwe | CWE-59 | Unknown |
// SPDX-License-Identifier: GPL-2.0-only
/*
* net/sched/sch_qfq.c Quick Fair Queueing Plus Scheduler.
*
* Copyright (c) 2009 Fabio Checconi, Luigi Rizzo, and Paolo Valente.
* Copyright (c) 2012 Paolo Valente.
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/bitops.h>
#include <linux/er... | cwe | CWE-787 | C/C++ |
void hfi1_mmu_rb_remove(struct mmu_rb_handler *handler,
struct mmu_rb_node *node)
{
unsigned long flags;
/* Validity of handler and node pointers has been checked by caller. */
trace_hfi1_mmu_rb_remove(node->addr, node->len);
spin_lock_irqsave(&handler->lock, flags);
__mmu_int_rb_remove(node, &handler->root);
... | cwe | CWE-416 | Unknown |
package com.salesmanager.shop.admin.model.reference;
import java.io.Serializable;
public class Weight implements Serializable {
/**
*
*/
private static final long serialVersionUID = -1006772612089740285L;
private String code;
private String name;
public String getName() {
return name;
}
public void se... | cwe | CWE-639 | Java |
#!/usr/bin/env python2
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
from __future__ import absolute_import, division, print_function, unicode_literals
import cPickle
import hashlib
import random
import shutil
import sys
import zipfile
from json import load as load_j... | cwe | CWE-502 | Python |
BGD_DECLARE(void) gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
{
int lastBorder;
/* Seek left */
int leftLimit, rightLimit;
int i;
int restoreAlphaBleding;
if (border < 0) {
/* Refuse to fill to a non-solid border */
return;
}
leftLimit = (-1);
restoreAlphaBleding =... | cwe | CWE-119 | C/C++ |
/* This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
* Copyright (C) 2012-2019 mutschler, janeczku, jkrehm, OzzieIsaacs
*
* 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 Soft... | cwe | CWE-352 | JavaScript |
void EC_GROUP_clear_free(EC_GROUP *group)
{
if (!group) return;
if (group->meth->group_clear_finish != 0)
group->meth->group_clear_finish(group);
else if (group->meth->group_finish != 0)
group->meth->group_finish(group);
EC_EX_DATA_clear_free_all_data(&group->extra_data);
if (group->generator != NULL)
... | cwe | CWE-320 | Unknown |
bool WideToCharMap(const wchar *Src,char *Dest,size_t DestSize,bool &Success)
{
// String with inconvertible characters mapped to private use Unicode area
// must have the mark code somewhere.
if (wcschr(Src,(wchar)MappedStringMark)==NULL)
return false;
Success=true;
uint SrcPos=0,DestPos=0;
while (Src... | cwe | CWE-787 | C/C++ |
static void ssl3_take_mac(SSL *s)
{
const char *sender;
int slen;
if (s->state & SSL_ST_CONNECT)
{
sender=s->method->ssl3_enc->server_finished_label;
slen=s->method->ssl3_enc->server_finished_label_len;
}
else
{
sender=s->method->ssl3_enc->client_finished_label;
slen=s->method->ssl3_enc->client_fini... | cwe | CWE-20 | Unknown |
setup_seccomp (FlatpakBwrap *bwrap,
const char *arch,
gulong allowed_personality,
FlatpakRunFlags run_flags,
GError **error)
{
gboolean multiarch = (run_flags & FLATPAK_RUN_FLAG_MULTIARCH) != 0;
gboolean devel = (run_flags & FLATPAK_R... | cwe | CWE-20 | C/C++ |
function unescape(html){return html.replace(/&([#\w]+);/g,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})} | cwe | CWE-79 | JavaScript |
/***************************************************************************
* Copyright (c) 2014-2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* Copyright (c) 2014 Martin Bříza <mbriza@redhat.com>
* Copyright (c) 2013 Abdurrahman AVCI <abdurrahmanavci@gmail.com>
*
* This program is free software; you can redis... | cwe | CWE-264 | C/C++ |
test func()
}{
{
"params disabled",
func() {
params := suite.app.ClaimsKeeper.GetParams(suite.ctx)
params.EnableClaims = false
suite.app.ClaimsKeeper.SetParams(suite.ctx, params)
resAck := suite.app.ClaimsKeeper.OnRecvPacket(suite.ctx, mockpacket, ack)
suite.Require().Equal(ack, resAck)
... | cwe | CWE-287 | Go |
private final void servlet31(HttpServletRequest request) {
try {
for(Part part:request.getParts()) {
if(part.getContentType() != null && (StringHelper.containsNonWhitespace(part.getSubmittedFileName()) || !part.getContentType().startsWith("text/plain"))) {
contentType = part.getContentType();
filenam... | cwe | CWE-23 | Java |
/*
* Copyright (C) Igor Sysoev
* Copyright (C) NGINX, Inc.
*/
#include <njs_main.h>
#define njs_array_func(type) \
((type << 1) | NJS_ARRAY_FUNC)
#define njs_array_arg(type) \
((type << 1) | NJS_ARRAY_AR... | cwe | CWE-416 | C/C++ |
Sidebar.prototype.initPalettes = function()
{
var imgDir = GRAPH_IMAGE_PATH;
var dir = STENCIL_PATH;
var signs = this.signs;
var rack = this.rack;
var pids = this.pids;
var cisco = this.cisco;
var sysml = this.sysml;
if (urlParams['createindex'] == '1')
{
this.createdSearchIndex = [];
}
th... | cwe | CWE-94 | JavaScript |
long VideoTrack::Parse(Segment* pSegment, const Info& info,
long long element_start, long long element_size,
VideoTrack*& pResult) {
if (pResult)
return -1;
if (info.type != Track::kVideo)
return -1;
long long width = 0;
long long height = 0;
long long d... | cwe | CWE-20 | C/C++ |
bgp_capability_msg_parse (struct peer *peer, u_char *pnt, bgp_size_t length)
{
u_char *end;
struct capability cap;
u_char action;
struct bgp *bgp;
afi_t afi;
safi_t safi;
bgp = peer->bgp;
end = pnt + length;
while (pnt < end)
{
/* We need at least action, capability code and capability len... | cwe | CWE-125 | C/C++ |
def show_owners name
response = rubygems_api_request :get, "api/v1/gems/#{name}/owners.yaml" do |request|
request.add_field "Authorization", api_key
end
with_response response do |resp|
owners = YAML.load resp.body
say "Owners for gem: #{name}"
owners.each do |owner|
say "-... | cwe | CWE-502 | Ruby |
package com.salesmanager.shop.admin.model.permission;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPrope... | cwe | CWE-79 | Java |
/**
* Copyright (c) 2006-2020, JGraph Ltd
* Copyright (c) 2006-2020, draw.io AG
*/
(function()
{
// Adds scrollbars for menus that exceed the page height
var mxPopupMenuShowMenu = mxPopupMenu.prototype.showMenu;
mxPopupMenu.prototype.showMenu = function()
{
this.div.style.overflowY = 'auto';
this.div.style.o... | cwe | CWE-79 | Java |
PrintMsg_Print_Params::PrintMsg_Print_Params()
: page_size(),
content_size(),
printable_area(),
margin_top(0),
margin_left(0),
dpi(0),
min_shrink(0),
max_shrink(0),
desired_dpi(0),
document_cookie(0),
selection_only(false),
supports_alpha_blend(false),
preview_ui_add... | cwe | CWE-200 | C/C++ |
void operator()(OpKernelContext* ctx, const Index num_segments,
const TensorShape& segment_ids_shape,
typename TTypes<Index>::ConstFlat segment_ids,
const Index data_size, const T* data,
typename TTypes<T, 2>::Tensor output) {
output.setConstan... | cwe | CWE-122 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% M M AAA TTTTT L AAA BBBB ... | cwe | CWE-20 | C/C++ |
rfbProcessClientNormalMessage(rfbClientPtr cl)
{
int n=0;
rfbClientToServerMsg msg;
char *str;
int i;
uint32_t enc=0;
uint32_t lastPreferredEncoding = -1;
char encBuf[64];
char encBuf2[64];
#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
if (cl->wsctx && webSocketCheckDisconnect(cl))
retu... | cwe | CWE-189 | C/C++ |
"12px";var ka=X.getRealtimeError();X=X.getRealtimeState();var ja=mxResources.get("realtimeCollaboration");1==X?(ea.src=Editor.syncImage,ja+=" ("+mxResources.get("online")+")"):(ea.src=Editor.syncProblemImage,ja=null!=ka&&null!=ka.message?ja+(" ("+ka.message+")"):ja+(" ("+mxResources.get("disconnected")+")"));ea.setAttr... | cwe | CWE-94 | JavaScript |
private def createSessionId(siteId: SiteId, userId: UserId): SidOk = {
// For now, create a SID value and *parse* it to get a SidOk.
// This is stupid and inefficient.
val now = globals.now()
val uid = "" // for now
val useridDateRandom =
userId +"."+
now.millis +"."+
(nex... | cwe | CWE-613 | Scala |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.