code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
# -*- 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 |
/*
* 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 L... | cwe | CWE-119 | C/C++ |
struct ldb_request *map_build_fixup_req(struct map_context *ac,
struct ldb_dn *olddn,
struct ldb_dn *newdn,
void *context,
ldb_map_callback_t callback)
{
struct ldb_context *ldb;
struct ldb_request *req;
struct ldb_message *msg;
const char *dn;
int ret;
ldb = ldb_module_get_ctx(ac->module);
... | cwe | CWE-200 | Unknown |
int virtio_load(VirtIODevice *vdev, QEMUFile *f)
{
int i, ret;
uint32_t num;
uint32_t features;
uint32_t supported_features;
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
if (k->load_config) {
ret = k->load_config(qbus->parent, f);
if (ret)
return ret;
}
... | cwe | CWE-119 | Unknown |
int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, char **error TSRMLS_DC) /* {{{ */
{
phar_zip_dir_end locator;
char buf[sizeof(locator) + 65536];
long size;
php_uint16 i;
phar_archive_data *mydata = NULL;
phar_entry_info entry = {0};
char *... | cwe | CWE-119 | C/C++ |
static void fix_hostname(struct SessionHandle *data,
struct connectdata *conn, struct hostname *host)
{
size_t len;
#ifndef USE_LIBIDN
(void)data;
(void)conn;
#elif defined(CURL_DISABLE_VERBOSE_STRINGS)
(void)conn;
#endif
/* set the name we use to display the host name */
host->di... | cwe | CWE-119 | C/C++ |
get_cdtext_generic (void *p_user_data)
{
generic_img_private_t *p_env = p_user_data;
uint8_t *p_cdtext_data = NULL;
size_t len;
if (!p_env) return NULL;
if (p_env->b_cdtext_error) return NULL;
if (NULL == p_env->cdtext) {
p_cdtext_data = read_cdtext_generic (p_env);
if (NULL != p_cdtext_data) {... | cwe | CWE-415 | Unknown |
/*
* Copyright (C) 2012-2018 Tobias Brunner
* Copyright (C) 2006-2009 Martin Willi
* HSR Hochschule fuer Technik Rapperswil
*
* 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 versio... | cwe | CWE-476 | C/C++ |
package com.salesmanager.shop.admin.model.customer.attribute;
import java.io.Serializable;
import com.salesmanager.shop.model.entity.ShopEntity;
public class CustomerOptionValue extends ShopEntity implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private String name;
p... | cwe | CWE-639 | Java |
rsock_read_nonblock(VALUE sock, VALUE length, VALUE buf, VALUE ex)
{
rb_io_t *fptr;
long n;
long len = NUM2LONG(length);
VALUE str = rsock_strbuf(buf, len);
char *ptr;
GetOpenFile(sock, fptr);
if (len == 0) {
return str;
}
ptr = RSTRING_PTR(str);
n = read_buffered_data(ptr, l... | cwe | CWE-908 | Unknown |
PHP_METHOD(Phar, addFromString)
{
char *localname, *cont_str;
size_t localname_len, cont_len;
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &localname, &localname_len, &cont_str, &cont_len) == FAILURE) {
return;
}
phar_add_file(&(phar_obj->archiv... | cwe | CWE-20 | C/C++ |
/*
* Copyright (c) 2016 Mellanox Technologies Ltd. All rights reserved.
* Copyright (c) 2015 System Fabric Works, 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) Versio... | cwe | CWE-190 | C/C++ |
void impeg2d_dec_user_data(dec_state_t *ps_dec)
{
UWORD32 u4_start_code;
stream_t *ps_stream;
ps_stream = &ps_dec->s_bit_stream;
u4_start_code = impeg2d_bit_stream_nxt(ps_stream,START_CODE_LEN);
while(u4_start_code == USER_DATA_START_CODE)
{
impeg2d_bit_stream_flush(ps_stream,START... | cwe | CWE-254 | C/C++ |
static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
int buf_size = avpkt->size;
FlashSVContext *s = avctx->priv_data;
int h_blocks, v_blocks, h_part, v_part, i, j, ret;
GetBitContext gb;
int last_blockwidth = s-... | cwe | CWE-20 | C/C++ |
void pushGenericCommand(client *c, int where) {
int j, pushed = 0;
robj *lobj = lookupKeyWrite(c->db,c->argv[1]);
if (lobj && lobj->type != OBJ_LIST) {
addReply(c,shared.wrongtypeerr);
return;
}
for (j = 2; j < c->argc; j++) {
if (!lobj) {
lobj = createQuicklist... | cwe | CWE-190 | Unknown |
// Minimal tooling for doing run-at-least-once, ordered migrations.
//
// Because migrations can experience partial failure and likely have
// side-effects, we should be careful to make sure all migrations are
// idempotent and safe to accidentally run multiple times.
import { Meteor } from "meteor/meteor";
import { _... | cwe | CWE-918 | 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++ |
public TList readListBegin() throws TException {
return new TList(readByte(), readI32());
} | cwe | CWE-770 | Java |
Graph.prototype.getTooltipForCell=function(a){var b="";if(mxUtils.isNode(a.value)){var f=null;Graph.translateDiagram&&null!=Graph.diagramLanguage&&(f=a.value.getAttribute("tooltip_"+Graph.diagramLanguage));null==f&&(f=a.value.getAttribute("tooltip"));if(null!=f)null!=f&&this.isReplacePlaceholders(a)&&(f=this.replacePla... | cwe | CWE-94 | JavaScript |
void SetImePropertyActivated(const char* key, bool activated) {
if (!IBusConnectionsAreAlive()) {
LOG(ERROR) << "SetImePropertyActivated: IBus connection is not alive";
return;
}
if (!key || (key[0] == '\0')) {
return;
}
if (input_context_path_.empty()) {
LOG(ERROR) <<... | cwe | CWE-20 | C/C++ |
$users = Jojo::selectQuery("SELECT userid, us_email, us_login, us_reminder FROM {user} WHERE us_email = ? OR us_login = ?", array($search, $search));
if (!count($users)) {
$errors[] = 'There is no user in our system with email address or username: '.$search;
}
... | cwe | CWE-79 | PHP |
public function testGetDropdownConnect($params, $expected, $session_params = []) {
$this->login();
$bkp_params = [];
//set session params if any
if (count($session_params)) {
foreach ($session_params as $param => $value) {
if (isset($_SESSION[$param])) {
$bkp... | cwe | CWE-639 | PHP |
/*
* 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/BCGen/HBC/HBC.h"
#include "hermes/BCGen/BCOpt.h"
#include "hermes/BCGen/HBC/BytecodeGenerator.h"
#include "herm... | cwe | CWE-681 | C/C++ |
pimv1_join_prune_print(netdissect_options *ndo,
register const u_char *bp, register u_int len)
{
int ngroups, njoin, nprune;
int njp;
/* If it's a single group and a single source, use 1-line output. */
if (ND_TTEST2(bp[0], 30) && bp[11] == 1 &&
((njoin = EXTRACT_16BITS(&bp[20])) + EXTR... | cwe | CWE-125 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-252 | C/C++ |
static void mysql_prune_stmt_list(MYSQL *mysql)
{
LIST *element= mysql->stmts;
LIST *pruned_list= 0;
for (; element; element= element->next)
{
MYSQL_STMT *stmt= (MYSQL_STMT *) element->data;
if (stmt->state != MYSQL_STMT_INIT_DONE)
{
stmt->mysql= 0;
stmt->last_errno= CR_SERVER_LOST;
... | cwe | CWE-416 | Unknown |
static int command_read(struct pci_dev *dev, int offset, u16 *value, void *data)
{
int i;
int ret;
ret = xen_pcibk_read_config_word(dev, offset, value, data);
if (!pci_is_enabled(dev))
return ret;
for (i = 0; i < PCI_ROM_RESOURCE; i++) {
if (dev->resource[i].flags & IORESOURCE_IO)
*value |= PCI_COMMAND_IO... | cwe | CWE-284 | Unknown |
xfs_iget_cache_miss(
struct xfs_mount *mp,
struct xfs_perag *pag,
xfs_trans_t *tp,
xfs_ino_t ino,
struct xfs_inode **ipp,
int flags,
int lock_flags)
{
struct xfs_inode *ip;
int error;
xfs_agino_t agino = XFS_INO_TO_AGINO(mp, ino);
int iflags;
ip = xfs_inode_alloc(mp, ino);
if (!ip)
return -EN... | cwe | CWE-476 | C/C++ |
def _remove_volume_set(self, vvs_name):
# Must first clear the QoS rules before removing the volume set
self._cli_run('setqos -clear vvset:%s' % (vvs_name), None)
self._cli_run('removevvset -f %s' % (vvs_name), None) | cwe | CWE-78 | Python |
$object[$key] = $this->filesystem->{$method}($path);
}
return $object;
} | cwe | CWE-89 | JavaScript |
return P.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(u){u=decodeURIComponent(mxUtils.getValue(u.style,"enumerateValue",""));""==u&&(u=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(u)+"</div>"};m... | cwe | CWE-20 | JavaScript |
void ChromeMockRenderThread::OnUpdatePrintSettings(
int document_cookie,
const base::DictionaryValue& job_settings,
PrintMsg_PrintPages_Params* params) {
std::string dummy_string;
int margins_type = 0;
if (!job_settings.GetBoolean(printing::kSettingLandscape, NULL) ||
!job_settings.GetBoolean(pr... | cwe | CWE-200 | C/C++ |
nfs4_atomic_open(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
{
struct path path = {
.mnt = nd->path.mnt,
.dentry = dentry,
};
struct dentry *parent;
struct iattr attr;
struct rpc_cred *cred;
struct nfs4_state *state;
struct dentry *res;
if (nd->flags & LOOKUP_CREATE) {
attr.ia_mode = ... | cwe | CWE-703 | Unknown |
void HTMLCanvasElement::Dispose() {
if (PlaceholderFrame())
ReleasePlaceholderFrame();
if (context_) {
context_->DetachHost();
context_ = nullptr;
}
if (canvas2d_bridge_) {
canvas2d_bridge_->SetCanvasResourceHost(nullptr);
canvas2d_bridge_ = nullptr;
}
if (gpu_memory_usage_) {
... | cwe | CWE-787 | C/C++ |
/* remove eslint errors to see if there is something really wrong */
/*eslint quotes: [0]*/
/*eslint indent: [0]*/
/*eslint vars-on-top: [0]*/
/*eslint yoda: 0*/
/*eslint curly: 0*/
/*eslint no-implicit-coercion: 0*/
/*eslint newline-after-var: 0*/
/*eslint space-before-function-paren: 0*/
/*eslint block-spacing: 0*/
/... | cwe | CWE-74 | JavaScript |
bool VariableUnserializer::matchString(folly::StringPiece str) {
const char* p = m_buf;
assertx(p <= m_end);
int total = 0;
if (*p == 'S') {
total = 2 + 8 + 1;
if (p + total > m_end) return false;
p++;
if (*p++ != ':') return false;
auto const sd = *reinterpret_cast<StringData*const*>(p);
... | cwe | CWE-119 | C/C++ |
function action_bandwidth(iface)
luci.http.prepare_content("application/json")
local bwc = io.popen("luci-bwc -i %q 2>/dev/null" % iface)
if bwc then
luci.http.write("[")
while true do
local ln = bwc:read("*l")
if not ln then break end
luci.http.write(ln)
end
luci.http.write("]")
bwc:close()
e... | cwe | CWE-78 | Lua |
Omeka.Items.addTagElement = function (tag) {
var tagLi = $('<li/>');
tagLi.after(" ");
var undoButton = $('<span class="undo-remove-tag"><a href="#">Undo</a></span>').appendTo(tagLi);
var deleteButton = $('<span class="remove-tag"><a href="#">Remove</a></span>').appendTo(tagLi);
... | cwe | CWE-79 | JavaScript |
int compat_get_timex(struct timex *txc, const struct compat_timex __user *utp)
{
struct compat_timex tx32;
if (copy_from_user(&tx32, utp, sizeof(struct compat_timex)))
return -EFAULT;
txc->modes = tx32.modes;
txc->offset = tx32.offset;
txc->freq = tx32.freq;
txc->maxerror = tx32.maxerror;
txc->esterror... | cwe | CWE-200 | C/C++ |
/* omzmq3.c
* Copyright 2012 Talksum, Inc
* Using the czmq interface to zeromq, we output
* to a zmq socket.
* Copyright (C) 2014 Rainer Gerhards
*
* This program 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 Soft... | cwe | CWE-134 | C/C++ |
ModuleExport MagickBooleanType ReadPSDLayers(Image *image,
const ImageInfo *image_info,const PSDInfo *psd_info,
const MagickBooleanType skip_layers,ExceptionInfo *exception)
{
char
type[4];
LayerInfo
*layer_info;
MagickSizeType
size;
MagickBooleanType
status;
register ssize_t
i;
... | cwe | CWE-119 | Unknown |
function(){return ja.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var U=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(z){return z.tableHandle||U.apply(this,arguments)&&(!this.graph.isTable(this.state.... | cwe | CWE-20 | JavaScript |
SqlString.escape = function(val, stringifyObjects, timeZone, dialect) {
if (val === undefined || val === null) {
return 'NULL';
}
switch (typeof val) {
case 'boolean': return (val) ? 'true' : 'false';
case 'number': return val+'';
}
if (val instanceof Date) {
val = SqlString.dateToString(val... | cwe | CWE-89 | JavaScript |
# -*- coding: utf-8 -*-
import hashlib
import os
from django.conf import settings
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
class LoginCode(models.Model):
user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='login_codes',
... | cwe | CWE-522 | Python |
Writer.prototype._stat = function (current) {
var self = this
var props = self.props
var stat = props.follow ? 'stat' : 'lstat'
var who = self._proxy || self
if (current) statCb(null, current)
else fs[stat](self._path, statCb)
function statCb (er, current) {
if (self.filter && !self.filter.call(who,... | cwe | CWE-59 | JavaScript |
static void initialise_write_state(fz_context *ctx, pdf_document *doc, const pdf_write_options *in_opts, pdf_write_state *opts)
{
int num;
int xref_len = pdf_xref_len(ctx, doc);
opts->do_incremental = in_opts->do_incremental;
opts->do_ascii = in_opts->do_ascii;
opts->do_tight = !in_opts->do_pretty;
opts->do_expa... | cwe | CWE-119 | Unknown |
"""
Custom Authenticator to use GitLab OAuth with JupyterHub
"""
import json
import os
import re
import sys
import warnings
from urllib.parse import quote
from tornado.auth import OAuth2Mixin
from tornado import web
from tornado.escape import url_escape
from tornado.httputil import url_concat
from tornado.httpclien... | cwe | CWE-863 | Python |
/*
* IPv6 library code, needed by static components when full IPv6 support is
* not configured or static. These functions are needed by GSO/GRO implementation.
*/
#include <linux/export.h>
#include <net/ip.h>
#include <net/ipv6.h>
#include <net/ip6_fib.h>
#include <net/addrconf.h>
#include <net/secure_seq.h>
#inclu... | cwe | CWE-835 | C/C++ |
load_image (const gchar *filename,
GError **error)
{
FILE *ifp;
gint depth, bpp;
gint32 image_ID;
L_XWDFILEHEADER xwdhdr;
L_XWDCOLOR *xwdcolmap = NULL;
ifp = g_fopen (filename, "rb");
if (!ifp)
{
g_set_error (error, G_FILE_ERROR, g_file_e... | cwe | CWE-787 | C/C++ |
/*
* (C) 2001 Clemson University and The University of Chicago
*
* See COPYING in top-level directory.
*/
#include "protocol.h"
#include "orangefs-kernel.h"
#include "orangefs-bufmap.h"
#include <linux/posix_acl_xattr.h>
#include <linux/fs_struct.h>
struct posix_acl *orangefs_get_acl(struct inode *inode, int type... | cwe | CWE-285 | C/C++ |
// Copyright (C) 2006-2009 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agr... | cwe | CWE-89 | Java |
int ip6_route_add(struct fib6_config *cfg)
{
int err;
struct net *net = cfg->fc_nlinfo.nl_net;
struct rt6_info *rt = NULL;
struct net_device *dev = NULL;
struct inet6_dev *idev = NULL;
struct fib6_table *table;
int addr_type;
if (cfg->fc_dst_len > 128 || cfg->fc_src_len > 128)
return -EINVAL;
#ifndef CONFIG_... | cwe | CWE-119 | C/C++ |
$input = ['name' => 'ldap', 'rootdn_passwd' => $password];
$result = $ldap->prepareInputForUpdate($input);
//Expected value to be encrypted using GLPIKEY key
$expected = \Toolbox::encrypt(stripslashes($password), GLPIKEY);
$this->string($result['rootdn_passwd'])->isIdenticalTo($expected);
... | cwe | CWE-798 | PHP |
check_user_password_V4(std::string const& user_password,
QPDF::EncryptionData const& data)
{
// Algorithm 3.6 from the PDF 1.7 Reference Manual
std::string u_value = compute_U_value(user_password, data);
int to_compare = ((data.getR() >= 3) ? sizeof(MD5::Digest)
... | cwe | CWE-787 | Unknown |
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Linux INET6 implementation
* Forwarding Information Database
*
* Authors:
* Pedro Roque <roque@di.fc.ul.pt>
*
* Changes:
* Yuji SEKIYA @USAGI: Support default route on router node;
* remove ip6_null_entry from the top of
* routing table.
* Ville Nuorva... | cwe | CWE-755 | C/C++ |
const fs = require('fs');
const path = require('path');
const Errors = {
ATTACHMENT_NOT_FOUND: {
attachmentNotFound: 'Attachment not found',
},
};
module.exports = {
inputs: {
id: {
type: 'string',
regex: /^[0-9]+$/,
required: true,
},
filename: {
type: 'string',
re... | cwe | CWE-22 | JavaScript |
function configure()
{
deskDomain = 'https://' + config.deskDomain + '.freshdesk.com';
deskApiKey = config.deskApiKey;
deskTypes = config.deskTypes || deskTypes;
deskStatus = config.deskStatus || deskStatus;
deskStatusWidth = {};
// Precomputes text widths for custom ticket status
var div = document.... | cwe | CWE-94 | JavaScript |
static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len)
{
struct sk_buff *skb;
int rc;
struct l2tp_ip_sock *lsa = l2tp_ip_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct ip_options *opt = inet->opt;
struct rtable *rt = NULL;
int connected = 0;
__be32 daddr;
if (soc... | cwe | CWE-362 | Unknown |
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache... | cwe | CWE-91 | Java |
def resource_start(params, request, session)
if not allowed_for_local_cluster(session, Permissions::WRITE)
return 403, 'Permission denied'
end
stdout, stderr, retval = run_cmd(
session, PCS, "resource", "enable", params[:resource]
)
if retval == 0
return JSON.generate({"success" => "true"})
else... | cwe | CWE-384 | Ruby |
// Copyright 2009 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.
// +build ignore
/*
Input to cgo -godefs. See README.md
*/
// +godefs map struct_in_addr [4]byte /* in_addr */
// +godefs map struct_in6_addr [16]byte /* in6... | cwe | CWE-287 | Go |
/* mqtt_client.c
*
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfMQTT.
*
* wolfMQTT is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your... | cwe | CWE-787 | C/C++ |
mxClient.IS_IOS?(M.style.padding="0px 10px 20px 10px",M.style.top="6px"):mxClient.IS_FF&&(n.style.paddingTop="0px",n.style.marginTop="-2px");if(null!=A)for(m=0;m<A.length;m++)mxUtils.br(n),mxUtils.write(n,A[m]);if(null!=x&&null==b[x]){y.style.visibility="hidden";mxUtils.setOpacity(n,10);var K=new Spinner({lines:12,leng... | cwe | CWE-20 | JavaScript |
/* radare2 - LGPL - Copyright 2009-2022 - pancake */
#include "r_anal.h"
#include "r_bin.h"
#include "r_cons.h"
#include "r_core.h"
#include "r_util.h"
#include "r_types.h"
#include <sdb/sdb.h>
char *getcommapath(RCore *core);
static R_TH_LOCAL ut64 filter_offset = UT64_MAX;
static R_TH_LOCAL int filter_format = 0;
... | cwe | CWE-74 | C/C++ |
void dev_load(struct net *net, const char *name)
{
struct net_device *dev;
rcu_read_lock();
dev = dev_get_by_name_rcu(net, name);
rcu_read_unlock();
if (!dev && capable(CAP_NET_ADMIN))
request_module("%s", name);
} | cwe | CWE-264 | C/C++ |
->where('owned_by', '=', $userIdToCheck);
});
} | cwe | CWE-284 | PHP |
main(int argc, char **argv)
{
const char *safepath = SAFE_PATH;
const char *confpath = NULL;
char *shargv[] = { NULL, NULL };
char *sh;
const char *cmd;
char cmdline[LINE_MAX];
char myname[_PW_NAME_LEN + 1];
struct passwd *original_pw, *target_pw;
struct rule *rule;
uid_t uid;
uid_t target = 0;
gid_t groups... | cwe | CWE-269 | C/C++ |
void vrend_renderer_context_create_internal(uint32_t handle, uint32_t nlen,
const char *debug_name)
{
struct vrend_decode_ctx *dctx;
if (handle >= VREND_MAX_CTX)
return;
dctx = malloc(sizeof(struct vrend_decode_ctx));
if (!dctx)
return;
r... | cwe | CWE-399 | C/C++ |
free_mbdata (struct dfa *d)
{
unsigned int i;
free(d->multibyte_prop);
d->multibyte_prop = NULL;
for (i = 0; i < d->nmbcsets; ++i)
{
unsigned int j;
struct mb_char_classes *p = &(d->mbcsets[i]);
free(p->chars);
free(p->ch_classes);
free(p->range_sts);
free(p->range_ends... | cwe | CWE-189 | Unknown |
def placeholder(filename)
css_class = InlineSvg.configuration.svg_not_found_css_class
not_found_message = "'#{filename}' #{extension_hint(filename)}"
if css_class.nil?
return "<svg><!-- SVG file not found: #{not_found_message}--></svg>".html_safe
else
return "<svg cl... | cwe | CWE-79 | Ruby |
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2000-2006 Silicon Graphics, Inc.
* All Rights Reserved.
*/
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_shared.h"
#include "xfs_format.h"
#include "xfs_log_format.h"
#include "xfs_trans_resv.h"
#include "xfs_mount.h"
#include "xfs_defer.h"
#include "xfs_in... | cwe | CWE-787 | C/C++ |
/*
* Kernel-based Virtual Machine driver for Linux
*
* This module enables machines with Intel VT-x extensions to run virtual
* machines without emulation or binary translation.
*
* Copyright (C) 2006 Qumranet, Inc.
* Copyright 2010 Red Hat, Inc. and/or its affiliates.
*
* Authors:
* Avi Kivity <avi@qumra... | cwe | CWE-264 | C/C++ |
processFinished(struct module_qstate* qstate, struct iter_qstate* iq,
int id)
{
log_query_info(VERB_QUERY, "finishing processing for",
&qstate->qinfo);
/* store negative cache element for parent side glue. */
if(!qstate->no_cache_store && iq->query_for_pside_glue
&& !iq->pside_glue)
iter_store_parentside_n... | cwe | CWE-703 | Unknown |
int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len)
{
struct sock *sk = sock->sk;
struct rds_sock *rs = rds_sk_to_rs(sk);
DECLARE_SOCKADDR(struct sockaddr_in *, usin, msg->msg_name);
__be32 daddr;
__be16 dport;
struct rds_message *rm = NULL;
struct rds_connection *conn;
int ret = 0;
in... | cwe | CWE-362 | C/C++ |
static int ssi_sd_load(QEMUFile *f, void *opaque, int version_id)
{
SSISlave *ss = SSI_SLAVE(opaque);
ssi_sd_state *s = (ssi_sd_state *)opaque;
int i;
if (version_id != 1)
return -EINVAL;
s->mode = qemu_get_be32(f);
s->cmd = qemu_get_be32(f);
for (i = 0; i < 4; i++)
s->cmda... | cwe | CWE-94 | Unknown |
package org.bouncycastle.jcajce.provider.drbg;
import java.lang.reflect.Constructor;
import java.security.SecureRandom;
import java.security.SecureRandomSpi;
import org.bouncycastle.crypto.digests.SHA512Digest;
import org.bouncycastle.crypto.prng.SP800SecureRandomBuilder;
import org.bouncycastle.jcajce.provider.confi... | cwe | CWE-310 | Java |
function addGroup($data) {
if($data['editgroupid'] == 0 || $data['editgroupid'] == '')
$data['editgroupid'] = 'NULL';
if($data['type'] == "user") {
if(! array_key_exists('custom', $data))
$data['custom'] = 1;
elseif($data['custom'] == 0) {
$ownerid = 'NULL';
$data['editgroupid'] = 'NULL';
}
if($dat... | cwe | CWE-20 | PHP |
bool OMXNodeInstance::handleMessage(omx_message &msg) {
const sp<GraphicBufferSource>& bufferSource(getGraphicBufferSource());
if (msg.type == omx_message::FILL_BUFFER_DONE) {
OMX_BUFFERHEADERTYPE *buffer =
findBufferHeader(msg.u.extended_buffer_data.buffer);
{
Mute... | cwe | CWE-119 | C/C++ |
/* Copyright 2020 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-369 | Python |
#
# Registration dialog/wizard
#
# Copyright (c) 2011 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You... | cwe | CWE-264 | Python |
int jpc_enc_enccblk(jpc_enc_t *enc, jas_stream_t *out, jpc_enc_tcmpt_t *tcmpt, jpc_enc_band_t *band, jpc_enc_cblk_t *cblk)
{
jpc_enc_pass_t *pass;
jpc_enc_pass_t *endpasses;
int bitpos;
int n;
int adjust;
int ret;
int passtype;
int t;
jpc_bitstream_t *bout;
jpc_enc_pass_t *termpass;
jpc_enc_rlvl_t *rlvl;
in... | cwe | CWE-189 | Unknown |
findoprnd(ITEM *ptr, int32 *pos)
{
if (ptr[*pos].type == VAL || ptr[*pos].type == VALTRUE)
{
ptr[*pos].left = 0;
(*pos)++;
}
else if (ptr[*pos].val == (int32) '!')
{
ptr[*pos].left = 1;
(*pos)++;
findoprnd(ptr, pos);
}
else
{
ITEM *curitem = &ptr[*pos];
int32 tmp = *pos;
(*pos)++;
fin... | cwe | CWE-189 | C/C++ |
int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
rpmpsm psm, char ** failedFile)
{
FD_t payload = rpmtePayload(te);
rpmfi fi = rpmfiNewArchiveReader(payload, files, RPMFI_ITER_READ_ARCHIVE);
rpmfs fs = rpmteGetFileStates(te);
rpmPlugins plugins = rpmtsPlugins(ts);
struct ... | cwe | CWE-61 | Unknown |
$("form#streamrule-form").on("click", "#sr-inverted", function() {
var modalBody = $(this).closest("form#streamrule-form").find(".modal-body");
var old_val = $("#sr-result-category", modalBody).html();
if ($(this).is(":checked")) {
// Add the not.
new_val = "not " + old_... | cwe | CWE-79 | JavaScript |
ds_fgetstr (FILE *f, dynamic_string *s, char eos)
{
int insize; /* Amount needed for line. */
int strsize; /* Amount allocated for S. */
int next_ch;
/* Initialize. */
insize = 0;
strsize = s->ds_length;
/* Read the input string. */
next_ch = getc (f);
while (next_ch != eos && next_ch != EOF... | cwe | CWE-190 | Unknown |
static int get_siz(Jpeg2000DecoderContext *s)
{
int i;
int ncomponents;
uint32_t log2_chroma_wh = 0;
const enum AVPixelFormat *possible_fmts = NULL;
int possible_fmts_nb = 0;
if (bytestream2_get_bytes_left(&s->g) < 36)
return AVERROR_INVALIDDATA;
s->avctx->profile = bytestream2_get... | cwe | CWE-703 | Unknown |
/*
* Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
*
* Author: zccrs <zccrs@live.com>
*
* Maintainer: zccrs <zhangjide@deepin.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foun... | cwe | CWE-59 | C/C++ |
generate: function (length, options) {
length = length || 10
const generateOptions = options || {}
generateOptions.digits = Object.prototype.hasOwnProperty.call(generateOptions, 'digits') ? options.digits : true
generateOptions.alphabets = Object.prototype.hasOwnProperty.call(generateOptions, 'alphabet... | cwe | CWE-330 | JavaScript |
void FileReaderLoader::OnCalculatedSize(uint64_t total_size,
uint64_t expected_content_size) {
OnStartLoading(expected_content_size);
if (expected_content_size == 0) {
received_all_data_ = true;
return;
}
if (IsSyncLoad()) {
OnDataPipeReadable(MOJO_RESUL... | cwe | CWE-416 | C/C++ |
QualifyIpPacket(IPHeader *pIpHeader, ULONG len)
{
tTcpIpPacketParsingResult res;
res.value = 0;
if (len < 4)
{
res.ipStatus = ppresNotIP;
return res;
}
UCHAR ver_len = pIpHeader->v4.ip_verlen;
UCHAR ip_version = (ver_len & 0xF0) >> 4;
USHORT ipHeaderSize = 0;
U... | cwe | CWE-20 | C/C++ |
/* boot.c - Read and analyze ia PC/MS-DOS boot sector
Copyright (C) 1993 Werner Almesberger <werner.almesberger@lrc.di.epfl.ch>
Copyright (C) 1998 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
Copyright (C) 2015 Andreas Bombe <aeb@debia... | cwe | CWE-119 | C/C++ |
import os.path
import random
import string
from celery.schedules import crontab
import base64
_basedir = os.path.abspath(os.path.dirname(__file__))
# See the Lemur docs (https://lemur.readthedocs.org) for more information on configuration
LOG_LEVEL = str(os.environ.get('LOG_LEVEL', 'DEBUG'))
LOG_FILE = str(os.envir... | cwe | CWE-330 | Python |
(function()
{
// Adds BPMN 2.0 shapes
Sidebar.prototype.addBpmn2Palette = function()
{
var gn = 'mxgraph.bpmn2';
var r = 400;
var sb = this;
this.setCurrentSearchEntryLibrary('bpmn2', 'bpmn2General');
this.addBPMN2GeneralPalette(gn, r, sb);
this.setCurrentSearchEntryLibrary('bpmn2', 'bpmn2Tasks');
t... | cwe | CWE-79 | Java |
xmlParseCDSect(xmlParserCtxtPtr ctxt) {
xmlChar *buf = NULL;
int len = 0;
int size = XML_PARSER_BUFFER_SIZE;
int r, rl;
int s, sl;
int cur, l;
int count = 0;
/* Check 2.6.0 was NXT(0) not RAW */
if (CMP9(CUR_PTR, '<', '!', '[', 'C', 'D', 'A', 'T', 'A', '[')) {
SKIP(9);
} else
... | cwe | CWE-119 | C/C++ |
function c(H,F,J,R){function W(){F.removeChild(U);F.removeChild(Y);V.style.display="block";O.style.display="block"}z={div:F,comment:H,saveCallback:J,deleteOnCancel:R};var O=F.querySelector(".geCommentTxt"),V=F.querySelector(".geCommentActionsList"),U=document.createElement("textarea");U.className=
"geCommentEditTxtArea... | cwe | CWE-94 | JavaScript |
ossl_cipher_set_key(VALUE self, VALUE key)
{
EVP_CIPHER_CTX *ctx;
int key_len;
StringValue(key);
GetCipher(self, ctx);
key_len = EVP_CIPHER_CTX_key_length(ctx);
if (RSTRING_LEN(key) != key_len)
ossl_raise(rb_eArgError, "key must be %d bytes", key_len);
if (EVP_CipherInit_ex(ctx, NULL, NU... | cwe | CWE-326 | Unknown |
netsnmp_init_mib(void)
{
const char *prefix;
char *env_var, *entry;
PrefixListPtr pp = &mib_prefixes[0];
char *st = NULL;
if (Mib)
return;
netsnmp_init_mib_internals();
/*
* Initialise the MIB directory/ies
*/
netsnmp_fixup_mib_directory();
... | cwe | CWE-59 | Unknown |
package controlplane
import (
"context"
"net"
"net/http"
"sync/atomic"
"time"
envoy_service_discovery_v3 "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3"
"github.com/gorilla/mux"
"github.com/rs/zerolog"
"golang.org/x/sync/errgroup"
"google.golang.org/grpc"
"google.golang.org/grpc/health/... | cwe | CWE-200 | Go |
static int aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
{
EVP_AES_CCM_CTX *cctx = EVP_C_DATA(EVP_AES_CCM_CTX,c);
switch (type) {
case EVP_CTRL_INIT:
cctx->key_set = 0;
cctx->iv_set = 0;
cctx->L = 8;
cctx->M = 12;
cctx->tag_set = 0;
cctx->len_s... | cwe | CWE-125 | C/C++ |
start_input_bmp(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
{
bmp_source_ptr source = (bmp_source_ptr)sinfo;
U_CHAR bmpfileheader[14];
U_CHAR bmpinfoheader[64];
#define GET_2B(array, offset) \
((unsigned short)UCH(array[offset]) + \
(((unsigned short)UCH(array[offset + 1])) << 8))
#define GET_4B(array, of... | cwe | CWE-200 | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.