code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
purgekeys_2_svc(purgekeys_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg, *funcname;
gss_buffer_desc client_name, service_name;
OM_uint32 minor_stat;
kadm5_server_handle_t handle;
const char ... | cwe | CWE-772 | C/C++ |
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* Cryptographic Abstraction Layer
*
* Copyright 2011-2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
*
* 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... | cwe | CWE-787 | C/C++ |
function e(H,F){F.innerHTML="";H=new Date(H.modifiedDate);var J=b.timeSince(H);null==J&&(J=mxResources.get("lessThanAMinute"));mxUtils.write(F,mxResources.get("timeAgo",
[J],"{1} ago"));F.setAttribute("title",H.toLocaleDateString()+" "+H.toLocaleTimeString())} | cwe | CWE-94 | JavaScript |
static int mount_entry_on_relative_rootfs(struct mntent *mntent,
const char *rootfs)
{
char path[MAXPATHLEN];
int ret;
/* relative to root mount point */
ret = snprintf(path, sizeof(path), "%s/%s", rootfs, mntent->mnt_dir);
if (ret >= sizeof(path)) {
ERROR("path name too long");
return -1;
}
return ... | cwe | CWE-59 | Unknown |
_XimProtoGetICValues(
XIC xic,
XIMArg *arg)
{
Xic ic = (Xic)xic;
Xim im = (Xim)ic->core.im;
register XIMArg *p;
register XIMArg *pp;
register int n;
CARD8 *buf;
CARD16 *buf_s;
INT16 len;
CARD32 reply32[BUFSIZE/4];
char *reply = (char *)reply32;
XPoin... | cwe | CWE-190 | Unknown |
static function sendXML($items_id, $itemtype) {
if (call_user_func([$itemtype, 'canView'])) {
$xml = file_get_contents(GLPI_PLUGIN_DOC_DIR."/fusioninventory/xml/".$items_id);
echo $xml;
} else {
Html::displayRightError();
}
} | cwe | CWE-19 | PHP |
static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn)
{
struct bpf_reg_state *regs = cur_regs(env);
u8 opcode = BPF_OP(insn->code);
int err;
if (opcode == BPF_END || opcode == BPF_NEG) {
if (opcode == BPF_NEG) {
if (BPF_SRC(insn->code) != 0 ||
insn->src_reg != BPF_REG_0 ||
... | cwe | CWE-668 | Unknown |
int callback_static_compressed_inmemory_website (const struct _u_request * request, struct _u_response * response, void * user_data) {
struct _u_compressed_inmemory_website_config * config = (struct _u_compressed_inmemory_website_config *)user_data;
char ** accept_list = NULL;
int ret = U_CALLBACK_CONTINUE, compr... | cwe | CWE-22 | C/C++ |
__reiserfs_set_acl(struct reiserfs_transaction_handle *th, struct inode *inode,
int type, struct posix_acl *acl)
{
char *name;
void *value = NULL;
size_t size = 0;
int error;
switch (type) {
case ACL_TYPE_ACCESS:
name = XATTR_NAME_POSIX_ACL_ACCESS;
if (acl) {
error = posix_acl_equiv_mode(acl, &inode->i... | cwe | CWE-862 | Unknown |
static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock,
struct msghdr *msg, size_t len,
int flags)
{
struct sock_iocb *siocb = kiocb_to_siocb(kiocb);
struct scm_cookie scm;
struct sock *sk = sock->sk;
struct netlink_sock *nlk = nlk_sk(sk);
int noblock = flags&MSG_DONTWAIT;
size_t copied;
... | cwe | CWE-20 | C/C++ |
absl::optional<CelValue> RequestWrapper::operator[](CelValue key) const {
if (!key.IsString()) {
return {};
}
auto value = key.StringOrDie().value();
if (value == Headers) {
return CelValue::CreateMap(&headers_);
} else if (value == Time) {
return CelValue::CreateTimestamp(absl::FromChrono(info_.... | cwe | CWE-400 | C/C++ |
function storeSerializedSession($serialized_session_data, $session_id)
{
$doSession = OA_Dal::staticGetDO('session', $session_id);
if ($doSession) {
$doSession->sessiondata = $serialized_session_data;
$doSession->update();
}
else {
$doSession = OA_... | cwe | CWE-384 | PHP |
static int udf_pc_to_char(struct super_block *sb, unsigned char *from,
int fromlen, unsigned char *to, int tolen)
{
struct pathComponent *pc;
int elen = 0;
int comp_len;
unsigned char *p = to;
/* Reserve one byte for terminating \0 */
tolen--;
while (elen < fromlen) {
pc = (struct pathComponent *)(fro... | cwe | CWE-703 | C/C++ |
// Copyright 2014 Unknown
//
// Licensed under the Apache License, Version 2.0 (the "License"): you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writ... | cwe | CWE-20 | Go |
compileRule(FileInfo *file, TranslationTableHeader **table,
DisplayTableHeader **displayTable, const MacroList **inScopeMacros) {
CharsString token;
TranslationTableOpcode opcode;
CharsString ruleChars;
CharsString ruleDots;
CharsString cells;
CharsString scratchPad;
CharsString emphClass;
TranslationTableCha... | cwe | CWE-787 | C/C++ |
function _sendFile(fileRequested, req, res, stats) {
fs.open(fileRequested, "r", (err, fd) => {
if (err) (err.code === "ENOENT") ? _sendError(req, res, 404, "Path Not Found.") : _sendError(req, res, 500, err);
else {
access.info(`Sending: ${fileRequested}`);
const mime = conf.mimeTypes[path.extname(fileRequ... | cwe | CWE-116 | JavaScript |
static int http_RecvPostMessage(
/*! HTTP Parser object. */
http_parser_t *parser,
/*! [in] Socket Information object. */
SOCKINFO *info,
/*! File where received data is copied to. */
char *filename,
/*! Send Instruction object which gives information whether the file
* is a virtual file or not. */
struct Sen... | cwe | CWE-284 | 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-200 | Unknown |
int wmain(int argc, wchar_t* argv[])
{
// If wmain is supported, argv contains UTF-16-encoded strings
// with a 16-bit wchar_t. Convert this to UTF-8-encoded strings
// for compatibility with other systems. That way the rest of
// qpdf.cc can just act like arguments are UTF-8.
std::vector<PointerHol... | cwe | CWE-787 | Unknown |
static int oidc_session_redirect_parent_window_to_logout(request_rec *r,
oidc_cfg *c) {
oidc_debug(r, "enter");
char *java_script = apr_psprintf(r->pool,
" <script type=\"text/javascript\">\n"
" window.top.location.href = '%s?session=logout';\n"
" </script>\n", oidc_get_redirect_uri(r, c));
... | cwe | CWE-79 | C/C++ |
kdc_process_s4u_x509_user(krb5_context context,
krb5_kdc_req *request,
krb5_pa_data *pa_data,
krb5_keyblock *tgs_subkey,
krb5_keyblock *tgs_session,
krb5_pa_s4u_x509_user **s4u_x509_user,
... | cwe | CWE-617 | C/C++ |
static Image *ReadTGAImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
Image
*image;
MagickBooleanType
status;
PixelInfo
pixel;
Quantum
index;
register Quantum
*q;
register ssize_t
i,
x;
size_t
base,
flag,
offset,
real,
skip;
ssize_t
... | cwe | CWE-415 | C/C++ |
/*!
* UAParser.js v0.7.22
* Lightweight JavaScript-based User-Agent string parser
* https://github.com/faisalman/ua-parser-js
*
* Copyright © 2012-2019 Faisal Salman <f@faisalman.com>
* Licensed under MIT License
*/
(function (window, undefined) {
'use strict';
//////////////
// Constants
////... | cwe | CWE-400 | Java |
PJ_DEF(pj_status_t) pjmedia_rtcp_fb_parse_sli(
const void *buf,
pj_size_t length,
unsigned *sli_cnt,
pjmedia_rtcp_fb_sli sli[])
{
pjmedia_rtcp_common *hdr = (pjmedia_rtcp_common*) buf;
pj_uint8_t *p;
unsigned cnt, i;
PJ_ASSERT_RETURN(buf && sli_cnt && sli, PJ_EINVAL);
PJ_ASSERT_... | cwe | CWE-125 | C/C++ |
export const stripStyleCharacters = emailContent => {
let contentToBeParsed = emailContent.replace(/<style(.|\s)*?<\/style>/g, '');
contentToBeParsed = contentToBeParsed.replace(/style="(.*?)"/g, '');
let parsedContent = new DOMParser().parseFromString(
contentToBeParsed,
'text/html'
);
if (!parsedCon... | cwe | CWE-1333 | JavaScript |
private function configureDefaults(array $config)
{
$defaults = [
'allow_redirects' => RedirectMiddleware::$defaultSettings,
'http_errors' => true,
'decode_content' => true,
'verify' => true,
'cookies' => false
];
... | cwe | CWE-89 | JavaScript |
enum ndr_err_code ndr_push_dns_string_list(struct ndr_push *ndr,
struct ndr_token_list *string_list,
int ndr_flags,
const char *s)
{
const char *start = s;
if (!(ndr_flags & NDR_SCALARS)) {
return NDR_ERR_SUCCESS;
}
while (s && *s) {
enum ndr_err_code ndr_err;
char *compname;
size_... | cwe | CWE-400 | Unknown |
fn should_correctly_handle_long_label_when_splitted() {
// given
let (server, fetch) = serve_with_fetch("xolrg9fePeQyKLnL");
// when
let response = request(server,
"\
GET /styles.css?test=123 HTTP/1.1\r\n\
Host: f1qprwk775k6am35a5wmpk3e9gnpgx3me1sk.mbsfcdqpwx3jd5h7ax39dxq2wvb5dhqpww3fe9t2wrvfdm.web.web3.si... | cwe | CWE-346 | Rust |
package com.zrlog.web.util;
import com.zrlog.util.ZrLogUtil;
import javax.servlet.http.HttpServletRequest;
/**
* 存放与Web相关的工具代码
*/
public class WebTools {
/**
* 处理由于浏览器使用透明代理,或者是WebServer运行在诸如 nginx/apache 这类 HttpServer后面的情况,通过获取请求头真实IP地址
*
* @param request
* @return
*/
public stat... | cwe | CWE-79 | Java |
private String getLocalePrefix(FacesContext context) {
String localePrefix = null;
localePrefix = context.getExternalContext().getRequestParameterMap().get("loc");
if(localePrefix != null){
return localePrefix;
}
String appBundleName = cont... | cwe | CWE-22 | Java |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, print_function
import frappe
import time
from frappe import _, msgprint
from frappe.utils import flt, cstr, now, get_datetime_str, file_lock, date_diff
from frappe.model.base_doc... | cwe | CWE-79 | Python |
void smp_proc_master_id(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
uint8_t* p = p_data->p_data;
tBTM_LE_PENC_KEYS le_key;
SMP_TRACE_DEBUG("%s", __func__);
smp_update_key_mask(p_cb, SMP_SEC_KEY_TYPE_ENC, true);
STREAM_TO_UINT16(le_key.ediv, p);
STREAM_TO_ARRAY(le_key.rand, p, BT_OCTET8_LEN);
/* store ... | cwe | CWE-125 | C/C++ |
c+";"))}}),mxUtils.bind(this,function(){var n=null;A.getModel().beginUpdate();try{n=A.insertVertex(A.getDefaultParent(),null,c,A.snap(e),A.snap(g),1,1,"text;"+(k?"html=1;":"")),A.updateCellSize(n),A.fireEvent(new mxEventObject("textInserted","cells",[n]))}finally{A.getModel().endUpdate()}A.setSelectionCell(n)}))}else{c... | cwe | CWE-20 | JavaScript |
'use strict';
const CDP = require('chrome-remote-interface');
class Renderer {
_loadPage(client, url, options, config) {
/**
* Finds any meta tags setting the status code.
* @return {?number} status code
*/
function getStatusCode() {
const metaElement = document.querySelector('meta[name... | cwe | CWE-22 | JavaScript |
static ScriptPromise fulfillImageBitmap(ExecutionContext* context, PassRefPtrWillBeRawPtr<ImageBitmap> imageBitmap)
{
RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(context);
ScriptPromise promise = resolver->promise();
resolver->resolve(imageBitmap);
return promise;
} | cwe | CWE-787 | C/C++ |
// SPDX-License-Identifier: BSD-2-Clause
/*
* Copyright (c) 2014, STMicroelectronics International N.V.
*/
#include <assert.h>
#include <compiler.h>
#include <crypto/crypto.h>
#include <kernel/tee_ta_manager.h>
#include <mm/tee_mmu.h>
#include <string_ext.h>
#include <string.h>
#include <sys/queue.h>
#include <tee_a... | cwe | CWE-119 | C/C++ |
#
# Copyright (c) 2011 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the im... | cwe | CWE-264 | Python |
int lgff_init(struct hid_device* hid)
{
struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);
struct input_dev *dev = hidinput->input;
const signed short *ff_bits = ff_joystick;
int error;
int i;
/* Check that the report looks ok */
if (!hid_validate_values(hid, HID_OUTPUT_REPORT, 0... | cwe | CWE-787 | C/C++ |
Node::InsertionNotificationRequest HTMLStyleElement::InsertedInto(
ContainerNode* insertion_point) {
HTMLElement::InsertedInto(insertion_point);
return kInsertionShouldCallDidNotifySubtreeInsertions;
} | cwe | CWE-416 | C/C++ |
callback: (request: PublishRequest, response: PublishResponse) => void; | cwe | CWE-400 | JavaScript |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
const TfLiteTensor* size = GetInput(context, node, kSizeTensor);
TfLiteTensor* o... | cwe | CWE-125 | C/C++ |
def write!(headers)
if @orig_disable_profiling != @disable_profiling || @orig_backtrace_level != @backtrace_level || @cookie.nil?
settings = {"p" => "t" }
settings["dp"] = "t" if @disable_profiling
settings["bt"] = @backtrace_level if @backtrace_level
settin... | cwe | CWE-200 | Ruby |
void free_bprm(struct linux_binprm *bprm)
{
free_arg_pages(bprm);
if (bprm->cred) {
mutex_unlock(¤t->signal->cred_guard_mutex);
abort_creds(bprm->cred);
}
kfree(bprm);
} | cwe | CWE-200 | Unknown |
/* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
* Copyright (c) 2007-2016, The Tor Project, Inc. */
/* See LICENSE for licensing information */
/**
* \file rendservice.c
* \brief The hidden-service side of rendezvous functionality.
**/
#define RENDSERVICE_PRIVATE
#include "or.h"
#include "circpathb... | cwe | CWE-532 | C/C++ |
virtual void requestInit() {
m_use_error = false;
m_errors.reset();
xmlParserInputBufferCreateFilenameDefault(nullptr);
} | cwe | CWE-94 | Unknown |
static struct ldb_parse_tree *ldap_decode_filter_tree(TALLOC_CTX *mem_ctx,
struct asn1_data *data)
{
uint8_t filter_tag;
struct ldb_parse_tree *ret;
if (!asn1_peek_uint8(data, &filter_tag)) {
return NULL;
}
filter_tag &= 0x1f; /* strip off the asn1 stuff */
ret = talloc(mem_ctx, struct ldb_parse... | cwe | CWE-399 | Unknown |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-401 | C/C++ |
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* th... | cwe | CWE-285 | Java |
foreach ($elem[2] as $field) {
echo '
<tr class="tr_fields itemCatName_'.$itemCatName.'">
<td valign="top" class="td_title"> <span class="ui-icon ui-icon-carat-1-e" style="float: left; margin: 0 .3em 0 15px; font-size:9px;"> </span><i>'.$fi... | cwe | CWE-89 | PHP |
def create_info_block(options)
return nil unless options
assignments = options.map { |k, v| "img.#{k} = #{v}" }
code = "lambda { |img| " + assignments.join(";") + "}"
eval code
end | cwe | CWE-94 | Ruby |
_PUBLIC_ bool ldap_encode(struct ldap_message *msg,
DATA_BLOB *result, TALLOC_CTX *mem_ctx)
{
struct asn1_data *data = asn1_init(mem_ctx);
int i, j;
if (!data) return false;
asn1_push_tag(data, ASN1_SEQUENCE(0));
asn1_write_Integer(data, msg->messageid);
switch (msg->type) {
... | cwe | CWE-399 | C/C++ |
it 'should verify a standard RS256 token' do
domain = 'example.org'
sub = 'abc123'
payload = {
sub: sub,
exp: future_timecode,
iss: "https://#{domain}/",
iat: past_timecode,
aud: client_id,
kid: jwks_kid
}
token = make_rs256_token(payload)
... | cwe | CWE-347 | Ruby |
package com.salesmanager.shop.admin.controller.configurations;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
imp... | cwe | CWE-79 | Java |
registerEvents(container) {
container.find('.js-modal__save').on('click', (e) => {
let progress = $.progressIndicator({
position: 'html',
blockInfo: {
enabled: true
}
});
let params = container.find('form').serializeFormData();
AppConnector.request(params)
.done(function (da... | cwe | CWE-79 | JavaScript |
'use strict';
const request = require('request');
/**
* A default set of user agent patterns for bots/crawlers that do not perform
* well with pages that require JavaScript.
*/
const botUserAgents = module.exports.botUserAgents = [
'W3C_Validator',
'baiduspider',
'bingbot',
'embedly',
'facebookexternalhi... | cwe | CWE-79 | JavaScript |
static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
{
MpegEncContext *s = &ctx->m;
int width, height, vo_ver_id;
/* vol header */
skip_bits(gb, 1); /* random access */
s->vo_type = get_bits(gb, 8);
if (get_bits1(gb) != 0) { /* is_ol_id */
vo... | cwe | CWE-703 | Unknown |
protected function getJobIdFromWidgetConfiguration()
{
$sql = "SELECT *
FROM plugin_hudson_widget
WHERE widget_name = '" . db_es($this->widget_id) . "'
AND owner_id = " . db_ei($this->owner_id) . "
AND owner_type = '" . db_e... | cwe | CWE-89 | PHP |
def decode(json, proc = nil, options = {})
data = ::JSON.load(json, proc, options)
if ActiveSupport.parse_json_times
convert_dates_from(data)
else
data
end
end | cwe | CWE-502 | Ruby |
static MagickBooleanType WritePICTImage(const ImageInfo *image_info,
Image *image)
{
#define MaxCount 128
#define PictCropRegionOp 0x01
#define PictEndOfPictureOp 0xff
#define PictJPEGOp 0x8200
#define PictInfoOp 0x0C00
#define PictInfoSize 512
#define PictPixmapOp 0x9A
#define PictPICTOp 0x98
#define PictVer... | cwe | CWE-772 | Unknown |
int nfc_deactivate_target(struct nfc_dev *dev, u32 target_idx, u8 mode)
{
int rc = 0;
pr_debug("dev_name=%s target_idx=%u\n",
dev_name(&dev->dev), target_idx);
device_lock(&dev->dev);
if (!device_is_registered(&dev->dev)) {
rc = -ENODEV;
goto error;
}
if (dev->active_target == NULL) {
rc = -ENOTCONN;... | cwe | CWE-416 | Unknown |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | cwe | CWE-502 | Java |
/*
* 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-787 | C/C++ |
# Copyright 2018-2022 Streamlit 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 in wr... | cwe | CWE-22 | Python |
static noinline void key_gc_unused_keys(struct list_head *keys)
{
while (!list_empty(keys)) {
struct key *key =
list_entry(keys->next, struct key, graveyard_link);
list_del(&key->graveyard_link);
kdebug("- %u", key->serial);
key_check(key);
security_key_free(key);
/* deal with the user's key tracking... | cwe | CWE-362 | Unknown |
void TileManager::crop( RawTile *ttt ){
int tw = image->getTileWidth();
int th = image->getTileHeight();
if( loglevel >= 5 ){
*logfile << "TileManager :: Edge tile: Base size: " << tw << "x" << th
<< ": This tile: " << ttt->width << "x" << ttt->height
<< endl;
}
// Create a new buffer, fill... | cwe | CWE-190 | Unknown |
QPDF::getObjectCount()
{
// This method returns the next available indirect object number.
// makeIndirectObject uses it for this purpose. After
// fixDanglingReferences is called, all objects in the xref table
// will also be in obj_cache.
fixDanglingReferences();
QPDFObjGen og(0, 0);
if (!... | cwe | CWE-787 | Unknown |
static long vfio_pci_ioctl(void *device_data,
unsigned int cmd, unsigned long arg)
{
struct vfio_pci_device *vdev = device_data;
unsigned long minsz;
if (cmd == VFIO_DEVICE_GET_INFO) {
struct vfio_device_info info;
minsz = offsetofend(struct vfio_device_info, num_irqs);
if (copy_from_user(&info, (void... | cwe | CWE-190 | C/C++ |
static int nc_email(ASN1_IA5STRING *eml, ASN1_IA5STRING *base)
{
const char *baseptr = (char *)base->data;
const char *emlptr = (char *)eml->data;
const char *baseat = strchr(baseptr, '@');
const char *emlat = strchr(emlptr, '@');
if (!emlat)
return X509_V_ERR_UNSUPPORTED_NAME_SYNTAX;
/... | cwe | CWE-125 | Unknown |
int sas_smp_get_phy_events(struct sas_phy *phy)
{
int res;
u8 *req;
u8 *resp;
struct sas_rphy *rphy = dev_to_rphy(phy->dev.parent);
struct domain_device *dev = sas_find_dev_by_rphy(rphy);
req = alloc_smp_req(RPEL_REQ_SIZE);
if (!req)
return -ENOMEM;
resp = alloc_smp_resp(RPEL_RESP_SIZE);
if (!resp) {
kfr... | cwe | CWE-772 | C/C++ |
static MagickBooleanType WritePDBImage(const ImageInfo *image_info,Image *image,
ExceptionInfo *exception)
{
const char
*comment;
int
bits;
MagickBooleanType
status;
PDBImage
pdb_image;
PDBInfo
pdb_info;
QuantumInfo
*quantum_info;
register const Quantum
*p;
register ... | cwe | CWE-787 | Unknown |
lyp_parse_value(struct lys_type *type, const char **value_, struct lyxml_elem *xml,
struct lyd_node_leaf_list *leaf, struct lyd_attr *attr, struct lys_module *local_mod,
int store, int dflt, int trusted)
{
struct lys_type *ret = NULL, *t;
struct lys_tpdf *tpdf;
enum int_log_o... | cwe | CWE-787 | Unknown |
PrintPreviewUI::~PrintPreviewUI() {
print_preview_data_service()->RemoveEntry(preview_ui_addr_str_);
g_print_preview_request_id_map.Get().Erase(preview_ui_addr_str_);
} | cwe | CWE-200 | C/C++ |
private function updateDeadline()
{
try {
$due_date = self::getDueDate($this->zdb, $this->_member);
if ($due_date != '') {
$date_fin_update = $due_date;
} else {
$date_fin_update = new Expression('NULL');
}
$update... | cwe | CWE-89 | PHP |
set_cmnd(void)
{
struct sudo_nss *nss;
int ret = FOUND;
debug_decl(set_cmnd, SUDOERS_DEBUG_PLUGIN);
/* Allocate user_stat for find_path() and match functions. */
user_stat = calloc(1, sizeof(struct stat));
if (user_stat == NULL) {
sudo_warnx(U_("%s: %s"), __func__, U_("unable to allocate memor... | cwe | CWE-193 | Unknown |
void TabSpecificContentSettings::OnContentBlocked(
ContentSettingsType type,
const std::string& resource_identifier) {
DCHECK(type != CONTENT_SETTINGS_TYPE_GEOLOCATION)
<< "Geolocation settings handled by OnGeolocationPermissionSet";
content_accessed_[type] = true;
std::string identifier;
if (... | cwe | CWE-20 | C/C++ |
function prepareInputForUpdate($input) {
if (isset($input["passwd"])) {
if (empty($input["passwd"])) {
unset($input["passwd"]);
} else {
$input["passwd"] = Toolbox::encrypt(stripslashes($input["passwd"]), GLPIKEY);
}
}
if (isset($input["_blank_passw... | cwe | CWE-798 | PHP |
function s(e,i){var s=i===o?a&&a.array:e&&e.array,u=i>n?0:n-i,c=r-i;return c>g&&(c=g),function(){if(u===c)return It;var e=t?--c:u++;return s&&s[e]}} | cwe | CWE-200 | JavaScript |
DEFINE_TEST(test_write_disk_secure)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
skipping("archive_write_disk security checks not supported on Windows");
#else
struct archive *a;
struct archive_entry *ae;
struct stat st;
/* Start with a known umask. */
assertUmask(UMASK);
/* Create an archive_write_disk objec... | cwe | CWE-22 | Unknown |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% M M AAA TTTTT L AAA BBBB ... | cwe | CWE-119 | C/C++ |
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2020 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under ... | cwe | CWE-22 | C/C++ |
/*-
* Copyright (c) 2003-2009 Tim Kientzle
* Copyright (c) 2010-2012 Michihiro NAKAJIMA
* Copyright (c) 2017 Martin Matuska
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistri... | cwe | CWE-59 | C/C++ |
utf32le_mbc_to_code(const UChar* p, const UChar* end ARG_UNUSED)
{
return (OnigCodePoint )(((p[3] * 256 + p[2]) * 256 + p[1]) * 256 + p[0]);
} | cwe | CWE-125 | Unknown |
e_ews_connection_utils_prepare_message (EEwsConnection *cnc,
SoupMessage *message,
GCancellable *cancellable)
{
ESoupAuthBearer *using_bearer_auth;
GError *local_error = NULL;
if (!ews_connection_utils_maybe_prepare_bearer_auth (cnc, message, cancellable))
return FALSE;
using_bearer_auth = e_ews_conne... | cwe | CWE-295 | Unknown |
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
import { saveAs } from 'file-saver'
import { FlowRouter } from 'meteor/ostrio:flow-router-extra'
import { NullXlsx } from '@neovici/nullxlsx'
import './periodtimetable.html'
import './pagination.js'
import './limitpicker.js'
import { i18nReady, t } from '../.... | cwe | CWE-79 | JavaScript |
// Copyright (C) 2004-2021 Artifex Software, Inc.
//
// This file is part of MuPDF.
//
// MuPDF is free software: you can redistribute it and/or modify it under the
// terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option)
// ... | cwe | CWE-369 | C/C++ |
void APar_ExtractDetails(FILE *isofile, uint8_t optional_output) {
char uint32_buffer[5];
Trackage track = {0};
AtomicInfo *mvhdAtom = APar_FindAtom("moov.mvhd", false, VERSIONED_ATOM, 0);
if (mvhdAtom != NULL) {
APar_ExtractMovieDetails(uint32_buffer, isofile, mvhdAtom);
fprintf(stdout,
"M... | cwe | CWE-787 | C/C++ |
int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a,
ASN1_BIT_STRING *signature, void *asn, EVP_PKEY *pkey)
{
EVP_MD_CTX ctx;
unsigned char *buf_in=NULL;
int ret= -1,inl;
int mdnid, pknid;
if (!pkey)
{
ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ERR_R_PASSED_NULL_PARAMETER);
return -1;
}
EVP_MD_CTX_ini... | cwe | CWE-310 | C/C++ |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# CherryMusic - a standalone music server
# Copyright (c) 2012 - 2015 Tom Wallroth & Tilman Boerner
#
# Project page:
# http://fomori.org/cherrymusic/
# Sources on github:
# http://github.com/devsnd/cherrymusic/
#
# CherryMusic is based on
# jPlayer (GPL/MIT licens... | cwe | CWE-22 | Python |
/*
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2002-2013, Open Source Geospatial Foundation (OSGeo)
*
* 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 ... | cwe | CWE-89 | Java |
static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir)
{
struct inode *inode = filp->f_path.dentry->d_inode;
struct super_block *sb = inode->i_sb;
int len, err;
char strbuf[HFSPLUS_MAX_STRLEN + 1];
hfsplus_cat_entry entry;
struct hfs_find_data fd;
struct hfsplus_readdir_data *rd;
u16 typ... | cwe | CWE-264 | C/C++ |
static struct ion_handle *ion_handle_get_by_id(struct ion_client *client,
int id)
{
struct ion_handle *handle;
mutex_lock(&client->lock);
handle = idr_find(&client->idr, id);
if (handle)
ion_handle_get(handle);
mutex_unlock(&client->lock);
return handle ? handle : ERR_PTR(-EINVAL);
} | cwe | CWE-264 | C/C++ |
null!=this.linkHint&&(this.linkHint.style.visibility="")};var Za=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Za.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListen... | cwe | CWE-20 | JavaScript |
static NOINLINE char *xmalloc_optname_optval(uint8_t *option, const struct dhcp_optflag *optflag, const char *opt_name)
{
unsigned upper_length;
int len, type, optlen;
char *dest, *ret;
/* option points to OPT_DATA, need to go back to get OPT_LEN */
len = option[-OPT_DATA + OPT_LEN];
type = optflag->flags & OPT... | cwe | CWE-119 | Unknown |
parse_fond( char* fond_data,
short* have_sfnt,
ResID* sfnt_id,
Str255 lwfn_file_name,
short face_index )
{
AsscEntry* assoc;
AsscEntry* base_assoc;
FamRec* fond;
*sfnt_id = 0;
*have_sfnt = 0;
lwfn_file_name[... | cwe | CWE-119 | C/C++ |
/* nbdkit
* Copyright (C) 2013-2019 Red Hat Inc.
*
* 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 copyright
* notice, this list of conditions and the f... | cwe | CWE-406 | C/C++ |
function renderRestrictedPipeline(node) {
var gui = '';
gui += '<h3 title="' + node.name + '" class="restricted">' + node.name + '</h3>';
if (node.message) {
gui += '<div class="message restricted"><span>' + node.message + '</span></div>';
}
gui += '<div class="action... | cwe | CWE-79 | JavaScript |
void EC_GROUP_free(EC_GROUP *group)
{
if (!group) return;
if (group->meth->group_finish != 0)
group->meth->group_finish(group);
EC_EX_DATA_free_all_data(&group->extra_data);
if (group->generator != NULL)
EC_POINT_free(group->generator);
BN_free(&group->order);
BN_free(&group->cofactor);
if (group->seed)... | cwe | CWE-320 | Unknown |
package com.salesmanager.shop.admin.controller.products;
import com.salesmanager.core.business.services.catalog.product.ProductService;
import com.salesmanager.core.business.services.catalog.product.review.ProductReviewService;
import com.salesmanager.core.business.utils.ajax.AjaxPageableResponse;
import com.salesmana... | cwe | CWE-639 | Java |
public function __construct(string $user = null, string $field = 'id') {
$this->_db = DB::getInstance();
$this->_sessionName = Config::get('session.session_name');
$this->_cookieName = Config::get('remember.cookie_name');
$this->_admSessionName = Config::get('session.admin_name');
... | cwe | CWE-384 | PHP |
function add_application($uniq_name_orig,$uniq_name,$process_name,$display,$url,$command,$type,$min_value,$bdd){
if($type != 'MIN'){
$min_value = "";
}
$sql = "select count(*) from bp where name = '" . $uniq_name . "';";
$req = $bdd->query($sql);
$bp_exist = $req->fetch();
// add
if($bp_exist[0] == 0 and empt... | cwe | CWE-78 | PHP |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.