code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
int main(int argc, char *argv[])
{
QCoreApplication *a;
if (isTUIMode(argc, argv)) {
Global::isTUIMode = true;
a = new QCoreApplication(argc, argv);
}
#ifdef ENABLE_GUI
else {
ConsoleAppender *consoleAppender = new ConsoleAppender;
consoleAppender->setFormat(logFormat);... | cwe | CWE-59 | C/C++ |
// imagew-main.c
// Part of ImageWorsener, Copyright (c) 2011 by Jason Summers.
// For more information, see the readme.txt file.
#include "imagew-config.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "imagew-internals.h"
// Given a color type having an alpha channel, returns the index of th... | cwe | CWE-787 | C/C++ |
import dictionary from './utils/dictionary';
import tracking from './utils/tracking';
import helpers from './utils/helpers';
import path from './utils/path';
import sorting from './utils/sorting';
import lazyLoading from './utils/lazyloading';
import ajax from './plugins/ajax';
import animation from './plugins/animati... | cwe | CWE-79 | JavaScript |
const _ = require('lodash')
const cheerio = require('cheerio')
const uslug = require('uslug')
const pageHelper = require('../../../helpers/page')
const URL = require('url').URL
/* global WIKI */
module.exports = {
async render() {
const $ = cheerio.load(this.input, {
decodeEntities: true
})
if ($... | cwe | CWE-79 | JavaScript |
#!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from typing import Optional
from uuid import UUID
import azure.functions as func
import jwt
from onefuzztypes.enums import ErrorCode
from onefuzztypes.models import Error, Result, UserInfo
def get_bearer_token(request: ... | cwe | CWE-863 | Python |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-125 | C/C++ |
function f(t){if(t instanceof Error||t.status>=400)return s.updateLoadingStatus("failed"),r.newThrownErr(o()(new Error((t.message||t.statusText)+" "+e),{source:"fetch"})),void(!t.status&&t instanceof Error&&function(){try{var t;if("URL"in m.a?t=new i.a(e):(t=document.createElement("a")).href=e,"https:"!==t.protocol&&"h... | cwe | CWE-451 | JavaScript |
bqarr_in(PG_FUNCTION_ARGS)
{
char *buf = (char *) PG_GETARG_POINTER(0);
WORKSTATE state;
int32 i;
QUERYTYPE *query;
int32 commonlen;
ITEM *ptr;
NODE *tmp;
int32 pos = 0;
#ifdef BS_DEBUG
StringInfoData pbuf;
#endif
state.buf = buf;
state.state = WAITOPERAND;
state.count = 0;
state.num = 0;
s... | cwe | CWE-189 | C/C++ |
static auth_result url_remove_listener (auth_client *auth_user)
{
client_t *client = auth_user->client;
auth_t *auth = client->auth;
auth_url *url = auth->state;
time_t duration = time(NULL) - client->con->con_time;
char *username, *password, *mount, *server;
const char *mountreq;
ice_config... | cwe | CWE-119 | Unknown |
"nowrap";H.style.overflow="hidden";H.style.textOverflow="ellipsis";H.setAttribute("title",F.title+" ("+F.id+")");var R=document.createElement("input");R.setAttribute("type","checkbox");R.checked=b.sidebar.isEntryVisible(F.id);R.defaultChecked=R.checked;H.appendChild(R);mxUtils.write(H," "+F.title);l.appendChild(H);var ... | cwe | CWE-94 | JavaScript |
const Chapters::Atom* Chapters::Edition::GetAtom(int index) const
{
if (index < 0)
return NULL;
if (index >= m_atoms_count)
return NULL;
return m_atoms + index;
} | cwe | CWE-119 | C/C++ |
getvcol(
win_T *wp,
pos_T *pos,
colnr_T *start,
colnr_T *cursor,
colnr_T *end)
{
colnr_T vcol;
char_u *ptr; // points to current char
char_u *posptr; // points to char at pos->col
char_u *line; // start of the line
int incr;
int head;
#ifdef FEAT_VARTABS
int *vts = w... | cwe | CWE-125 | C/C++ |
static netdev_tx_t hns_nic_net_xmit(struct sk_buff *skb,
struct net_device *ndev)
{
struct hns_nic_priv *priv = netdev_priv(ndev);
int ret;
assert(skb->queue_mapping < ndev->ae_handle->q_num);
ret = hns_nic_net_xmit_hw(ndev, skb,
&tx_ring_data(priv, skb->queue_mapping));
if (ret == NETDEV_TX_OK... | cwe | CWE-416 | C/C++ |
# -*- 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-613 | Python |
#include "source/extensions/filters/http/jwt_authn/matcher.h"
#include "envoy/config/route/v3/route_components.pb.h"
#include "envoy/extensions/filters/http/jwt_authn/v3/config.pb.h"
#include "source/common/common/logger.h"
#include "source/common/common/matchers.h"
#include "source/common/common/regex.h"
#include "s... | cwe | CWE-476 | C/C++ |
def loadUserAnyDetails(who: String): Action[Unit] = GetAction { request =>
import request.{dao, requesterOrUnknown}
// First try looking up by `who` as a numeric user id. If won't work,
// lookup by `who` as username instead.
CLEAN_UP // make reusable [load_pat_stats_grps]
// Don't incl anyUser... | cwe | CWE-613 | Scala |
# Generated by Django 3.0.7 on 2020-09-02 14:04
import InvenTree.fields
import InvenTree.validators
import markdownx
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('part', '0047_auto_20200808_0715'),
]
operations = [
migrations.AlterF... | cwe | CWE-400 | Python |
e1000_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
E1000State *s = DO_UPCAST(NICState, nc, nc)->opaque;
struct e1000_rx_desc desc;
dma_addr_t base;
unsigned int n, rdt;
uint32_t rdh_start;
uint16_t vlan_special = 0;
uint8_t vlan_status = 0, vlan_offset = 0;
uint8_t min_... | cwe | CWE-120 | C/C++ |
}
actionItems() {
let composing = new PrivateComposing(this.user);
const items = new ItemList();
if (app.session.user && app.forum.attribute('canStartPrivateDiscussion')) {
items.add('start_private', composing.component());
} | cwe | CWE-863 | JavaScript |
def resolve
if @uri && @uri.port == 80 && FinalDestination.is_https_domain?(@uri.hostname)
@uri.scheme = "https"
@uri = URI(@uri.to_s)
end
if @limit < 0
@status = :too_many_redirects
log(:warn, "FinalDestination could not resolve URL (too many redirects): #{@uri}") if @verbose
... | cwe | CWE-835 | Ruby |
static int iccdomain(i_ctx_t * i_ctx_p, ref *space, float *ptr)
{
int components, i, code = 0;
ref *tempref, ICCdict, valref;
code = array_get(imemory, space, 1, &ICCdict);
if (code < 0)
return code;
code = dict_find_string(&ICCdict, "N", &tempref);
if (code < 0)
return code;
... | cwe | CWE-704 | Unknown |
cib_remote_perform_op(cib_t * cib, const char *op, const char *host, const char *section,
xmlNode * data, xmlNode ** output_data, int call_options, const char *name)
{
int rc = pcmk_ok;
xmlNode *op_msg = NULL;
xmlNode *op_reply = NULL;
cib_remote_opaque_t *private = cib->variant_... | cwe | CWE-399 | 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 |
// mkerrors.sh -m32
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build 386,netbsd
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m32 _const.go
package unix
import "syscall"
const (
AF_APPLETALK = 0x10
AF_ARP = 0x1c
... | cwe | CWE-287 | Go |
import os
from shutil import ExecError
import time
import re
import logging
import uuid
from lxml.html.clean import clean_html
import pypandoc
import knowledge_graph
import random
import string
from flask import Flask, render_template, request, redirect, url_for, send_from_directory, make_response
from werkzeug.utils ... | cwe | CWE-23 | Python |
static bool ad_unpack(struct adouble *ad, const size_t nentries,
size_t filesize)
{
size_t bufsize = talloc_get_size(ad->ad_data);
size_t adentries, i;
uint32_t eid, len, off;
bool ok;
/*
* The size of the buffer ad->ad_data is checked when read, so
* we wouldn't have to check our own offsets, a few e... | cwe | CWE-787 | Unknown |
package libcontainer
import (
"github.com/vishvananda/netlink/nl"
"golang.org/x/sys/unix"
)
// list of known message types we want to send to bootstrap program
// The number is randomly chosen to not conflict with known netlink types
const (
InitMsg uint16 = 62000
CloneFlagsAttr uint16 = 27281
NsPaths... | cwe | CWE-190 | Go |
xmlXPtrNewRangeNodes(xmlNodePtr start, xmlNodePtr end) {
xmlXPathObjectPtr ret;
if (start == NULL)
return(NULL);
if (end == NULL)
return(NULL);
ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
if (ret == NULL) {
xmlXPtrErrMemory("allocating range");
return(NULL);
}
m... | cwe | CWE-119 | Unknown |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-787 | C/C++ |
try_resolve_op_from_metadata (FlatpakTransaction *self,
FlatpakTransactionOperation *op,
const char *checksum,
GFile *sideload_path,
FlatpakRemoteState *state)
{
g_autoptr(GBytes) metadata_bytes = N... | cwe | CWE-269 | C/C++ |
exports.verifyCertificate = function verifyCertificate(cert, caDir, caFile, cb) {
var command = 'openssl verify -purpose sslclient';
if (caDir) {
command += ' -CApath ' + caDir;
}
if (caFile) {
command += ' -CAfile ' + caFile;
}
var openssl = exec(command, function(err, stdout, stderr) {
var validationResu... | cwe | CWE-78 | JavaScript |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#define DEBUG_TYPE "vm"
#include "hermes/VM/Interpreter.h"
#include "hermes/VM/Runtime.h"
#include "hermes/Inst/InstDecode.h"
#i... | cwe | CWE-681 | C/C++ |
static int dcc_send_one_file(int queue, const char *target, const char *fname,
IRC_SERVER_REC *server, CHAT_DCC_REC *chat,
int passive)
{
struct stat st;
char *str;
char host[MAX_IP_LEN];
int hfile, port = 0;
SEND_DCC_REC *dcc;
IPADDR own_ip;
GIOChannel *handle;
if (dcc_find_request(DCC_... | cwe | CWE-416 | Unknown |
static unsigned long ioapic_read_indirect(struct kvm_ioapic *ioapic,
unsigned long addr,
unsigned long length)
{
unsigned long result = 0;
switch (ioapic->ioregsel) {
case IOAPIC_REG_VERSION:
result = ((((IOAPIC_NUM_PINS - 1) & 0xff) << 16)
| (IOAPIC_VERSION_ID & 0xff));
break;
case IOAPIC_... | cwe | CWE-20 | Unknown |
import base64
import simplejson
import cgi
from twisted.web import server, resource
from twisted.application import internet
from twisted.web.server import Site, GzipEncoderFactory
import twisted.web.resource
from twisted.web.resource import Resource, EncodingResourceWrapper, \
Forbidd... | cwe | CWE-79 | Python |
static Image *ReadPALMImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
Image
*image;
IndexPacket
index;
MagickBooleanType
status;
MagickOffsetType
totalOffset,
seekNextDepth;
MagickPixelPacket
transpix;
register IndexPacket
*indexes;
register ssize_t
i... | cwe | CWE-772 | C/C++ |
static void init_busid_table(void)
{
/*
* This also sets the bus_table[i].status to
* STUB_BUSID_OTHER, which is 0.
*/
memset(busid_table, 0, sizeof(busid_table));
spin_lock_init(&busid_table_lock);
} | cwe | CWE-362 | Unknown |
void BaseRenderingContext2D::drawImage(ScriptState* script_state,
CanvasImageSource* image_source,
double sx,
double sy,
double sw,
... | cwe | CWE-200 | C/C++ |
int main(int argc, char **argv) {
int result;
int error = FALSE;
int display_license = FALSE;
int display_help = FALSE;
int c = 0;
struct tm *tm, tm_s;
time_t now;
char datestring[256];
nagios_macros *mac;
const char *worker_socket = NULL;
int i;
#ifdef HAVE_SIGACTION
struct sigaction sig_action;
#endif
#i... | cwe | CWE-665 | C/C++ |
def insertData(self,userid,post):
sqlText="insert into post(userid,date,comment) \
values(%d,current_timestamp(0),'%s');"%(userid,post);
result=sql.insertDB(self.conn,sqlText)
return result; | cwe | CWE-89 | Python |
search(searchTerm, callback) {
pg.connect(this.connectionUri, function (err, client, done) {
if (err) {
return console.error('Could not connect to postgres', err);
done(client);
}
searchTerm = (searchTerm || '').trim().replace(/\s+/g, ' | ');... | cwe | CWE-79 | JavaScript |
function breakQueryString(qs) {
if (!qs) {
return {}
}
if (qs.includes("?")) {
qs = qs.split("?")[1]
}
const params = qs.split("&")
let paramObj = {}
for (let param of params) {
const split = param.split("=")
paramObj[split[0]] = split.slice(1).join("=")
}
return paramObj
} | cwe | CWE-913 | JavaScript |
func Handler(configFns ...func(*Config)) http.HandlerFunc {
var once sync.Once
config := &Config{
URL: "doc.json",
DeepLinking: true,
DocExpansion: "list",
DomID: "#swagger-ui",
}
for _, configFn := range configFns {
configFn(config)
}
// create a template with name
t := template.New... | cwe | CWE-400 | Go |
// Sandstorm - Personal Cloud Sandbox
// Copyright (c) 2014 Sandstorm Development Group, Inc. and contributors
// 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
//
/... | cwe | CWE-918 | JavaScript |
int perf_event_task_disable(void)
{
struct perf_event *event;
mutex_lock(¤t->perf_event_mutex);
list_for_each_entry(event, ¤t->perf_event_list, owner_entry)
perf_event_for_each_child(event, perf_event_disable);
mutex_unlock(¤t->perf_event_mutex);
return 0;
} | cwe | CWE-264 | C/C++ |
static MagickBooleanType WriteDIBImage(const ImageInfo *image_info,Image *image,
ExceptionInfo *exception)
{
DIBInfo
dib_info;
MagickBooleanType
status;
register const Quantum
*p;
register ssize_t
i,
x;
register unsigned char
*q;
size_t
bytes_per_line;
ssize_t
y;
... | cwe | CWE-401 | C/C++ |
public function update($data)
{
if ($this->securityController->isWikiHibernated()) {
throw new \Exception(_t('WIKI_IN_HIBERNATION'));
}
return $this->dbService->query('UPDATE' . $this->dbService->prefixTable('nature') . 'SET '
. '`bn_label_nature`="' . addslashes(_con... | cwe | CWE-89 | PHP |
MagickExport MagickBooleanType IsOptionMember(const char *option,
const char *options)
{
char
**option_list,
*string;
int
number_options;
MagickBooleanType
member;
register ssize_t
i;
/*
Is option a member of the options list?
*/
if (options == (const char *) NULL)
return... | cwe | CWE-399 | C/C++ |
xsltFormatNumberConversion(xsltDecimalFormatPtr self,
xmlChar *format,
double number,
xmlChar **result)
{
xmlXPathError status = XPATH_EXPRESSION_OK;
xmlBufferPtr buffer;
xmlChar *the_format, *prefix = NULL, *suffix = NULL;
xmlChar *nprefix, *nsuffix = NULL;
xmlChar pchar;
int ... | cwe | CWE-119 | Unknown |
static int pcan_usb_fd_init(struct peak_usb_device *dev)
{
struct pcan_usb_fd_device *pdev =
container_of(dev, struct pcan_usb_fd_device, dev);
int i, err = -ENOMEM;
/* do this for 1st channel only */
if (!dev->prev_siblings) {
/* allocate netdevices common structure attached to first one */
pdev->usb_if = ... | cwe | CWE-908 | C/C++ |
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\... | cwe | CWE-416 | C/C++ |
TPM2B_ATTEST_Marshal(TPM2B_ATTEST *source, BYTE **buffer, INT32 *size)
{
UINT16 written = 0;
written += TPM2B_Marshal(&source->b, buffer, size);
return written;
} | cwe | CWE-787 | Unknown |
static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
union {
struct v4l2_format v2f;
struct v4l2_buffer v2b;
struct v4l2_framebuffer v2fb;
struct v4l2_input v2i;
struct v4l2_standard v2s;
struct v4l2_ext_controls v2ecs;
struct v4l2_event v2ev;
struct v4l2_create_buffers ... | cwe | CWE-787 | Unknown |
static int IntensityCompare(const void *x,const void *y)
{
PixelPacket
*color_1,
*color_2;
ssize_t
intensity;
color_1=(PixelPacket *) x;
color_2=(PixelPacket *) y;
intensity=(ssize_t) PixelPacketIntensity(color_1)-
(ssize_t) PixelPacketIntensity(color_2);
return((int) intensity);
} | cwe | CWE-190 | C/C++ |
# -*- coding: utf-8 -*-
# Copyright 2018 New Vector Ltd
#
# 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 l... | cwe | CWE-20 | Python |
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-787 | C/C++ |
TfLiteStatus PreluPrepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input = GetInput(context, node, 0);
TfLiteTensor* output = GetOutput(context, node, 0);
const TfLiteTensor* alpha = GetInpu... | cwe | CWE-787 | C/C++ |
def passwd_reset(user, newpasswd, db, salt=True, email=None):
""" Resets a user's password with newpasswd. Uses a random salt if salt is
set to true. """
if salt:
from random import choice
from string import uppercase, digits
randSalt = ''.join(choice(uppercase + digits) for i in range(SALT_SIZE))
... | cwe | CWE-89 | Python |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
auto* op_data = static_cast<OpData*>(node->user_data);
// Inputs: box_encodings, scores, anchors
TF_LITE_ENSURE_EQ(context, NumInputs(node), 3);
const TfLiteTensor* input_box_encodings =
GetInput(context, node, kInputTensorBoxEncodings);
c... | cwe | CWE-787 | C/C++ |
'use strict';
// match1 - section, match2 - optional full inheritance part, match3 - inherited section
const REGEXP_SECTION = /^\s*\[\s*([^:]*?)\s*(:\s*(.+?)\s*)?\]\s*$/;
const REGEXP_COMMENT = /^;.*/;
const REGEXP_SINGLE_LINE = /^\s*(.*?)\s*?=\s*?(\S.*?)$/;
const REGEXP_MULTI_LINE = /^\s*(.*?)\s*?=\s*?"(.*?)$/;
cons... | cwe | CWE-400 | JavaScript |
static int ocfs2_dio_get_block(struct inode *inode, sector_t iblock,
struct buffer_head *bh_result, int create)
{
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
struct ocfs2_inode_info *oi = OCFS2_I(inode);
struct ocfs2_write_ctxt *wc;
struct ocfs2_write_cluster_desc *desc = NULL;
struct ocfs2_dio_w... | cwe | CWE-362 | C/C++ |
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2011, Industrial Light & Magic, a division of Lucas
// Digital Ltd. LLC
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the fol... | cwe | CWE-476 | Java |
/* CAN driver for Geschwister Schneider USB/CAN devices
* and bytewerk.org candleLight USB CAN interfaces.
*
* Copyright (C) 2013-2016 Geschwister Schneider Technologie-,
* Entwicklungs- und Vertriebs UG (Haftungsbeschränkt).
* Copyright (C) 2016 Hubert Denkmair
*
* Many thanks to all socketcan devs!
*
* This ... | cwe | CWE-119 | C/C++ |
static bool split_region(struct uc_struct *uc, MemoryRegion *mr,
uint64_t address, size_t size, bool do_delete)
{
uint8_t *backup;
uint32_t perms;
uint64_t begin, end, chunk_end;
size_t l_size, m_size, r_size;
RAMBlock *block = NULL;
bool prealloc = false;
chunk_end... | cwe | CWE-697 | C/C++ |
def access?(query)
return false if record.internal == true && !user.permissions?('ticket.agent')
ticket = Ticket.lookup(id: record.ticket_id)
Pundit.authorize(user, ticket, query)
end | cwe | CWE-862 | Ruby |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* perf_client.c -- Implements the "perf" client, see
* https://tools.ietf.org/html/draft-banks-quic-performance-00
*/
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdli... | cwe | CWE-476 | C/C++ |
def file(path):
path = secure_filename(path)
if app.interface.encrypt and isinstance(app.interface.examples, str) and path.startswith(app.interface.examples):
with open(os.path.join(app.cwd, path), "rb") as encrypted_file:
encrypted_data = encrypted_file.read()
file_data = encryptor.... | cwe | CWE-22 | Python |
TfLiteStatus Subgraph::AllocateTensors() {
TFLITE_SCOPED_TAGGED_DEFAULT_PROFILE(profiler_.get(), "AllocateTensors");
if (!consistent_) {
ReportError("AllocateTensors() called on inconsistent model.");
return kTfLiteError;
}
// Restore delegation state if applicable.
TF_LITE_ENSURE_STATUS(RedoAllDeleg... | cwe | CWE-703 | Unknown |
static void ikev2_parent_inI2outR2_continue(struct pluto_crypto_req_cont *pcrc,
struct pluto_crypto_req *r,
err_t ugh)
{
struct dh_continuation *dh = (struct dh_continuation *)pcrc;
struct msg_digest *md = dh->md;
struct state *const st = md->st;
stf_status e;
DBG(DBG_CONTROLMORE,
DBG_log("... | cwe | CWE-20 | Unknown |
int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *ret)
{
int ok = 0;
BIGNUM *q = NULL;
*ret = 0;
q = BN_new();
if (q == NULL)
goto err;
BN_set_word(q, 1);
if (BN_cmp(pub_key, q) <= 0)
*ret |= DH_CHECK_PUBKEY_TOO_SMALL;
BN_copy(q, dh->p);
BN_sub_wor... | cwe | CWE-200 | Unknown |
static void test_modules()
{
assert_true_rule(
"import \"tests\" \
rule test { \
condition: tests.constants.one + 1 == tests.constants.two \
}",
NULL);
assert_true_rule(
"import \"tests\" \
rule test { \
condition: tests.constants.foo == \"foo\" \
}",
... | cwe | CWE-787 | Unknown |
/*
* kvm eventfd support - use eventfd objects to signal various KVM events
*
* Copyright 2009 Novell. All Rights Reserved.
* Copyright 2010 Red Hat, Inc. and/or its affiliates.
*
* Author:
* Gregory Haskins <ghaskins@novell.com>
*
* This file is free software; you can redistribute it and/or modify
* it unde... | cwe | CWE-20 | C/C++ |
public void write(byte[] b, int offset, int length) throws IOException {
if (b == null) {
throw new NullPointerException();
}
if (offset < 0 || offset + length > b.length) {
throw new ArrayIndexOutOfBoundsException();
}
write(fd, b, offset, length);
} | cwe | CWE-787 | Java |
recv_and_process_client_pkt(void /*int fd*/)
{
ssize_t size;
//uint8_t version;
len_and_sockaddr *to;
struct sockaddr *from;
msg_t msg;
uint8_t query_status;
l_fixedpt_t query_xmttime;
to = get_sock_lsa(G_listen_fd);
from = xzalloc(to->len);
size = recv_from_to(G_... | cwe | CWE-399 | Unknown |
static void urlParsePostBody(struct URL *url,
const struct HttpConnection *http,
const char *buf, int len) {
struct HashMap contentType;
initHashMap(&contentType, urlDestroyHashMapEntry, NULL);
const char *ctHeader = getFromHashMap(&http->header, "cont... | cwe | CWE-703 | C/C++ |
PaymentRequest::PaymentRequest(
content::RenderFrameHost* render_frame_host,
content::WebContents* web_contents,
std::unique_ptr<ContentPaymentRequestDelegate> delegate,
PaymentRequestWebContentsManager* manager,
PaymentRequestDisplayManager* display_manager,
mojo::InterfaceRequest<mojom::Payme... | cwe | CWE-189 | C/C++ |
_libssh2_channel_packet_data_len(LIBSSH2_CHANNEL * channel, int stream_id)
{
LIBSSH2_SESSION *session = channel->session;
LIBSSH2_PACKET *read_packet;
uint32_t read_local_id;
read_packet = _libssh2_list_first(&session->packets);
if(read_packet == NULL)
return 0;
while(read_packet) {
... | cwe | CWE-787 | Unknown |
def mode_receive(self, request):
"""
This is called by render_POST when the client is telling us
that it is ready to receive data as soon as it is available.
This is the basis of a long-polling (comet) mechanism: the
server will wait to reply until data is available.
Arg... | cwe | CWE-79 | Python |
DecodeTime(char *str, int *tmask, struct tm * tm, fsec_t *fsec)
{
char *cp;
*tmask = DTK_TIME_M;
tm->tm_hour = strtol(str, &cp, 10);
if (*cp != ':')
return -1;
str = cp + 1;
tm->tm_min = strtol(str, &cp, 10);
if (*cp == '\0')
{
tm->tm_sec = 0;
*fsec = 0;
}
else if (*cp != ':')
return -1;
else
{... | cwe | CWE-119 | C/C++ |
import { FlowRouter } from 'meteor/ostrio:flow-router-extra'
import './projectAccessRights.html'
import { t, i18nReady } from '../../utils/i18n.js'
import {
validateEmail, getGlobalSetting, showToast,
} from '../../utils/frontend_helpers'
import Projects from '../../api/projects/projects.js'
Template.projectAccessRi... | cwe | CWE-79 | JavaScript |
handle_keywordonly_args(struct compiling *c, const node *n, int start,
asdl_seq *kwonlyargs, asdl_seq *kwdefaults)
{
PyObject *argname;
node *ch;
expr_ty expression, annotation;
arg_ty arg = NULL;
int i = start;
int j = 0; /* index for kwdefaults and kwonlyargs */
if... | cwe | CWE-125 | C/C++ |
/*
* 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++ |
return a},remove:function(a,b){var c=null;if("object"==typeof b)for(var d=mxUtils.indexOf(b,a);0<=d;)b.splice(d,1),c=a,d=mxUtils.indexOf(b,a);for(var e in b)b[e]==a&&(delete b[e],c=a);return c},isNode:function(a,b,c,d){return null==a||isNaN(a.nodeType)||null!=b&&a.nodeName.toLowerCase()!=b.toLowerCase()?!1:null==c||a.g... | cwe | CWE-94 | JavaScript |
package the.bytecode.club.bytecodeviewer.util;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.Objects;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.u... | cwe | CWE-22 | Java |
saveTitle: function(cancel) {
if ($("#conversationTitle").hasClass("editing")) {
// Return the conversation title input back to normal.
var title = $("#conversationTitle input").val();
if (!title || cancel) title = ETConversation.title;
$("#conversationTitle").html("<a href='#'>"+title+"</a>").removeClass("ed... | cwe | CWE-79 | JavaScript |
#include <math.h>
#ifndef JSI_AMALGAMATION
#include "jsiInt.h"
#endif
bool Jsi_NumberIsSubnormal(Jsi_Number a) { return fpclassify(a) == FP_SUBNORMAL; }
bool Jsi_NumberIsNormal(Jsi_Number a) { return (fpclassify(a) == FP_ZERO || isnormal(a)); }
bool Jsi_NumberIsNaN(Jsi_Number n)
{
return isnan(n);
}
int Jsi_Num... | cwe | CWE-120 | C/C++ |
static void do_init_timer(struct timer_list *timer, unsigned int flags,
const char *name, struct lock_class_key *key)
{
timer->entry.pprev = NULL;
timer->flags = flags | raw_smp_processor_id();
#ifdef CONFIG_TIMER_STATS
timer->start_site = NULL;
timer->start_pid = -1;
memset(timer->start_comm, 0, TASK_COMM_LE... | cwe | CWE-200 | Unknown |
void brcmf_rx_frame(struct device *dev, struct sk_buff *skb, bool handle_event)
{
struct brcmf_if *ifp;
struct brcmf_bus *bus_if = dev_get_drvdata(dev);
struct brcmf_pub *drvr = bus_if->drvr;
brcmf_dbg(DATA, "Enter: %s: rxp=%p\n", dev_name(dev), skb);
if (brcmf_rx_hdrpull(drvr, skb, &ifp))
return;
if (brcmf_... | cwe | CWE-20 | Unknown |
QPDFAnnotationObjectHelper::getFlags()
{
QPDFObjectHandle flags_obj = this->oh.getKey("/F");
return flags_obj.isInteger() ? flags_obj.getIntValue() : 0;
} | cwe | CWE-787 | Unknown |
BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2Ctx (gdIOCtxPtr in)
{
int sx, sy;
int i;
int ncx, ncy, nc, cs, cx, cy;
int x, y, ylo, yhi, xlo, xhi;
int vers, fmt;
t_chunk_info *chunkIdx = NULL; /* So we can gdFree it with impunity. */
unsigned char *chunkBuf = NULL; /* So we can gdFree it with impunity. */
int chu... | cwe | CWE-20 | C/C++ |
static int init_common_variables()
{
char buff[FN_REFLEN];
umask(((~my_umask) & 0666));
my_decimal_set_zero(&decimal_zero); // set decimal_zero constant;
tzset(); // Set tzname
max_system_variables.pseudo_thread_id= (ulong)~0;
server_start_time= flush_status_time= my_time(0);
rpl_filter= new Rpl_filte... | cwe | CWE-264 | Unknown |
static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh,
struct netlink_ext_ack *extack)
{
struct net *net = sock_net(in_skb->sk);
struct rtmsg *rtm;
struct nlattr *tb[RTA_MAX+1];
struct fib_result res = {};
struct rtable *rt = NULL;
struct flowi4 fl4;
__be32 dst = 0;
__be32 src = 0;
... | cwe | CWE-476 | C/C++ |
function networkStatsSingle(iface) {
function parseLinesWindowsPerfData(sections) {
let perfData = [];
for (let i in sections) {
if ({}.hasOwnProperty.call(sections, i)) {
if (sections[i].trim() !== '') {
let lines = sections[i].trim().split('\r\n');
perfData.push({
... | cwe | CWE-78 | JavaScript |
de265_error video_usability_information::hrd_parameters(error_queue* errqueue, bitreader* br, const seq_parameter_set* sps)
{
int vlc;
nal_hrd_parameters_present_flag = get_bits(br, 1);
vcl_hrd_parameters_present_flag = get_bits(br, 1);
if (nal_hrd_parameters_present_flag || vcl_hrd_parameters_present_flag)
... | cwe | CWE-787 | Unknown |
static pj_bool_t on_handshake_complete(pj_ssl_sock_t *ssock,
pj_status_t status)
{
/* Cancel handshake timer */
if (ssock->timer.id == TIMER_HANDSHAKE_TIMEOUT) {
pj_timer_heap_cancel(ssock->param.timer_heap, &ssock->timer);
ssock->timer.id = TIMER_NONE;
}
/* Update certificates info on su... | cwe | CWE-362 | C/C++ |
h2_vfp_body(struct vfp_ctx *vc, struct vfp_entry *vfe, void *ptr, ssize_t *lp)
{
struct h2_req *r2;
struct h2_sess *h2;
unsigned l;
enum vfp_status retval = VFP_OK;
CHECK_OBJ_NOTNULL(vc, VFP_CTX_MAGIC);
CHECK_OBJ_NOTNULL(vfe, VFP_ENTRY_MAGIC);
CAST_OBJ_NOTNULL(r2, vfe->priv1, H2_REQ_MAGIC);
h2 = r2->h2sess;
... | cwe | CWE-444 | Unknown |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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 applic... | cwe | CWE-770 | C/C++ |
/*! DataTables 1.11.2
* ©2008-2021 SpryMedia Ltd - datatables.net/license
*/
/**
* @summary DataTables
* @description Paginate, search and order HTML tables
* @version 1.11.2
* @file jquery.dataTables.js
* @author SpryMedia Ltd
* @contact www.datatables.net
* @copyright Copyright 200... | cwe | CWE-79 | JavaScript |
/* $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-120 | C/C++ |
# -*- coding: utf-8 -*-
'''
Support for the Git SCM
'''
from __future__ import absolute_import
# Import python libs
import os
import subprocess
# Import salt libs
from salt import utils
from salt.exceptions import SaltInvocationError, CommandExecutionError
from salt.ext.six.moves.urllib.parse import urlparse as _urlp... | cwe | CWE-200 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.