code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
std::string get_wml_location(const std::string &filename, const std::string ¤t_dir)
{
DBG_FS << "Looking for '" << filename << "'.\n";
std::string result;
if (filename.empty()) {
LOG_FS << " invalid filename\n";
return result;
}
if (filename.find("..") != std::string::npos) {
ERR_FS << "Illegal pat... | cwe | CWE-200 | C/C++ |
int get_evtchn_to_irq(evtchn_port_t evtchn)
{
if (evtchn >= xen_evtchn_max_channels())
return -1;
if (evtchn_to_irq[EVTCHN_ROW(evtchn)] == NULL)
return -1;
return evtchn_to_irq[EVTCHN_ROW(evtchn)][EVTCHN_COL(evtchn)];
} | cwe | CWE-362 | C/C++ |
def get_auth_users
Log.add_info(request, params.inspect)
begin
@folder = Folder.find(params[:id])
rescue
@folder = nil
end
@users = []
session[:folder_id] = params[:id]
if !@login_user.nil? and (@login_user.admin?(User::AUTH_FOLDER) or (!@folder.nil? and @folder.in_my_folder_... | cwe | CWE-89 | Ruby |
static XMLSharedNodeList* find_impl(xmlXPathContext* ctxt, const string& xpath)
{
xmlXPathObject* result = xmlXPathEval((const xmlChar*)xpath.c_str(), ctxt);
if (!result) {
xmlXPathFreeContext(ctxt);
xmlFreeDoc(ctxt->doc);
throw XMLException("Invalid XPath: " + xpath);
}
if (result->type != XPATH_NODESET) ... | cwe | CWE-416 | Unknown |
def post(self, request, *args, **kwargs): # doccov: ignore
command = request.POST.get("command")
if command:
dispatcher = getattr(self, "dispatch_%s" % command, None)
if not callable(dispatcher):
raise Problem(_("Unknown command: `%s`.") % command)
di... | cwe | CWE-79 | Python |
# Copyright: (c) 2008, Jarek Zgoda <jarek.zgoda@gmail.com>
__revision__ = "$Id: models.py 28 2009-10-22 15:03:02Z jarek.zgoda $"
import datetime
import secrets
from base64 import b32encode
from typing import Mapping, Optional, Union
from urllib.parse import urljoin
from django.conf import settings
from django.contrib... | cwe | CWE-613 | Python |
sp<ABuffer> decodeBase64(const AString &s) {
size_t n = s.size();
if ((n % 4) != 0) {
return NULL;
}
size_t padding = 0;
if (n >= 1 && s.c_str()[n - 1] == '=') {
padding = 1;
if (n >= 2 && s.c_str()[n - 2] == '=') {
padding = 2;
if (n >= 3 && s.c_str()[n - 3] == '=') {
pad... | cwe | CWE-119 | C/C++ |
/*
* Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
*
* Author: zccrs <zccrs@live.com>
*
* Maintainer: zccrs <zhangjide@deepin.com>
*
* 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 Foun... | cwe | CWE-59 | C/C++ |
/*****************************************************************
|
| AP4 - avcC Atoms
|
| Copyright 2002-2008 Axiomatic Systems, LLC
|
|
| This file is part of Bento4/AP4 (MP4 Atom Processing Library).
|
| Unless you have obtained Bento4 under a difference license,
| this version of Bento4 is Bento4|G... | cwe | CWE-119 | C/C++ |
def config_backup(params, request, session)
if params[:name]
code, response = send_request_with_token(
session, params[:name], 'config_backup', true
)
else
if not allowed_for_local_cluster(session, Permissions::FULL)
return 403, 'Permission denied'
end
$logger.info "Backup node confi... | cwe | CWE-384 | Ruby |
package eu.nimble.service.model.solr.owl;
import java.util.Collection;
import java.util.Map;
public interface IConcept {
String ID_FIELD = "id";
String CODE_FIELD = "code";
/**
* Collection of languages
*/
String LANGUAGES_FIELD = "languages";
/**
* The language based label, e.g. <code><i>en</i>_label</cod... | cwe | CWE-290 | Java |
get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw)
{
unsigned long address = (unsigned long)uaddr;
struct mm_struct *mm = current->mm;
struct page *page;
struct address_space *mapping;
int err, ro = 0;
/*
* The futex address must be "naturally" aligned.
*/
key->both.offset = address... | cwe | CWE-416 | C/C++ |
/*
* Copyright 2020 ThoughtWorks, 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 applicable law or agr... | cwe | CWE-668 | Java |
TfLiteStatus CheckLstmTensorDimensionsAndTypes(
TfLiteContext* context, TfLiteNode* node, int n_input, int n_output,
int n_cell, int input_to_input_weights_tensor,
int input_to_forget_weights_tensor, int input_to_cell_weights_tensor,
int input_to_output_weights_tensor, int recurrent_to_input_weights_ten... | cwe | CWE-125 | C/C++ |
PJ_DEF(pj_status_t) pjmedia_rtcp_fb_build_nack(
pjmedia_rtcp_session *session,
void *buf,
pj_size_t *length,
unsigned nack_cnt,
const pjmedia_rtcp_fb_nack nack[])
{
pjmedia_rtcp_common *hdr;
pj_uint8_t *p;
unsigned len, i;
PJ_ASSERT_RETURN(session && buf && length && nack_cnt &... | cwe | CWE-125 | C/C++ |
def test_manage_pools(self) -> None:
user1 = uuid4()
user2 = uuid4()
# by default, any can modify
self.assertIsNone(
check_can_manage_pools_impl(
InstanceConfig(allow_pool_management=True), UserInfo()
)
)
# with oid, but no admin
... | cwe | CWE-863 | Python |
ContentEncoding::GetEncryptionByIndex(unsigned long idx) const {
const ptrdiff_t count = encryption_entries_end_ - encryption_entries_;
assert(count >= 0);
if (idx >= static_cast<unsigned long>(count))
return NULL;
return encryption_entries_[idx];
} | cwe | CWE-119 | C/C++ |
static int acm_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
struct usb_cdc_union_desc *union_header = NULL;
struct usb_cdc_country_functional_desc *cfd = NULL;
unsigned char *buffer = intf->altsetting->extra;
int buflen = intf->altsetting->extralen;
struct usb_interface *control_inter... | cwe | CWE-703 | C/C++ |
bool ChromeDownloadManagerDelegate::IsDangerousFile(
const DownloadItem& download,
const FilePath& suggested_path,
bool visited_referrer_before) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (download.GetTransitionType() & content::PAGE_TRANSITION_FROM_ADDRESS_BAR)
return false;
... | cwe | CWE-863 | C/C++ |
TEE_Result syscall_hash_init(unsigned long state,
const void *iv __maybe_unused,
size_t iv_len __maybe_unused)
{
TEE_Result res;
struct tee_cryp_state *cs;
struct tee_ta_session *sess;
res = tee_ta_get_current_session(&sess);
if (res != TEE_SUCCESS)
return res;
res = tee_svc_cryp_get_state(ses... | cwe | CWE-327 | Unknown |
internalEntityProcessor(XML_Parser parser, const char *s, const char *end,
const char **nextPtr) {
ENTITY *entity;
const char *textStart, *textEnd;
const char *next;
enum XML_Error result;
OPEN_INTERNAL_ENTITY *openEntity = parser->m_openInternalEntities;
if (! openEntity)
return... | cwe | CWE-125 | C/C++ |
"use strict"
const parsePath = require("parse-path")
, normalizeUrl = require("normalize-url")
/**
* parseUrl
* Parses the input url.
*
* **Note**: This *throws* if invalid urls are provided.
*
* @name parseUrl
* @function
* @param {String} url The input url.
* @param {Boolean|Object} normalize Wheter to... | cwe | CWE-79 | JavaScript |
bool IDNSpoofChecker::SafeToDisplayAsUnicode(base::StringPiece16 label,
bool is_tld_ascii) {
UErrorCode status = U_ZERO_ERROR;
int32_t result =
uspoof_check(checker_, label.data(),
base::checked_cast<int32_t>(label.size()), NULL, &status);
if (... | cwe | CWE-20 | C/C++ |
void RemoteFsDevice::load()
{
if (RemoteFsDevice::constSambaAvahiProtocol==details.url.scheme()) {
// Start Avahi listener...
Avahi::self();
QUrlQuery q(details.url);
if (q.hasQueryItem(constServiceNameQuery)) {
details.serviceName=q.queryItemValue(constServiceNameQuery);... | cwe | CWE-20 | Unknown |
BGD_DECLARE(void *) gdImagePngPtrEx (gdImagePtr im, int *size, int level)
{
void *rv;
gdIOCtx *out = gdNewDynamicCtx (2048, NULL);
if (out == NULL) return NULL;
gdImagePngCtxEx (im, out, level);
rv = gdDPExtractData (out, size);
out->gd_free (out);
return rv;
} | cwe | CWE-415 | Unknown |
static int io_add_buffers(struct io_provide_buf *pbuf, struct io_buffer **head)
{
struct io_buffer *buf;
u64 addr = pbuf->addr;
int i, bid = pbuf->bid;
for (i = 0; i < pbuf->nbufs; i++) {
buf = kmalloc(sizeof(*buf), GFP_KERNEL);
if (!buf)
break;
buf->addr = addr;
buf->len = pbuf->len;
buf->bid = bid;... | cwe | CWE-787 | C/C++ |
int wwunpack(uint8_t *exe, uint32_t exesz, uint8_t *wwsect, struct cli_exe_section *sects, uint16_t scount, uint32_t pe, int desc) {
uint8_t *structs = wwsect + 0x2a1, *compd, *ccur, *unpd, *ucur, bc;
uint32_t src, srcend, szd, bt, bits;
int error=0, i;
cli_dbgmsg("in wwunpack\n");
while (1) {
if (!CLI_I... | cwe | CWE-416 | C/C++ |
/*
* Copyright (C) 2017 The Android Open Source Project
*
* 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 app... | cwe | CWE-863 | Java |
static void reds_handle_ticket(void *opaque)
{
RedLinkInfo *link = (RedLinkInfo *)opaque;
char password[SPICE_MAX_PASSWORD_LENGTH];
time_t ltime;
//todo: use monotonic time
time(<ime);
RSA_private_decrypt(link->tiTicketing.rsa_size,
link->tiTicketing.encrypted_ticket.e... | cwe | CWE-119 | Unknown |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2022
* 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-476 | C/C++ |
"""
Copyright 2006-2009, Red Hat, Inc and Others
Michael DeHaan <michael.dehaan AT gmail>
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 2 of the License, or
(at your option) any late... | cwe | CWE-94 | Python |
int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested)
{
int rc = NET_RX_SUCCESS;
if (sk_filter(sk, skb))
goto discard_and_relse;
skb->dev = NULL;
if (nested)
bh_lock_sock_nested(sk);
else
bh_lock_sock(sk);
if (!sock_owned_by_user(sk)) {
/*
* trylock + unlock semantics:
*/
m... | cwe | CWE-400 | Unknown |
static int add_time_element(struct ldb_message *msg, const char *attr, time_t t)
{
struct ldb_message_element *el;
char *s;
int ret;
if (ldb_msg_find_element(msg, attr) != NULL) {
return LDB_SUCCESS;
}
s = ldb_timestring(msg, t);
if (s == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
ret = ldb_msg_add_stri... | cwe | CWE-200 | Unknown |
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | cwe | CWE-287 | Java |
static int jp2_colr_getdata(jp2_box_t *box, jas_stream_t *in)
{
jp2_colr_t *colr = &box->data.colr;
colr->csid = 0;
colr->iccp = 0;
colr->iccplen = 0;
if (jp2_getuint8(in, &colr->method) || jp2_getuint8(in, &colr->pri) ||
jp2_getuint8(in, &colr->approx)) {
return -1;
}
switch (colr->method) {
case JP2_COL... | cwe | CWE-189 | Unknown |
log2vis_utf8 (PyObject * string, int unicode_length,
FriBidiParType base_direction, int clean, int reordernsm)
{
FriBidiChar *logical = NULL; /* input fribidi unicode buffer */
FriBidiChar *visual = NULL; /* output fribidi unicode buffer */
char *visual_utf8 = NULL; /* output fribidi UTF-8 buffer */
FriB... | cwe | CWE-119 | C/C++ |
public function pwd(){
$item_id = I("item_id/d");
$password = I("password");
$v_code = I("v_code");
$refer_url = I('refer_url');
//检查用户输错密码的次数。如果超过一定次数,则需要验证 验证码
$key= 'item_pwd_fail_times_'.$item_id;
if(!D("VerifyCode")->_check_times($key,10)){
if (!... | cwe | CWE-352 | PHP |
static cJSON *get_object_item(const cJSON * const object, const char * const name, const cJSON_bool case_sensitive)
{
cJSON *current_element = NULL;
if ((object == NULL) || (name == NULL))
{
return NULL;
}
current_element = object->child;
if (case_sensitive)
{
while ((curre... | cwe | CWE-754 | C/C++ |
GF_Descriptor *gf_isom_get_root_od(GF_ISOFile *movie)
{
GF_Descriptor *desc;
GF_ObjectDescriptor *od;
GF_InitialObjectDescriptor *iod;
GF_IsomObjectDescriptor *isom_od;
GF_IsomInitialObjectDescriptor *isom_iod;
GF_ESD *esd;
GF_ES_ID_Inc *inc;
u32 i;
u8 useIOD;
if (!movie || !movie->moov) return NULL;
if (!m... | cwe | CWE-401 | C/C++ |
void CLASS nikon_coolscan_load_raw()
{
int bufsize = width*3*tiff_bps/8;
if(tiff_bps <= 8)
gamma_curve(1.0/imgdata.params.coolscan_nef_gamma,0.,1,255);
else
gamma_curve(1.0/imgdata.params.coolscan_nef_gamma,0.,1,65535);
fseek (ifp, data_offset, SEEK_SET);
unsigned char *buf = (unsigned char*)malloc(bu... | cwe | CWE-787 | Unknown |
static void skel(const char *homedir, uid_t u, gid_t g) {
char *fname;
if (arg_zsh) {
if (asprintf(&fname, "%s/.zshrc", homedir) == -1)
errExit("asprintf");
struct stat s;
if (stat(fname, &s) == 0)
return;
if (stat("/etc/skel/.zshrc", &s) == 0) {
if (is_link("/etc/skel/.zshrc")) {
fprintf(stde... | cwe | CWE-269 | C/C++ |
ppm_load_read_header(FILE *fp,
pnm_struct *img)
{
/* PPM Headers Variable Declaration */
gchar *ptr;
//gchar *retval;
gchar header[MAX_CHARS_IN_ROW];
gint maxval;
/* Check the PPM file Type P2 or P5 */
fgets (header,MAX_CHARS_IN_ROW,fp);
if (header[0] != A... | cwe | CWE-189 | C/C++ |
const got = require('@/utils/got');
const cheerio = require('cheerio');
const parser = require('@/utils/rss-parser');
module.exports = async (ctx) => {
const lang = ctx.params.lang === 'us' ? 'www' : ctx.params.lang || 'cn';
const rssUrl = `https://${lang}.engadget.com/rss.xml`;
const feed = await parser.p... | cwe | CWE-918 | JavaScript |
// --- BEGIN COPYRIGHT BLOCK ---
// 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; version 2 of the License.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT... | cwe | CWE-79 | C/C++ |
function read_cache( $cache_id, $check = false ) {
global $cms_db;
if ( $cache_id && $this->use_cache ) {
if ( !$this->cache_db ) $this->cache_db = new DB_cms;
$return = false;
$sql = "SELECT val FROM
" . $cms_db['db_cache'] . " WHERE
name = '" . $... | cwe | CWE-89 | PHP |
init_ccline(int firstc, int indent)
{
ccline.overstrike = FALSE; // always start in insert mode
/*
* set some variables for redrawcmd()
*/
ccline.cmdfirstc = (firstc == '@' ? 0 : firstc);
ccline.cmdindent = (firstc > 0 ? indent : 0);
// alloc initial ccline.cmdbuff
alloc_cmdbuff... | cwe | CWE-787 | C/C++ |
Http::FilterMetadataStatus Context::onRequestMetadata() {
if (!wasm_->onRequestMetadata_) {
return Http::FilterMetadataStatus::Continue;
}
if (wasm_->onRequestMetadata_(this, id_).u64_ == 0) {
return Http::FilterMetadataStatus::Continue;
}
return Http::FilterMetadataStatus::Continue; // This is curren... | cwe | CWE-476 | C/C++ |
void HeaderMapImpl::addCopy(const LowerCaseString& key, uint64_t value) {
auto* entry = getExistingInline(key.get());
if (entry != nullptr) {
char buf[32];
StringUtil::itoa(buf, sizeof(buf), value);
appendToHeader(entry->value(), buf);
return;
}
HeaderString new_key;
new_key.setCopy(key.get().... | cwe | CWE-400 | C/C++ |
def build_command_line(command, params = nil)
return command.to_s if params.nil? || params.empty?
"#{command} #{assemble_params(sanitize(params))}"
end | cwe | CWE-78 | Ruby |
static void WriteTo8BimProfile(Image *image,const char *name,
const StringInfo *profile)
{
const unsigned char
*datum,
*q;
register const unsigned char
*p;
size_t
length;
StringInfo
*profile_8bim;
ssize_t
count;
unsigned char
length_byte;
unsigned int
value;
uns... | cwe | CWE-20 | C/C++ |
function Kt(e,t){var n,r;e&&e.response&&e.response.body?n=s()(r="".concat(e.response.body.code," ")).call(r,e.response.body.message):n=e.message;return new Ut("Could not resolve reference: ".concat(n),t,e)} | cwe | CWE-200 | JavaScript |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 shavitmichael, OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | cwe | CWE-918 | Python |
bool Cues::Find(long long time_ns, const Track* pTrack, const CuePoint*& pCP,
const CuePoint::TrackPosition*& pTP) const {
assert(time_ns >= 0);
assert(pTrack);
#if 0
LoadCuePoint(); //establish invariant
assert(m_cue_points);
assert(m_count > 0);
CuePoint** const ii = m_cue_points... | cwe | CWE-20 | C/C++ |
ProcXFixesCopyRegion(ClientPtr client)
{
RegionPtr pSource, pDestination;
REQUEST(xXFixesCopyRegionReq);
VERIFY_REGION(pSource, stuff->source, client, DixReadAccess);
VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess);
if (!RegionCopy(pDestination, pSource))
retu... | cwe | CWE-20 | C/C++ |
#include <qpdf/Pl_AES_PDF.hh>
#include <qpdf/QUtil.hh>
#include <cstring>
#include <assert.h>
#include <stdexcept>
#include <qpdf/QIntC.hh>
#include <qpdf/QPDFCryptoProvider.hh>
#include <string>
#include <stdlib.h>
bool Pl_AES_PDF::use_static_iv = false;
Pl_AES_PDF::Pl_AES_PDF(char const* identifier, Pipeline* next,... | cwe | CWE-787 | 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
* (the "License"); you may n... | cwe | CWE-502 | Java |
function updateScout(firstName, lastName, birthDate,packNumber,
rankType, parentID, leaderID, scoutID, connection)
{
var strQuery = "UPDATE scout SET first_name="+firstName+", last_name="+lastName+", birth_date="+
+ ", pack_number=" + + ", rank_type=" + packNumber+", parent_id="+
leaderType +", leader_id="+ ran... | cwe | CWE-89 | JavaScript |
static ssize_t userfaultfd_ctx_read(struct userfaultfd_ctx *ctx, int no_wait,
struct uffd_msg *msg)
{
ssize_t ret;
DECLARE_WAITQUEUE(wait, current);
struct userfaultfd_wait_queue *uwq;
/*
* Handling fork event requires sleeping operations, so
* we drop the event_wqh lock, then do these ops, then
* loc... | cwe | CWE-119 | C/C++ |
public void deleteById(Integer id) {
databaseTypeDao.selectOptionalById(id).ifPresent(data -> {
if (DatabaseTypes.has(data.getDatabaseType())) {
throw DomainErrors.MUST_NOT_MODIFY_SYSTEM_DEFAULT_DATABASE_TYPE.exception();
}
databaseTypeDao.deleteById(id);
... | cwe | CWE-20 | Java |
#ifndef JSI_AMALGAMATION
#include "jsiInt.h"
#endif
#define _JSI_OPNM(nam) .sig=JSI_SIG_TYPEDEF, .id=JSI_OPTION_##nam, .idName=#nam
// Note: these need to be in the same order as JSI_OPT_* in jsi.h
static Jsi_OptionTypedef jsi_OptTypeInfo[] = {
{.sig=JSI_SIG_TYPEDEF, .id=JSI_OPTION_END,.idName="NONE", },
{_JS... | cwe | CWE-120 | C/C++ |
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2021 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except... | cwe | CWE-918 | C/C++ |
static cJSON *create_reference( cJSON *item )
{
cJSON *ref;
if ( ! ( ref = cJSON_New_Item() ) )
return 0;
memcpy( ref, item, sizeof(cJSON) );
ref->string = 0;
ref->type |= cJSON_IsReference;
ref->next = ref->prev = 0;
return ref;
} | cwe | CWE-120 | C/C++ |
seamless_process_line(const char *line, void *data)
{
char *p, *l;
char *tok1, *tok2, *tok3, *tok4, *tok5, *tok6, *tok7, *tok8;
unsigned long id, flags;
char *endptr;
l = xstrdup(line);
p = l;
DEBUG_SEAMLESS(("seamlessrdp got:%s\n", p));
tok1 = seamless_get_token(&p);
tok2 = seamless_get_token(&p);
tok3 = ... | cwe | CWE-787 | Unknown |
// ***************************************************************** -*- C++ -*-
/*
* Copyright (C) 2004-2021 Exiv2 authors
* This program is part of the Exiv2 distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as publish... | cwe | CWE-20 | C/C++ |
function PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings, data, disp_mode) {
// deleting the hide button. remove <br><br><a> tags
$del_hide.find('a, br').remove();
// append inline edit button.
$del_hide.append($data_a.clone());
// changing inline_edit_active to inline_edit_a... | cwe | CWE-79 | JavaScript |
public function make()
{
$this->image->encode($this->format, $this->quality);
$data = $this->image->getEncoded();
$mime = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $data);
$length = strlen($data);
if (function_exists('app') && is_a($app = app(), 'Illuminate\Foundation\App... | cwe | CWE-89 | JavaScript |
void mk_request_free(struct session_request *sr)
{
if (sr->fd_file > 0) {
mk_vhost_close(sr);
}
if (sr->headers.location) {
mk_mem_free(sr->headers.location);
}
if (sr->uri_processed.data != sr->uri.data) {
mk_ptr_free(&sr->uri_processed);
}
if (sr->real_path.data ... | cwe | CWE-20 | Unknown |
ospf6_decode_v3(netdissect_options *ndo,
register const struct ospf6hdr *op,
register const u_char *dataend)
{
register const rtrid_t *ap;
register const struct lsr6 *lsrp;
register const struct lsa6_hdr *lshp;
register const struct lsa6 *lsap;
register int i;
switch (op->ospf6_ty... | cwe | CWE-125 | C/C++ |
compile_nested_function(exarg_T *eap, cctx_T *cctx, garray_T *lines_to_free)
{
int is_global = *eap->arg == 'g' && eap->arg[1] == ':';
char_u *name_start = eap->arg;
char_u *name_end = to_name_end(eap->arg, TRUE);
int off;
char_u *func_name;
char_u *lambda_name;
ufunc_T *ufunc;
int r ... | cwe | CWE-416 | C/C++ |
/*
* 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-285 | Java |
_pyfribidi_log2vis (PyObject * self, PyObject * args, PyObject * kw)
{
PyObject *logical = NULL; /* input unicode or string object */
FriBidiParType base = FRIBIDI_TYPE_RTL; /* optional direction */
const char *encoding = "utf-8"; /* optional input string encoding */
int clean = 0; /* optional flag to clean the str... | cwe | CWE-119 | C/C++ |
static int exif_scan_JPEG_header(image_info_type *ImageInfo) {
int section, sn;
int marker = 0, last_marker = M_PSEUDO, comment_correction=1;
int ll, lh;
unsigned char *Data;
size_t fpos, size, got, itemlen;
jpeg_sof_info sof_info;
for(section=0;;section++) {
// get marker byte, swallowing possible ... | cwe | CWE-125 | C/C++ |
package action
import (
"context"
"image/color"
"strings"
"github.com/answerdev/answer/internal/base/reason"
"github.com/answerdev/answer/internal/schema"
"github.com/mojocn/base64Captcha"
"github.com/segmentfault/pacman/errors"
"github.com/segmentfault/pacman/log"
)
// CaptchaRepo captcha repository
type Ca... | cwe | CWE-307 | Go |
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-120 | Python |
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 1992 obz under the linux copyright
*
* Dynamic diacritical handling - aeb@cwi.nl - Dec 1993
* Dynamic keymap and string allocation - aeb@cwi.nl - May 1994
* Restrict VT switching via ioctl() - grif@cs.ucr.edu - Dec 1995
* Some code moved for less code du... | cwe | CWE-362 | C/C++ |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "ESTreeIRGen.h"
#include "llvh/ADT/SmallString.h"
namespace hermes {
namespace irgen {
//===---------------------------... | cwe | CWE-787 | C/C++ |
parse_ihu_subtlv(const unsigned char *a, int alen,
unsigned int *hello_send_us,
unsigned int *hello_rtt_receive_time)
{
int type, len, i = 0, ret = 0;
while(i < alen) {
type = a[0];
if(type == SUBTLV_PAD1) {
i++;
continue;
}
... | cwe | CWE-787 | Unknown |
static int vivid_fb_ioctl(struct fb_info *info, unsigned cmd, unsigned long arg)
{
struct vivid_dev *dev = (struct vivid_dev *)info->par;
switch (cmd) {
case FBIOGET_VBLANK: {
struct fb_vblank vblank;
vblank.flags = FB_VBLANK_HAVE_COUNT | FB_VBLANK_HAVE_VCOUNT |
FB_VBLANK_HAVE_VSYNC;
vblank.count = ... | cwe | CWE-200 | C/C++ |
void PdfCompositorClient::Composite(
service_manager::Connector* connector,
base::SharedMemoryHandle handle,
size_t data_size,
mojom::PdfCompositor::CompositePdfCallback callback,
scoped_refptr<base::SequencedTaskRunner> callback_task_runner) {
DCHECK(data_size);
if (!compositor_)
Connect... | cwe | CWE-787 | C/C++ |
xsltRegisterExtModuleElement(const xmlChar * name, const xmlChar * URI,
xsltPreComputeFunction precomp,
xsltTransformFunction transform)
{
int ret;
xsltExtElementPtr ext;
if ((name == NULL) || (URI == NULL) || (transform == NULL))
ret... | cwe | CWE-119 | C/C++ |
PHP_FUNCTION(unserialize)
{
char *buf = NULL;
size_t buf_len;
const unsigned char *p;
php_unserialize_data_t var_hash;
zval *options = NULL, *classes = NULL;
HashTable *class_hash = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|a", &buf, &buf_len, &options) == FAILURE) {
RETURN_FALSE;
}
if (buf... | cwe | CWE-416 | C/C++ |
Status Conv3DShape(shape_inference::InferenceContext* c) {
ShapeHandle input_shape;
TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 5, &input_shape));
ShapeHandle filter_shape;
TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 5, &filter_shape));
string data_format;
Status s = c->GetAttr("data_format", &data_format)... | cwe | CWE-369 | Unknown |
static int rxrpc_krb5_decode_tagged_data(struct krb5_tagged_data *td,
size_t max_data_size,
const __be32 **_xdr,
unsigned int *_toklen)
{
const __be32 *xdr = *_xdr;
unsigned int toklen = *_toklen, len;
/* there must be at least one tag and one length word */
if (toklen <= 8)
return -EINVAL;
_... | cwe | CWE-190 | Unknown |
gss_get_mic_iov_length(OM_uint32 *minor_status, gss_ctx_id_t context_handle,
gss_qop_t qop_req, gss_iov_buffer_desc *iov,
int iov_count)
{
OM_uint32 status;
gss_union_ctx_id_t ctx;
gss_mechanism mech;
status = val_wrap_iov_args(minor_status, context_handle, 0, qop_req, NULL,
... | cwe | CWE-415 | C/C++ |
/*
* Digital Signature Service Protocol Project.
* Copyright (C) 2013-2016 e-Contract.be BVBA.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version
* 3.0 as published by the Free Software Foundation.
*
* This software is distribut... | cwe | CWE-611 | Java |
bool WebviewHandler::Parse(Extension* extension, base::string16* error) {
scoped_ptr<WebviewInfo> info(new WebviewInfo());
const base::DictionaryValue* dict_value = NULL;
if (!extension->manifest()->GetDictionary(keys::kWebview,
&dict_value)) {
*error = base::ASCII... | cwe | CWE-399 | C/C++ |
Graph.sanitizeHtml=function(b,e){return DOMPurify.sanitize(b,{ADD_ATTR:["target"],FORBID_TAGS:["form"],ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto|tel|callto|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i})};Graph.sanitizeSvg=function(b){return DOMPurify.sanitize(b,{IN_PLACE:!0})}; | cwe | CWE-918 | JavaScript |
nbd_internal_command_common (struct nbd_handle *h,
uint16_t flags, uint16_t type,
uint64_t offset, uint64_t count, int count_err,
void *data, struct command_cb *cb)
{
struct command *cmd;
if (h->disconnect_request) {
set_e... | cwe | CWE-252 | Unknown |
int LUKS2_config_get_requirements(struct crypt_device *cd, struct luks2_hdr *hdr, uint32_t *reqs)
{
json_object *jobj_config, *jobj_requirements, *jobj_mandatory, *jobj;
int i, len;
uint32_t req;
assert(hdr);
if (!hdr || !reqs)
return -EINVAL;
*reqs = 0;
if (!json_object_object_get_ex(hdr->jobj, "config", &... | cwe | CWE-345 | Unknown |
static void vmxnet3_complete_packet(VMXNET3State *s, int qidx, uint32_t tx_ridx)
{
struct Vmxnet3_TxCompDesc txcq_descr;
PCIDevice *d = PCI_DEVICE(s);
VMXNET3_RING_DUMP(VMW_RIPRN, "TXC", qidx, &s->txq_descr[qidx].comp_ring);
txcq_descr.txdIdx = tx_ridx;
txcq_descr.gen = vmxnet3_ring_curr_gen(... | cwe | CWE-200 | Unknown |
// An object that encapsulates everything we need to run a 'find'
// operation, encoded in the REST API format.
var SchemaController = require('./Controllers/SchemaController');
var Parse = require('parse/node').Parse;
const triggers = require('./triggers');
const { continueWhile } = require('parse/lib/node/promiseUti... | cwe | CWE-74 | JavaScript |
function removeKanban() {
var message = gettextCatalog.getString("Kanban {{ label }} successfuly deleted", {
label: SharedPropertiesService.getKanban().label,
});
$window.sessionStorage.setItem("tuleap_feedback", message);
$window.location.href =
"/plugins/agileda... | cwe | CWE-79 | JavaScript |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-125 | Python |
static int ext4_clear_blocks(handle_t *handle, struct inode *inode,
struct buffer_head *bh,
ext4_fsblk_t block_to_free,
unsigned long count, __le32 *first,
__le32 *last)
{
__le32 *p;
int flags = EXT4_FREE_BLOCKS_VALIDATED;
int err;
if (S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode... | cwe | CWE-703 | Unknown |
static int rtnl_fill_link_ifmap(struct sk_buff *skb, struct net_device *dev)
{
struct rtnl_link_ifmap map = {
.mem_start = dev->mem_start,
.mem_end = dev->mem_end,
.base_addr = dev->base_addr,
.irq = dev->irq,
.dma = dev->dma,
.port = dev->if_port,
};
if (nla_put(skb, IFLA_... | cwe | CWE-200 | C/C++ |
void TestingPlatformSupport::cryptographicallyRandomValues(unsigned char* buffer, size_t length)
{
} | cwe | CWE-310 | Unknown |
secret_core_crt (gcry_mpi_t M, gcry_mpi_t C,
gcry_mpi_t D, unsigned int Nlimbs,
gcry_mpi_t P, gcry_mpi_t Q, gcry_mpi_t U)
{
gcry_mpi_t m1 = mpi_alloc_secure ( Nlimbs + 1 );
gcry_mpi_t m2 = mpi_alloc_secure ( Nlimbs + 1 );
gcry_mpi_t h = mpi_alloc_secure ( Nlimbs + 1 );
/* m1 ... | cwe | CWE-310 | C/C++ |
PJ_DEF(pj_status_t) pjsip_ua_register_dlg( pjsip_user_agent *ua,
pjsip_dialog *dlg )
{
/* Sanity check. */
PJ_ASSERT_RETURN(ua && dlg, PJ_EINVAL);
/* For all dialogs, local tag (inc hash) must has been initialized. */
PJ_ASSERT_RETURN(dlg->local.info && dlg->local.info->tag.slen &&
dlg->... | cwe | CWE-416 | Unknown |
// Copyright 2013 Unknown
//
// 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 writ... | cwe | CWE-22 | Go |
def create(request, comment_id):
comment = get_object_or_404(Comment, pk=comment_id)
form = FlagForm(
user=request.user,
comment=comment,
data=post_data(request))
if is_post(request) and form.is_valid():
form.save()
return redirect(request.POST.get('next', comment.ge... | cwe | CWE-601 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.