code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
/* Copyright 2019 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-131 | Python |
function checkPassword($username, $password)
{
$doUser = OA_Dal::factoryDO('users');
$doUser->username = strtolower($username);
$doUser->password = md5($password);
$doUser->find();
if ($doUser->fetch()) {
return $doUser;
} else {
return false;... | cwe | CWE-287 | PHP |
bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table,
bool *error_reported, vcol_init_mode mode)
{
CHARSET_INFO *save_character_set_client= thd->variables.character_set_client;
CHARSET_INFO *save_collation= thd->variables.collation_connection;
Query_arena *backup_stmt_arena_ptr= t... | cwe | CWE-416 | Unknown |
static unsigned long get_ctl_id_hash(const struct snd_ctl_elem_id *id)
{
int i;
unsigned long h;
h = id->iface;
h = MULTIPLIER * h + id->device;
h = MULTIPLIER * h + id->subdevice;
for (i = 0; id->name[i] && i < SNDRV_CTL_ELEM_ID_NAME_MAXLEN; i++)
h = MULTIPLIER * h + id->name[i];
h = MULTIPLIER * h + id->ind... | cwe | CWE-125 | C/C++ |
/*
* hmi.c -- Midi Wavetable Processing library
*
* Copyright (C) WildMIDI Developers 2001-2016
*
* This file is part of WildMIDI.
*
* WildMIDI is free software: you can redistribute and/or modify the player
* under the terms of the GNU General Public License and you can redistribute
* and/or modify the librar... | cwe | CWE-125 | C/C++ |
write_header( FT_Error error_code )
{
FT_Face face;
const char* basename;
const char* format;
error = FTC_Manager_LookupFace( handle->cache_manager,
handle->scaler.face_id, &face );
if ( error )
Fatal( "can't access font file" );
if ( !status... | cwe | CWE-120 | C/C++ |
evbuffer_add_vprintf(struct evbuffer *buf, const char *fmt, va_list ap)
{
char *buffer;
size_t space;
int sz, result = -1;
va_list aq;
struct evbuffer_chain *chain;
EVBUFFER_LOCK(buf);
if (buf->freeze_end) {
goto done;
}
/* make sure that at least some space is available */
if ((chain = evbuffer_expand_... | cwe | CWE-189 | Unknown |
static int __init acpi_custom_method_init(void)
{
if (!acpi_debugfs_dir)
return -ENOENT;
cm_dentry = debugfs_create_file("custom_method", S_IWUSR,
acpi_debugfs_dir, NULL, &cm_fops);
if (!cm_dentry)
return -ENODEV;
return 0;
} | cwe | CWE-264 | C/C++ |
TfLiteStatus SimpleOpEval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input1 = tflite::GetInput(context, node, /*index=*/0);
const TfLiteTensor* input2 = tflite::GetInput(context, node, /*index=*/1);
TfLiteTensor* output = GetOutput(context, node, /*index=*/0);
int32_t* output_data = outpu... | cwe | CWE-125 | C/C++ |
def send_request(session, node, request, post=false, data={}, remote=true, raw_data=nil, timeout=30, cookies_data=nil)
cookies_data = {} if not cookies_data
begin
request = "/#{request}" if not request.start_with?("/")
# fix ipv6 address for URI.parse
node6 = node
if (node.include?(":") and ! node.... | cwe | CWE-384 | Ruby |
#
# Copyright (C) 2009-2020 the sqlparse authors and contributors
# <see AUTHORS file>
#
# This module is part of python-sqlparse and is released under
# the BSD License: https://opensource.org/licenses/BSD-3-Clause
from sqlparse import tokens
# object() only supports "is" and is useful as a marker
# use this marker ... | cwe | CWE-1333 | Python |
void InputConnectionImpl::CommitText(const base::string16& text,
int new_cursor_pos) {
StartStateUpdateTimer();
std::string error;
if (!ime_engine_->ClearComposition(input_context_id_, &error))
LOG(ERROR) << "ClearComposition failed: error=\"" << error << "\"";
if (IsC... | cwe | CWE-119 | Unknown |
/**
* File: TGA Input
*
* Read TGA images.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include "gd_tga.h"
#include "gd.h"
#include "gd_errors.h"
#include "gdhelpers.h"
/*
Function: gdImageCreateFromTga
... | cwe | CWE-125 | C/C++ |
package com.salesmanager.shop.admin.controller.products;
import com.salesmanager.core.business.services.catalog.category.CategoryService;
import com.salesmanager.core.business.services.catalog.product.ProductService;
import com.salesmanager.core.business.services.catalog.product.relationship.ProductRelationshipService... | cwe | CWE-639 | Java |
SYSCALL_DEFINE1(timer_getoverrun, timer_t, timer_id)
{
struct k_itimer *timr;
int overrun;
unsigned long flags;
timr = lock_timer(timer_id, &flags);
if (!timr)
return -EINVAL;
overrun = timr->it_overrun_last;
unlock_timer(timr, flags);
return overrun;
} | cwe | CWE-190 | Unknown |
static void xen_irq_init(unsigned irq)
{
struct irq_info *info;
#ifdef CONFIG_SMP
/* By default all event channels notify CPU#0. */
cpumask_copy(irq_get_affinity_mask(irq), cpumask_of(0));
#endif
info = kzalloc(sizeof(*info), GFP_KERNEL);
if (info == NULL)
panic("Unable to allocate metadata for IRQ%d\n", irq);
... | cwe | CWE-400 | Unknown |
/*
* Copyright (c) 2018-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <fizz/record/PlaintextRecordLayer.h>
#include <folly/String.h>
namespace fizz {
using Conte... | cwe | CWE-835 | C/C++ |
exsltCryptoPopString (xmlXPathParserContextPtr ctxt, int nargs,
xmlChar ** str) {
int str_len = 0;
if ((nargs < 1) || (nargs > 2)) {
xmlXPathSetArityError (ctxt);
return 0;
}
*str = xmlXPathPopString (ctxt);
str_len = xmlUTF8Strlen (*str);
if (str_len == 0) {
xmlXPathReturnE... | cwe | CWE-119 | C/C++ |
gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr fd) /* {{{ */
{
int BitPixel;
#if 0
int ColorResolution;
int Background;
int AspectRatio;
#endif
int Transparent = (-1);
unsigned char buf[16];
unsigned char c;
unsigned char ColorMap[3][MAXCOLORMAPSIZE];
unsigned char localColorMap[3][MAXCOLORMAPSIZE];
in... | cwe | CWE-681 | C/C++ |
static void umount_tree(struct mount *mnt, enum umount_tree_flags how)
{
LIST_HEAD(tmp_list);
struct mount *p;
if (how & UMOUNT_PROPAGATE)
propagate_mount_unlock(mnt);
/* Gather the mounts to umount */
for (p = mnt; p; p = next_mnt(p, mnt)) {
p->mnt.mnt_flags |= MNT_UMOUNT;
list_move(&p->mnt_list, &tmp_lis... | cwe | CWE-200 | Unknown |
"geCommentActionLnk";mxUtils.write(da,P);Y.appendChild(da);mxEvent.addListener(da,"click",function(ha){O(ha,J);ha.preventDefault();mxEvent.consume(ha)});T.appendChild(Y);R&&(Y.style.display="none")}function W(){function P(Y){O.push(R);if(null!=Y.replies)for(var da=0;da<Y.replies.length;da++)R=R.nextSibling,P(Y.replies[... | cwe | CWE-20 | JavaScript |
static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define RMT_EQUAL_RGB 1
#define RMT_NONE 0
#define RMT_RAW 2
#define RT_STANDARD 1
#define RT_ENCODED 2
#define RT_FORMAT_RGB 3
typedef struct _SUNInfo
{
unsigned int
magic,
width,
height,
depth,
... | cwe | CWE-119 | C/C++ |
xsltShallowCopyElem(xsltTransformContextPtr ctxt, xmlNodePtr node,
xmlNodePtr insert, int isLRE)
{
xmlNodePtr copy;
if ((node->type == XML_DTD_NODE) || (insert == NULL))
return(NULL);
if ((node->type == XML_TEXT_NODE) ||
(node->type == XML_CDATA_SECTION_NODE))
return(xsltCopyText(ctxt, insert, nod... | cwe | CWE-119 | C/C++ |
BIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N)
{
/* k = SHA1(PAD(A) || PAD(B) ) -- tls-srp draft 8 */
BIGNUM *u;
unsigned char cu[SHA_DIGEST_LENGTH];
unsigned char *cAB;
EVP_MD_CTX ctxt;
int longN;
if ((A == NULL) ||(B == NULL) || (N == NULL))
return NULL;
longN= BN_num_bytes(N);
if ((cAB = OPENS... | cwe | CWE-119 | Unknown |
void isis_notif_authentication_type_failure(const struct isis_circuit *circuit,
const char *raw_pdu,
size_t raw_pdu_len)
{
const char *xpath = "/frr-isisd:authentication-type-failure";
struct list *arguments = yang_data_list_new();
char xpath_arg[XPATH_MAXLEN];
struct yang_data *data;
struct isis... | cwe | CWE-119 | Unknown |
public boolean archiveNodeData(Locale locale, ICourse course, ArchiveOptions options,
ZipOutputStream exportStream, String archivePath, String charset) {
String filename = "checklist_"
+ StringHelper.transformDisplayNameToFileSystemName(getShortName())
+ "_" + Formatter.formatDatetimeFilesystemSave(new Dat... | cwe | CWE-91 | Java |
static Image *ReadAAIImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
Image
*image;
MagickBooleanType
status;
register ssize_t
x;
register PixelPacket
*q;
register unsigned char
*p;
size_t
height,
length,
width;
ssize_t
count,
y;
unsigned char
... | cwe | CWE-401 | Unknown |
void arch_pick_mmap_layout(struct mm_struct *mm)
{
unsigned long random_factor = 0UL;
if (current->flags & PF_RANDOMIZE)
random_factor = arch_mmap_rnd();
mm->mmap_legacy_base = mmap_legacy_base(random_factor);
if (mmap_is_legacy()) {
mm->mmap_base = mm->mmap_legacy_base;
mm->get_unmapped_area = arch_get_un... | cwe | CWE-254 | Unknown |
// Copyright 2014 The Macaron 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 agree... | cwe | CWE-601 | Go |
package org.jolokia.http;
import java.io.*;
import java.net.*;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.*;
import javax.management.RuntimeMBeanException;
import javax.security.auth.Subject;
import javax.servlet.*;
import javax.servlet.http.*;
im... | cwe | CWE-79 | Java |
static av_cold int dnxhd_init_rc(DNXHDEncContext *ctx)
{
FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_rc, 8160*ctx->m.avctx->qmax*sizeof(RCEntry), fail);
if (ctx->m.avctx->mb_decision != FF_MB_DECISION_RD)
FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_cmp, ctx->m.mb_num*sizeof(RCCMPEntry), fail);
ctx->frame_b... | cwe | CWE-703 | Unknown |
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2000-2002,2005 Silicon Graphics, Inc.
* All Rights Reserved.
*/
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_format.h"
#include "xfs_log_format.h"
#include "xfs_shared.h"
#include "xfs_trans_resv.h"
#include "xfs_bit.h"
#include "xfs_sb.h"
#include "xfs_mo... | cwe | CWE-400 | C/C++ |
static void fpm_worker_pool_cleanup(int which, void *arg) /* {{{ */
{
struct fpm_worker_pool_s *wp, *wp_next;
for (wp = fpm_worker_all_pools; wp; wp = wp_next) {
wp_next = wp->next;
fpm_worker_pool_config_free(wp->config);
fpm_children_free(wp->children);
if ((which & FPM_CLEANUP_CHILD) == 0 && fpm_globals.p... | cwe | CWE-787 | Unknown |
package api
type Resource struct {
ID int `json:"id"`
// Standard fields
CreatorID int `json:"creatorId"`
CreatedTs int64 `json:"createdTs"`
UpdatedTs int64 `json:"updatedTs"`
// Domain specific fields
Filename string `json:"filename"`
Blob []byte `json:"-"`
Type string `json:"type"`
Size int... | cwe | CWE-285 | Go |
function toString(stringify) {
if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify;
var query
, url = this
, protocol = url.protocol;
if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';
var result =
protocol +
((url.protocol && url.slashes) |... | cwe | CWE-639 | JavaScript |
/*
* Copyright (c) 2009-2012, 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 co... | cwe | CWE-190 | C/C++ |
ProcessUDPHeader(tTcpIpPacketParsingResult _res, PVOID pIpHeader, ULONG len, USHORT ipHeaderSize)
{
tTcpIpPacketParsingResult res = _res;
ULONG udpDataStart = ipHeaderSize + sizeof(UDPHeader);
res.xxpStatus = ppresXxpIncomplete;
res.TcpUdp = ppresIsUDP;
res.XxpIpHeaderSize = udpDataStart;
if (le... | cwe | CWE-20 | C/C++ |
int32_t FASTCALL get_word (WavpackStream *wps, int chan, int32_t *correction)
{
register struct entropy_data *c = wps->w.c + chan;
uint32_t ones_count, low, mid, high;
int32_t value;
int sign;
if (!wps->wvbits.ptr)
return WORD_EOF;
if (correction)
*correction = 0;
if (!(wp... | cwe | CWE-125 | C/C++ |
gs_main_init1(gs_main_instance * minst)
{
if (minst->init_done < 1) {
gs_dual_memory_t idmem;
int code =
ialloc_init(&idmem, minst->heap,
minst->memory_clump_size, gs_have_level2());
if (code < 0)
return code;
code = gs_lib_init1((gs_m... | cwe | CWE-20 | C/C++ |
private CallbackHandler getCallbackHandler(
@UnderInitialization(WrappedFactory.class) LibPQFactory this,
Properties info) throws PSQLException {
// Determine the callback handler
CallbackHandler cbh;
String sslpasswordcallback = PGProperty.SSL_PASSWORD_CALLBACK.get(info);
if (sslpasswordcal... | cwe | CWE-665 | Java |
pci_emul_mem_handler(struct vmctx *ctx, int vcpu, int dir, uint64_t addr,
int size, uint64_t *val, void *arg1, long arg2)
{
struct pci_vdev *pdi = arg1;
struct pci_vdev_ops *ops = pdi->dev_ops;
uint64_t offset;
int bidx = (int) arg2;
assert(bidx <= PCI_BARMAX);
assert(pdi->bar[bidx].type == PCIBAR_MEM32 |... | cwe | CWE-617 | Unknown |
int btrfs_rm_device(struct btrfs_fs_info *fs_info, const char *device_path,
u64 devid)
{
struct btrfs_device *device;
struct btrfs_fs_devices *cur_devices;
struct btrfs_fs_devices *fs_devices = fs_info->fs_devices;
u64 num_devices;
int ret = 0;
mutex_lock(&uuid_mutex);
num_devices = btrfs_num_devices(fs_... | cwe | CWE-703 | C/C++ |
TfLiteStatus ExpandTensorDim(TfLiteContext* context, const TfLiteTensor& input,
int axis, TfLiteTensor* output) {
const TfLiteIntArray& input_dims = *input.dims;
if (axis < 0) {
axis = input_dims.size + 1 + axis;
}
TF_LITE_ENSURE(context, axis <= input_dims.size);
TfLiteIntAr... | cwe | CWE-125 | C/C++ |
/************************************************************************
* 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 |
/*
* INET An implementation of the TCP/IP protocol suite for the LINUX
* operating system. INET is implemented using the BSD Socket
* interface as the means of communication with the user level.
*
* Implementation of the Transmission Control Protocol(TCP).
*
* Authors: Ross Biro
* Fred N. van Kempen, <wa... | cwe | CWE-400 | C/C++ |
def registerPlayer(name):
"""Adds a player to the tournament database.
The database assigns a unique serial id number for the player. (This
should be handled by your SQL database schema, not in your Python code.)
Args:
name: the player's full name (need not be unique).
"""
conn = connec... | cwe | CWE-89 | Python |
int qeth_snmp_command(struct qeth_card *card, char __user *udata)
{
struct qeth_cmd_buffer *iob;
struct qeth_ipa_cmd *cmd;
struct qeth_snmp_ureq *ureq;
int req_len;
struct qeth_arp_query_info qinfo = {0, };
int rc = 0;
QETH_CARD_TEXT(card, 3, "snmpcmd");
if (card->info.guestlan)
return -EOPNOTSUPP;
... | cwe | CWE-119 | C/C++ |
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package zip
import (
"bufio"
"encoding/binary"
"errors"
"hash"
"hash/crc32"
"io"
"io/fs"
"os"
"path"
"sort"
"strings"
"sync"
"time"
)
var (
ErrF... | cwe | CWE-20 | Go |
static struct rmap_item *scan_get_next_rmap_item(struct page **page)
{
struct mm_struct *mm;
struct mm_slot *slot;
struct vm_area_struct *vma;
struct rmap_item *rmap_item;
if (list_empty(&ksm_mm_head.mm_list))
return NULL;
slot = ksm_scan.mm_slot;
if (slot == &ksm_mm_head) {
/*
* A number of pages can h... | cwe | CWE-362 | C/C++ |
def initialize(*configs)
@config = configs.each_with_object(default_config) do |path, obj|
new = YAML.load(File.read(path))
next unless new
obj.deep_merge! Cymbal.symbolize(new)
end
@paths = @config[:paths]
end | cwe | CWE-502 | Ruby |
package com.salesmanager.shop.model.catalog.product.product.definition;
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.catalog.prod... | cwe | CWE-79 | Java |
jpc_pi_t *jpc_enc_pi_create(jpc_enc_cp_t *cp, jpc_enc_tile_t *tile)
{
jpc_pi_t *pi;
int compno;
jpc_picomp_t *picomp;
jpc_pirlvl_t *pirlvl;
jpc_enc_tcmpt_t *tcomp;
int rlvlno;
jpc_enc_rlvl_t *rlvl;
int prcno;
int *prclyrno;
if (!(pi = jpc_pi_create0())) {
return 0;
}
pi->pktno = -1;
pi->numcomps = cp->n... | cwe | CWE-189 | Unknown |
/*
* Copyright (c) by Jaroslav Kysela <perex@perex.cz>
* Copyright (c) 2009 by Krzysztof Helt
* Routines for control of MPU-401 in UART mode
*
* MPU-401 supports UART mode which is not capable generate transmit
* interrupts thus output is done via polling. Also, if irq < 0, then
* input is done also via po... | cwe | CWE-125 | C/C++ |
/*
Copyright The Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... | cwe | CWE-74 | Go |
// Copyright 2016 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 db
import (
"fmt"
"io"
"io/ioutil"
"mime/multipart"
"os"
"os/exec"
"path"
"path/filepath"
"strings"
"time"
gouuid "github.com/satori/go.u... | cwe | CWE-434 | Go |
stringprep_utf8_nfkc_normalize (const char *str, ssize_t len)
{
return g_utf8_normalize (str, len, G_NORMALIZE_NFKC);
} | cwe | CWE-125 | Unknown |
void DeepScanLineInputFile::initialize(const Header& header)
{
try
{
if (header.type() != DEEPSCANLINE)
throw IEX_NAMESPACE::ArgExc("Can't build a DeepScanLineInputFile from "
"a type-mismatched part.");
if(header.version()!=1)
{
THROW(IEX_NAM... | cwe | CWE-125 | Unknown |
$otherPublisherName = MAX_buildName($aOtherPublisher['publisher_id'], $aOtherPublisher['name']);
if ($aOtherPublisher['publisher_id'] != $affiliateid) {
$form .= "<option value='" . $aOtherPublisher['publisher_id'] . "'>" . htmlspecialchars($otherPublisherName) . "</option>";
}
... | cwe | CWE-352 | PHP |
package com.salesmanager.shop.admin.model.reference;
import java.io.Serializable;
public class Size implements Serializable {
/**
*
*/
private static final long serialVersionUID = -4737272153685816396L;
private String code;
private String name;
public String getCode() {
return code;
}
public void se... | cwe | CWE-79 | Java |
do_uncompress( compress_filter_context_t *zfx, z_stream *zs,
IOBUF a, size_t *ret_len )
{
int zrc;
int rc=0;
size_t n;
int nread, count;
int refill = !zs->avail_in;
if( DBG_FILTER )
log_debug("begin inflate: avail_in=%u, avail_out=%u, inbuf=%u\n",
(unsigned)zs->avail_in, (unsigned)zs... | cwe | CWE-20 | Unknown |
function validateBaseUrl(url: string) {
// from this MIT-licensed gist: https://gist.github.com/dperini/729294
return /^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-... | cwe | CWE-697 | JavaScript |
/*****************************************************************
|
| Platinum - HTTP Server
|
| Copyright (c) 2004-2010, Plutinosoft, LLC.
| All rights reserved.
| http://www.plutinosoft.com
|
| This program is free software; you can redistribute it and/or
| modify it under the terms of the GNU General Public Licen... | cwe | CWE-22 | C/C++ |
int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf,
int len, int peek)
{
int al, i, j, ret;
unsigned int n;
SSL3_RECORD *rr;
void (*cb) (const SSL *ssl, int type2, int val) = NULL;
if (!SSL3_BUFFER_is_initialised(&s->rlayer.rbuf)) {
/* Not initia... | cwe | CWE-400 | Unknown |
// This file is part of Deark.
// Copyright (C) 2016 Jason Summers
// See the file COPYING for terms of use.
// This file is for format-specific functions that are used by multiple modules.
#define DE_NOT_IN_MODULE
#include "deark-config.h"
#include "deark-private.h"
#include "deark-fmtutil.h"
void fmtutil_get_bmp_c... | cwe | CWE-369 | C/C++ |
/*
* Copyright 2018 Red Hat, 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 agreed to ... | cwe | CWE-863 | Java |
export function loadEmailAddressesAndLoginMethods(userId: UserId, success: UserAcctRespHandler) {
get(`/-/load-email-addrs-login-methods?userId=${userId}`, response => {
success(response);
});
} | cwe | CWE-613 | Scala |
int extract_status_code(char *buffer, size_t size)
{
char *buf_code;
char *begin;
char *end = buffer + size;
size_t inc = 0;
int code;
/* Allocate the room */
buf_code = (char *)MALLOC(10);
/* Status-Code extraction */
while (buffer < end && *buffer++ != ' ') ;
begin = buffer;
while (buffer < end && *bu... | cwe | CWE-119 | C/C++ |
const {
getGlobalDB,
getTenantId,
isUserInAppTenant,
} = require("@budibase/backend-core/tenancy")
const { generateDevInfoID, SEPARATOR } = require("@budibase/backend-core/db")
const { user: userCache } = require("@budibase/backend-core/cache")
const {
hash,
platformLogout,
getCookie,
clearCookie,
} = req... | cwe | CWE-284 | JavaScript |
/*
* 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 void ftrace_syscall_enter(void *data, struct pt_regs *regs, long id)
{
struct trace_array *tr = data;
struct ftrace_event_file *ftrace_file;
struct syscall_trace_enter *entry;
struct syscall_metadata *sys_data;
struct ring_buffer_event *event;
struct ring_buffer *buffer;
unsigned long irq_flags;
int pc;
... | cwe | CWE-119 | Unknown |
/*
* Kexec bzImage loader
*
* Copyright (C) 2014 Red Hat Inc.
* Authors:
* Vivek Goyal <vgoyal@redhat.com>
*
* This source code is licensed under the GNU General Public License,
* Version 2. See the file COPYING for more details.
*/
#define pr_fmt(fmt) "kexec-bzImage64: " fmt
#include <linux/string.h>
... | cwe | CWE-254 | C/C++ |
void CL_Init( void ) {
Com_Printf( "----- Client Initialization -----\n" );
Con_Init ();
if(!com_fullyInitialized)
{
CL_ClearState();
clc.state = CA_DISCONNECTED; // no longer CA_UNINITIALIZED
cl_oldGameSet = qfalse;
}
cls.realtime = 0;
CL_InitInput ();
//
// register our variables
//
cl_noprint =... | cwe | CWE-269 | Unknown |
static RList *symbols(RBinFile *bf) {
RList *res = r_list_newf ((RListFree)r_bin_symbol_free);
r_return_val_if_fail (res && bf->o && bf->o->bin_obj, res);
RCoreSymCacheElement *element = bf->o->bin_obj;
size_t i;
HtUU *hash = ht_uu_new0 ();
if (!hash) {
return res;
}
bool found = false;
for (i = 0; i < eleme... | cwe | CWE-787 | C/C++ |
static int string_scan_range(RList *list, const ut8 *buf, int min,
const ut64 from, const ut64 to, int type) {
ut8 tmp[R_STRING_SCAN_BUFFER_SIZE];
ut64 str_start, needle = from;
int count = 0, i, rc, runes;
int str_type = R_STRING_TYPE_DETECT;
if (type == -1) {
type = R_STRING_TYPE_DETECT;
}
if (!buf... | cwe | CWE-125 | Unknown |
int ocfs2_set_acl(handle_t *handle,
struct inode *inode,
struct buffer_head *di_bh,
int type,
struct posix_acl *acl,
struct ocfs2_alloc_context *meta_ac,
struct ocfs2_alloc_context *data_ac)
{
int name_index;
void *value = NULL;
size_t size = 0;
int ret;
if (S_ISLNK(inode->i_mode))
retur... | cwe | CWE-285 | Unknown |
export function escapeCommentText(value: string): string {
return value.replace(END_COMMENT, END_COMMENT_ESCAPED);
} | cwe | CWE-79 | JavaScript |
function send_reset_confirmation_request($name)
{
global $sitename;
$rs = safe_row("email, nonce", 'txp_users', "name = '".doSlash($name)."'");
if ($rs) {
extract($rs);
$confirm = bin2hex(pack('H*', substr(md5($nonce), 0, 10)).$name);
$message = gTxt('greeting').' '.$name.','.
... | cwe | CWE-521 | PHP |
lspci_process(STREAM s)
{
unsigned int pkglen;
static char *rest = NULL;
char *buf;
pkglen = s->end - s->p;
/* str_handle_lines requires null terminated strings */
buf = xmalloc(pkglen + 1);
STRNCPY(buf, (char *) s->p, pkglen + 1);
#if 0
printf("lspci recv:\n");
hexdump(s->p, pkglen);
#endif
str_handle_line... | cwe | CWE-787 | Unknown |
lrmd_remote_listen(gpointer data)
{
int csock = 0;
int flag = 0;
unsigned laddr = 0;
struct sockaddr addr;
gnutls_session_t *session = NULL;
crm_client_t *new_client = NULL;
static struct mainloop_fd_callbacks lrmd_remote_fd_cb = {
.dispatch = lrmd_remote_client_msg,
.destro... | cwe | CWE-254 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-399 | C/C++ |
/*
* This file is part of Espruino, a JavaScript interpreter for Microcontrollers
*
* Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http... | cwe | CWE-787 | C/C++ |
static v8::Handle<v8::Value> getNamedProperty(HTMLDocument* htmlDocument, const AtomicString& key, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
if (!htmlDocument->hasNamedItem(key.impl()) && !htmlDocument->hasExtraNamedItem(key.impl()))
return v8Undefined();
RefPtr<HTMLCollection... | cwe | CWE-399 | C/C++ |
parse_wbxml_attribute_list_defined (proto_tree *tree, tvbuff_t *tvb,
guint32 offset, guint32 str_tbl, guint8 level, 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 | C/C++ |
"""
File: /lib/cogs/website.py
Info: This cog handles the website which talks to the API.
"""
from datetime import datetime
from math import prod
import nextcord
from nextcord.ext.commands import Cog, command
from nextcord.ext.commands.core import Command
from nextcord import Embed, Colour, colour
from quart im... | cwe | CWE-116 | Python |
e1000e_write_packet_to_guest(E1000ECore *core, struct NetRxPkt *pkt,
const E1000E_RxRing *rxr,
const E1000E_RSSInfo *rss_info)
{
PCIDevice *d = core->owner;
dma_addr_t base;
uint8_t desc[E1000_MAX_RX_DESC_LEN];
size_t desc_size;
size_t desc_o... | cwe | CWE-835 | C/C++ |
function PMA_getErrorReportForm()
{
$html = "";
$html .= '<form action="error_report.php" method="post" name="report_frm"'
. ' id="report_frm" class="ajax">'
. '<fieldset style="padding-top:0px">';
$html .= '<p>' . __(
'phpMyAdmin has encountered an error. We have collected ... | cwe | CWE-79 | PHP |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | cwe | CWE-94 | C/C++ |
int agp_generic_remove_memory(struct agp_memory *mem, off_t pg_start, int type)
{
size_t i;
struct agp_bridge_data *bridge;
int mask_type;
bridge = mem->bridge;
if (!bridge)
return -EINVAL;
if (mem->page_count == 0)
return 0;
if (type != mem->type)
return -EINVAL;
mask_type = bridge->driver->agp_type_... | cwe | CWE-190 | Unknown |
GPMF_ERR IsValidSize(GPMF_stream *ms, uint32_t size) // size is in longs not bytes.
{
if (ms)
{
int32_t nestsize = (int32_t)ms->nest_size[ms->nest_level];
if (nestsize == 0 && ms->nest_level == 0)
nestsize = ms->buffer_size_longs;
if (size + 2 <= nestsize) return GPMF_OK;
}
return GPMF_ERROR_BAD_STRUCTURE... | cwe | CWE-125 | 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 |
int flb_parser_json_do(struct flb_parser *parser,
const char *in_buf, size_t in_size,
void **out_buf, size_t *out_size,
struct flb_time *out_time)
{
int i;
int skip;
int ret;
int slen;
int root_type;
int records;
double tmf... | cwe | CWE-415 | C/C++ |
znumicc_components(i_ctx_t * i_ctx_p)
{
ref * pnval;
ref * pstrmval;
stream * s;
int ncomps, expected = 0, code;
cmm_profile_t *picc_profile;
os_ptr op = osp;
check_type(*op, t_dictionary);
... | cwe | CWE-704 | Unknown |
/*
* 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 "checkout.h"
#include "git2/repository.h"
#include "git2/refs.h"
#include "git2/tree.h"
#inclu... | cwe | CWE-20 | C/C++ |
/*
* This file is part of Espruino, a JavaScript interpreter for Microcontrollers
*
* Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http... | cwe | CWE-674 | C/C++ |
/*
Ming, an SWF output library
Copyright (C) 2002 Opaque Industries - http://www.opaque.net/
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the ... | cwe | CWE-20 | C/C++ |
/*
Copyright 2017 The Kubernetes 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, ... | cwe | CWE-863 | Go |
/************************************************************************
* 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 |
void writeBytes(const void* data, int length) {
check(length);
memcpy(ptr, data, length);
ptr += length;
} | cwe | CWE-787 | C/C++ |
void ExtensionWebContentsObserver::RenderViewCreated(
content::RenderViewHost* render_view_host) {
const Extension* extension = GetExtension(render_view_host);
if (!extension)
return;
content::RenderProcessHost* process = render_view_host->GetProcess();
if (type == Manifest::TYPE_EXTENSION ||
... | cwe | CWE-264 | C/C++ |
/*
* Copyright 2014-2021 the original author or 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 app... | cwe | CWE-94 | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.