code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
/**
*
* Glewlwyd SSO Server
*
* Authentiation server
* Users are authenticated via various backend available: database, ldap
* Using various authentication methods available: password, OTP, send code, etc.
*
* WebAuthn scheme module
*
* Copyright 2019-2020 Nicolas Mora <mail@babelouest.org>
*
* This program... | cwe | CWE-120 | C/C++ |
setTimeout(function () {
updateScheduled = false;
var form = $('#mail-form-newsletter form'),
action = form.attr('action'),
target = form.attr('target');
form.attr('action', '/admin/newsletter/create_preview');... | cwe | CWE-79 | JavaScript |
zset_outputintent(i_ctx_t * i_ctx_p)
{
os_ptr op = osp;
int code = 0;
gx_device *dev = gs_currentdevice(igs);
cmm_dev_profile_t *dev_profile;
stream * s = 0L;
ref * pnval;
ref * pstrmval;
int ... | cwe | CWE-704 | C/C++ |
CAMLprim value caml_blit_string(value s1, value ofs1, value s2, value ofs2,
value n)
{
memmove(&Byte(s2, Long_val(ofs2)), &Byte(s1, Long_val(ofs1)), Int_val(n));
return Val_unit;
} | cwe | CWE-200 | C/C++ |
static int clone_submodule(const char *path, const char *gitdir, const char *url,
const char *depth, struct string_list *reference,
int quiet, int progress)
{
struct child_process cp = CHILD_PROCESS_INIT;
argv_array_push(&cp.args, "clone");
argv_array_push(&cp.args, "--no-checkout");
if (quiet)
argv_... | cwe | CWE-88 | Unknown |
mp_sint32 LoaderXM::load(XMFileBase& f, XModule* module)
{
mp_ubyte insData[230];
mp_sint32 smpReloc[MP_MAXINSSAMPS];
mp_ubyte nbu[MP_MAXINSSAMPS];
mp_uint32 fileSize = 0;
module->cleanUp();
// this will make code much easier to read
TXMHeader* header = &module->header;
TXMInstrument* instr = module->i... | cwe | CWE-787 | Unknown |
do_mouse(
oparg_T *oap, // operator argument, can be NULL
int c, // K_LEFTMOUSE, etc
int dir, // Direction to 'put' if necessary
long count,
int fixindent) // PUT_FIXINDENT if fixing indent necessary
{
static int do_always = FALSE; // ignore 'mouse' setting next time
static int got_cli... | cwe | CWE-703 | C/C++ |
long vorbis_book_decodevs_add(codebook *book,float *a,oggpack_buffer *b,int n){
if(book->used_entries>0){
int step=n/book->dim;
long *entry = alloca(sizeof(*entry)*step);
float **t = alloca(sizeof(*t)*step);
int i,j,o;
for (i = 0; i < step; i++) {
entry[i]=decode_packed_entry_number(book,b)... | cwe | CWE-787 | Unknown |
function editComment(comment, cdiv, saveCallback, deleteOnCancel)
{
curEdited = {div: cdiv, comment: comment, saveCallback: saveCallback, deleteOnCancel: deleteOnCancel};
var commentTxt = cdiv.querySelector('.geCommentTxt');
var actionsDiv = cdiv.querySelector('.geCommentActionsList');
var textArea = doc... | cwe | CWE-94 | JavaScript |
void FilterManager::maybeEndEncode(bool end_stream) {
if (end_stream) {
filter_manager_callbacks_.endStream();
}
} | cwe | CWE-416 | Unknown |
Pl_DCT::decompress(void* cinfo_p, Buffer* b)
{
struct jpeg_decompress_struct* cinfo =
reinterpret_cast<jpeg_decompress_struct*>(cinfo_p);
#if ((defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || \
defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ign... | cwe | CWE-787 | Unknown |
MagickExport void DestroyXResources(void)
{
register int
i;
unsigned int
number_windows;
XWindowInfo
*magick_windows[MaxXWindows];
XWindows
*windows;
DestroyXWidget();
windows=XSetWindows((XWindows *) ~0);
if ((windows == (XWindows *) NULL) || (windows->display == (Display *) NULL))
... | cwe | CWE-401 | C/C++ |
long keyctl_session_to_parent(void)
{
#ifdef TIF_NOTIFY_RESUME
struct task_struct *me, *parent;
const struct cred *mycred, *pcred;
struct cred *cred, *oldcred;
key_ref_t keyring_r;
int ret;
keyring_r = lookup_user_key(KEY_SPEC_SESSION_KEYRING, 0, KEY_LINK);
if (IS_ERR(keyring_r))
return PTR_ERR(keyring_r);
... | cwe | CWE-476 | Unknown |
SProcRecordRegisterClients(ClientPtr client)
{
REQUEST(xRecordRegisterClientsReq);
int status;
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xRecordRegisterClientsReq);
if ((status = SwapCreateRegister((void *) stuff)) != Success)
return status;
return ProcRecordRegisterClients(client);
... | cwe | CWE-191 | Unknown |
static int hci_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;
struct sk_buff *skb;
int copied, err;
BT_DBG("sock %p, sk %p", sock, sk);
if (flags & (MSG_OOB))
return -EOPNOTSUPP;
if (sk... | cwe | CWE-20 | Unknown |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
OpContext op_context(context, node);
OpData* op_data = reinterpret_cast<OpData*>(node->user_data);
const TfLiteTensor* lhs = GetInput(context, node, kInputLHSTensor);
const TfLiteTensor* rhs = GetInput(context, node, kInputRHSTensor);
TfLiteTensor*... | cwe | CWE-787 | C/C++ |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2012
* 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-400 | C/C++ |
function make_task($ajax_req)
{
global $send;
$from_id = $ajax_req['from_id'];
$to_id = $ajax_req['to_id'];
$patient_id = $ajax_req['pid'];
$doc_type = $ajax_req['doc_type'];
$doc_id = $ajax_req['doc_id'];
$enc = $ajax_req['enc'];
$query = "SELECT * FROM users ... | cwe | CWE-89 | PHP |
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This 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
* th... | cwe | CWE-601 | Java |
/*
* 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 "codeblock"
#include "hermes/VM/CodeBlock.h"
#include "hermes/BCGen/HBC/Bytecode.h"
#include "hermes/BCGen/H... | cwe | CWE-681 | C/C++ |
ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
int argc, char ** argv)
{
struct lan_param * p;
uint8_t data[32], temp[32];
int rc = 0;
if (argc < 2) {
print_lan_alert_set_usage();
return (-1);
}
if (strncmp(argv[0], "help", 4) == 0 ||
strncmp(argv[1], "help", 4) == 0) {
... | cwe | CWE-120 | Unknown |
int FdInStream::readWithTimeoutOrCallback(void* buf, int len, bool wait)
{
struct timeval before, after;
if (timing)
gettimeofday(&before, 0);
int n;
while (true) {
do {
fd_set fds;
struct timeval tv;
struct timeval* tvp = &tv;
if (!wait) {
tv.tv_sec = tv.tv_usec = 0;
... | cwe | CWE-787 | C/C++ |
static void filter_parse_dyn_args(GF_Filter *filter, const char *args, GF_FilterArgType arg_type, Bool for_script, char *szSrc, char *szDst, char *szEscape, char *szSecName, Bool has_meta_args, u32 argfile_level)
{
char *szArg=NULL;
u32 i=0;
u32 alloc_len=1024;
const GF_FilterArgs *f_args = NULL;
Bool opts_optiona... | cwe | CWE-787 | Unknown |
public int validateUser(boolean withConfirmEmail, XWikiContext context) throws XWikiException
{
try {
XWikiRequest request = context.getRequest();
// Get the user document
String username = convertUsername(request.getParameter("xwikiname"), context);
if (usern... | cwe | CWE-863 | Java |
int ImagingLibTiffDecode(Imaging im, ImagingCodecState state, UINT8* buffer, Py_ssize_t bytes) {
TIFFSTATE *clientstate = (TIFFSTATE *)state->context;
char *filename = "tempfile.tif";
char *mode = "r";
TIFF *tiff;
/* buffer is the encoded file, bytes is the length of the encoded file */
/* ... | cwe | CWE-787 | Unknown |
do_core_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
int swap, uint32_t namesz, uint32_t descsz,
size_t noff, size_t doff, int *flags, size_t size, int clazz)
{
#ifdef ELFCORE
int os_style = -1;
/*
* Sigh. The 2.0.36 kernel in Debian 2.1, at
* least, doesn't correctly implement name
*... | cwe | CWE-787 | Unknown |
static int get_line(JournalImporter *imp, char **line, size_t *size) {
ssize_t n;
char *c = NULL;
assert(imp);
assert(imp->state == IMPORTER_STATE_LINE);
assert(imp->offset <= imp->filled);
assert(imp->filled <= imp->size);
assert(!imp->buf || imp->size > 0);
... | cwe | CWE-770 | Unknown |
function PMA_getUrlParams(
$what, $reload, $action, $db, $table, $selected, $views,
$original_sql_query, $original_url_query
) {
$_url_params = array(
'query_type' => $what,
'reload' => (! empty($reload) ? 1 : 0),
);
if (mb_strpos(' ' . $action, 'db_') == 1) {
$_url_params['d... | cwe | CWE-79 | PHP |
static int bochs_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
BDRVBochsState *s = bs->opaque;
uint32_t i;
struct bochs_header bochs;
int ret;
bs->read_only = 1; // no write support yet
ret = bdrv_pread(bs->file, 0, &bochs, sizeof(bochs));
if (... | cwe | CWE-369 | C/C++ |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2021
* All rights reserved
*
* This file is part of GPAC / ISO Media File Format sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU L... | cwe | CWE-119 | C/C++ |
// imagew-bmp.c
// Part of ImageWorsener, Copyright (c) 2011 by Jason Summers.
// For more information, see the readme.txt file.
#include "imagew-config.h"
#include <stdio.h> // for SEEK_SET
#include <stdlib.h>
#include <string.h>
#define IW_INCLUDE_UTIL_FUNCTIONS
#include "imagew.h"
#define IWBMP_BI_RGB 0 //... | cwe | CWE-19 | C/C++ |
import secrets
from django.contrib.auth import get_user_model
from rest_framework import serializers
from backend.mixins import IncorrectSolvesMixin
from challenge.serializers import SolveSerializer
from member.models import UserIP
class MemberSerializer(IncorrectSolvesMixin, serializers.ModelSerializer):
solve... | cwe | CWE-287 | Python |
int rose_parse_facilities(unsigned char *p,
struct rose_facilities_struct *facilities)
{
int facilities_len, len;
facilities_len = *p++;
if (facilities_len == 0)
return 0;
while (facilities_len > 0) {
if (*p == 0x00) {
facilities_len--;
p++;
switch (*p) {
case FAC_NATIONAL: /* National */
... | cwe | CWE-20 | C/C++ |
SYSCALL_DEFINE5(perf_event_open,
struct perf_event_attr __user *, attr_uptr,
pid_t, pid, int, cpu, int, group_fd, unsigned long, flags)
{
struct perf_event *group_leader = NULL, *output_event = NULL;
struct perf_event *event, *sibling;
struct perf_event_attr attr;
struct perf_event_context *ctx;
struct file *e... | cwe | CWE-264 | Unknown |
static void nodeConstruct(struct SaveNode* node, tr_variant const* v, bool sort_dicts)
{
node->isVisited = false;
node->childIndex = 0;
if (sort_dicts && tr_variantIsDict(v))
{
/* make node->sorted a sorted version of this dictionary */
size_t const n = v->val.l.count;
struct K... | cwe | CWE-284 | Unknown |
R_API RBinJavaAttrInfo *r_bin_java_synthetic_attr_new(RBinJavaObj *bin, ut8 *buffer, ut64 sz, ut64 buf_offset) {
ut64 offset = 0;
RBinJavaAttrInfo *attr = r_bin_java_default_attr_new (bin, buffer, sz, buf_offset);
if (!attr) {
return NULL;
}
offset += 6;
attr->type = R_BIN_JAVA_ATTR_TYPE_SYNTHETIC_ATTR;
attr->... | cwe | CWE-119 | C/C++ |
@staticmethod
def get_max_task_id_for_project(project_id: int):
"""Gets the nights task id currently in use on a project"""
sql = """select max(id) from tasks where project_id = {0} GROUP BY project_id""".format(project_id)
result = db.engine.execute(sql)
if result.rowcount == 0:
... | cwe | CWE-89 | Python |
std::string ExpandFilePath(const std::string &filepath, void *) {
#ifdef _WIN32
// Assume input `filepath` is encoded in UTF-8
std::wstring wfilepath = UTF8ToWchar(filepath);
DWORD wlen = ExpandEnvironmentStringsW(wfilepath.c_str(), nullptr, 0);
wchar_t *wstr = new wchar_t[wlen];
ExpandEnvironmentStringsW(wfi... | cwe | CWE-20 | Unknown |
void __skb_tstamp_tx(struct sk_buff *orig_skb,
struct skb_shared_hwtstamps *hwtstamps,
struct sock *sk, int tstype)
{
struct sk_buff *skb;
bool tsonly;
if (!sk)
return;
tsonly = sk->sk_tsflags & SOF_TIMESTAMPING_OPT_TSONLY;
if (!skb_may_tx_timestamp(sk, tsonly))
return;
if (tsonly) {
#ifdef C... | cwe | CWE-125 | Unknown |
/* $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; eit... | cwe | CWE-120 | C/C++ |
AP4_HvccAtom::AP4_HvccAtom(AP4_UI32 size, const AP4_UI08* payload) :
AP4_Atom(AP4_ATOM_TYPE_HVCC, size)
{
// make a copy of our configuration bytes
unsigned int payload_size = size-AP4_ATOM_HEADER_SIZE;
m_RawBytes.SetData(payload, payload_size);
// parse the payload
m_ConfigurationVersion = p... | cwe | CWE-787 | C/C++ |
protocol_handshake_oldstyle (struct connection *conn)
{
struct old_handshake handshake;
int64_t r;
uint64_t exportsize;
uint16_t gflags, eflags;
/* In --tls=require / FORCEDTLS mode, old style handshakes are
* rejected because they cannot support TLS.
*/
if (tls == 2) {
nbdkit_error ("non-TLS cli... | cwe | CWE-406 | Unknown |
static void cmd_parse_status (IMAP_DATA* idata, char* s)
{
char* mailbox;
char* value;
BUFFY* inc;
IMAP_MBOX mx;
unsigned long ulcount;
unsigned int count;
IMAP_STATUS *status;
unsigned int olduv, oldun;
unsigned int litlen;
short new = 0;
short new_msg_count = 0;
mailbox = imap_next_word (s);
... | cwe | CWE-20 | C/C++ |
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-369 | Python |
op_insert(oparg_T *oap, long count1)
{
long ins_len, pre_textlen = 0;
char_u *firstline, *ins_text;
colnr_T ind_pre_col = 0, ind_post_col;
int ind_pre_vcol = 0, ind_post_vcol = 0;
struct block_def bd;
int i;
pos_T t1;
pos_T start_insert;
// offset when cursor was moved in ins... | cwe | CWE-122 | C/C++ |
package handlers
import (
"bytes"
"encoding/base64"
"fmt"
"net"
"net/url"
"strings"
"time"
"github.com/valyala/fasthttp"
"github.com/authelia/authelia/internal/authentication"
"github.com/authelia/authelia/internal/authorization"
"github.com/authelia/authelia/internal/configuration/schema"
"github.com/au... | cwe | CWE-287 | Go |
/*
* Copyright (c) 2007-2021, Arshan Dabirsiaghi, Jason Li
*
* 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 li... | cwe | CWE-79 | Java |
new_msg_sync_lsdb (u_int32_t seqnum, struct lsa_filter_type *filter)
{
u_char buf[OSPF_API_MAX_MSG_SIZE];
struct msg_sync_lsdb *smsg;
int len;
smsg = (struct msg_sync_lsdb *) buf;
len = sizeof (struct msg_sync_lsdb) +
filter->num_areas * sizeof (struct in_addr);
smsg->filter.typemask = htons (filter->t... | cwe | CWE-119 | Unknown |
rsock_s_recvfrom(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from)
{
rb_io_t *fptr;
VALUE str;
struct recvfrom_arg arg;
VALUE len, flg;
long buflen;
long slen;
rb_scan_args(argc, argv, "12", &len, &flg, &str);
if (flg == Qnil) arg.flags = 0;
else arg.flags = ... | cwe | CWE-908 | Unknown |
static void coroutine_fn v9fs_link(void *opaque)
{
V9fsPDU *pdu = opaque;
int32_t dfid, oldfid;
V9fsFidState *dfidp, *oldfidp;
V9fsString name;
size_t offset = 7;
int err = 0;
v9fs_string_init(&name);
err = pdu_unmarshal(pdu, offset, "dds", &dfid, &oldfid, &name);
if (err < 0) {
... | cwe | CWE-399 | Unknown |
status_t SampleTable::setCompositionTimeToSampleParams(
off64_t data_offset, size_t data_size) {
ALOGI("There are reordered frames present.");
if (mCompositionTimeDeltaEntries != NULL || data_size < 8) {
return ERROR_MALFORMED;
}
uint8_t header[8];
if (mDataSource->readAt(
data_offset, heade... | cwe | CWE-189 | C/C++ |
CloseUndoneFileDownload(rfbClientPtr cl, rfbTightClientPtr rtcp)
{
if(cl == NULL)
return;
if(rtcp->rcft.rcfd.downloadInProgress == TRUE) {
rtcp->rcft.rcfd.downloadInProgress = FALSE;
if(rtcp->rcft.rcfd.downloadFD != -1) {
close(rtcp->rcft.rcfd.downloadFD);
rtcp->rcft.rcfd.downloadFD = -1;
}
mems... | cwe | CWE-416 | Unknown |
import EventEmitter from "event-emitter";
import {extend, defer, windowBounds, isNumber} from "../../utils/core";
import scrollType from "../../utils/scrolltype";
import Mapping from "../../mapping";
import Queue from "../../utils/queue";
import Stage from "../helpers/stage";
import Views from "../helpers/views";
impor... | cwe | CWE-79 | JavaScript |
/*
* Copyright (c) 2008-2017, 2019-2020 Nicira, Inc.
*
* 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-416 | C/C++ |
static void t1_check_unusual_charstring(void)
{
char *p = strstr(t1_line_array, charstringname) + strlen(charstringname);
int i;
/*tex If no number follows |/CharStrings|, let's read the next line. */
if (sscanf(p, "%i", &i) != 1) {
strcpy(t1_buf_array, t1_line_array);
t1_getline();
... | cwe | CWE-119 | C/C++ |
static void gx_ttfReader__Read(ttfReader *self, void *p, int n)
{
gx_ttfReader *r = (gx_ttfReader *)self;
const byte *q;
if (!r->error) {
if (r->extra_glyph_index != -1) {
q = r->glyph_data.bits.data + r->pos;
r->error = (r->glyph_data.bits.size - r->pos < n ?
... | cwe | CWE-125 | C/C++ |
void BinaryUploadService::IsAuthorized(AuthorizationCallback callback) {
if (!timer_.IsRunning()) {
timer_.Start(FROM_HERE, base::TimeDelta::FromHours(24), this,
&BinaryUploadService::ResetAuthorizationData);
}
if (!can_upload_data_.has_value()) {
if (!pending_validate_data_upload_requ... | cwe | CWE-20 | C/C++ |
/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
* Copyright (c) 2016 Facebook
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in th... | cwe | CWE-119 | C/C++ |
/*
* Record values functions
*
* Copyright (C) 2011-2018, Joachim Metz <joachim.metz@gmail.com>
*
* Refer to AUTHORS for acknowledgements.
*
* This software 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 ... | cwe | CWE-125 | C/C++ |
/*
Copyright The Helm Authors.
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 agreed to in writing, software
distrib... | cwe | CWE-22 | Go |
static int aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
{
EVP_AES_GCM_CTX *gctx = EVP_C_DATA(EVP_AES_GCM_CTX,c);
switch (type) {
case EVP_CTRL_INIT:
gctx->key_set = 0;
gctx->iv_set = 0;
gctx->ivlen = EVP_CIPHER_CTX_iv_length(c);
gctx->iv = EVP_CIPHER_CTX_iv_n... | cwe | CWE-125 | C/C++ |
void CiffDirectory::readDirectory(const byte* pData,
uint32_t size,
ByteOrder byteOrder)
{
if (size < 4)
throw Error(kerCorruptedMetadata);
uint32_t o = getULong(pData + size - 4, byteOrder);
if ( o+... | cwe | CWE-125 | Unknown |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | cwe | CWE-74 | Python |
buf_copy_options(buf_T *buf, int flags)
{
int should_copy = TRUE;
char_u *save_p_isk = NULL; // init for GCC
int dont_do_help;
int did_isk = FALSE;
/*
* Skip this when the option defaults have not been set yet. Happens when
* main() allocates the first buffer.
*/
if (p_cp... | cwe | CWE-122 | C/C++ |
privsep_preauth(Authctxt *authctxt)
{
int status, r;
pid_t pid;
struct ssh_sandbox *box = NULL;
/* Set up unprivileged child process to deal with network data */
pmonitor = monitor_init();
/* Store a pointer to the kex for later rekeying */
pmonitor->m_pkex = &active_state->kex;
if (use_privsep == PRIVSEP_ON)... | cwe | CWE-119 | C/C++ |
static int h2c_decode_headers(struct h2c *h2c, struct buffer *rxbuf, uint32_t *flags)
{
const uint8_t *hdrs = (uint8_t *)b_head(&h2c->dbuf);
struct buffer *tmp = get_trash_chunk();
struct http_hdr list[MAX_HTTP_HDR * 2];
struct buffer *copy = NULL;
unsigned int msgf;
struct htx *htx = NULL;
int flen; // header f... | cwe | CWE-125 | C/C++ |
public function verifyDOMDocument($document)
{
$signatureNode = $this->locateSignature($document);
/**
* No signature was added, it should not fail as this is not a requirement on redirect bindings
*/
if (!$signatureNode) {
return true;
}
$this... | cwe | CWE-287 | PHP |
int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p,
unsigned char *limit, int *al)
{
unsigned short type;
unsigned short size;
unsigned short len;
unsigned char *data = *p;
int renegotiate_seen = 0;
int sigalg_seen = 0;
s->servername_done = 0;
s-... | cwe | CWE-401 | Unknown |
int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
{
int al, i, j, ret;
unsigned int n;
SSL3_RECORD *rr;
void (*cb) (const SSL *ssl, int type2, int val) = NULL;
if (s->s3->rbuf.buf == NULL) /* Not initialized yet */
if (!ssl3_setup_read_buffer(s))
retur... | cwe | CWE-203 | Unknown |
NORET_TYPE void do_exit(long code)
{
struct task_struct *tsk = current;
int group_dead;
profile_task_exit(tsk);
WARN_ON(atomic_read(&tsk->fs_excl));
if (unlikely(in_interrupt()))
panic("Aiee, killing interrupt handler!");
if (unlikely(!tsk->pid))
panic("Attempted to kill the idle task!");
tracehook_repor... | cwe | CWE-703 | Unknown |
smb_flush_file(struct smb_request *sr, struct smb_ofile *ofile)
{
sr->user_cr = smb_ofile_getcred(ofile);
if ((ofile->f_node->flags & NODE_FLAGS_WRITE_THROUGH) == 0)
(void) smb_fsop_commit(sr, sr->user_cr, ofile->f_node);
} | cwe | CWE-476 | C/C++ |
static int8_t parse_ext_option(uint16_t *dst, uint8_t **packet_data_pptr, uint8_t *packet_data_start_ptr, uint16_t packet_len, uint16_t *message_left)
{
uint16_t option_number = *dst;
if (option_number == 13) {
uint8_t option_ext;
int8_t read_result = sn_coap_parser_read_packet_u8(&option_ext,
... | cwe | CWE-401 | C/C++ |
/*
* Copyright © 2014-2019 Red Hat, Inc
*
* This program 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.
*
* This libr... | cwe | CWE-20 | C/C++ |
#
# Copyright (c) 2014 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of... | cwe | CWE-264 | Python |
$file_link = explode(" ", trim($row['file']))[0];
// If the link has no "http://" in front, then add it
if (substr(strtolower($file_link), 0, 4) !== 'http') {
$file_link = 'http://' . $file_link;
}
echo '<td><a href="http://anonym.to/?'... | cwe | CWE-79 | PHP |
void UpdateDownloader::CleanLeftovers()
{
// Note: this is called at startup. Do not use wxWidgets from this code!
std::wstring tmpdir;
if ( !Settings::ReadConfigValue("UpdateTempDir", tmpdir) )
return;
tmpdir.append(1, '\0'); // double NULL-terminate for SHFileOperation
SHFILEOPSTRUCT fo... | cwe | CWE-401 | Unknown |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_enc_sess_ietf.c -- Crypto session for IETF QUIC
*/
#include <assert.h>
#include <errno.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <sys/queue.h>
#if LSQUIC_PREFERRED_ADDR
#include <arpa/inet.h>
#endif
#... | cwe | CWE-476 | C/C++ |
static void sdhci_do_adma(SDHCIState *s)
{
unsigned int begin, length;
const uint16_t block_size = s->blksize & BLOCK_SIZE_MASK;
ADMADescr dscr = {};
int i;
if (s->trnmod & SDHC_TRNS_BLK_CNT_EN && !s->blkcnt) {
/* Stop Multiple Transfer */
sdhci_end_transfer(s);
return;
... | cwe | CWE-119 | Unknown |
(function()
{
// Adds electrical stencils
Sidebar.prototype.addElectricalPalette = function()
{
var s = mxConstants.STYLE_VERTICAL_LABEL_POSITION + '=bottom;shadow=0;dashed=0;align=center;html=1;' + mxConstants.STYLE_VERTICAL_ALIGN + '=top;' + mxConstants.STYLE_SHAPE;
var mea = s + '=mxgraph.electrical.abstract.... | cwe | CWE-79 | Java |
static void print_c_function(const state st) {
const char TYPE[] = "__m256i ";
char buf[10];
printf("static inline void sbox(const %sin0, const %sin1, const %sin2, const %sin3,\n"
"const %sin4, const %sin5, const %sin6, const %sin7, %s*out0,\n"
"%s*out1, %s*out2, %s*out3, %s*out4, %s*out5, %s*out6,\n"... | cwe | CWE-190 | C/C++ |
public function uploadCustomLogoAction(Request $request)
{
$fileExt = File::getFileExtension($_FILES['Filedata']['name']);
if (!in_array($fileExt, ['svg', 'png', 'jpg'])) {
throw new \Exception('Unsupported file format');
}
if ($fileExt === 'svg' && stripos(file_get_cont... | cwe | CWE-79 | PHP |
/*! jQuery v3.3.1 | (c) JS Foundation and other contributors | jquery.org/license */
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined... | cwe | CWE-94 | JavaScript |
pub fn error_on_execution_failure(reason: &ExitReason, data: &[u8]) -> Result<()> {
match reason {
ExitReason::Succeed(_) => Ok(()),
ExitReason::Error(e) => {
if *e == ExitError::OutOfGas {
// `ServerError(0)` will be useful in estimate gas
return Err(internal_err("out of gas"));
}
Err(crate::inte... | cwe | CWE-190 | Rust |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Cyril Concolato / Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2005-2019
* 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 und... | cwe | CWE-401 | C/C++ |
AP4_AvccAtom::AP4_AvccAtom(AP4_UI32 size, const AP4_UI08* payload) :
AP4_Atom(AP4_ATOM_TYPE_AVCC, size)
{
// make a copy of our configuration bytes
unsigned int payload_size = size-AP4_ATOM_HEADER_SIZE;
m_RawBytes.SetData(payload, payload_size);
// parse the payload
m_ConfigurationVersion = pay... | cwe | CWE-125 | C/C++ |
package com.salesmanager.core.business.services.merchant;
import java.util.List;
import java.util.Optional;
import javax.inject.Inject;
import org.jsoup.helper.Validate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.c... | cwe | CWE-639 | Java |
const exec = require('async-execute');
const {
list,
modified,
remote,
reset,
tag,
unadded,
} = require('./lib');
/**
* Items to pull out of git show entry
* @type {Array[]}
* @see https://git-scm.com/docs/git-show for placeholders
*/
const formats = [
[ 'author', 'an' ],
[ 'body', 'b' ],
[ 'comitter', '... | cwe | CWE-88 | JavaScript |
/* quicklist.c - A doubly linked list of ziplists
*
* Copyright (c) 2014, Matt Stancliff <matt@genges.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... | cwe | CWE-680 | C/C++ |
/*
* ====================================================================
* Project: openCRX/Core, http://www.opencrx.org/
* Description: CopyDb tool
* Owner: CRIXP AG, Switzerland, http://www.crixp.com
* ====================================================================
*
* This software is publishe... | cwe | CWE-79 | Java |
/*
* Kernel-based Virtual Machine driver for Linux
*
* This module enables machines with Intel VT-x extensions to run virtual
* machines without emulation or binary translation.
*
* Copyright (C) 2006 Qumranet, Inc.
* Copyright 2010 Red Hat, Inc. and/or its affiliates.
*
* Authors:
* Avi Kivity <avi@qumra... | cwe | CWE-264 | C/C++ |
static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
Image
*image;
MagickBooleanType
status;
MagickSizeType
number_pixels;
MemoryInfo
*pixel_info;
register IndexPacket
*indexes;
register PixelPacket
*q;
register ssize_t
i,
x;
register ... | cwe | CWE-401 | Unknown |
var http = require('http');
var fs = require('fs');
fs.exists = fs.exists || require('path').exists;
var SERVER_PORT = 8080;
var FILE_TYPE_GZIP = 1;
var FILE_EXT_GZIP = '.gz';
var FILE_EXT_CSS = '.css';
var FILE_EXT_JS = '.js';
// GZIP text/plain required to get Chrome XHR to decompress file.
var MIME_TYPE_GZIP = ... | cwe | CWE-22 | JavaScript |
xmlPushInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr input) {
int ret;
if (input == NULL) return(-1);
if (xmlParserDebugEntities) {
if ((ctxt->input != NULL) && (ctxt->input->filename))
xmlGenericError(xmlGenericErrorContext,
"%s(%d): ", ctxt->input->filename,
ctxt->input->line);
xmlGen... | cwe | CWE-703 | Unknown |
static int renameColumnSelectCb(Walker *pWalker, Select *p){
renameWalkWith(pWalker, p);
return WRC_Continue;
} | cwe | CWE-787 | Unknown |
MagickExport Image *EnhanceImage(const Image *image,ExceptionInfo *exception)
{
#define EnhanceImageTag "Enhance/Image"
#define EnhancePixel(weight) \
mean=QuantumScale*((double) GetPixelRed(image,r)+pixel.red)/2.0; \
distance=QuantumScale*((double) GetPixelRed(image,r)-pixel.red); \
distance_squared=(4.0+mean)*... | cwe | CWE-787 | C/C++ |
/* Copyright 2016-2017 Vector Creations 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 law or... | cwe | CWE-863 | Go |
def call(env)
client_settings = ClientSettings.new(env)
status = headers = body = nil
query_string = env['QUERY_STRING']
path = env['PATH_INFO'].sub('//', '/')
# Someone (e.g. Rails engine) could change the SCRIPT_NAME so we save it
env['RACK_MINI_PROFILER_ORIGINAL_SCRIPT_... | cwe | CWE-200 | Ruby |
WORD32 ih264d_read_mmco_commands(struct _DecStruct * ps_dec)
{
dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
dpb_commands_t *ps_dpb_cmds = ps_dec->ps_dpb_cmds;
dec_slice_params_t * ps_slice = ps_dec->ps_cur_slice;
WORD32 j;
UWORD8 u1_buf_mode;
struct MMCParams *ps_mmc_params;
UWORD32 *pu4_bitstrm_b... | cwe | CWE-119 | C/C++ |
/* This file is copied from the libsrs2 sources */
/* Modified by Timo Röhling <timo.roehling@gmx.de> */
/* Copyright (c) 2004 Shevek (srs@anarres.org)
* All rights reserved.
*
* This file is a part of libsrs2 from http://www.libsrs2.org/
*
* Redistribution and use in source and binary forms, with or without
* m... | cwe | CWE-400 | C/C++ |
int ssl3_get_cert_verify(SSL *s)
{
EVP_PKEY *pkey=NULL;
unsigned char *p;
int al,ok,ret=0;
long n;
int type=0,i,j;
X509 *peer;
const EVP_MD *md = NULL;
EVP_MD_CTX mctx;
EVP_MD_CTX_init(&mctx);
n=s->method->ssl_get_message(s,
SSL3_ST_SR_CERT_VRFY_A,
SSL3_ST_SR_CERT_VRFY_B,
-1,
SSL3_RT_MAX_PLAIN_LENGT... | cwe | CWE-310 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.