code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t size,
int flags)
{
struct sock_iocb *siocb = kiocb_to_siocb(iocb);
struct scm_cookie tmp_scm;
struct sock *sk = sock->sk;
struct unix_sock *u = unix_sk(sk);
int noblock = flags & MSG_DONTWAIT;
struc... | cwe | CWE-20 | C/C++ |
conn_rec *h2_slave_create(conn_rec *master, int slave_id, apr_pool_t *parent)
{
apr_allocator_t *allocator;
apr_status_t status;
apr_pool_t *pool;
conn_rec *c;
void *cfg;
module *mpm;
ap_assert(master);
ap_log_cerror(APLOG_MARK, APLOG_TRACE3, 0, master,
"h2_stream(... | cwe | CWE-444 | Unknown |
package api
import (
"fmt"
"github.com/ansible-semaphore/semaphore/api/helpers"
"github.com/ansible-semaphore/semaphore/db"
"net/http"
"os"
"strings"
"github.com/ansible-semaphore/semaphore/api/projects"
"github.com/ansible-semaphore/semaphore/api/sockets"
"github.com/ansible-semaphore/semaphore/util"
"gith... | cwe | CWE-287 | Go |
function deleteBudgetLimit(e) {
var button = $(e.currentTarget);
var budgetLimitId = button.data('budget-limit-id');
var url = deleteBudgetLimitUrl.replace('REPLACEME', budgetId.toString();
return false;
}
function createAltAvailableBudget(e) {
$('#defaultModal').empty().load(createAltAvailableBudg... | cwe | CWE-352 | JavaScript |
R_API RBinJavaAttrInfo *r_bin_java_source_code_file_attr_new(RBinJavaObj *bin, ut8 *buffer, ut64 sz, ut64 buf_offset) {
if (!sz) {
return NULL;
}
ut64 offset = 0;
RBinJavaAttrInfo *attr = r_bin_java_default_attr_new (bin, buffer, sz, buf_offset);
offset += 6;
if (!attr) {
return NULL;
}
attr->type = R_BIN_J... | cwe | CWE-119 | C/C++ |
static void r_bin_dwarf_dump_debug_info(FILE *f, const RBinDwarfDebugInfo *inf) {
size_t i, j, k;
RBinDwarfDIE *dies;
RBinDwarfAttrValue *values;
if (!inf || !f) {
return;
}
for (i = 0; i < inf->length; i++) {
fprintf (f, " Compilation Unit @ offset 0x%"PFMT64x":\n", inf->comp_units [i].offset);
fprintf (... | cwe | CWE-125 | C/C++ |
/**@license
* sysend.js - send messages between browser windows/tabs version 1.9.0
*
* Copyright (C) 2014-2022 Jakub T. Jankiewicz <https://jcubic.pl/me>
* Released under the MIT license
*
* The idea for localStorage implementation came from this StackOverflow question:
* http://stackoverflow.com/q/24182409... | cwe | CWE-200 | JavaScript |
def get_bracket_graph_data(db, tag):
# First, we have to find out which scenes this player has brackets in
sql = "SELECT DISTINCT scene FROM ranks WHERE player='{}'".format(tag)
scenes = db.exec(sql)
scenes = [s[0] for s in scenes]
bracket_placings_by_scene = {s: get_bracket_placings_in_scene(db, s... | cwe | CWE-89 | Python |
static Image *ReadPWPImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
FILE
*file;
Image
*image,
*next_image,
*pwp_image;
ImageInfo
*read_info;
int
c,
unique_file;
MagickBooleanType
status;
register Image
*p;
register ssize_t
i;
size_t
files... | cwe | CWE-416 | Unknown |
TfLiteStatus InitializeTemporaries(TfLiteContext* context, TfLiteNode* node,
OpContext* op_context) {
// Create temporary tensors to hold transposed LHS/RHS.
OpData* op_data = reinterpret_cast<OpData*>(node->user_data);
const TfLiteTensor* lhs = op_context->lhs;
const TfLiteTe... | cwe | CWE-787 | C/C++ |
/*****************************************************************************
* update.c: VLC update checking and downloading
*****************************************************************************
* Copyright © 2005-2008 VLC authors and VideoLAN
* $Id$
*
* Authors: Antoine Cellerier <dionoea -at- videolan... | cwe | CWE-120 | C/C++ |
App.Actions.DB.update_db_databasename_hint = function(elm, hint) {
if (hint.trim() == '') {
$(elm).parent().find('.hint').html('');
}
$(elm).parent().find('.hint').text(GLOBAL.DB_DBNAME_PREFIX + hint);
} | cwe | CWE-79 | JavaScript |
/*
* Copyright (C) 2004-2018 ZNC, see the NOTICE file for details.
* Copyright (C) 2008 by Stefan Rado
* based on admin.cpp by Sebastian Ramacher
* based on admin.cpp in crox branch
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Licen... | cwe | CWE-20 | C/C++ |
@mod.route('/register', methods=['GET', 'POST'])
def register():
if request.method == 'POST':
error = None
email = request.form['email'].strip()
nickname = request.form['nickname'].strip()
password = request.form['password'].strip()
password2 = request.form['password2'].strip... | cwe | CWE-89 | Python |
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: https://www.espocrm.com
*
* EspoCRM is free software: you can redistribute i... | cwe | CWE-79 | JavaScript |
// Copyright 2020 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package pathutil
import (
"path"
"strings"
)
// Clean cleans up given path and returns a relative path that goes straight down.
func Clean(p string) strin... | cwe | CWE-22 | Go |
enum ImapAuthRes imap_auth_login(struct ImapData *idata, const char *method)
{
char q_user[SHORT_STRING], q_pass[SHORT_STRING];
char buf[STRING];
int rc;
if (mutt_bit_isset(idata->capabilities, LOGINDISABLED))
{
mutt_message(_("LOGIN disabled on this server."));
return IMAP_AUTH_UNAVAIL;
}
if (m... | cwe | CWE-78 | Unknown |
int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
{
struct super_block *sb = inode->i_sb;
ext4_lblk_t punch_start, punch_stop;
handle_t *handle;
unsigned int credits;
loff_t new_size, ioffset;
int ret;
/*
* We need to test this early because xfstests assumes that a
* collapse range of ... | cwe | CWE-362 | Unknown |
static void write_reply_cb(DBusMessage *message, void *user_data)
{
struct pending_op *op = user_data;
struct external_chrc *chrc;
struct external_desc *desc;
DBusError err;
DBusMessageIter iter;
uint8_t ecode = 0;
if (!op->owner_queue) {
DBG("Pending write was canceled when object got removed");
return;
}... | cwe | CWE-416 | Unknown |
/*
* 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++ |
/*
* Copyright(c) 2015-2018 Intel Corporation.
*
* This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license.
*
* GPL LICENSE SUMMARY
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of versio... | cwe | CWE-416 | C/C++ |
def verify(self, data):
credentials = self._formatCredentials(data, name='current')
command = '{} rclone lsjson current:'.format(credentials)
try:
result = self._execute(command)
return {
'result': True,
'message': 'Success',
}... | cwe | CWE-78 | Python |
static int cmd_handle_untagged(struct ImapData *idata)
{
unsigned int count = 0;
char *s = imap_next_word(idata->buf);
char *pn = imap_next_word(s);
if ((idata->state >= IMAP_SELECTED) && isdigit((unsigned char) *s))
{
pn = s;
s = imap_next_word(s);
/* EXISTS and EXPUNGE are always related to th... | cwe | CWE-20 | C/C++ |
function deleteBudgetLimit(e) {
var button = $(e.currentTarget);
var budgetLimitId = button.data('budget-limit-id');
var url = deleteBudgetLimitUrl.replace('REPLACEME', budgetId.toString();
return false;
}
function createAltAvailableBudget(e) {
$('#defaultModal').empty().load(createAltAvailableBudg... | cwe | CWE-352 | JavaScript |
ikev2_auth_print(netdissect_options *ndo, u_char tpay,
const struct isakmp_gen *ext,
u_int item_len _U_, const u_char *ep,
uint32_t phase _U_, uint32_t doi _U_,
uint32_t proto _U_, int depth _U_)
{
struct ikev2_auth a;
const char *v2_auth[]={ "invalid", "rsasig",
"shared-secret", "dsssig" };
const u_char... | cwe | CWE-835 | C/C++ |
// imagew-jpeg.c
// Part of ImageWorsener, Copyright (c) 2011 by Jason Summers.
// For more information, see the readme.txt file.
#include "imagew-config.h"
#if IW_SUPPORT_JPEG == 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <setjmp.h>
#include <jpeglib.h>
#include <jerror... | cwe | CWE-125 | C/C++ |
compat_do_replace(struct net *net, void __user *user, unsigned int len)
{
int ret;
struct compat_ipt_replace tmp;
struct xt_table_info *newinfo;
void *loc_cpu_entry;
struct ipt_entry *iter;
if (copy_from_user(&tmp, user, sizeof(tmp)) != 0)
return -EFAULT;
/* overflow check */
if (tmp.size >= INT_MAX / num_p... | cwe | CWE-200 | Unknown |
// Load modules.
var passport = require('passport-strategy')
, url = require('url')
, uid = require('uid2')
, crypto = require('crypto')
, base64url = require('base64url')
, util = require('util')
, utils = require('./utils')
, OAuth2 = require('oauth').OAuth2
, NullStore = require('./state/null')
, N... | cwe | CWE-287 | JavaScript |
public function getChart($renderer, $id, $store_in_session = true)
{
$c = null;
$chart_data = null;
if ($renderer != null && $store_in_session) {
$session = new Tracker_Report_Session($renderer->report->id);
$session->changeSessionNamespace("renderers.{$rende... | cwe | CWE-862 | PHP |
DxfData::DxfData(double fn, double fs, double fa,
const std::string &filename, const std::string &layername,
double xorigin, double yorigin, double scale)
{
std::ifstream stream(filename.c_str());
if (!stream.good()) {
LOG(message_group::Warning,Location::NONE,"","Can't open DXF file '%1$s'.",fi... | cwe | CWE-703 | Unknown |
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
... | cwe | CWE-787 | C/C++ |
def autocomplete_phrases(query):
query_string = ur"""
with s as (SELECT id, lower(title) as lower_title FROM pub_2018 WHERE title iLIKE '%{query}%')
select match, count(*) as score from (
SELECT regexp_matches(lower_title, '({query}\w*?\M)', 'g') as match FROM s
union all
... | cwe | CWE-89 | Python |
sctp_disposition_t sctp_sf_do_5_1D_ce(struct net *net,
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type, void *arg,
sctp_cmd_seq_t *commands)
{
struct sctp_chunk *chunk = arg;
struct sctp_association *new_asoc;
sctp_init_chunk_t *p... | cwe | CWE-20 | C/C++ |
exports.parse = exports.decode = decode
exports.stringify = exports.encode = encode
exports.safe = safe
exports.unsafe = unsafe
var eol = typeof process !== 'undefined' &&
process.platform === 'win32' ? '\r\n' : '\n'
function encode (obj, opt) {
var children = []
var out = ''
if (typeof opt === 'string') {... | cwe | CWE-400 | Java |
/*!
Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
package com.rebuild.core.service.query;
import cn.devezhao.commons.Calenda... | cwe | CWE-89 | Java |
void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data)
{
struct rtattr *rta;
int size = RTA_LENGTH(attrlen);
rta = (struct rtattr*)skb_put(skb, RTA_ALIGN(size));
rta->rta_type = attrtype;
rta->rta_len = size;
memcpy(RTA_DATA(rta), data, attrlen);
} | cwe | CWE-200 | Unknown |
static int list_devices(struct file *filp, struct dm_ioctl *param, size_t param_size)
{
unsigned int i;
struct hash_cell *hc;
size_t len, needed = 0;
struct gendisk *disk;
struct dm_name_list *orig_nl, *nl, *old_nl = NULL;
uint32_t *event_nr;
down_write(&_hash_lock);
/*
* Loop through all the devices workin... | cwe | CWE-787 | C/C++ |
void MD5::update(unsigned char *input,
unsigned int inputLen)
{
unsigned int i, index, partLen;
// Compute number of bytes mod 64
index = static_cast<unsigned int>((count[0] >> 3) & 0x3f);
// Update number of bits
if ((count[0] += (static_cast<UINT4>(inputLen) << 3)) <
(static_cast<UINT... | cwe | CWE-787 | Unknown |
#include "git-compat-util.h"
#include "strbuf.h"
#include "utf8.h"
/* This code is originally from http://www.cl.cam.ac.uk/~mgk25/ucs/ */
static const char utf16_be_bom[] = {'\xFE', '\xFF'};
static const char utf16_le_bom[] = {'\xFF', '\xFE'};
static const char utf32_be_bom[] = {'\0', '\0', '\xFE', '\xFF'};
static co... | cwe | CWE-190 | 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 / Media Tools sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser Gene... | cwe | CWE-476 | C/C++ |
_XkbSetNamesCheck(ClientPtr client, DeviceIntPtr dev,
xkbSetNamesReq * stuff, CARD32 *data)
{
XkbDescRec *xkb;
CARD32 *tmp;
Atom bad = None;
tmp = data;
xkb = dev->key->xkbInfo->desc;
if (stuff->which & XkbKeyTypeNamesMask) {
int i;
CARD32 *old;
if (s... | cwe | CWE-119 | Unknown |
$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 |
swabHorDiff16(TIFF* tif, uint8* cp0, tmsize_t cc)
{
uint16* wp = (uint16*) cp0;
tmsize_t wc = cc / 2;
horDiff16(tif, cp0, cc);
TIFFSwabArrayOfShort(wp, wc);
} | cwe | CWE-119 | C/C++ |
static int hugetlb_sysctl_handler_common(bool obey_mempolicy,
struct ctl_table *table, int write,
void *buffer, size_t *length, loff_t *ppos)
{
struct hstate *h = &default_hstate;
unsigned long tmp = h->max_huge_pages;
int ret;
if (!hugepages_supported())
return -EOPNOTSUPP;
table->data = &tmp;
table-... | cwe | CWE-362 | Unknown |
parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
guint32 str_tbl, guint8 *level, guint8 *codepage_stag, guint8 *codepage_attr,
const wbxml_decoding *map)
{
guint32 tvb_len = tvb_reported_length (tvb);
guint32 off = offset;
guint32 len;
guint str_len;
guint32... | cwe | CWE-399 | Unknown |
crypto_retrieve_X509_sans(krb5_context context,
pkinit_plg_crypto_context plgctx,
pkinit_req_crypto_context reqctx,
X509 *cert,
krb5_principal **princs_ret,
krb5_principal **upn_ret,
... | cwe | CWE-295 | C/C++ |
__u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr,
__be16 sport, __be16 dport)
{
__u32 seq;
__u32 hash[12];
struct keydata *keyptr = get_keyptr();
/* The procedure is the same as for IPv4, but addresses are longer.
* Thus we must use twothirdsMD4Transform.
*/
memcpy(hash, saddr, 16);
ha... | cwe | CWE-703 | Unknown |
* Elliptic Curve Key Exchange
*/
static int curve25519_sha256(LIBSSH2_SESSION *session, unsigned char *data,
size_t data_len, unsigned char public_key[LIBSSH2_ED25519_KEY_LEN],
unsigned char private_key[LIBSSH2_ED25519_KEY_LEN],
km... | cwe | CWE-787 | 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-122 | C/C++ |
renderList(mentionChar, data, searchTerm) {
if (data && data.length > 0) {
this.removeLoading();
this.values = data;
this.mentionList.innerHTML = "";
var initialSelection = -1;
for (let i = 0; i < data.length; i += 1) {
const li = document.createElement("li");
li.id ... | cwe | CWE-79 | JavaScript |
function Wn(t,e){for(var n=t.length;n--;)if(Fs(t[n][0],e))return n;return-1} | cwe | CWE-79 | JavaScript |
package dao
import (
"errors"
"github.com/bluele/gcache"
jsoniter "github.com/json-iterator/go"
"github.com/px-org/PanIndex/module"
_115 "github.com/px-org/PanIndex/pan/115"
"github.com/px-org/PanIndex/pan/123"
"github.com/px-org/PanIndex/pan/ali"
"github.com/px-org/PanIndex/pan/base"
"github.com/px-org/PanIn... | cwe | CWE-798 | Go |
parseChars(FileInfo *nested, CharsString *result, CharsString *token) {
int in = 0;
int out = 0;
int lastOutSize = 0;
int lastIn;
unsigned int ch = 0;
int numBytes = 0;
unsigned int utf32 = 0;
int k;
while (in < token->length) {
ch = token->chars[in++] & 0xff;
if (ch < 128) {
if (ch == '\\') { /* escape... | cwe | CWE-787 | C/C++ |
int perf_cpu_time_max_percent_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp,
loff_t *ppos)
{
int ret = proc_dointvec(table, write, buffer, lenp, ppos);
if (ret || !write)
return ret;
if (sysctl_perf_cpu_time_max_percent == 100 ||
sysctl_perf_cpu_time_max_percent... | cwe | CWE-190 | C/C++ |
/*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#include "common.h"
#include "git2/types.h"
#include "git2/errors.h"
#include "git2/refs.h"
#include "g... | cwe | CWE-119 | C/C++ |
############################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (th... | cwe | CWE-362 | Python |
package io.dropwizard.validation.selfvalidating;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
... | cwe | CWE-74 | Java |
/**
* @file
* Send/receive commands to/from an IMAP server
*
* @authors
* Copyright (C) 1996-1998,2010,2012 Michael R. Elkins <me@mutt.org>
* Copyright (C) 1996-1999 Brandon Long <blong@fiction.net>
* Copyright (C) 1999-2009,2011 Brendan Cully <brendan@kublai.com>
*
* @copyright
* This program is free softwar... | cwe | CWE-77 | C/C++ |
/*!
* UAParser.js v0.7.21
* Lightweight JavaScript-based User-Agent string parser
* https://github.com/faisalman/ua-parser-js
*
* Copyright © 2012-2019 Faisal Salman <f@faisalman.com>
* Licensed under MIT License
*/
(function (window, undefined) {
'use strict';
//////////////
// Constants
////... | cwe | CWE-400 | JavaScript |
async function getRecent() {
function getCookie(name) {
const value = `; ${document.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) return parts.pop().split(';').shift();
}
var response2 = await fetch("https://scratch.mit.edu/session/", {
"headers": {
"accept": "*/... | cwe | CWE-79 | JavaScript |
# -*- coding: utf-8 -*-
# udb, A web interface to manage IT network
# Copyright (C) 2022 IKUS Software inc.
#
# 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 3 of the License, or
... | cwe | CWE-613 | Python |
obj2ast_withitem(PyObject* obj, withitem_ty* out, PyArena* arena)
{
PyObject* tmp = NULL;
expr_ty context_expr;
expr_ty optional_vars;
if (_PyObject_HasAttrId(obj, &PyId_context_expr)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_context_expr);
if (tmp == NULL) goto failed;
... | cwe | CWE-125 | C/C++ |
function filterTemplates()
{
var searchTerms = tmplSearchInput.value;
if (searchTerms == '')
{
resetTemplates();
return;
}
if (NewDialog.tagsList[templateFile] == null)
{
var tagsList = {};
for (var cat in categories)
{
var templateList = categories[cat];
for (var i = ... | cwe | CWE-94 | JavaScript |
void Context::onUpstreamConnectionClose(PeerType peer_type) {
if (wasm_->onUpstreamConnectionClose_) {
wasm_->onUpstreamConnectionClose_(this, id_, static_cast<uint32_t>(peer_type));
}
} | cwe | CWE-476 | C/C++ |
static js_Ast *callexp(js_State *J)
{
js_Ast *a = newexp(J);
loop:
if (jsP_accept(J, '.')) { a = EXP2(MEMBER, a, identifiername(J)); goto loop; }
if (jsP_accept(J, '[')) { a = EXP2(INDEX, a, expression(J, 0)); jsP_expect(J, ']'); goto loop; }
if (jsP_accept(J, '(')) { a = EXP2(CALL, a,... | cwe | CWE-674 | C/C++ |
function getLegendHeaderHtml(statName) {
var name = statName;
if (panel.legend.header) {
name = panel.legend.header;
}
var html = '<th class="pointer" data-stat="' + statName + '">' + name;
if (panel.legend.sort === statName) {
... | cwe | CWE-79 | JavaScript |
/*
* Copyright (c) 2017, 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 copyrig... | cwe | CWE-190 | C/C++ |
function ac_checkme($id, $name) {
global $cms_db;
$ret = true;
$cquery = sprintf("select count(*) from %s where sid='%s' and name='%s'",
$cms_db['sessions'],
$id,
$name);
$squery = sprintf("select sid from %s where sid = '%s' and name = '%s'",
... | cwe | CWE-89 | PHP |
static pj_status_t pjsip_auth_verify( const pjsip_authorization_hdr *hdr,
const pj_str_t *method,
const pjsip_cred_info *cred_info )
{
if (pj_stricmp(&hdr->scheme, &pjsip_DIGEST_STR) == 0) {
char digest_buf[PJSIP_MD5STRLEN];
pj_str_t digest;
const pjsip_digest_credential *dig = &hdr->credenti... | cwe | CWE-120 | Unknown |
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: https://www.espocrm.com
*
* EspoCRM is free software: you can redistribute i... | cwe | CWE-79 | JavaScript |
static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define ThrowDCMException(exception,message) \
{ \
if (info.scale != (Quantum *) NULL) \
info.scale=(Quantum *) RelinquishMagickMemory(info.scale); \
if (data != (unsigned char *) NULL) \
data=(unsigned char *) RelinquishMagi... | cwe | CWE-20 | C/C++ |
int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *tty)
{
struct vc_data *vc = vc_cons[fg_console].d;
int sel_mode, new_sel_start, new_sel_end, spc;
char *bp, *obp;
int i, ps, pe, multiplier;
u16 c;
struct kbd_struct *kbd = kbd_table + fg_console;
poke_blanked_console();
{ unsigned... | cwe | CWE-399 | Unknown |
static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
Image *image, *image2=NULL,
*rotated_image;
register Quantum *q;
unsigned int status;
MATHeader MATLAB_HDR;
size_t size;
size_t CellType;
QuantumInfo *quantum_info;
ImageInfo *clone_info;
int i;
ssize_t ldblk;
u... | cwe | CWE-772 | C/C++ |
QPDFObjectHandle::parse(std::string const& object_str,
std::string const& object_description)
{
PointerHolder<InputSource> input =
new BufferInputSource("parsed object", object_str);
QPDFTokenizer tokenizer;
bool empty = false;
QPDFObjectHandle result =
parse(inpu... | cwe | CWE-787 | Unknown |
// SPDX-License-Identifier: GPL-2.0-only
/* binder.c
*
* Android IPC Subsystem
*
* Copyright (C) 2007-2008 Google, Inc.
*/
/*
* Locking overview
*
* There are 3 main spinlocks which must be acquired in the
* order shown:
*
* 1) proc->outer_lock : protects binder_ref
* binder_proc_lock() and binder_proc_... | cwe | CWE-416 | C/C++ |
void Image::printIFDStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption option,uint32_t start,bool bSwap,char c,int depth)
{
depth++;
bool bFirst = true ;
// buffer
const size_t dirSize = 32;
DataBuf dir(dirSize);
bool bPrint = option == kpsBasic... | cwe | CWE-125 | C/C++ |
"""
Custom Authenticator to use GitLab OAuth with JupyterHub
Modified for GitLab by Laszlo Dobos (@dobos)
based on the GitHub plugin by Kyle Kelley (@rgbkrk)
"""
import json
import os
import sys
from tornado.auth import OAuth2Mixin
from tornado import gen, web
from tornado.escape import url_escape
from tornado.htt... | cwe | CWE-264 | Python |
static void free_huge_page(struct page *page)
{
/*
* Can't pass hstate in here because it is called from the
* compound page destructor.
*/
struct hstate *h = page_hstate(page);
int nid = page_to_nid(page);
struct address_space *mapping;
mapping = (struct address_space *) page_private(page);
set_page_priva... | cwe | CWE-399 | C/C++ |
UserCloudPolicyManagerFactoryChromeOS::CreateManagerForProfile(
Profile* profile,
bool force_immediate_load,
scoped_refptr<base::SequencedTaskRunner> background_task_runner) {
const CommandLine* command_line = CommandLine::ForCurrentProcess();
if (chromeos::ProfileHelper::IsSigninProfile(pro... | cwe | CWE-119 | C/C++ |
pq_getbytes(char *s, size_t len)
{
size_t amount;
while (len > 0)
{
while (PqRecvPointer >= PqRecvLength)
{
if (pq_recvbuf()) /* If nothing in buffer, then recv some */
return EOF; /* Failed to recv data */
}
amount = PqRecvLength - PqRecvPointer;
if (amount > len)
amount = len;
memcpy(s, Pq... | cwe | CWE-89 | Unknown |
shmem_get_inode(struct super_block *sb, int mode, dev_t dev)
{
struct inode *inode;
struct shmem_inode_info *info;
struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
if (shmem_reserve_inode(sb))
return NULL;
inode = new_inode(sb);
if (inode) {
inode->i_mode = mode;
inode->i_uid = current->fsuid;
inode->i_gid ... | cwe | CWE-400 | Unknown |
static int sco_sock_bind(struct socket *sock, struct sockaddr *addr,
int addr_len)
{
struct sockaddr_sco *sa = (struct sockaddr_sco *) addr;
struct sock *sk = sock->sk;
int err = 0;
BT_DBG("sk %p %pMR", sk, &sa->sco_bdaddr);
if (!addr || addr->sa_family != AF_BLUETOOTH)
return -EINVAL;
lock_sock(sk);... | cwe | CWE-200 | C/C++ |
MagickExport MagickBooleanType SetImageExtent(Image *image,const size_t columns,
const size_t rows,ExceptionInfo *exception)
{
if ((columns == 0) || (rows == 0))
ThrowBinaryException(ImageError,"NegativeOrZeroImageSize",image->filename);
image->columns=columns;
image->rows=rows;
if ((image->depth == 0) ||... | cwe | CWE-401 | C/C++ |
static int changedline (const Proto *p, int oldpc, int newpc) {
while (oldpc++ < newpc) {
if (p->lineinfo[oldpc] != 0)
return (luaG_getfuncline(p, oldpc - 1) != luaG_getfuncline(p, newpc));
}
return 0; /* no line changes in the way */
} | cwe | CWE-787 | C/C++ |
/*
* The MIT License
*
* Copyright 2014 CloudBees, Inc.
*
* 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-78 | Java |
/* Listpack -- A lists of strings serialization format
*
* This file implements the specification you can find at:
*
* https://github.com/antirez/listpack
*
* Copyright (c) 2017, Salvatore Sanfilippo <antirez at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with ... | cwe | CWE-190 | C/C++ |
function _makeGetter(property, next) {
if (
property === '__proto__' ||
property === 'constructor' ||
property === 'prototype'
) {
throw new Error('unable to access __proto__, constructor, prototype');
}
if (next) {
return function getter(obj) {
try {
return next(obj[property]);
} catch (ex) {
... | cwe | CWE-1321 | JavaScript |
function_call(int argc, VALUE argv[], VALUE self)
{
ffi_cif * cif;
fiddle_generic retval;
fiddle_generic *generic_args;
void **values;
VALUE cfunc, types, cPointer;
int i;
cfunc = rb_iv_get(self, "@ptr");
types = rb_iv_get(self, "@args");
cPointer = rb_const_get(mFiddle, rb_in... | cwe | CWE-264 | C/C++ |
public function ExpandHash($project, $abbrevHash)
{
if (!$project)
return $abbrevHash;
if (!(preg_match('/[0-9A-Fa-f]{4,39}/', $abbrevHash))) {
return $abbrevHash;
}
$args = array();
$args[] = '-1';
$args[] = '--format=format:%H';
$args[] = $abbrevHash;
$fullData = explode("\n", $this->exe->Ex... | cwe | CWE-78 | PHP |
void snd_timer_interrupt(struct snd_timer * timer, unsigned long ticks_left)
{
struct snd_timer_instance *ti, *ts, *tmp;
unsigned long resolution, ticks;
struct list_head *p, *ack_list_head;
unsigned long flags;
int use_tasklet = 0;
if (timer == NULL)
return;
spin_lock_irqsave(&timer->lock, flags);
/* reme... | cwe | CWE-362 | Unknown |
package io.socket.client;
import io.socket.backo.Backoff;
import io.socket.emitter.Emitter;
import io.socket.parser.IOParser;
import io.socket.parser.Packet;
import io.socket.parser.Parser;
import io.socket.thread.EventThread;
import okhttp3.Call;
import okhttp3.WebSocket;
import java.net.URI;
import java.util.ArrayL... | cwe | CWE-476 | Java |
int cipso_v4_validate(const struct sk_buff *skb, unsigned char **option)
{
unsigned char *opt = *option;
unsigned char *tag;
unsigned char opt_iter;
unsigned char err_offset = 0;
u8 opt_len;
u8 tag_len;
struct cipso_v4_doi *doi_def = NULL;
u32 tag_iter;
/* caller already checks for length values that are too ... | cwe | CWE-119 | C/C++ |
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
| Copyrigh... | cwe | CWE-22 | C/C++ |
void DefaultCertValidator::updateDigestForSessionId(bssl::ScopedEVP_MD_CTX& md,
uint8_t hash_buffer[EVP_MAX_MD_SIZE],
unsigned hash_length) {
int rc;
// Hash all the settings that affect whether the server will ... | cwe | CWE-362 | C/C++ |
HexOutStream::HexOutStream(OutStream& os, int buflen)
: out_stream(os), offset(0), bufSize(buflen ? buflen : DEFAULT_BUF_LEN)
{
if (bufSize % 2)
bufSize--;
ptr = start = new U8[bufSize];
end = start + bufSize;
} | cwe | CWE-122 | C/C++ |
void __kthread_queue_delayed_work(struct kthread_worker *worker,
struct kthread_delayed_work *dwork,
unsigned long delay)
{
struct timer_list *timer = &dwork->timer;
struct kthread_work *work = &dwork->work;
WARN_ON_ONCE(timer->function != kthread_delayed_work_timer_fn ||
timer->data != (unsigned... | cwe | CWE-200 | Unknown |
def lists
if request.post?
if params[:language_action] == "remove"
lu = Tr8n::LanguageUser.find(:first, :conditions => ["language_id = ? and user_id = ?", params[:language_id], tr8n_current_user.id])
lu.destroy
end
end
@all_languages = Tr8n::Language.enabled_l... | cwe | CWE-89 | Ruby |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2020 University of Dundee & Open Microscopy Environment.
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software F... | cwe | CWE-116 | Python |
ContentEncoding::GetCompressionByIndex(unsigned long idx) const {
const ptrdiff_t count = compression_entries_end_ - compression_entries_;
assert(count >= 0);
if (idx >= static_cast<unsigned long>(count))
return NULL;
return compression_entries_[idx];
} | cwe | CWE-20 | C/C++ |
void FontInfoScanner::scanFonts(XRef *xrefA, Dict *resDict, std::vector<FontInfo*> *fontsList) {
GfxFontDict *gfxFontDict;
GfxFont *font;
// scan the fonts in this resource dictionary
gfxFontDict = nullptr;
const Object &fontObj = resDict->lookupNF("Font");
if (fontObj.isRef()) {
Object obj2 = fontObj.... | cwe | CWE-674 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.