code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
xfs_fs_put_super(
struct super_block *sb)
{
struct xfs_mount *mp = XFS_M(sb);
xfs_notice(mp, "Unmounting Filesystem");
xfs_filestream_unmount(mp);
xfs_unmountfs(mp);
xfs_freesb(mp);
free_percpu(mp->m_stats.xs_stats);
xfs_destroy_percpu_counters(mp);
xfs_destroy_mount_workqueues(mp);
xfs_close_devices(mp);
... | cwe | CWE-416 | Unknown |
QPDFPageDocumentHelper::flattenAnnotationsForPage(
QPDFPageObjectHelper& page,
QPDFObjectHandle& resources,
QPDFAcroFormDocumentHelper& afdh,
int required_flags,
int forbidden_flags)
{
bool need_appearances = afdh.getNeedAppearances();
std::vector<QPDFAnnotationObjectHelper> annots = page.ge... | cwe | CWE-787 | Unknown |
def pref_get(key):
if get_user() is None:
return "Authentication required", 401
if key in get_preferences():
return Response(json.dumps({'key': key, 'value': get_preferences()[key]}))
else:
return Response(json.dumps({'key': key, 'error': 'novalue'})) | cwe | CWE-79 | Python |
/** @odoo-module **/
import { registry } from "@web/core/registry";
import {
Many2OneAvatarUserField,
KanbanMany2OneAvatarUserField,
many2OneAvatarUserField,
kanbanMany2OneAvatarUserField,
} from "@mail/web/fields/many2one_avatar_user_field/many2one_avatar_user_field";
export class Many2OneAvatarEmplo... | cwe | CWE-284 | JavaScript |
static void hci_extended_inquiry_result_evt(struct hci_dev *hdev,
struct sk_buff *skb)
{
struct inquiry_data data;
struct extended_inquiry_info *info = (void *) (skb->data + 1);
int num_rsp = *((__u8 *) skb->data);
size_t eir_len;
BT_DBG("%s num_rsp %d", hdev->name, num_rsp);
if (!num_rsp)
return;
... | cwe | CWE-125 | C/C++ |
static int oidc_request_post_preserved_restore(request_rec *r,
const char *original_url) {
oidc_debug(r, "enter: original_url=%s", original_url);
const char *method = "postOnLoad";
const char *script =
apr_psprintf(r->pool,
" <script type=\"text/javascript\">\n"
" function str_decode(string)... | cwe | CWE-79 | C/C++ |
static struct pid *good_sigevent(sigevent_t * event)
{
struct task_struct *rtn = current->group_leader;
if ((event->sigev_notify & SIGEV_THREAD_ID ) &&
(!(rtn = find_task_by_vpid(event->sigev_notify_thread_id)) ||
!same_thread_group(rtn, current) ||
(event->sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_SIGNAL))
... | cwe | CWE-125 | C/C++ |
GF_Err mpgviddmx_process(GF_Filter *filter)
{
GF_MPGVidDmxCtx *ctx = gf_filter_get_udta(filter);
GF_FilterPacket *pck, *dst_pck;
u64 byte_offset;
s64 vosh_start = -1;
s64 vosh_end = -1;
GF_Err e;
char *data;
u8 *start;
u32 pck_size;
s32 remain;
//always reparse duration
if (!ctx->duration.num)
mpgviddmx_... | cwe | CWE-476 | Unknown |
static int __fpu__restore_sig(void __user *buf, void __user *buf_fx, int size)
{
int ia32_fxstate = (buf != buf_fx);
struct task_struct *tsk = current;
struct fpu *fpu = &tsk->thread.fpu;
int state_size = fpu_kernel_xstate_size;
u64 xfeatures = 0;
int fx_only = 0;
ia32_fxstate &= (IS_ENABLED(CONFIG_X86_32) ||
... | cwe | CWE-200 | C/C++ |
bt_status_t btif_storage_add_bonded_device(bt_bdaddr_t *remote_bd_addr,
LINK_KEY link_key,
uint8_t key_type,
uint8_t pin_length)
{
bdstr_t bdstr;
bdaddr_to_string(remote_bd_addr, bdstr, sizeof(bdstr));
int ret = btif_config_set_int(bdstr, "LinkKeyType", (int)key_t... | cwe | CWE-20 | C/C++ |
protected function remove($path, $force = false)
{
$stat = $this->stat($path);
if (empty($stat)) {
return $this->setError(elFinder::ERROR_RM, $path, elFinder::ERROR_FILE_NOT_FOUND);
}
$stat['realpath'] = $path;
$this->rmTmb($stat);
$this->clearcache();
... | cwe | CWE-22 | PHP |
req::ptr<XMLDocumentData> doc() const { return m_node->doc(); } | cwe | CWE-22 | C/C++ |
int main(int argc, char **argv)
{
opj_decompress_parameters parameters; /* decompression parameters */
OPJ_INT32 num_images, imageno;
img_fol_t img_fol;
dircnt_t *dirptr = NULL;
int failed = 0;
OPJ_FLOAT64 t, tCumulative = 0;
OPJ_UINT32 numDecompressedImages = 0;
OPJ_UINT32 cp... | cwe | CWE-824 | C/C++ |
from typing import List, Optional, Tuple
import graphene
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.db import transaction
from django.db.models import Prefetch
from ...account.error_codes import AccountErrorCode
from ...checkout import models
fr... | cwe | CWE-200 | C/C++ |
read_yin_leaf(struct lys_module *module, struct lys_node *parent, struct lyxml_elem *yin, int options,
struct unres_schema *unres)
{
struct ly_ctx *ctx = module->ctx;
struct lys_node *retval;
struct lys_node_leaf *leaf;
struct lyxml_elem *sub, *next;
const char *value;
int r, has_t... | cwe | CWE-252 | Unknown |
PHP_FUNCTION(readlink)
{
char *link;
int link_len;
char buff[MAXPATHLEN];
int ret;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &link, &link_len) == FAILURE) {
return;
}
if (php_check_open_basedir(link TSRMLS_CC)) {
RETURN_FALSE;
}
ret = php_sys_read... | cwe | CWE-254 | C/C++ |
function groupChat() {
const tokenValidation = AuthTokenValidation.findOne({ connectionId: this.connection.id });
if (!tokenValidation || tokenValidation.validationStatus !== ValidationStates.VALIDATED) {
Logger.warn(`Publishing GroupChat was requested by unauth connection ${this.connection.id}`);
return G... | cwe | CWE-918 | JavaScript |
void SoftVPX::onQueueFilled(OMX_U32 /* portIndex */) {
if (mOutputPortSettingsChange != NONE) {
return;
}
List<BufferInfo *> &inQueue = getPortQueue(0);
List<BufferInfo *> &outQueue = getPortQueue(1);
bool EOSseen = false;
while (!inQueue.empty() && !outQueue.empty()) {
BufferInfo *inInfo = *inQueue.begin();
... | cwe | CWE-119 | Unknown |
package io.onedev.server.web.component.markdown;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.activation.MimetypesFileTypeM... | cwe | CWE-434 | Java |
static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
char
colorspace[MagickPathExtent],
text[MagickPathExtent];
Image
*image;
long
x_offset,
y_offset;
PixelInfo
pixel;
MagickBooleanType
status;
QuantumAny
range;
register ssize_t
i,
... | cwe | CWE-190 | C/C++ |
# -*- coding: utf-8 -*-
# rdiffweb, A web interface to rdiff-backup repositories
# Copyright (C) 2012-2021 rdiffweb contributors
#
# 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 ... | cwe | CWE-613 | Python |
exports.delete = function (obj, path) {
var segs = path.split('.');
var attr = segs.pop();
for (var i = 0; i < segs.length; i++) {
var seg = segs[i];
if (!obj[seg]) return;
obj = obj[seg];
}
if (Array.isArray(obj)) {
obj.splice(path, 1);
} else {
delete obj[attr];
}
}; | cwe | CWE-1321 | JavaScript |
jpc_streamlist_t *jpc_streamlist_create()
{
jpc_streamlist_t *streamlist;
int i;
if (!(streamlist = jas_malloc(sizeof(jpc_streamlist_t)))) {
return 0;
}
streamlist->numstreams = 0;
streamlist->maxstreams = 100;
if (!(streamlist->streams = jas_malloc(streamlist->maxstreams *
sizeof(jas_stream_t *)))) {
ja... | cwe | CWE-189 | Unknown |
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "extensions/browser/guest_view/extensions_guest_view_message_filter.h"
#include "base/guid.h"
#include "base/no_destructor.h"
#include "base/stl... | cwe | CWE-787 | C/C++ |
v3d_submit_cl_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct v3d_dev *v3d = to_v3d_dev(dev);
struct v3d_file_priv *v3d_priv = file_priv->driver_priv;
struct drm_v3d_submit_cl *args = data;
struct v3d_bin_job *bin = NULL;
struct v3d_render_job *render;
struct ww_acquire_ctx ac... | cwe | CWE-401 | C/C++ |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2012
* All rights reserved
*
* This file is part of GPAC / Media Tools sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser Gene... | cwe | CWE-476 | C/C++ |
onChange: function () {
imagePreview('file');
} | cwe | CWE-434 | JavaScript |
res.writeHead(200, _getServerHeaders({ "Content-Type": Array.isArray(mime)?mime[0]:mime, "Content-Encoding": "gzip" }, stats));
rawStream.pipe(zlib.createGzip()).pipe(res)
.on("error", err => _sendError(req, res, 500, `500: ${req.url}, Server error: ${err}`))
.on("end", _ => res.end());
} else {
res.... | cwe | CWE-79 | JavaScript |
static int nntp_fetch_headers(struct Context *ctx, void *hc, anum_t first,
anum_t last, int restore)
{
struct NntpData *nntp_data = ctx->data;
struct FetchCtx fc;
struct Header *hdr = NULL;
char buf[HUGE_STRING];
int rc = 0;
int oldmsgcount = ctx->msgcount;
anum_t current;
... | cwe | CWE-20 | C/C++ |
load(ImlibImage * im, ImlibProgressFunction progress,
char progress_granularity, char immediate_load)
{
int rc;
char p = ' ', numbers = 3, count = 0;
int w = 0, h = 0, v = 255, c = 0;
char buf[256];
FILE *f = NULL;
if (i... | cwe | CWE-189 | C/C++ |
iscsi_aio_ioctl_cb(struct iscsi_context *iscsi, int status,
void *command_data, void *opaque)
{
IscsiAIOCB *acb = opaque;
if (status == SCSI_STATUS_CANCELLED) {
if (!acb->bh) {
acb->status = -ECANCELED;
iscsi_schedule_bh(acb);
}
return;
}... | cwe | CWE-125 | C/C++ |
g_socket_client_enumerator_callback (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
GSocketClientAsyncConnectData *data = user_data;
GSocketAddress *address = NULL;
GSocket *socket;
ConnectionAttempt *attempt;
GError *error = NULL;
if (g_task_return_error_if_cancel... | cwe | CWE-754 | Unknown |
public function setProperty($name, $value)
{
$this->properties[$name] = $value;
return $this;
} | cwe | CWE-89 | JavaScript |
void ImportEPUB::ExtractContainer()
{
int res = 0;
if (!cp437) {
cp437 = new QCodePage437Codec();
}
#ifdef Q_OS_WIN32
zlib_filefunc64_def ffunc;
fill_win32_filefunc64W(&ffunc);
unzFile zfile = unzOpen2_64(Utility::QStringToStdWString(QDir::toNativeSeparators(m_FullFilePath)).c_str(), &ff... | cwe | CWE-22 | C/C++ |
function addAttribute(mainTemplate, elName, source, chunk) {
const outputOptions = this.compilation.outputOptions || mainTemplate.outputOptions;
if (!outputOptions.crossOriginLoading) {
this.sriPlugin.errorOnce(
this.compilation,
'webpack option output.crossOriginLoading not set, code spli... | cwe | CWE-345 | JavaScript |
int hashtable_set(hashtable_t *hashtable,
const char *key, size_t serial,
json_t *value)
{
pair_t *pair;
bucket_t *bucket;
size_t hash, index;
/* rehash if the load ratio exceeds 1 */
if(hashtable->size >= num_buckets(hashtable))
if(hashtable_do_rehash(ha... | cwe | CWE-310 | Unknown |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2005-2012
*
* This file is part of GPAC / MPEG2-TS sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as publishe... | cwe | CWE-125 | C/C++ |
rio_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
{
int phy_addr;
struct netdev_private *np = netdev_priv(dev);
struct mii_data *miidata = (struct mii_data *) &rq->ifr_ifru;
struct netdev_desc *desc;
int i;
phy_addr = np->phy_addr;
switch (cmd) {
case SIOCDEVPRIVATE:
break;
case SIOCDEVPRI... | cwe | CWE-264 | C/C++ |
nfs4_xdr_dec_getacl(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
struct nfs_getaclres *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
if (status)
goto out;
status = decode_sequence(xdr, &res->seq_res, rqstp);
if (status)
goto out;
status = decode_putfh(xdr);
i... | cwe | CWE-189 | Unknown |
int tcp_test(const char* ip_str, const short port)
{
int sock, i;
struct sockaddr_in s_in;
int packetsize = 1024;
unsigned char packet[packetsize];
struct timeval tv, tv2, tv3;
int caplen = 0;
int times[REQUESTS];
int min, avg, max, len;
struct net_hdr nh;
tv3.tv_sec=0;
tv3.... | cwe | CWE-787 | Unknown |
package config
import (
"bytes"
"context"
"crypto/tls"
"encoding/base64"
"errors"
"fmt"
"net/url"
"os"
"path/filepath"
"reflect"
"sort"
"strings"
"sync/atomic"
"time"
"github.com/mitchellh/mapstructure"
"github.com/spf13/viper"
"github.com/volatiletech/null/v9"
"github.com/pomerium/pomerium/interna... | cwe | CWE-200 | Go |
SECURITY_STATUS ntlm_read_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer buffer)
{
wStream* s;
size_t length;
UINT32 flags;
NTLM_AV_PAIR* AvFlags;
UINT32 PayloadBufferOffset;
NTLM_AUTHENTICATE_MESSAGE* message;
SSPI_CREDENTIALS* credentials = context->credentials;
flags = 0;
AvFlags = NULL;
message = &... | cwe | CWE-125 | C/C++ |
static int nl80211_start_sched_scan(struct sk_buff *skb,
struct genl_info *info)
{
struct cfg80211_sched_scan_request *request;
struct cfg80211_registered_device *rdev = info->user_ptr[0];
struct net_device *dev = info->user_ptr[1];
struct nlattr *attr;
struct wiphy *wiphy;
int err, tmp, n_ssids = 0, n_ch... | cwe | CWE-119 | Unknown |
void ScreenPositionController::ConvertHostPointToRelativeToRootWindow(
aura::Window* root_window,
const aura::Window::Windows& root_windows,
gfx::Point* point,
aura::Window** target_root) {
DCHECK(!root_window->parent());
gfx::Point point_in_root(*point);
root_window->GetHost()->ConvertPointFrom... | cwe | CWE-399 | C/C++ |
/*
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2016 The PHP Group |
+---------... | cwe | CWE-787 | C/C++ |
l2tp_call_errors_print(netdissect_options *ndo, const u_char *dat)
{
const uint16_t *ptr = (const uint16_t *)dat;
uint16_t val_h, val_l;
ptr++; /* skip "Reserved" */
val_h = EXTRACT_16BITS(ptr); ptr++;
val_l = EXTRACT_16BITS(ptr); ptr++;
ND_PRINT((ndo, "CRCErr=%u ", (val_h<<16) + val_l));
val_h = EXT... | cwe | CWE-125 | C/C++ |
/*
* Copyright 2014 Red Hat, Inc.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.o... | cwe | CWE-22 | Java |
network_init ()
{
#ifdef HAVE_GNUTLS
char *ca_path, *ca_path2;
gnutls_global_init ();
gnutls_certificate_allocate_credentials (&gnutls_xcred);
ca_path = string_expand_home (CONFIG_STRING(config_network_gnutls_ca_file));
if (ca_path)
{
ca_path2 = string_replace (ca_path, "%h", weech... | cwe | CWE-20 | Unknown |
void GDataFileSystem::OnGetDocumentEntry(const FilePath& cache_file_path,
const GetFileFromCacheParams& params,
GDataErrorCode status,
scoped_ptr<base::Value> data) {
DCHECK(BrowserThread::Curren... | cwe | CWE-399 | C/C++ |
/*
* 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 lo_release(struct gendisk *disk, fmode_t mode)
{
struct loop_device *lo = disk->private_data;
int err;
if (atomic_dec_return(&lo->lo_refcnt))
return;
mutex_lock(&lo->lo_ctl_mutex);
if (lo->lo_flags & LO_FLAGS_AUTOCLEAR) {
/*
* In autoclear mode, stop the loop thread
* and remove configurati... | cwe | CWE-416 | Unknown |
a.charAt(f)||" "===k)f++;else if(g.test(k)&&!a.slice(f).indexOf(g.exec(k)[1]))f+=k.length-2;else{"..."===k&&(f=a.length);break}e.H=e.H||h.h12(e.h,e.A);e._index=f;e._length=a.length;return e};d.isValid=function(a,c){var b="string"===typeof a?d.preparse(a,c):a,e=[31,28+d.isLeapYear(b.Y)|0,31,30,31,30,31,31,30,31,30,31][b... | cwe | CWE-400 | JavaScript |
void ConnectionImpl::onHeaderValue(const char* data, size_t length) {
if (header_parsing_state_ == HeaderParsingState::Done) {
// Ignore trailers.
return;
}
const absl::string_view header_value = absl::string_view(data, length);
if (strict_header_validation_) {
if (!Http::HeaderUtility::headerIsVa... | cwe | CWE-400 | Unknown |
int main(int argc, char **argv)
{
MYSQL mysql;
option_string *eptr;
MY_INIT(argv[0]);
my_getopt_use_args_separator= TRUE;
if (load_defaults("my",load_default_groups,&argc,&argv))
{
my_end(0);
exit(1);
}
my_getopt_use_args_separator= FALSE;
defaults_argv=argv;
if (get_options(&argc,&argv))
... | cwe | CWE-284 | 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-119 | C/C++ |
bool bt_att_cancel(struct bt_att *att, unsigned int id)
{
const struct queue_entry *entry;
struct att_send_op *op;
if (!att || !id)
return false;
/* Lookuo request on each channel first */
for (entry = queue_get_entries(att->chans); entry;
entry = entry->next) {
struct bt_att_chan *chan = entry->data;
... | cwe | CWE-415 | Unknown |
/**
* Copyright (c) 2006-2020, JGraph Ltd
* Copyright (c) 2006-2020, draw.io AG
*/
(function()
{
// Adds scrollbars for menus that exceed the page height
var mxPopupMenuShowMenu = mxPopupMenu.prototype.showMenu;
mxPopupMenu.prototype.showMenu = function()
{
this.div.style.overflowY = 'auto';
this.div.style.o... | cwe | CWE-79 | JavaScript |
static int vrend_decode_create_ve(struct vrend_decode_ctx *ctx, uint32_t handle, uint16_t length)
{
struct pipe_vertex_element *ve = NULL;
int num_elements;
int i;
int ret;
if (length < 1)
return EINVAL;
if ((length - 1) % 4)
return EINVAL;
num_elements = (length - 1) / 4;
if (nu... | cwe | CWE-125 | Unknown |
/*
* Copyright (c) 2014 Open Grid Computing, Inc. All rights reserved.
* Copyright (c) 2005-2006 Network Appliance, Inc. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Vers... | cwe | CWE-399 | C/C++ |
static int _hostsock_getsockopt(
oe_fd_t* sock_,
int level,
int optname,
void* optval,
oe_socklen_t* optlen)
{
int ret = -1;
sock_t* sock = _cast_sock(sock_);
oe_socklen_t optlen_in = 0;
oe_errno = 0;
if (!sock)
OE_RAISE_ERRNO(OE_EINVAL);
if (optlen)
optlen... | cwe | CWE-552 | Unknown |
/* radare2 - LGPL - Copyright 2014-2015 - pancake */
#include <r_asm.h>
#include <r_lib.h>
static int analop(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len, RAnalOpMask mask) {
int opsize = -1;
op->type = -1;
opsize = 2;
switch (buf[0]) {
case 0x3f:
case 0x4f:
op->type = R_ANAL_OP_TYPE_MOV;
opsiz... | cwe | CWE-125 | C/C++ |
void dvb_usbv2_disconnect(struct usb_interface *intf)
{
struct dvb_usb_device *d = usb_get_intfdata(intf);
const char *name = d->name;
struct device dev = d->udev->dev;
dev_dbg(&d->udev->dev, "%s: bInterfaceNumber=%d\n", __func__,
intf->cur_altsetting->desc.bInterfaceNumber);
if (d->props->exit)
d->pro... | cwe | CWE-119 | C/C++ |
static void load_xref_from_plaintext(FILE *fp, xref_t *xref)
{
int i, buf_idx, obj_id, added_entries;
char c, buf[32] = {0};
long start, pos;
start = ftell(fp);
/* Get number of entries */
pos = xref->end;
fseek(fp, pos, SEEK_SET);
while (ftell(fp) != 0)
if (SAFE_F(fp, (fgetc(fp... | cwe | CWE-787 | Unknown |
CImg<T>& _load_bmp(std::FILE *const file, const char *const filename) {
if (!file && !filename)
throw CImgArgumentException(_cimg_instance
"load_bmp(): Specified filename is (null).",
cimg_instance);
std::FILE *const nfile = fi... | cwe | CWE-770 | Unknown |
static int local_mkdir(FsContext *fs_ctx, V9fsPath *dir_path,
const char *name, FsCred *credp)
{
int err = -1;
int dirfd;
dirfd = local_opendir_nofollow(fs_ctx, dir_path->data);
if (dirfd == -1) {
return -1;
}
if (fs_ctx->export_flags & V9FS_SM_MAPPED ||
... | cwe | CWE-732 | Unknown |
#define _POSIX_C_SOURCE 200809L
#include <errno.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include "util.h"
extern const char *argv0;
static void
vwarn(const char *fmt, va_list ap)
{
fprintf(stderr, "%s: ", argv0);... | cwe | CWE-476 | C/C++ |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_packet_out.c
*/
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <sys/queue.h>
#include "lsquic.h"
#include "lsquic_int_types.h"
#include "lsquic_malo.h"
#include "lsquic_mm.h"
#include "lsqu... | cwe | CWE-476 | C/C++ |
public function params()
{
$project = $this->getProject();
$values = $this->request->getValues();
if (empty($values['action_name']) || empty($values['project_id']) || empty($values['event_name'])) {
$this->create();
return;
}
$action = $this->actionM... | cwe | CWE-639 | PHP |
void lremCommand(client *c) {
robj *subject, *obj;
obj = c->argv[3];
long toremove;
long removed = 0;
if ((getLongFromObjectOrReply(c, c->argv[2], &toremove, NULL) != C_OK))
return;
subject = lookupKeyWriteOrReply(c,c->argv[1],shared.czero);
if (subject == NULL || checkType(c,subje... | cwe | CWE-190 | Unknown |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2019
* All rights reserved
*
* This file is part of GPAC / ISO Media File Format sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU L... | cwe | CWE-119 | C/C++ |
package com.appsmith.external.helpers.restApiUtils.helpers;
import com.appsmith.external.models.ActionConfiguration;
import com.appsmith.external.models.DatasourceConfiguration;
import com.appsmith.external.models.Property;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.Str... | cwe | CWE-918 | Java |
HeaderLookupTable_t::lookup (const char *buf, const std::size_t len) const {
const HeaderTableRecord *r = HttpHeaderHashTable::lookup(buf, len);
if (!r)
return BadHdr;
return *r;
} | cwe | CWE-116 | Unknown |
function D(t,e,i){if(Hi.errorHandler)Hi.errorHandler.call(null,t,e,i);else{if(!Ui||"undefined"==typeof console)throw t;console.error(t)}} | cwe | CWE-79 | JavaScript |
def file_list io # :nodoc:
header = String.new
read_until_dashes io do |line|
header << line
end
YAML.load header
end | cwe | CWE-502 | Ruby |
// SPDX-License-Identifier: GPL-2.0-only
/*
* Xen event channels
*
* Xen models interrupts with abstract event channels. Because each
* domain gets 1024 event channels, but NR_IRQ is not that large, we
* must dynamically map irqs<->event channels. The event channels
* interface with the rest of the kernel by de... | cwe | CWE-416 | C/C++ |
function getValueRenderedWithColor(value, filter_terms) {
const r = parseInt(value.color.r, 10);
const g = parseInt(value.color.g, 10);
const b = parseInt(value.color.b, 10);
const color = $sce.getTrustedHtml(`<span class="extra-card-field-color"
style="ba... | cwe | CWE-79 | JavaScript |
static int ssl2_read_internal(SSL *s, void *buf, int len, int peek)
{
int n;
unsigned char mac[MAX_MAC_SIZE];
unsigned char *p;
int i;
int mac_size;
ssl2_read_again:
if (SSL_in_init(s) && !s->in_handshake)
{
n=s->handshake_func(s);
if (n < 0) return(n);
if (n == 0)
{
SSLerr(SSL_F_SSL2_READ_INTERN... | cwe | CWE-310 | Unknown |
/*
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2017 The PHP Group |
+--------------... | cwe | CWE-20 | C/C++ |
def create_edit_shelf(shelf, page_title, page, shelf_id=False):
sync_only_selected_shelves = current_user.kobo_only_shelves_sync
# calibre_db.session.query(ub.Shelf).filter(ub.Shelf.user_id == current_user.id).filter(ub.Shelf.kobo_sync).count()
if request.method == "POST":
to_save = request.form.to_... | cwe | CWE-863 | Python |
static int rxrpc_krb5_decode_ticket(u8 **_ticket, u16 *_tktlen,
const __be32 **_xdr, unsigned int *_toklen)
{
const __be32 *xdr = *_xdr;
unsigned int toklen = *_toklen, len;
/* there must be at least one length word */
if (toklen <= 4)
return -EINVAL;
_enter(",{%x},%u", ntohl(xdr[0]), toklen);
len = ... | cwe | CWE-190 | Unknown |
void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
const unsigned char *in, int inl)
{
int i, j;
unsigned int total = 0;
*outl = 0;
if (inl <= 0)
return;
OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data));
if ((ctx->num + inl) < ctx... | cwe | CWE-189 | Unknown |
static RzList *entries(RzBinFile *bf) {
if (!bf) {
return NULL;
}
LuacBinInfo *bin_info_obj = GET_INTERNAL_BIN_INFO_OBJ(bf);
if (!bin_info_obj) {
return NULL;
}
return bin_info_obj->entry_list;
} | cwe | CWE-200 | Unknown |
"""
A node in its simplest would retrieve a task from the central server by
an API call, run this task and finally return the results to the central
server again.
The node application runs four threads:
*Main thread*
Checks the task queue and run the next task if there is one available.
*Listening thread*
Lis... | cwe | CWE-613 | Python |
proxy_list_slots (Proxy *py, Mapping *mappings, unsigned int n_mappings)
{
CK_FUNCTION_LIST_PTR *f;
CK_FUNCTION_LIST_PTR funcs;
CK_SLOT_ID_PTR slots;
CK_ULONG i, count;
unsigned int j;
CK_RV rv = CKR_OK;
for (f = py->inited; *f; ++f) {
funcs = *f;
assert (funcs != NULL);
slots = NULL;
/* Ask module for... | cwe | CWE-190 | Unknown |
pdf14_pop_transparency_group(gs_gstate *pgs, pdf14_ctx *ctx,
const pdf14_nonseparable_blending_procs_t * pblend_procs,
int tos_num_color_comp, cmm_profile_t *curr_icc_profile, gx_device *dev)
{
pdf14_buf *tos = ctx->stack;
pdf14_buf *nos = tos->saved;
pdf14_mask_t *mask_stack = tos->mask_stack;
... | cwe | CWE-476 | C/C++ |
def _call(env)
unless ALLOWED_VERBS.include? env["REQUEST_METHOD"]
return fail(405, "Method Not Allowed")
end
path_info = Utils.unescape(env["PATH_INFO"])
parts = path_info.split SEPS
parts.inject(0) do |depth, part|
case part
when '', '.'
depth
... | cwe | CWE-22 | Ruby |
void CoordinatorImpl::GetVmRegionsForHeapProfiler(
const std::vector<base::ProcessId>& pids,
GetVmRegionsForHeapProfilerCallback callback) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
uint64_t dump_guid = ++next_dump_id_;
std::unique_ptr<QueuedVmRegionRequest> request =
std::make_unique<QueuedV... | cwe | CWE-416 | C/C++ |
static void stream_joined(h2_mplx *m, h2_stream *stream)
{
ap_assert(!stream->task || stream->task->worker_done);
h2_ihash_remove(m->shold, stream->id);
h2_ihash_add(m->spurge, stream);
} | cwe | CWE-770 | Unknown |
static Image *ReadCINImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define MonoColorType 1
#define RGBColorType 3
char
property[MaxTextExtent];
CINInfo
cin;
Image
*image;
MagickBooleanType
status;
MagickOffsetType
offset;
QuantumInfo
*quantum_info;
QuantumT... | cwe | CWE-787 | C/C++ |
void TabletModeWindowManager::ArrangeWindowsForClamshellMode(
base::flat_map<aura::Window*, WindowStateType> windows_in_splitview) {
int divider_position = CalculateCarryOverDividerPostion(windows_in_splitview);
while (window_state_map_.size()) {
aura::Window* window = window_state_map_.begin()->first;... | cwe | CWE-362 | C/C++ |
function XMLRPCaddNode($nodeName, $parentNode){
require_once(".ht-inc/privileges.php");
global $user;
if(in_array("nodeAdmin", $user['privileges'])){
if(!$parentNode){
$topNodes = getChildNodes();
$keys = array_keys($topNodes);
$parentNode = array_shift($keys);
... | cwe | CWE-264 | PHP |
public Object parse(SerializerHandler serializerHandler, InputStream response, boolean debugMode) throws XMLRPCException {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
Document dom = ... | cwe | CWE-611 | Java |
package com.salesmanager.shop.admin.controller.products;
import com.salesmanager.core.business.services.catalog.product.ProductService;
import com.salesmanager.core.business.services.catalog.product.image.ProductImageService;
import com.salesmanager.core.business.utils.ajax.AjaxPageableResponse;
import com.salesmanage... | cwe | CWE-639 | Java |
TfLiteStatus EvalHashtable(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE(context, node->user_data != nullptr);
const auto* params =
reinterpret_cast<const TfLiteHashtableParams*>(node->user_data);
// The resource id is generated based on the given table name.
const int resource_id = std::has... | cwe | CWE-787 | C/C++ |
crm_client_new(qb_ipcs_connection_t * c, uid_t uid_client, gid_t gid_client)
{
static uid_t uid_server = 0;
static gid_t gid_cluster = 0;
crm_client_t *client = NULL;
CRM_LOG_ASSERT(c);
if (c == NULL) {
return NULL;
}
if (gid_cluster == 0) {
uid_server = getuid();
... | cwe | CWE-285 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-284 | C/C++ |
/* 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-354 | C/C++ |
package org.mozilla.jss.util;
public class GlobalRefProxy extends NativeProxy {
public GlobalRefProxy(byte[] pointer) {
super(pointer);
}
public GlobalRefProxy(Object target) {
super(GlobalRefProxy.refOf(target));
}
private static native byte[] refOf(Object target);
@Override... | cwe | CWE-401 | Java |
static cmark_node *try_opening_table_header(cmark_syntax_extension *self,
cmark_parser *parser,
cmark_node *parent_container,
unsigned char *input, int len) {
bufsize_t matched =
s... | cwe | CWE-190 | Unknown |
xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
const xmlChar *name = NULL;
xmlChar *value = NULL;
xmlChar *URI = NULL, *literal = NULL;
const xmlChar *ndata = NULL;
int isParameter = 0;
xmlChar *orig = NULL;
int skipped;
/* GROW; done in the caller */
if (CMP8(CUR_PTR, '<', '!', 'E', '... | cwe | CWE-119 | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.