code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
QPDF::addPage(QPDFObjectHandle newpage, bool first)
{
if (first)
{
insertPage(newpage, 0);
}
else
{
insertPage(newpage,
getRoot().getKey("/Pages").getKey("/Count").getIntValue());
}
} | cwe | CWE-787 | Unknown |
QPDF_Array::getItem(int n) const
{
if ((n < 0) || (n >= static_cast<int>(this->items.size())))
{
throw std::logic_error(
"INTERNAL ERROR: bounds error accessing QPDF_Array element");
}
return this->items.at(n);
} | cwe | CWE-787 | Unknown |
/* vi:set ts=8 sts=4 sw=4 noet:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
#include "vim.h"
/*
* Vim originated fro... | cwe | CWE-416 | C/C++ |
static int pkey_GOST_ECcp_decrypt(EVP_PKEY_CTX *pctx, unsigned char *key,
size_t *key_len, const unsigned char *in,
size_t in_len)
{
const unsigned char *p = in;
EVP_PKEY *priv = EVP_PKEY_CTX_get0_pkey(pctx);
GOST_KEY_TRANSPORT *gkt = NULL;
int ret =... | cwe | CWE-787 | Unknown |
// Copyright Joyent, Inc. and other Node contributors.
//
// 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, modi... | cwe | CWE-295 | JavaScript |
void RilSapSocket::sendResponse(MsgHeader* hdr) {
size_t encoded_size = 0;
uint32_t written_size;
size_t buffer_size = 0;
pb_ostream_t ostream;
bool success = false;
pthread_mutex_lock(&write_lock);
if ((success = pb_get_encoded_size(&encoded_size, MsgHeader_fields,
hdr)) && encoded_size <= IN... | cwe | CWE-264 | C/C++ |
/**
* HTTP client-side implementation that uses forge.net sockets.
*
* @author Dave Longley
*
* Copyright (c) 2010-2014 Digital Bazaar, Inc. All rights reserved.
*/
var forge = require('./forge');
require('./tls');
require('./util');
// define http namespace
var http = module.exports = forge.http = forge.http ||... | cwe | CWE-601 | JavaScript |
/*
* Copyright (C) 2001,2002 Constantin Kaplinsky. All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later ver... | cwe | CWE-787 | C/C++ |
"""
Authenticator to use GitHub OAuth with JupyterHub
"""
import json
import os
import re
import string
import warnings
from tornado.auth import OAuth2Mixin
from tornado import web
from tornado.httputil import url_concat
from tornado.httpclient import HTTPRequest, AsyncHTTPClient, HTTPError
from jupyterhub.auth im... | cwe | CWE-863 | Python |
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/dom_storage/dom_storage_context_wrapper.h"
#include <string>
#include <vector>
#include "base/barrier_closure.h"
#include "bas... | cwe | CWE-415 | C/C++ |
produce_output()
{
char *str;
FILE *mailer;
MyString subject,szTmp;
subject.sprintf("condor_preen results %s: %d old file%s found",
my_full_hostname(), BadFiles->number(),
(BadFiles->number() > 1)?"s":"");
if( MailFlag ) {
if( (mailer=email_open(PreenAdmin, subject.Value())) == NULL ) {
EXCEPT( "Can't ... | cwe | CWE-134 | C/C++ |
package authzserver
import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"mime"
"net/http"
"net/url"
"strings"
"k8s.io/apimachinery/pkg/util/sets"
"github.com/flyteorg/flytestdlib/config"
"github.com/coreos/go-oidc"
authConfig "github.com/flyteorg/flyteadmin/auth/config"
"github.com/flyteorg/flyteadmin... | cwe | CWE-613 | Go |
/*
* ScreenPressor decoder
*
* Copyright (c) 2017 Paul B Mahol
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, ... | cwe | CWE-119 | C/C++ |
char *VDir::MapPathA(const char *pInName)
{ /*
* possiblities -- relative path or absolute path with or without drive letter
* OR UNC name
*/
char szBuffer[(MAX_PATH+1)*2];
char szlBuf[MAX_PATH+1];
int length = strlen(pInName);
if (!length)
return (char*)pInName;
if (length > MAX... | cwe | CWE-125 | C/C++ |
// url.c -- Object representing uniform resource locators
// Copyright (C) 2008-2010 Markus Gutschke <markus@shellinabox.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
/... | cwe | CWE-400 | C/C++ |
void yajl_string_decode(yajl_buf buf, const unsigned char * str,
unsigned int len)
{
unsigned int beg = 0;
unsigned int end = 0;
while (end < len) {
if (str[end] == '\\') {
char utf8Buf[5];
const char * unescaped = "?";
yajl_buf_append... | cwe | CWE-134 | C/C++ |
pattern_apply_fallback (gpointer data, gpointer fallback_data)
{
RsvgPattern *pattern;
RsvgPattern *fallback;
pattern = data;
fallback = fallback_data;
if (!pattern->hasx && fallback->hasx) {
pattern->hasx = TRUE;
pattern->x = fallback->x;
}
if (!pattern->hasy && fallback->... | cwe | CWE-125 | Unknown |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-787 | C/C++ |
ArgParser::argKeepFilesOpenThreshold(char* parameter)
{
o.keep_files_open_threshold =
static_cast<size_t>(QUtil::string_to_int(parameter));
} | cwe | CWE-787 | Unknown |
urlParams.sketch?3:48)));this.getX()==U&&this.getY()==X||mxWindow.prototype.setLocation.apply(this,arguments)};var V=mxUtils.bind(this,function(){var U=this.window.getX(),X=this.window.getY();this.window.setLocation(U,X)});mxEvent.addListener(window,"resize",V);this.destroy=function(){mxEvent.removeListener(window,"res... | cwe | CWE-94 | JavaScript |
/*
* 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 |
sraSpanInsertAfter(sraSpan *newspan, sraSpan *after) {
newspan->_next = after->_next;
newspan->_prev = after;
after->_next->_prev = newspan;
after->_next = newspan;
} | cwe | CWE-476 | C/C++ |
MD5::checkFileChecksum(char const* const checksum,
char const* filename, int up_to_size)
{
bool result = false;
try
{
std::string actual_checksum = getFileChecksum(filename, up_to_size);
result = (checksum == actual_checksum);
}
catch (std::runtime_error const&)
{
// Ignore -- return... | cwe | CWE-787 | Unknown |
/*
* 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-89 | Java |
static int llcp_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t len, int flags)
{
int noblock = flags & MSG_DONTWAIT;
struct sock *sk = sock->sk;
unsigned int copied, rlen;
struct sk_buff *skb, *cskb;
int err = 0;
pr_debug("%p %zu\n", sk, len);
msg->msg_namelen = 0;
l... | cwe | CWE-269 | Unknown |
int ntlm_read_ntlm_v2_response(wStream* s, NTLMv2_RESPONSE* response)
{
Stream_Read(s, response->Response, 16);
return ntlm_read_ntlm_v2_client_challenge(s, &(response->Challenge));
} | cwe | CWE-125 | Unknown |
int ssl_cipher_list_to_bytes(SSL *s,STACK_OF(SSL_CIPHER) *sk,unsigned char *p,
int (*put_cb)(const SSL_CIPHER *, unsigned char *))
{
int i,j=0;
SSL_CIPHER *c;
unsigned char *q;
#ifndef OPENSSL_NO_KRB5
int nokrb5 = !kssl_tgt_is_available(s->kssl_ctx);
#endif /* OPENSSL_NO_KRB5 */... | cwe | CWE-310 | Unknown |
/*
* 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 |
"""Tornado handlers for security logging."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from tornado import gen, web
from ...base.handlers import IPythonHandler, json_errors
from . import csp_report_uri
class CSPReportHandler(IPythonHandler):
'''Accepts ... | cwe | CWE-79 | Python |
bool smbXcli_session_is_guest(struct smbXcli_session *session)
{
if (session == NULL) {
return false;
}
if (session->conn == NULL) {
return false;
}
if (session->conn->protocol >= PROTOCOL_SMB2_02) {
if (session->smb2->session_flags & SMB2_SESSION_FLAG_IS_GUEST) {
return true;
}
return false;
}
i... | cwe | CWE-94 | 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-601 | Python |
def main(_):
sess = tf.Session()
# Construct the TensorFlow network.
ph_float = tf.placeholder(tf.float32, name="ph_float")
x = tf.transpose(ph_float, name="x")
v = tf.Variable(np.array([[-2.0], [-3.0], [6.0]], dtype=np.float32), name="v")
m = tf.constant(
np.array([[0.0, 1.0, 2.0], [-4.0, -1.0, 0.0]... | cwe | CWE-377 | Python |
static void parseServerMonitors(HttpRoute *route, cchar *key, MprJson *prop)
{
MprJson *child;
MprTicks period;
cchar *counter, *expression, *limit, *relation, *defenses;
int ji;
for (ITERATE_CONFIG(route, prop, child, ji)) {
defenses = mprGetJson(child, "defenses");
... | cwe | CWE-476 | C/C++ |
PUBLIC char *espBuildScript(HttpRoute *route, cchar *page, cchar *path, cchar *cacheName, cchar *layout,
EspState *state, char **err)
{
EspState top;
EspParse parse;
MprBuf *body;
cchar *layoutsDir;
char *control, *incText, *where, *layoutCode, *bodyCode;
char ... | cwe | CWE-476 | C/C++ |
exif_data_load_data (ExifData *data, const unsigned char *d_orig,
unsigned int ds)
{
unsigned int l;
ExifLong offset;
ExifShort n;
const unsigned char *d = d_orig;
unsigned int len, fullds;
if (!data || !data->priv || !d || !ds)
return;
exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
"... | cwe | CWE-190 | C/C++ |
processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
struct iter_env* ie, int id)
{
int dnsseclame = 0;
enum response_type type;
iq->num_current_queries--;
if(!inplace_cb_query_response_call(qstate->env, qstate, iq->response))
log_err("unable to call query_response callback");
if(iq->re... | cwe | CWE-613 | Unknown |
static void ssl_check_for_safari(SSL *s, const unsigned char *data,
const unsigned char *limit)
{
unsigned short type, size;
static const unsigned char kSafariExtensionsBlock[] = {
0x00, 0x0a, /* elliptic_curves extension */
0x00, 0x08, /*... | cwe | CWE-190 | Unknown |
/*
* Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com>
* 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 co... | cwe | CWE-190 | C/C++ |
static void Process_ipfix_template_withdraw(exporter_ipfix_domain_t *exporter, void *DataPtr, uint32_t size_left, FlowSource_t *fs) {
ipfix_template_record_t *ipfix_template_record;
// a template flowset can contain multiple records ( templates )
while ( size_left ) {
uint32_t id;
// map next record.
ipfix_te... | cwe | CWE-190 | Unknown |
exports['date-time'] = /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}[tT ]\d{2}:\d{2}:\d{2}(\.\d+)?([zZ]|[+-]\d{2}:\d{2})$/
exports['date'] = /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}$/
exports['time'] = /^\d{2}:\d{2}:\d{2}$/
exports['email'] = /^\S+@\S+$/
exports['ip-address'] = exports['ipv4'] = /^(?:(?:25[0-5]|2[0-4][0-9]|... | cwe | CWE-20 | Java |
/* $OpenBSD: serverloop.c,v 1.188 2016/11/30 03:00:05 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
* Server main loop for handling the interactive session.
*
* As far as I am concerned, the code I ha... | cwe | CWE-264 | C/C++ |
async function downloadNpmStarter({ name, version }, parentDir, { useYarn } = {}) {
// Download from npm, using yarn if possible
if (useYarn) {
await execa.command(`yarn add ${name}@${version} --no-lockfile --silent`, {
cwd: parentDir,
});
} else {
await execa.command(`npm install ${name}@${vers... | cwe | CWE-78 | JavaScript |
function serializeAndUploadFiles(s, obj, files) {
for(var i = 0; i < files.length; i++) {
if(!isFileTypeAllowed(obj, s, files[i].name)) {
if(s.showError) $("<div class='" + s.errorClass + "'><b>" + files[i].name + "</b> " + s.extErrorStr + s.allowedTypes + "</div>").appen... | cwe | CWE-79 | JavaScript |
static PresentationContext* PresentationContext_new(VideoClientContext* video, BYTE PresentationId,
UINT32 x, UINT32 y, UINT32 width, UINT32 height)
{
VideoClientContextPriv* priv = video->priv;
PresentationContext* ret = calloc(1, sizeof(*ret));
if (!ret)
return... | cwe | CWE-190 | C/C++ |
XListFonts(
register Display *dpy,
_Xconst char *pattern, /* null-terminated */
int maxNames,
int *actualCount) /* RETURN */
{
register long nbytes;
register unsigned i;
register int length;
char **flist = NULL;
char *ch = NULL;
char *chstart;
char *chend;
int count = 0;
xListFontsR... | cwe | CWE-193 | C/C++ |
bool PamBackend::start(const QString &user) {
bool result;
QString service = QStringLiteral("sddm");
if (user == QStringLiteral("sddm") && m_greeter)
service = QStringLiteral("sddm-greeter");
else if (m_app->session()->path().isEmpty())
service = QStringLiteral(... | cwe | CWE-284 | C/C++ |
static int mincore_unmapped_range(unsigned long addr, unsigned long end,
struct mm_walk *walk)
{
walk->private += __mincore_unmapped_range(addr, end,
walk->vma, walk->private);
return 0;
} | cwe | CWE-319 | Unknown |
DECLAREContigPutFunc(putcontig8bitYCbCr41tile)
{
(void) y;
/* XXX adjust fromskew */
do {
x = w>>2;
do {
int32 Cb = pp[4];
int32 Cr = pp[5];
YCbCrtoRGB(cp [0], pp[0]);
YCbCrtoRGB(cp [1], pp[1]);
YCbCrtoRGB(cp [2], pp[2]);
YCbCrtoRGB(cp [3], pp[3]);
cp += 4;
pp += ... | cwe | CWE-119 | Unknown |
static TPM_RC StartAuthSession(TSS2_SYS_CONTEXT *sapi_context, SESSION *session )
{
TPM_RC rval;
TPM2B_ENCRYPTED_SECRET key;
char label[] = "ATH";
UINT16 bytes;
int i;
key.t.size = 0;
if( session->nonceOlder.t.size == 0 )
{
/* this is an internal routine to TSS and should be re... | cwe | CWE-522 | C/C++ |
aperture_report(gerbv_aperture_t *apertures[], int aperture_num,
double x, double y, gerbv_image_t *img, gerbv_project_t *prj)
{
gerbv_aperture_type_t type = apertures[aperture_num]->type;
double *params = apertures[aperture_num]->parameter;
gerbv_simplified_amacro_t *sim = apertures[aperture_num]->simplified;
do... | cwe | CWE-200 | Unknown |
ciphertext_to_compressed (gnutls_session_t session,
gnutls_datum_t *ciphertext,
opaque * compress_data,
int compress_size,
uint8_t type, record_parameters_st * params,
uint64* sequence)
{
... | cwe | CWE-310 | C/C++ |
status_t MyOpusExtractor::readNextPacket(MediaBuffer **out) {
if (mOffset <= mFirstDataOffset && mStartGranulePosition < 0) {
MediaBuffer *mBuf;
uint32_t numSamples = 0;
uint64_t curGranulePosition = 0;
while (true) {
status_t err = _readNextPacket(&mBuf, /* calcVorbisTimestamp = */false);
if (err != OK && err !... | cwe | CWE-772 | C/C++ |
pullf_read_max(PullFilter *pf, int len, uint8 **data_p, uint8 *tmpbuf)
{
int res,
total;
uint8 *tmp;
res = pullf_read(pf, len, data_p);
if (res <= 0 || res == len)
return res;
/* read was shorter, use tmpbuf */
memcpy(tmpbuf, *data_p, res);
*data_p = tmpbuf;
len -= res;
total = res;
while (len >... | cwe | CWE-120 | Unknown |
function format_topic(topic_data) {
const last_msg = message_store.get(topic_data.last_msg_id);
const stream = last_msg.stream;
const stream_id = last_msg.stream_id;
const stream_info = sub_store.get(stream_id);
if (stream_info === undefined) {
// stream was deleted
return {};
}
... | cwe | CWE-79 | JavaScript |
static void nsc_rle_decode(BYTE* in, BYTE* out, UINT32 originalSize)
{
UINT32 len;
UINT32 left;
BYTE value;
left = originalSize;
while (left > 4)
{
value = *in++;
if (left == 5)
{
*out++ = value;
left--;
}
else if (value == *in)
{
in++;
if (*in < 0xFF)
{
len = (UINT32) *... | cwe | CWE-787 | C/C++ |
/* $Id: upnpsoap.c,v 1.151 2018/03/13 10:32:53 nanard Exp $ */
/* vim: tabstop=4 shiftwidth=4 noexpandtab
* MiniUPnP project
* http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
* (c) 2006-2018 Thomas Bernard
* This software is subject to the conditions detailed
* in the LICENCE file provided within the d... | cwe | CWE-476 | C/C++ |
dhcp6opt_print(netdissect_options *ndo,
const u_char *cp, const u_char *ep)
{
const struct dhcp6opt *dh6o;
const u_char *tp;
size_t i;
uint16_t opttype;
size_t optlen;
uint8_t auth_proto;
u_int authinfolen, authrealmlen;
int remain_len; /* Length of remaining options */
int label_len; /* Labe... | cwe | CWE-125 | C/C++ |
package com.salesmanager.shop.mapper.catalog;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.co... | cwe | CWE-639 | Java |
package main
import (
"encoding/json"
"errors"
"fmt"
tykerror "github.com/TykTechnologies/tyk-identity-broker/error"
"io/ioutil"
"net/http"
"github.com/sirupsen/logrus"
"github.com/TykTechnologies/tyk-identity-broker/tap"
"github.com/gorilla/mux"
)
var APILogTag string = "API"
type APIOKMessage struct {
S... | cwe | CWE-287 | Go |
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <math.h>
#include <fstream>
#include <sstream>
#include <iostream>
#include <unistd.h>
#include <errno.h>
#include "boinc/sched_msgs.h"
#include "boinc/error_numbers.h"
#include "boinc/boinc_db.h"
#include "sched_util.h"
#include "val... | cwe | CWE-120 | C/C++ |
removeExtension({ extensionId }) {
checkAuthentication(this)
const extension = Extensions.findOne({ _id: extensionId })
if (extension) {
Extensions.remove({ _id: extension._id })
return 'notifications.success'
}
return new Meteor.Error('Extension does not exist.')
}, | cwe | CWE-285 | JavaScript |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
const TfLiteTensor* multipliers = GetInput(context, node, kInputMultipliers);
if (IsDynamicTensor(output)) {
TF_LI... | cwe | CWE-787 | C/C++ |
ECDSA_Signature_Operation::raw_sign(const uint8_t msg[], size_t msg_len,
RandomNumberGenerator& rng)
{
BigInt m(msg, msg_len, m_group.get_order_bits());
#if defined(BOTAN_HAS_RFC6979_GENERATOR)
const BigInt k = generate_rfc6979_nonce(m_x, m_group.get_order(), m, m_rfc6979_h... | cwe | CWE-200 | C/C++ |
void Chapters::Edition::Clear()
{
while (m_atoms_count > 0)
{
Atom& a = m_atoms[--m_atoms_count];
a.Clear();
}
delete[] m_atoms;
m_atoms = NULL;
m_atoms_size = 0;
} | cwe | CWE-119 | C/C++ |
/**
* (c) jSuites Javascript Web Components
*
* Website: https://jsuites.net
* Description: Create amazing web based applications.
*
* MIT License
*
*/
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' ... | cwe | CWE-79 | JavaScript |
/*
* . .o8 oooo
* .o8 "888 `888
* .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo
* 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P'
* 888 888 888 888 8... | cwe | CWE-434 | JavaScript |
static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type)
{
hdlc_device *hdlc = dev_to_hdlc(frad);
pvc_device *pvc;
struct net_device *dev;
int used;
if ((pvc = add_pvc(frad, dlci)) == NULL) {
netdev_warn(frad, "Memory squeeze on fr_add_pvc()\n");
return -ENOBUFS;
}
if (*get_dev_p(pvc, ty... | cwe | CWE-703 | Unknown |
int sas_ex_revalidate_domain(struct domain_device *port_dev)
{
int res;
struct domain_device *dev = NULL;
res = sas_find_bcast_dev(port_dev, &dev);
while (res == 0 && dev) {
struct expander_device *ex = &dev->ex_dev;
int i = 0, phy_id;
do {
phy_id = -1;
res = sas_find_bcast_phy(dev, &phy_id, i, true);... | cwe | CWE-284 | Unknown |
/* 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-908 | Python |
int Chapters::GetEditionCount() const
{
return m_editions_count;
} | cwe | CWE-119 | C/C++ |
RemoteDevicePropertiesWidget::RemoteDevicePropertiesWidget(QWidget *parent)
: QWidget(parent)
, modified(false)
, saveable(false)
{
setupUi(this);
if (qobject_cast<QTabWidget *>(parent)) {
verticalLayout->setMargin(4);
}
type->addItem(tr("Samba Share"), (int)Type_Samba);
type->ad... | cwe | CWE-22 | Unknown |
static netdev_tx_t usb_8dev_start_xmit(struct sk_buff *skb,
struct net_device *netdev)
{
struct usb_8dev_priv *priv = netdev_priv(netdev);
struct net_device_stats *stats = &netdev->stats;
struct can_frame *cf = (struct can_frame *) skb->data;
struct usb_8dev_tx_msg *msg;
struct urb *urb;
struct usb_8dev... | cwe | CWE-415 | C/C++ |
void CIRCSock::ReadLine(const CString& sData) {
CString sLine = sData;
sLine.TrimRight("\n\r");
DEBUG("(" << m_pNetwork->GetUser()->GetUserName() << "/"
<< m_pNetwork->GetName() << ") IRC -> ZNC [" << sLine << "]");
bool bReturn = false;
IRCSOCKMODULECALL(OnRaw(sLine), &bReturn);
... | cwe | CWE-20 | C/C++ |
AP4_Processor::Process(AP4_ByteStream& input,
AP4_ByteStream& output,
AP4_ByteStream* fragments,
ProgressListener* listener,
AP4_AtomFactory& atom_factory)
{
// read all atoms.
// keep all atoms except [mdat]
... | cwe | CWE-476 | Unknown |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | cwe | CWE-352 | Python |
void MD5::encodeString(char const* str)
{
unsigned int len = strlen(str);
update(QUtil::unsigned_char_pointer(str), len);
final();
} | cwe | CWE-787 | Unknown |
static int inotify_update_existing_watch(struct fsnotify_group *group,
struct inode *inode,
u32 arg)
{
struct fsnotify_mark *fsn_mark;
struct inotify_inode_mark *i_mark;
__u32 old_mask, new_mask;
__u32 mask;
int add = (arg & IN_MASK_ADD);
int create = (arg & IN_MASK_CREATE);
int ret;
mask = inotify... | cwe | CWE-401 | C/C++ |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 3);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* indices = GetInput(context, node, kIndices);
const TfLiteTensor* updates = GetInput(context, node, kUpdates);
const TfLiteTenso... | cwe | CWE-125 | 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-125 | C/C++ |
GF_Err gf_isom_text_get_encoded_tx3g(GF_ISOFile *file, u32 track, u32 sidx, u32 sidx_offset, u8 **tx3g, u32 *tx3g_size)
{
GF_BitStream *bs;
GF_TrackBox *trak;
GF_Tx3gSampleEntryBox *a;
trak = gf_isom_get_track_from_file(file, track);
if (!trak) return GF_BAD_PARAM;
a = (GF_Tx3gSampleEntryBox *) gf_list_get(trak... | cwe | CWE-703 | Unknown |
>(values: Ts, utils: U, meta: M | undefined) {
const result: Record<PropertyKey, unknown> = {};
/* eslint-disable functional/no-loop-statement, functional/no-conditional-statement -- using a loop here is more performant. */
for (const key of getKeys(values)) {
const propValues = [];
for (const value of... | cwe | CWE-1321 | JavaScript |
/*----------------------------------------------------------------------------*/
/* */
/* LIBMESHB V7.61 */
/* ... | cwe | CWE-120 | C/C++ |
frag6_print(netdissect_options *ndo, register const u_char *bp, register const u_char *bp2)
{
register const struct ip6_frag *dp;
register const struct ip6_hdr *ip6;
dp = (const struct ip6_frag *)bp;
ip6 = (const struct ip6_hdr *)bp2;
ND_TCHECK(dp->ip6f_offlg);
if (ndo->ndo_vflag) {
ND_PRINT((ndo, "fra... | cwe | CWE-125 | C/C++ |
int MemIo::seek( int64_t offset, Position pos )
{
uint64_t newIdx = 0;
switch (pos) {
case BasicIo::cur: newIdx = p_->idx_ + offset; break;
case BasicIo::beg: newIdx = offset; break;
case BasicIo::end: newIdx = p_->size_ + offset; break;
}
p_->idx_ = static_... | cwe | CWE-125 | Unknown |
obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena)
{
int isinstance;
PyObject *tmp = NULL;
int lineno;
int col_offset;
if (obj == Py_None) {
*out = NULL;
return 0;
}
if (_PyObject_HasAttrId(obj, &PyId_lineno)) {
int res;
tmp = _PyObj... | cwe | CWE-125 | C/C++ |
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed... | cwe | CWE-476 | C/C++ |
this.editingHandler);L=this.graph.getLinkForCell(this.state.cell);M=this.graph.getLinksForState(this.state);this.updateLinkHint(L,M);if(null!=L||null!=M&&0<M.length)z=!0;z&&this.redrawHandles()};mxVertexHandler.prototype.updateLinkHint=function(z,L){try{if(null==z&&(null==L||0==L.length)||1<this.graph.getSelectionCount... | cwe | CWE-918 | JavaScript |
static size_t push_pipe(struct iov_iter *i, size_t size,
int *iter_headp, size_t *offp)
{
struct pipe_inode_info *pipe = i->pipe;
unsigned int p_tail = pipe->tail;
unsigned int p_mask = pipe->ring_size - 1;
unsigned int iter_head;
size_t off;
ssize_t left;
if (unlikely(size > i->count))
size = i->count;
i... | cwe | CWE-284 | C/C++ |
ChunkedDecode(Request *reqPtr, bool update)
{
const Tcl_DString *bufPtr;
const char *end, *chunkStart;
bool success = NS_TRUE;
NS_NONNULL_ASSERT(reqPtr != NULL);
bufPtr = &reqPtr->buffer;
end = bufPtr->string + bufPtr->length;
chunkStart = bufPtr->string + reqPtr->chunk... | cwe | CWE-20 | C/C++ |
function escapeArgBash(arg, interpolation, quoted) {
let result = arg.replace(/\u0000/g, "");
if (interpolation) {
result = result
.replace(/\\/g, "\\\\")
.replace(/\n/g, " ")
.replace(/(^|\s)(~|#)/g, "$1\\$2")
.replace(/(\*|\?)/g, "\\$1")
.replace(/(\$|\;|\&|\|)/g, "\\$1")
... | cwe | CWE-74 | JavaScript |
function applyReplacement(str, replacementHash, nestedKey, options) {
if (!str) return str;
options = options || replacementHash; // first call uses replacement hash combined with options
if (str.indexOf(options.interpolationPrefix || o.interpolationPrefix) < 0) return str;
var prefix = options.interp... | cwe | CWE-79 | JavaScript |
cmdline_erase_chars(
int c,
int indent
#ifdef FEAT_SEARCH_EXTRA
, incsearch_state_T *isp
#endif
)
{
int i;
int j;
if (c == K_KDEL)
c = K_DEL;
/*
* Delete current character is the same as backspace on next
* character, except at end of line.
*/
if (c == K_DEL && ccline.cmdpos ... | cwe | CWE-122 | C/C++ |
/*
* Copyright (C) 2020 HAW Hamburg
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup sys_uri_parser
* @{
*
* @file
* @brief A minimal, non-destructive URI parse... | cwe | CWE-120 | C/C++ |
# Copyright (c) 2015 Mirantis, Inc.
# 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 requir... | cwe | CWE-863 | Python |
nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp,
struct svc_export **expp)
{
struct svc_export *exp = *expp, *exp2 = NULL;
struct dentry *dentry = *dpp;
struct path path = {.mnt = mntget(exp->ex_path.mnt),
.dentry = dget(dentry)};
int err = 0;
err = follow_down(&path);
if (err < 0)... | cwe | CWE-404 | C/C++ |
snmp_api_set_oid(snmp_varbind_t *varbind, uint32_t *oid, uint32_t *ret_oid)
{
snmp_api_replace_oid(varbind, oid);
varbind->value_type = BER_DATA_TYPE_OID;
varbind->value.oid = ret_oid;
} | cwe | CWE-125 | C/C++ |
"""Tornado handlers for nbconvert."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import io
import os
import zipfile
from tornado import web, escape
from tornado.log import app_log
from ..base.handlers import (
IPythonHandler, FilesRedirectHandler,
pa... | cwe | CWE-79 | Python |
void diff_addremove(struct diff_options *options,
int addremove, unsigned mode,
const unsigned char *sha1,
const char *base, const char *path)
{
char concatpath[PATH_MAX];
struct diff_filespec *one, *two;
if (DIFF_OPT_TST(options, IGNORE_SUBMODULES) && S_ISGITLINK(mode))
return;
/* This may lo... | cwe | CWE-119 | C/C++ |
static struct sk_buff *xfrm_state_netlink(struct sk_buff *in_skb,
struct xfrm_state *x, u32 seq)
{
struct xfrm_dump_info info;
struct sk_buff *skb;
skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
if (!skb)
return ERR_PTR(-ENOMEM);
info.in_skb = in_skb;
info.out_skb = skb;
info.nlmsg_seq = seq;... | cwe | CWE-703 | C/C++ |
/* SSDP responder
*
* Copyright (c) 2017 Joachim Nilsson <troglobit@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWA... | cwe | CWE-787 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.