code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
v8::Local<v8::Object> CreateNativeEvent(
v8::Isolate* isolate,
v8::Local<v8::Object> sender,
content::RenderFrameHost* frame,
electron::mojom::ElectronBrowser::MessageSyncCallback callback) {
v8::Local<v8::Object> event;
if (frame && callback) {
gin::Handle<Event> native_event = Event::Create(is... | cwe | CWE-668 | C/C++ |
MagickExport void *DetachBlob(BlobInfo *blob_info)
{
void
*data;
assert(blob_info != (BlobInfo *) NULL);
if (blob_info->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
if (blob_info->mapped != MagickFalse)
{
(void) UnmapBlob(blob_info->data,blob_info->lengt... | cwe | CWE-416 | C/C++ |
int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *a, ASN1_BIT_STRING *signature,
char *data, EVP_PKEY *pkey)
{
EVP_MD_CTX ctx;
const EVP_MD *type;
unsigned char *p,*buf_in=NULL;
int ret= -1,i,inl;
EVP_MD_CTX_init(&ctx);
i=OBJ_obj2nid(a->algorithm);
type=EVP_get_digestbyname(OBJ_nid2sn(i));
if (type == NULL)
{... | cwe | CWE-310 | C/C++ |
/* Apache 2.0 - Copyright 2007-2018 - pancake and dso
class.c rewrite: Adam Pridgen <dso@rice.edu || adam.pridgen@thecoverofnight.com>
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <unistd.h>
#include <r_types.h>
#include <r_util.h>
#include <r_bin.h>
#include <math.h>
#... | cwe | CWE-125 | C/C++ |
static void skel(const char *homedir, uid_t u, gid_t g) {
char *fname;
if (!arg_shell_none && (strcmp(cfg.shell,"/usr/bin/zsh") == 0 || strcmp(cfg.shell,"/bin/zsh") == 0)) {
if (asprintf(&fname, "%s/.zshrc", homedir) == -1)
errExit("asprintf");
struct stat s;
if (stat(fname, &s) == 0)
return;
if (st... | cwe | CWE-269 | C/C++ |
static void compactxref(fz_context *ctx, pdf_document *doc, pdf_write_state *opts)
{
int num, newnum;
int xref_len = pdf_xref_len(ctx, doc);
/*
* Update renumber_map in-place, clustering all used
* objects together at low object ids. Objects that
* already should be renumbered will have their new
* object i... | cwe | CWE-119 | Unknown |
ValueSetter::writeAppearance()
{
this->replaced = true;
// This code does not take quadding into consideration because
// doing so requires font metric information, which we don't
// have in many cases.
double tfh = 1.2 * tf;
int dx = 1;
// Write one or more lines, centered vertically, po... | cwe | CWE-787 | Unknown |
/* radare - LGPL - Copyright 2019-2022 - GustavoLCR */
#include "ne.h"
#define NE_BUG 0
static char *__get_target_os(r_bin_ne_obj_t *bin) {
switch (bin->ne_header->targOS) {
case 1:
return "OS/2";
case 2:
return "Windows";
case 3:
return "European MS-DOS 4.x";
case 4:
return "Windows 386";
case 5:
ret... | cwe | CWE-476 | C/C++ |
void serveloop(GArray* servers) {
struct sockaddr_storage addrin;
socklen_t addrinlen=sizeof(addrin);
int i;
int max;
fd_set mset;
fd_set rset;
/*
* Set up the master fd_set. The set of descriptors we need
* to select() for never changes anyway and it buys us a *lot*
* of time to only build this once. Ho... | cwe | CWE-399 | C/C++ |
query_rename(struct cpio_file_stat* file_hdr, FILE *tty_in, FILE *tty_out,
FILE *rename_in)
{
char *str_res; /* Result for string function. */
static dynamic_string new_name; /* New file name for rename option. */
static int initialized_new_name = false;
if (!initialized_new_name)
{
ds_init (&new... | cwe | CWE-190 | Unknown |
/* -*- mode: c; c-basic-offset: 8; -*-
* vim: noexpandtab sw=8 ts=8 sts=0:
*
* Copyright (C) 2002, 2004 Oracle. All rights reserved.
*
* 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-362 | C/C++ |
/**
* Copyright (c) 2006-2017, JGraph Ltd
* Copyright (c) 2006-2017, Gaudenz Alder
*/
(function()
{
/**
* Version
*/
EditorUi.VERSION = '@DRAWIO-VERSION@';
/**
* Overrides compact UI setting.
*/
EditorUi.compactUi = uiTheme != 'atlas';
/**
* Overrides default grid color for dark mode
*/
if (Edit... | cwe | CWE-79 | JavaScript |
horDiff8(TIFF* tif, uint8* cp0, tmsize_t cc)
{
TIFFPredictorState* sp = PredictorState(tif);
tmsize_t stride = sp->stride;
unsigned char* cp = (unsigned char*) cp0;
assert((cc%stride)==0);
if (cc > stride) {
cc -= stride;
/*
* Pipeline the most common cases.
*/
if (stride == 3) {
unsigned int r1, ... | cwe | CWE-119 | C/C++ |
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { art } = require('@/utils/render');
const path = require('path');
const shortcuts = {
potd: 'picture/browse/potd/',
potw: 'picture/browse/potw/',
potm: 'picture/browse/potm/',
};
module.exports = async (ctx) => {
const lang... | cwe | CWE-918 | JavaScript |
def findNPC(race, classe, sex,level):
c, conn = getConnection()
date = now()
#select image, SUM(legit) as l FROM npc WHERE race='Elf' AND class='Bard' AND sex='Male' GROUP BY image HAVING l>5 ORDER BY SUM(legit) DESC;
c.execute("select image, avg(legit) as l FROM npc WHERE race='"+race+"' AND class='"+classe+"' AND... | cwe | CWE-89 | Python |
static MOBI_RET mobi_parse_index_entry(MOBIIndx *indx, const MOBIIdxt idxt, const MOBITagx *tagx, const MOBIOrdt *ordt, MOBIBuffer *buf, const size_t curr_number) {
if (indx == NULL) {
debug_print("%s", "INDX structure not initialized\n");
return MOBI_INIT_FAILED;
}
const size_t entry_offset... | cwe | CWE-125 | C/C++ |
function m(){var b,c,d,e,f,h,i;if(b=vc,c=N(),c!==X)if(ia.test(a.charAt(vc))?(d=a.charAt(vc),vc++):(d=X,0===Bc&&g(ja)),d!==X){for(e=[],f=S();f!==X;)e.push(f),f=S();e!==X?(f=v(),f!==X?(h=o(),h!==X?(i=p(),i!==X?(wc=b,c=ka(d,f,h,i),b=c):(vc=b,b=aa)):(vc=b,b=aa)):(vc=b,b=aa)):(vc=b,b=aa)}else vc=b,b=aa;else vc=b,b=aa;return... | cwe | CWE-1321 | JavaScript |
static bool io_match_task_safe(struct io_kiocb *head, struct task_struct *task,
bool cancel_all)
{
if (task && head->task != task)
return false;
return cancel_all;
} | cwe | CWE-416 | Unknown |
/*
===========================================================================
Copyright (C) 1999 - 2005, Id Software, Inc.
Copyright (C) 2000 - 2013, Raven Software, Inc.
Copyright (C) 2001 - 2013, Activision, Inc.
Copyright (C) 2005 - 2015, ioquake3 contributors
Copyright (C) 2013 - 2015, OpenJK contributors
This fi... | cwe | CWE-269 | C/C++ |
public function browse() {
$params = func_get_args();
$this->path = join('/', $params);
// make sure there's a / at the end
if (substr($this->path, -1, 1) != '/')
$this->path .= '/';
//security
// we dont allow back link
if (strpos($this->path, '..')... | cwe | CWE-20 | PHP |
/*
* Copyright (C) 1996-2022 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
* Please see the COPYING and CONTRIBUTORS files for details.
*/
/* DEBUG: section 10 Gopher */
#include ... | cwe | CWE-400 | C/C++ |
# Natural Language Toolkit: Transformation-based learning
#
# Copyright (C) 2001-2021 NLTK Project
# Author: Marcus Uneson <marcus.uneson@gmail.com>
# based on previous (nltk2) version by
# Christopher Maloof, Edward Loper, Steven Bird
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
from... | cwe | CWE-1333 | Python |
boost::optional<SaplingNotePlaintext> SaplingNotePlaintext::decrypt(
const SaplingEncCiphertext &ciphertext,
const uint256 &epk,
const uint256 &esk,
const uint256 &pk_d,
const uint256 &cmu
)
{
auto pt = AttemptSaplingEncDecryption(ciphertext, epk, esk, pk_d);
if (!pt) {
return boost:... | cwe | CWE-755 | C/C++ |
}
actionItems() {
let composing = new PrivateComposing(this.user);
const items = new ItemList();
if (app.session.user && app.forum.attribute('canStartPrivateDiscussion')) {
items.add('start_private', composing.component());
} | cwe | CWE-269 | JavaScript |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-125 | C/C++ |
function init(_settings, _runtime) {
settings = _settings;
runtime = _runtime;
projectsDir = fspath.join(settings.userDir,"projects");
authCache.init();
} | cwe | CWE-22 | JavaScript |
static void kvm_unpin_pages(struct kvm *kvm, pfn_t pfn, unsigned long npages)
{
unsigned long i;
for (i = 0; i < npages; ++i)
kvm_release_pfn_clean(pfn + i);
} | cwe | CWE-189 | C/C++ |
def followFriends(self,userid,friendid):
sqlText="insert into friends values(%d,%d);"%(friendid,userid)
result=sql.insertDB(self.conn,sqlText)
return result; | cwe | CWE-89 | Python |
lzw_decoder_feed (LZWDecoder *self,
guint8 *input,
gsize input_length,
guint8 *output,
gsize output_length)
{
gsize i, n_written = 0;
g_return_val_if_fail (LZW_IS_DECODER (self), 0);
/* Ignore data afte... | cwe | CWE-835 | C/C++ |
/*
* 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.
*/
//===----------------------------------------------------------------------===//
/// \file
/// ES5.1 15.4 Initialize the Array co... | cwe | CWE-787 | C/C++ |
AspectDialog.prototype.createPageItem=function(b,f,l){var d=document.createElement("div");d.className="geAspectDlgListItem";d.setAttribute("data-page-id",b);d.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+mxUtils.htmlEntities(f)+"</div>";this.pagesContainer.appe... | cwe | CWE-94 | JavaScript |
int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
{
int retval;
int remount_ro;
if (sb->s_writers.frozen != SB_UNFROZEN)
return -EBUSY;
#ifdef CONFIG_BLOCK
if (!(flags & MS_RDONLY) && bdev_read_only(sb->s_bdev))
return -EACCES;
#endif
if (flags & MS_RDONLY)
acct_auto_close(sb);
... | cwe | CWE-17 | C/C++ |
"80px";mxUtils.setPrefixedStyle(m.style,"transform","translate(50%,-50%)");n.appendChild(m);mxClient.IS_FF||null==navigator.clipboard||"image/png"!=x||(A=mxUtils.button(mxResources.get("copy"),function(P){P=b.base64ToBlob(L,"image/png");P=new ClipboardItem({"image/png":P,"text/html":new Blob(['<img src="data:'+x+";base... | cwe | CWE-20 | JavaScript |
static void rose_loopback_timer(unsigned long param)
{
struct sk_buff *skb;
struct net_device *dev;
rose_address *dest;
struct sock *sk;
unsigned short frametype;
unsigned int lci_i, lci_o;
while ((skb = skb_dequeue(&loopback_queue)) != NULL) {
lci_i = ((skb->data[0] << 8) & 0xF00) + ((skb->data[1] << 0) ... | cwe | CWE-20 | Unknown |
IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";C=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(J){function V(P){if(null!=P){P.sort(function(ia,la){return new Date(ia.modifiedDate)-new Date(la.modifiedDate)});for(var R=0;R<P.length;R++)V(P[R].r... | cwe | CWE-94 | JavaScript |
void hash_preload(struct mm_struct *mm, unsigned long ea,
unsigned long access, unsigned long trap)
{
unsigned long vsid;
void *pgdir;
pte_t *ptep;
cpumask_t mask;
unsigned long flags;
int local = 0;
/* We don't want huge pages prefaulted for now
*/
if (unlikely(in_hugepage_area(mm->context, ea)))
retu... | cwe | CWE-200 | Unknown |
/**
* Encode and decode ini/conf/cfg files
* @author Rolf Loges
* @licence MIT
* @param {{lineEnding: string, sectionOpenIdentifier: string, sectionCloseIdentifier: string, defaultValue: boolean, assignIdentifier: string, commentIdentifiers: string, trimLines: boolean, ignoreMultipleAssignIdentifier: boolean}} opti... | cwe | CWE-1321 | JavaScript |
func (h *Handler) DefaultErrorHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
h.L.Warnln("A client requested the default error URL, environment variable OAUTH2_ERROR_URL is probably not set.")
fmt.Fprintf(w, `
<html>
<head>
<title>An OAuth 2.0 Error Occurred</title>
</head>
<body>
<h1>
The O... | cwe | CWE-79 | Go |
function He(t,e){var n=t._computedWatchers=Object.create(null),r=$a();for(var i in e){var o=e[i],a="function"==typeof o?o:o.get;null==a&&ka('Getter is missing for computed property "'+i+'".',t),r||(n[i]=new Ms(t,a||C,C,Ds)),i in t?i in t.$data?ka('The computed property "'+i+'" is already defined in data.',t):t.$options... | cwe | CWE-79 | JavaScript |
flatpak_builtin_build (int argc, char **argv, GCancellable *cancellable, GError **error)
{
g_autoptr(GOptionContext) context = NULL;
g_autoptr(FlatpakDeploy) runtime_deploy = NULL;
g_autoptr(GBytes) runtime_deploy_data = NULL;
g_autoptr(FlatpakDeploy) extensionof_deploy = NULL;
g_autoptr(GFile) var = NULL;
... | cwe | CWE-74 | C/C++ |
xmlMallocLoc(size_t size, const char * file, int line)
{
MEMHDR *p;
void *ret;
if (!xmlMemInitialized) xmlInitMemory();
#ifdef DEBUG_MEMORY
xmlGenericError(xmlGenericErrorContext,
"Malloc(%d)\n",size);
#endif
TEST_POINT
p = (MEMHDR *) malloc(RESERVE_SIZE+size);
if (!p) {
xmlGeneric... | cwe | CWE-787 | Unknown |
static int ohci_queue_iso_receive_dualbuffer(struct fw_iso_context *base,
struct fw_iso_packet *packet,
struct fw_iso_buffer *buffer,
unsigned long payload)
{
struct iso_context *ctx = container_of(base, struct iso_context, base);
struct db_descriptor *db = NULL;
struct descriptor *d;
... | cwe | CWE-399 | Unknown |
prologProcessor(XML_Parser parser, const char *s, const char *end,
const char **nextPtr) {
const char *next = s;
int tok = XmlPrologTok(parser->m_encoding, s, end, &next);
return doProlog(parser, parser->m_encoding, s, end, tok, next, nextPtr,
(XML_Bool)! parser->m_parsingStatus.... | cwe | CWE-125 | C/C++ |
/**
@file packetParser.c
@brief functions to parse and generate a ZRTP packet
@author Johan Pascal
@copyright Copyright (C) 2014 Belledonne Communications, Grenoble, France
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-254 | C/C++ |
void CuePoint::Load(IMkvReader* pReader) {
if (m_timecode >= 0) // already loaded
return;
assert(m_track_positions == NULL);
assert(m_track_positions_count == 0);
long long pos_ = -m_timecode;
const long long element_start = pos_;
long long stop;
{
long len;
const long long id = R... | cwe | CWE-20 | 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 ... | cwe | CWE-476 | 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
di... | cwe | CWE-74 | Go |
(function()
{
Sidebar.prototype.addRackPalette = function(rack, dir)
{
for (var i = 0; i < rack.length; i++)
{
if (rack[i].toLowerCase() === 'general')
{
this.setCurrentSearchEntryLibrary('rack', 'rackGeneral');
this.addRackGeneralPalette();
}
else if (rack[i].toLowerCase() === 'f5')
{
... | cwe | CWE-79 | Java |
function fastifyMultipart (fastify, options, done) {
if (options.addToBody === true) {
if (typeof options.sharedSchemaId === 'string') {
fastify.addSchema({
$id: options.sharedSchemaId,
type: 'object',
properties: {
encoding: { type: 'string' },
filename: { type: ... | cwe | CWE-1321 | JavaScript |
this.editingHandler);L=this.graph.getLinkForCell(this.state.cell);M=this.graph.getLinksForState(this.state);this.updateLinkHint(L,M);if(null!=L||null!=M&&0<M.length)z=!0;z&&this.redrawHandles()};mxVertexHandler.prototype.updateLinkHint=function(z,L){try{if(null==z&&(null==L||0==L.length)||1<this.graph.getSelectionCount... | cwe | CWE-94 | JavaScript |
static inline bool unconditional(const struct arpt_arp *arp)
{
static const struct arpt_arp uncond;
return memcmp(arp, &uncond, sizeof(uncond)) == 0;
} | cwe | CWE-119 | C/C++ |
static wStream* rdg_receive_packet(rdpRdg* rdg)
{
wStream* s;
const size_t header = sizeof(RdgPacketHeader);
size_t packetLength;
assert(header <= INT_MAX);
s = Stream_New(NULL, 1024);
if (!s)
return NULL;
if (!rdg_read_all(rdg->tlsOut, Stream_Buffer(s), header))
{
Stream_Free(s, TRUE);
return NULL;
}
... | cwe | CWE-125 | C/C++ |
void ConnectionManagerImpl::ActiveStream::encodeHeaders(ResponseHeaderMap& headers,
bool end_stream) {
// Base headers.
// We want to preserve the original date header, but we add a date header if it is absent
if (!headers.Date()) {
connection_manager_.... | cwe | CWE-416 | Unknown |
static int install_process_keyring(void)
{
struct cred *new;
int ret;
new = prepare_creds();
if (!new)
return -ENOMEM;
ret = install_process_keyring_to_cred(new);
if (ret < 0) {
abort_creds(new);
return ret != -EEXIST ? ret : 0;
}
return commit_creds(new);
} | cwe | CWE-404 | Unknown |
boost::optional<ServerDescriptionPtr> TopologyDescription::installServerDescription(
const ServerDescriptionPtr& newServerDescription) {
boost::optional<ServerDescriptionPtr> previousDescription;
if (getType() == TopologyType::kSingle) {
// For Single, there is always one ServerDescription in Topolo... | cwe | CWE-755 | Unknown |
/*
* Copyright 2017-present Facebook, 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 a... | cwe | CWE-119 | C/C++ |
/*
* Copyright (C) 2012 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-862 | Java |
mp_dss_print(netdissect_options *ndo,
const u_char *opt, u_int opt_len, u_char flags)
{
const struct mp_dss *mdss = (const struct mp_dss *) opt;
if ((opt_len != mp_dss_len(mdss, 1) &&
opt_len != mp_dss_len(mdss, 0)) || flags & TH_SYN)
return 0;
if (mds... | cwe | CWE-125 | C/C++ |
public void sendResetPasswordEmailRequest(ResetPasswordRequestResponse requestResponse)
throws ResetPasswordException
{
AuthenticationResourceReference resourceReference =
new AuthenticationResourceReference(AuthenticationAction.RESET_PASSWORD);
UserReference userReference = req... | cwe | CWE-640 | Java |
function access_has_bug_level( $p_access_level, $p_bug_id, $p_user_id = null ) {
if( $p_user_id === null ) {
$p_user_id = auth_get_current_user_id();
}
# Deal with not logged in silently in this case
# @@@ we may be able to remove this and just error
# and once we default to anon login, we can remove it for... | cwe | CWE-264 | PHP |
/*
* 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 ... | cwe | CWE-863 | Java |
static reenc_status_t reencrypt_step(struct crypt_device *cd,
struct luks2_hdr *hdr,
struct luks2_reencrypt *rh,
uint64_t device_size,
bool online)
{
int r;
/* update reencrypt keyslot protection parameters in memory only */
r = reencrypt_keyslot_update(cd, rh);
if (r < 0) {
log_dbg(cd, "Keyslot update f... | cwe | CWE-345 | Unknown |
Graph.fileSupport&&(D.addEventListener("dragover",function(v){v.stopPropagation();v.preventDefault()},!1),D.addEventListener("drop",function(v){v.stopPropagation();v.preventDefault();if(0<v.dataTransfer.files.length){v=v.dataTransfer.files[0];var x=new FileReader;x.onload=function(A){D.value=A.target.result};x.readAsTe... | cwe | CWE-20 | JavaScript |
static ssize_t _epoll_write(oe_fd_t* epoll_, const void* buf, size_t count)
{
ssize_t ret = -1;
epoll_t* epoll = _cast_epoll(epoll_);
oe_errno = 0;
/* Call the host. */
if (oe_syscall_write_ocall(&ret, epoll->host_fd, buf, count) != OE_OK)
OE_RAISE_ERRNO(OE_EINVAL);
done:
return ret;
... | cwe | CWE-200 | Unknown |
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-617 | Python |
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator p... | cwe | CWE-200 | Java |
mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
struct host_cmd_ds_command *cmd,
struct cfg80211_ssid *req_ssid)
{
int rsn_ie_len = 0;
struct mwifiex_adapter *adapter = priv->adapter;
struct host_cmd_ds_802_11_ad_hoc_start *adhoc_start =
&cmd->params.adhoc_start;
struct mwifiex_bssdescriptor... | cwe | CWE-787 | C/C++ |
func createDeviceNode(rootfs string, node *devices.Device, bind bool) error {
if node.Path == "" {
// The node only exists for cgroup reasons, ignore it here.
return nil
}
dest := filepath.Join(rootfs, node.Path)
if err := os.MkdirAll(filepath.Dir(dest), 0755); err != nil {
return err
}
if bind {
return b... | cwe | CWE-362 | Go |
size_t recv_body(char* buf, size_t max) override {
auto& message = parser.get();
auto& body_remaining = message.body();
body_remaining.data = buf;
body_remaining.size = max;
while (body_remaining.size && !parser.is_done()) {
boost::system::error_code ec;
http::async_read_some(stream, bu... | cwe | CWE-400 | C/C++ |
static struct sk_buff *tcp_shift_skb_data(struct sock *sk, struct sk_buff *skb,
struct tcp_sacktag_state *state,
u32 start_seq, u32 end_seq,
bool dup_sack)
{
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *prev;
int mss;
int pcount = 0;
int len;
int in_sack;
/* Normally R but no L won't r... | cwe | CWE-190 | Unknown |
static void url_stream_start (auth_client *auth_user)
{
char *mount, *server;
ice_config_t *config = config_get_config ();
mount_proxy *mountinfo = config_find_mount (config, auth_user->mount, MOUNT_TYPE_NORMAL);
auth_t *auth = mountinfo->auth;
auth_url *url = auth->state;
char *stream_start_url... | cwe | CWE-119 | Unknown |
void ClipboardMessageFilter::OnWriteObjectsSync(
const ui::Clipboard::ObjectMap& objects,
base::SharedMemoryHandle bitmap_handle) {
DCHECK(base::SharedMemory::IsHandleValid(bitmap_handle))
<< "Bad bitmap handle";
scoped_ptr<ui::Clipboard::ObjectMap> long_living_objects(
new ui::Clipboard::Obj... | cwe | CWE-20 | C/C++ |
ArgParser::checkCompletion()
{
// See if we're being invoked from bash completion.
std::string bash_point_env;
if (QUtil::get_env("COMP_LINE", &bash_line) &&
QUtil::get_env("COMP_POINT", &bash_point_env))
{
int p = QUtil::string_to_int(bash_point_env.c_str());
if ((p > 0) && (p <... | cwe | CWE-787 | Unknown |
static Image *ReadPALMImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
Image
*image;
MagickBooleanType
status;
MagickOffsetType
totalOffset,
seekNextDepth;
PixelInfo
transpix;
Quantum
index;
register ssize_t
i,
x;
register Quantum
*q;
size_t
... | cwe | CWE-772 | C/C++ |
dir_initialize(int argc, VALUE *argv, VALUE dir)
{
struct dir_data *dp;
rb_encoding *fsenc;
VALUE dirname, opt, orig;
static ID keyword_ids[1];
const char *path;
if (!keyword_ids[0]) {
keyword_ids[0] = rb_intern("encoding");
}
fsenc = rb_filesystem_encoding();
rb_scan_args(argc,... | cwe | CWE-22 | Unknown |
static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value,
BN_GENCB *cb)
{
BIGNUM *r0 = NULL, *r1 = NULL, *r2 = NULL, *r3 = NULL, *tmp;
int bitsp, bitsq, ok = -1, n = 0;
BN_CTX *ctx = NULL;
unsigned long error = 0;
/*
* When generating ridiculously small k... | cwe | CWE-327 | Unknown |
static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
int param_length, const u8 params[],
int *result_length, u8 cmd_result[])
{
int result, actual_len;
u8 *b;
dprintk("%s\n", __func__);
b = kmalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
if (!b)
return -ENOMEM;
if ((result = ... | cwe | CWE-772 | C/C++ |
# Generated by Django 2.2.9 on 2020-02-23 09:01
from django.db import migrations
import markdownx.models
class Migration(migrations.Migration):
dependencies = [
('part', '0028_auto_20200203_1007'),
]
operations = [
migrations.AlterField(
model_name='part',
name='... | cwe | CWE-400 | Python |
CallResult<HermesValue> Interpreter::interpretFunction(
Runtime *runtime,
InterpreterState &state) {
// The interepter is re-entrant and also saves/restores its IP via the runtime
// whenever a call out is made (see the CAPTURE_IP_* macros). As such, failure
// to preserve the IP across calls to interpete... | cwe | CWE-703 | C/C++ |
*/
static int
xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
{
int total = 0;
int equal, ret;
xmlXPathCompExprPtr comp;
xmlXPathObjectPtr arg1, arg2;
CHECK_ERROR0;
comp = ctxt->comp;
switch (op->op) {
case XPATH_OP_END:
return (0);
case X... | cwe | CWE-476 | C/C++ |
static Image *ReadPCLImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define CropBox "CropBox"
#define DeviceCMYK "DeviceCMYK"
#define MediaBox "MediaBox"
#define RenderPCLText " Rendering PCL... "
char
command[MaxTextExtent],
*density,
filename[MaxTextExtent],
geometry[MaxTextExt... | cwe | CWE-190 | C/C++ |
void Huff_offsetTransmit (huff_t *huff, int ch, byte *fout, int *offset) {
bloc = *offset;
send(huff->loc[ch], NULL, fout);
*offset = bloc;
} | cwe | CWE-119 | C/C++ |
sraSpanInsertBefore(sraSpan *newspan, sraSpan *before) {
newspan->_next = before;
newspan->_prev = before->_prev;
before->_prev->_next = newspan;
before->_prev = newspan;
} | cwe | CWE-476 | C/C++ |
dtls1_hm_fragment_free(hm_fragment *frag)
{
if (frag->fragment) OPENSSL_free(frag->fragment);
if (frag->reassembly) OPENSSL_free(frag->reassembly);
OPENSSL_free(frag);
} | cwe | CWE-310 | Unknown |
static int qcow2_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
BDRVQcowState *s = bs->opaque;
int len, i, ret = 0;
QCowHeader header;
QemuOpts *opts;
Error *local_err = NULL;
uint64_t ext_end;
uint64_t l1_vm_state_index;
const char *opt_overl... | cwe | CWE-20 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-617 | C/C++ |
static void vhost_vsock_common_send_transport_reset(VHostVSockCommon *vvc)
{
VirtQueueElement *elem;
VirtQueue *vq = vvc->event_vq;
struct virtio_vsock_event event = {
.id = cpu_to_le32(VIRTIO_VSOCK_EVENT_TRANSPORT_RESET),
};
elem = virtqueue_pop(vq, sizeof(VirtQueueElement));
if (!elem... | cwe | CWE-772 | C/C++ |
perf_event_parse_addr_filter(struct perf_event *event, char *fstr,
struct list_head *filters)
{
struct perf_addr_filter *filter = NULL;
char *start, *orig, *filename = NULL;
substring_t args[MAX_OPT_ARGS];
int state = IF_STATE_ACTION, token;
unsigned int kernel = 0;
int ret = -EINVAL;
orig = fstr = kstr... | cwe | CWE-401 | C/C++ |
def _get_3par_hostname_from_wwn_iqn(self, wwns_iqn):
out = self._cli_run('showhost -d', None)
# wwns_iqn may be a list of strings or a single
# string. So, if necessary, create a list to loop.
if not isinstance(wwns_iqn, list):
wwn_iqn_list = [wwns_iqn]
else:
... | cwe | CWE-78 | Python |
# -*- coding: utf-8 -*-
# Copyright 2014 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | cwe | CWE-20 | Python |
/*
* 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.
*/
#include "hermes/Optimizer/Scalar/SimpleCallGraphProvider.h"
#include "hermes/IR/IR.h"
#include "hermes/IR/Instrs.h"
#include "h... | cwe | CWE-416 | C/C++ |
static bool dump_fd_info(const char *dest_filename, char *source_filename, int source_base_ofs)
{
FILE *fp = fopen(dest_filename, "w");
if (!fp)
return false;
unsigned fd = 0;
while (fd <= 99999) /* paranoia check */
{
sprintf(source_filename + source_base_ofs, "fd/%u", fd);
... | cwe | CWE-59 | C/C++ |
int main(int argc, char *argv[])
{
int ret;
struct lxc_lock *lock;
lock = lxc_newlock(NULL, NULL);
if (!lock) {
fprintf(stderr, "%d: failed to get unnamed lock\n", __LINE__);
exit(1);
}
ret = lxclock(lock, 0);
if (ret) {
fprintf(stderr, "%d: failed to take unnamed lock (%d)\n", __LINE__, ret);
exit(1);
... | cwe | CWE-61 | Unknown |
getcmdline_int(
int firstc,
long count UNUSED, // only used for incremental search
int indent, // indent for inside conditionals
int clear_ccline) // clear ccline first
{
static int depth = 0; // call depth
int c;
int i;
int j;
int gotesc = FALSE; // TRUE when <ESC> just... | cwe | CWE-416 | C/C++ |
ldbm_back_bind(Slapi_PBlock *pb)
{
backend *be;
ldbm_instance *inst;
ber_tag_t method;
struct berval *cred;
struct ldbminfo *li;
struct backentry *e;
Slapi_Attr *attr;
Slapi_Value **bvals;
entry_address *addr;
back_txn txn = {NULL};
int rc = SLAPI_BIND_SUCCESS;
int result... | cwe | CWE-203 | C/C++ |
fn should_disallow_non_get_requests() {
// given
let (server, fetch) = serve_with_fetch("token");
// when
let response = request(server,
"\
POST / HTTP/1.1\r\n\
Host: EHQPPSBE5DM78X3GECX2YBVGC5S6JX3S5SMPY.web.web3.site\r\n\
Content-Type: application/json\r\n\
Connection: close\r\n\
\r\n\
123\r\... | cwe | CWE-346 | Rust |
package com.salesmanager.shop.model.catalog.product;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.salesmanager.shop.model.catalog.category.ReadableCategory;
import com.salesmanager.shop.model.catalog.manufacturer.ReadableManufacturer;
import com.salesmanager.shop.model.ca... | cwe | CWE-639 | Java |
package org.pac4j.oidc.credentials.authenticator;
import static java.util.Optional.ofNullable;
import static org.pac4j.core.profile.AttributeLocation.PROFILE_ATTRIBUTE;
import java.io.IOException;
import java.util.Map;
import javax.naming.AuthenticationException;
import org.pac4j.core.context.WebContext;
import org... | cwe | CWE-347 | Java |
static void btif_av_event_free_data(btif_sm_event_t event, void* p_data) {
switch (event) {
case BTA_AV_META_MSG_EVT: {
tBTA_AV* av = (tBTA_AV*)p_data;
osi_free_and_reset((void**)&av->meta_msg.p_data);
if (av->meta_msg.p_msg) {
if (av->meta_msg.p_msg->hdr.opcode == AVRC_OP_VENDOR) {
... | cwe | CWE-416 | C/C++ |
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distribute... | cwe | CWE-200 | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.