code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
errcode_t ext2fs_flush2(ext2_filsys fs, int flags)
{
dgrp_t i;
errcode_t retval;
unsigned long fs_state;
__u32 feature_incompat;
struct ext2_super_block *super_shadow = 0;
struct ext2_group_desc *group_shadow = 0;
#ifdef WORDS_BIGENDIAN
struct ext2_group_desc *gdp;
dgrp_t j;
#endif
char *group_ptr;
int old... | cwe | CWE-119 | 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 |
public function getData()
{
$this->validate('transactionReference', 'amount');
$data = array();
$data['amount'] = $this->getAmountInteger();
if ($this->getRefundApplicationFee()) {
$data['refund_application_fee'] = 'true';
}
return $data;
} | cwe | CWE-89 | JavaScript |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_cubic.c -- LSQUIC CUBIC implementation.
*/
#include <inttypes.h>
#include <math.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <sys/queue.h>
#ifdef WIN32
#include <vc_compat.h>
#endif
#include "lsquic_int_... | cwe | CWE-476 | C/C++ |
function updateLabel () {
try {
var thisId = jQuery('#fb-field-id').val();
var thisLabel = jQuery('#fb-new-label').val();
// Update preview
if (thisLabel.length === 0) {
jQuery('#fb-new-field' + thisId + ' label .label-text').html("New field");
} else {
jQuery('#fb-new-field' + thisId + ' label... | cwe | CWE-79 | JavaScript |
rsock_init_unixsock(VALUE sock, VALUE path, int server)
{
struct sockaddr_un sockaddr;
socklen_t sockaddrlen;
int fd, status;
rb_io_t *fptr;
FilePathValue(path);
INIT_SOCKADDR_UN(&sockaddr, sizeof(struct sockaddr_un));
if (sizeof(sockaddr.sun_path) < (size_t)RSTRING_LEN(path)) {
rb... | cwe | CWE-20 | C/C++ |
InputMethodDescriptors* ChromeOSGetSupportedInputMethodDescriptors() {
InputMethodDescriptors* input_methods = new InputMethodDescriptors;
for (size_t i = 0; i < arraysize(chromeos::kIBusEngines); ++i) {
if (InputMethodIdIsWhitelisted(chromeos::kIBusEngines[i].name)) {
input_methods->push_back(chromeos::C... | cwe | CWE-20 | C/C++ |
static long _syscall(
long num,
long arg1,
long arg2,
long arg3,
long arg4,
long arg5,
long arg6)
{
long ret = -1;
oe_errno = 0;
/* Handle the software system call. */
switch (num)
{
#if defined(OE_SYS_creat)
case OE_SYS_creat:
{
const char* p... | cwe | CWE-200 | Unknown |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include "lsquic_int_types.h"
#include "lsquic_qpack_exp.h"
struct qpack_exp_record *
lsquic_qpack_exp_new (void)
{
return calloc(1, sizeof(struct qpack_exp_record));
}
void
ls... | cwe | CWE-476 | C/C++ |
OmniboxPopupViewGtk::OmniboxPopupViewGtk(const gfx::Font& font,
OmniboxView* omnibox_view,
AutocompleteEditModel* edit_model,
GtkWidget* location_bar)
: model_(new AutocompletePopupModel(thi... | cwe | CWE-399 | C/C++ |
public function setAuthorizedBackendSession()
{
$_SESSION['authorized'] = true;
$_SESSION['lastSessionId'] = time();
$_SESSION['tstamp'] = time();
$_SESSION['expires'] = time() + $this->expireTimeInMinutes * 60;
$_SESSION['isBackendSession'] = true;
// Renew the sessi... | cwe | CWE-613 | PHP |
function getCardFieldFileValue(artifact_id, field_id, file_descriptions, filter_terms) {
function getFileUrl(file) {
return (
"/plugins/tracker/attachments/" +
encodeURIComponent(file.id) +
"-" +
encodeURIComponent(file.name)
... | cwe | CWE-79 | JavaScript |
void parser(void)
{
char *arg;
#ifndef MINIMAL
char *sitearg;
#endif
#ifdef WITH_RFC2640
char *narg = NULL;
#endif
size_t n;
#ifdef IMPLICIT_TLS
(void) tls_init_new_session();
data_protection_level = CPL_PRIVATE;
#endif
for (;;) {
xferfd = -1;
if (state_needs_update != 0) {
... | cwe | CWE-399 | Unknown |
status_t BnGraphicBufferProducer::onTransact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
switch(code) {
case REQUEST_BUFFER: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
int bufferIdx = data.readInt32();
sp<GraphicBuffer> buffer;
int result = requestBuf... | cwe | CWE-254 | C/C++ |
rfbBool HandleCursorShape(rfbClient* client,int xhot, int yhot, int width, int height, uint32_t enc)
{
int bytesPerPixel;
size_t bytesPerRow, bytesMaskData;
rfbXCursorColors rgb;
uint32_t colors[2];
char *buf;
uint8_t *ptr;
int x, y, b;
bytesPerPixel = client->format.bitsPerPixel / 8;
bytesPerRow = (... | cwe | CWE-787 | C/C++ |
// 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-476 | C/C++ |
int _yr_scan_match_callback(
uint8_t* match_data,
int32_t match_length,
int flags,
void* args)
{
CALLBACK_ARGS* callback_args = (CALLBACK_ARGS*) args;
YR_STRING* string = callback_args->string;
YR_MATCH* new_match;
int result = ERROR_SUCCESS;
int tidx = callback_args->context->tidx;
size_... | cwe | CWE-125 | Unknown |
$options['LIMIT'] = $this->parameters->getParameter( 'count' );
}
if ( $this->parameters->getParameter( 'openreferences' ) ) {
if ( count( $this->parameters->getParameter( 'imagecontainer' ) ) > 0 ) {
//$sSqlSelectFrom = $sSqlCl_to.'ic.il_to, '.$sSqlSelPage."ic.il_to AS sortkey".' FROM '.$this->tableNames['... | cwe | CWE-400 | PHP |
void Document::DispatchUnloadEvents() {
PluginScriptForbiddenScope forbid_plugin_destructor_scripting;
if (parser_)
parser_->StopParsing();
if (load_event_progress_ == kLoadEventNotRun)
return;
if (load_event_progress_ <= kUnloadEventInProgress) {
Element* current_focused_element = FocusedElement(... | cwe | CWE-285 | C/C++ |
from flask import make_response
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import functools
import logging
import os
import t... | cwe | CWE-613 | Python |
TEE_Result syscall_cryp_state_copy(unsigned long dst, unsigned long src)
{
TEE_Result res;
struct tee_cryp_state *cs_dst;
struct tee_cryp_state *cs_src;
struct tee_ta_session *sess;
res = tee_ta_get_current_session(&sess);
if (res != TEE_SUCCESS)
return res;
res = tee_svc_cryp_get_state(sess, tee_svc_uref_to... | cwe | CWE-327 | Unknown |
int format_expand_styles(GString *out, const char **format, int *flags)
{
int retval = 1;
char *p, fmt;
/* storage for numerical parsing code for %x/X formats. */
int tmp;
unsigned int tmp2;
fmt = **format;
switch (fmt) {
case '{':
case '}':
case '%':
/* escaped char */
g_string_append_c(out, fmt);
b... | cwe | CWE-476 | Unknown |
int yr_re_fast_exec(
uint8_t* code,
uint8_t* input_data,
size_t input_forwards_size,
size_t input_backwards_size,
int flags,
RE_MATCH_CALLBACK_FUNC callback,
void* callback_args,
int* matches)
{
RE_REPEAT_ANY_ARGS* repeat_any_args;
uint8_t* code_stack[MAX_FAST_RE_STACK];
uint8_t* ... | cwe | CWE-125 | C/C++ |
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.csrf().disable()
.authorizeRequests()
.antMatchers("/api/userinfo", "/api/userinfo/", "/api/user/information", "/api/user/information/").permitAll()
.antMatchers("/").permitAll()
.antMatchers("/static/*... | cwe | CWE-352 | Java |
// SPDX-License-Identifier: GPL-2.0
/*
* Completely Fair Scheduling (CFS) Class (SCHED_NORMAL/SCHED_BATCH)
*
* Copyright (C) 2007 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
*
* Interactivity improvements by Mike Galbraith
* (C) 2007 Mike Galbraith <efault@gmx.de>
*
* Various enhancements by Dmitry Adamus... | cwe | CWE-400 | C/C++ |
static int io_write(struct io_kiocb *req, unsigned int issue_flags)
{
struct iovec inline_vecs[UIO_FASTIOV], *iovec = inline_vecs;
struct kiocb *kiocb = &req->rw.kiocb;
struct iov_iter __iter, *iter = &__iter;
struct io_async_rw *rw = req->async_data;
ssize_t ret, ret2, io_size;
bool force_nonblock = issue_flags ... | cwe | CWE-125 | Unknown |
generateRandomFile (int partCount, const std::string & fn)
{
//
// Init data.
//
Array2D<half> halfData;
Array2D<float> floatData;
Array2D<unsigned int> uintData;
fillPixels<unsigned int>(uintData, width, height);
fillPixels<half>(halfData, width, height);
fillPixels<float>(floatData... | cwe | CWE-125 | Unknown |
// +build tools
package fosite
import (
_ "github.com/gorilla/websocket"
_ "github.com/mattn/goveralls"
_ "github.com/ory/go-acc"
)
| cwe | CWE-755 | Go |
/*
* Copyright 2017-2019 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | cwe | CWE-400 | Java |
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;
dctx->grc... | cwe | CWE-399 | Unknown |
GF_EXPORT
u32 gf_isom_guess_specification(GF_ISOFile *file)
{
u32 count, i, nb_any, nb_m4s, nb_a, nb_v, nb_auxv,nb_scene, nb_od, nb_mp3, nb_aac, nb_m4v, nb_avc, nb_amr, nb_h263, nb_qcelp, nb_evrc, nb_smv, nb_text, nb_pict;
nb_m4s = nb_a = nb_v = nb_auxv = nb_any = nb_scene = nb_od = nb_mp3 = nb_aac = nb_m4v = nb_avc... | cwe | CWE-476 | Unknown |
var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*Object*/options) {
if (!options) options = {};
var _changing = options.changing;
function getType(schema){
return schema.type || (primitiveConstructors[schema.name] == schema && schema.name.toLowerCase());
}
var errors = [];
// val... | cwe | CWE-1321 | JavaScript |
func (p *HTTPClient) ReadByte() (c byte, err error) {
return readByte(p.response.Body)
} | cwe | CWE-770 | Go |
array_push($privs, $type);
}
if(count($privs))
array_push($privs, "cascade");
updateUserOrGroupPrivs($user["id"], $nodeid, $privs, array(), "user");
print "addChildNode('$newnode', $nodeid);";
} | cwe | CWE-264 | PHP |
def cluster_start(params, request, session)
if params[:name]
code, response = send_request_with_token(
session, params[:name], 'cluster_start', true
)
else
if not allowed_for_local_cluster(session, Permissions::WRITE)
return 403, 'Permission denied'
end
$logger.info "Starting Daemons... | cwe | CWE-384 | Ruby |
Number(L.value),[f[n]])}}finally{l.getModel().endUpdate()}});M.className="geBtn gePrimaryBtn";mxEvent.addListener(u,"keypress",function(n){13==n.keyCode&&M.click()});t=document.createElement("div");t.style.marginTop="20px";t.style.textAlign="right";b.editor.cancelFirst?(t.appendChild(d),t.appendChild(M)):(t.appendChild... | cwe | CWE-20 | JavaScript |
zfs_fuid_create(zfsvfs_t *zfsvfs, uint64_t id, cred_t *cr,
zfs_fuid_type_t type, zfs_fuid_info_t **fuidpp)
{
#ifdef HAVE_KSID
const char *domain;
char *kdomain;
uint32_t fuid_idx = FUID_INDEX(id);
uint32_t rid;
idmap_stat status;
uint64_t idx = 0;
zfs_fuid_t *zfuid = NULL;
zfs_fuid_info_t *fuidp = NULL;
/... | cwe | CWE-200 | Unknown |
[J],"{1} ago"));F.setAttribute("title",H.toLocaleDateString()+" "+H.toLocaleTimeString())}function g(H){var F=document.createElement("img");F.className="geCommentBusyImg";F.src=IMAGE_PATH+"/spin.gif";H.appendChild(F);H.busyImg=F}function k(H){H.style.border="1px solid red";H.removeChild(H.busyImg)}function m(H){H.style... | cwe | CWE-94 | JavaScript |
result.set(value: .urlEncoded(value), forPath: [])
case 2:
let key = kv[0]
let value = String(kv[1])
result.set(value: .urlEncoded(value), forPath: try parseKey(key: Substring(key)))
default:
//Empty `&&`
continue
... | cwe | CWE-120 | Swift |
/* Copyright 2018 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-787 | Python |
static bool blk_kick_flush(struct request_queue *q, struct blk_flush_queue *fq)
{
struct list_head *pending = &fq->flush_queue[fq->flush_pending_idx];
struct request *first_rq =
list_first_entry(pending, struct request, flush.list);
struct request *flush_rq = fq->flush_rq;
/* C1 described at the top of this file... | cwe | CWE-362 | Unknown |
static void ssl3_take_mac(SSL *s)
{
const char *sender;
int slen;
if (s->state & SSL_ST_CONNECT)
{
sender=s->method->ssl3_enc->server_finished_label;
sender=s->method->ssl3_enc->client_finished_label;
slen=s->method->ssl3_enc->client_finished_label_len... | cwe | CWE-20 | Unknown |
package com.fit2cloud.provider.impl.huawei.api;
import com.aliyun.tea.TeaException;
import com.fit2cloud.common.exception.Fit2cloudException;
import com.fit2cloud.common.log.utils.LogUtil;
import com.fit2cloud.common.provider.entity.F2CEntityType;
import com.fit2cloud.common.provider.entity.F2CPerfMetricMonitorData;
i... | cwe | CWE-639 | Java |
/*!
* resolve-path
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module dependencies.
* @private
*/
var createError = require('http-errors')
var normalize = require('path').normalize
var pathIsAbsolute = require('path-is-absolute')
var re... | cwe | CWE-22 | JavaScript |
static int acurite_00275rm_decode(r_device *decoder, bitbuffer_t *bitbuffer)
{
int result = 0;
bitbuffer_invert(bitbuffer);
// This sensor repeats a signal three times. Combine as fallback.
uint8_t *b_rows[3] = {0};
int n_rows = 0;
for (int row = 0; row < bitbuffer->num_rows; ++row) {
... | cwe | CWE-703 | Unknown |
/*
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | cwe | CWE-770 | Java |
public function sdm_save_thumbnail_meta_data($post_id) { // Save Thumbnail Upload metabox
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
return;
if (!isset($_POST['sdm_thumbnail_box_nonce_check']) || !wp_verify_nonce($_POST['sdm_thumbnail_box_nonce_check'], 'sdm_thumbnail_box_nonce'))
return;
if (isset... | cwe | CWE-79 | PHP |
/*
* 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-863 | Java |
static public function onPost( $par, $out, $request ) {
global $wgUser;
if (!$request->getText('reason')) {
$out->addHTML(Html::rawElement(
'p',
[ 'class' => 'error '],
wfMessage( 'report-error-missing-reason' )->escaped()
));
} else {
$dbw = wfGetDB( DB_MASTER );
$dbw->startAtomic(__METHO... | cwe | CWE-352 | PHP |
/*
Copyright 2018-2020 Accenture Technology
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 la... | cwe | CWE-611 | Java |
static pdf_creator_t *new_creator(int *n_elements)
{
pdf_creator_t *daddy;
static const pdf_creator_t creator_template[] =
{
{"Title", ""},
{"Author", ""},
{"Subject", ""},
{"Keywords", ""},
{"Creator", ""},
{"Producer", ""},
... | cwe | CWE-787 | Unknown |
/*
* Cantata
*
* Copyright (c) 2011-2018 Craig Drummond <craig.p.drummond@gmail.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 Foundation; either version 2 of the License, or
* (a... | cwe | CWE-22 | C/C++ |
function a(e){1<e.which||e.shiftKey||e.altKey||e.metaKey||e.ctrlKey||(e.preventDefault(),r(this))} | cwe | CWE-284 | JavaScript |
mono_gc_cleanup (void)
{
#ifdef DEBUG
g_message ("%s: cleaning up finalizer", __func__);
#endif
if (!gc_disabled) {
ResetEvent (shutdown_event);
finished = TRUE;
if (mono_thread_internal_current () != gc_thread) {
mono_gc_finalize_notify ();
/* Finishing the finalizer thread, so wait a little bit... */
... | cwe | CWE-399 | Unknown |
public function getParent()
{
} | cwe | CWE-89 | JavaScript |
var fs = require('fs')
var path = require('path')
var request = require('teeny-request').teenyRequest
var urlgrey = require('urlgrey')
var jsYaml = require('js-yaml')
var walk = require('ignore-walk')
var execSync = require('child_process').execSync
var detectProvider = require('./detect')
var version = 'v' + require... | cwe | CWE-78 | JavaScript |
static ssize_t _consolefs_readv(
oe_fd_t* desc,
const struct oe_iovec* iov,
int iovcnt)
{
ssize_t ret = -1;
file_t* file = _cast_file(desc);
void* buf = NULL;
size_t buf_size = 0;
if (!file || !iov || iovcnt < 0 || iovcnt > OE_IOV_MAX)
OE_RAISE_ERRNO(OE_EINVAL);
/* Flatten ... | cwe | CWE-552 | Unknown |
find_pattern_in_path(
char_u *ptr, // pointer to search pattern
int dir UNUSED, // direction of expansion
int len, // length of search pattern
int whole, // match whole words only
int skip_comments, // don't match inside comments
int type, // Type of search; are we looking for a type?
... | cwe | CWE-416 | C/C++ |
asmlinkage long sys_oabi_fcntl64(unsigned int fd, unsigned int cmd,
unsigned long arg)
{
struct oabi_flock64 user;
struct flock64 kernel;
mm_segment_t fs = USER_DS; /* initialized to kill a warning */
unsigned long local_arg = arg;
int ret;
switch (cmd) {
case F_OFD_GETLK:
case F_OFD_SETLK:
case ... | cwe | CWE-264 | Unknown |
tt_size_reset( TT_Size size,
FT_Bool only_height )
{
TT_Face face;
FT_Size_Metrics* metrics;
size->ttmetrics.valid = FALSE;
face = (TT_Face)size->root.face;
metrics = &size->metrics;
/* copy the result from base layer */
/* This bit flag, if set, ... | cwe | CWE-787 | Unknown |
def _checkPairing():
if winner == loser:
raise ValueError('Attempt to match player against self')
q = '''
SELECT COUNT(*) FROM matches
WHERE (matches.winner_id = %s AND matches.loser_id = %s)
OR (matches.winner_id = %s AND matches.loser_id = %s);
''' % ... | cwe | CWE-89 | Python |
(function() {
(function(factory) {
if (typeof exports === "object") {
return module.exports = factory();
} else if (typeof define === "function" && define.amd) {
return define([], factory);
}
})(function() {
var getAndCreate, getValue, isArray, isObject, objectUtils, setValue;
isObje... | cwe | CWE-1321 | JavaScript |
/*
* Timers abstract layer
* Copyright (c) by Jaroslav Kysela <perex@perex.cz>
*
*
* 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 2 of the License, or
* (at you... | cwe | CWE-200 | C/C++ |
list_restrict4(
restrict_u * res,
struct info_restrict ** ppir
)
{
struct info_restrict * pir;
if (res->link != NULL)
list_restrict4(res->link, ppir);
pir = *ppir;
pir->addr = htonl(res->u.v4.addr);
if (client_v6_capable)
pir->v6_flag = 0;
pir->mask = htonl(res->u.v4.mask);
pir->count = htonl(res->cou... | cwe | CWE-476 | Unknown |
inline typename V::MapType FBUnserializer<V>::unserializeMap() {
p_ += CODE_SIZE;
typename V::MapType ret = V::createMap();
size_t code = nextCode();
while (code != FB_SERIALIZE_STOP) {
switch (code) {
case FB_SERIALIZE_VARCHAR:
case FB_SERIALIZE_STRING:
{
auto key = unserial... | cwe | CWE-674 | C/C++ |
package com.salesmanager.shop.admin.controller.merchant;
import java.io.InputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.annotation.Resource;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.Htt... | cwe | CWE-639 | Java |
void svhandler_flash_pgm_blk(void) {
uint32_t beginAddr = _param_1;
uint32_t data = _param_2;
uint32_t length = _param_3;
// Protect from overflow.
if (beginAddr + length < beginAddr) return;
// Do not allow firmware to erase bootstrap or bootloader sectors.
if (((beginAddr >= BSTRP_FLASH_SECT_START) &&... | cwe | CWE-668 | Unknown |
int pure_strcmp(const char * const s1, const char * const s2)
{
return pure_memcmp(s1, s2, strlen(s1) + 1U);
} | cwe | CWE-125 | C/C++ |
static void n_hdlc_release(struct n_hdlc *n_hdlc)
{
struct tty_struct *tty = n_hdlc2tty (n_hdlc);
struct n_hdlc_buf *buf;
if (debuglevel >= DEBUG_LEVEL_INFO)
printk("%s(%d)n_hdlc_release() called\n",__FILE__,__LINE__);
/* Ensure that the n_hdlcd process is not hanging on select()/poll() */
wake_up_interrup... | cwe | CWE-362 | Unknown |
const ESCAPE = /[&"<]/g, CHARS = {
'"': '"',
'&': '&',
'<': '<',
};
import { gen } from './$utils';
export function esc(value) {
if (typeof value !== 'string') return value;
let last=ESCAPE.lastIndex=0, tmp=0, out='';
while (ESCAPE.test(value)) {
tmp = ESCAPE.lastIndex - 1;
out += value.substring... | cwe | CWE-79 | JavaScript |
static const uint8_t *get_signature(const uint8_t *asn1_sig, int *len)
{
int offset = 0;
const uint8_t *ptr = NULL;
if (asn1_next_obj(asn1_sig, &offset, ASN1_SEQUENCE) < 0 ||
asn1_skip_obj(asn1_sig, &offset, ASN1_SEQUENCE))
goto end_get_sig;
if (asn1_sig[offset++] != ASN1_OCTET_STRI... | cwe | CWE-347 | C/C++ |
function g(){B&&(p(),t())} | cwe | CWE-1236 | JavaScript |
HandleFunctionRequest(StringInfo msgBuf)
{
Oid fid;
AclResult aclresult;
FunctionCallInfoData fcinfo;
int16 rformat;
Datum retval;
struct fp_info my_fp;
struct fp_info *fip;
bool callit;
bool was_logged = false;
char msec_str[32];
/*
* Read message contents if not already done.
*/
if (PG_PROTOCO... | cwe | CWE-89 | Unknown |
"use strict";
const setupRoute = require('./setup');
const loginRoute = require('./login');
const indexRoute = require('./index');
const utils = require('../services/utils');
const multer = require('multer')();
// API routes
const treeApiRoute = require('./api/tree');
const notesApiRoute = require('./api/notes');
con... | cwe | CWE-79 | JavaScript |
static int vrend_renderer_transfer_write_iov(struct vrend_context *ctx,
struct vrend_resource *res,
struct iovec *iov, int num_iovs,
const struct vrend_transfer_info *info)
{
void *d... | cwe | CWE-787 | C/C++ |
int __cil_build_ast_last_child_helper(struct cil_tree_node *parse_current, void *extra_args)
{
struct cil_args_build *args = extra_args;
struct cil_tree_node *ast = args->ast;
if (ast->flavor == CIL_ROOT) {
return SEPOL_OK;
}
args->ast = ast->parent;
if (ast->flavor == CIL_TUNABLEIF) {
args->tunif = NULL;
... | cwe | CWE-125 | Unknown |
JBIG2Bitmap::JBIG2Bitmap(Guint segNumA, JBIG2Bitmap *bitmap):
JBIG2Segment(segNumA)
{
w = bitmap->w;
h = bitmap->h;
line = bitmap->line;
if (w <= 0 || h <= 0 || line <= 0 || h >= (INT_MAX - 1) / line) {
error(-1, "invalid width/height");
data = NULL;
return;
}
data = (Guchar *)gmalloc(h * l... | cwe | CWE-189 | C/C++ |
svcauth_gss_accept_sec_context(struct svc_req *rqst,
struct rpc_gss_init_res *gr)
{
struct svc_rpc_gss_data *gd;
struct rpc_gss_cred *gc;
gss_buffer_desc recv_tok, seqbuf;
gss_OID mech;
OM_uint32 maj_stat = 0, min_stat = 0, ret_flags, seq;
log_debug("in svcauth_gss_accept_context()");
gd = SVC... | cwe | CWE-200 | C/C++ |
static int xt_osf_remove_callback(struct net *net, struct sock *ctnl,
struct sk_buff *skb,
const struct nlmsghdr *nlh,
const struct nlattr * const osf_attrs[],
struct netlink_ext_ack *extack)
{
struct xt_osf_user_finger *f;
struct xt_osf_finger *sf;
int err = -ENOENT;
if (!osf_attrs[OSF_ATT... | cwe | CWE-862 | Unknown |
import pipes
from galaxy import exceptions
from galaxy.util.none_like import NoneDataset
from galaxy.util import odict
from logging import getLogger
log = getLogger( __name__ )
# Fields in .log files corresponding to paths, must have one of the following
# field names and all such fields are assumed to be paths. This... | cwe | CWE-74 | Python |
do_ipt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
{
int ret;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
switch (cmd) {
case IPT_SO_GET_INFO:
ret = get_info(sock_net(sk), user, len, 0);
break;
case IPT_SO_GET_ENTRIES:
ret = get_entries(sock_net(sk), user, len);
break;
case IPT_SO... | cwe | CWE-200 | Unknown |
static int ismt_access(struct i2c_adapter *adap, u16 addr,
unsigned short flags, char read_write, u8 command,
int size, union i2c_smbus_data *data)
{
int ret;
unsigned long time_left;
dma_addr_t dma_addr = 0; /* address of the data buffer */
u8 dma_size = 0;
enum dma_data_direction dma_direction ... | cwe | CWE-703 | C/C++ |
int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc)
{
struct scsi_device *SDev;
struct scsi_sense_hdr sshdr;
int result, err = 0, retries = 0;
SDev = cd->device;
retry:
if (!scsi_block_when_processing_errors(SDev)) {
err = -ENODEV;
goto out;
}
result = scsi_execute(SDev, cgc->cmd, ... | cwe | CWE-119 | C/C++ |
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-369 | C/C++ |
package policychecker
import (
"bytes"
"encoding/json"
"io/ioutil"
"net/http"
"sigs.k8s.io/yaml"
"github.com/concourse/concourse/atc/api/accessor"
"github.com/concourse/concourse/atc/policy"
)
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
//counterfeiter:generate . PolicyChecker
ty... | cwe | CWE-863 | Go |
package com.salesmanager.shop.admin.controller.customers;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.salesmanager.core.business.services.customer.attribute.CustomerOptionService;
import com.salesmanager.core.business.services.customer.attribute.CustomerOptionSetService;
import com.salesmanager.core... | cwe | CWE-639 | Java |
e_ews_autodiscover_ws_url_sync (ESource *source,
CamelEwsSettings *settings,
const gchar *email_address,
const gchar *password,
GCancellable *cancellable,
GError **error)
{
EAsyncClosure ... | cwe | CWE-295 | Unknown |
/*
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
* Copyright (C) 2008 Craig Edwards <craigedwards@brainbox.cc>
*
* This file is part of InspIRCd. InspIRCd is free software: you can
* redistribute it and/or modify it under the terms of the GNU Ge... | cwe | CWE-264 | C/C++ |
package com.salesmanager.shop.admin.controller.user;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import javax.inject.Inject;
import javax.inject.Named;
import javax.servlet.http.HttpServletR... | cwe | CWE-79 | Java |
_WM_ParseNewHmp(uint8_t *hmp_data, uint32_t hmp_size) {
uint8_t is_hmp2 = 0;
uint32_t zero_cnt = 0;
uint32_t i = 0;
uint32_t hmp_file_length = 0;
uint32_t hmp_chunks = 0;
uint32_t hmp_divisions = 0;
uint32_t hmp_unknown = 0;
uint32_t hmp_bpm = 0;
uint32_t hmp_song_time = 0;
struc... | cwe | CWE-125 | C/C++ |
void PPB_Buffer_Proxy::OnMsgCreate(
PP_Instance instance,
uint32_t size,
HostResource* result_resource,
ppapi::proxy::SerializedHandle* result_shm_handle) {
result_shm_handle->set_null_shmem();
HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance);
if (!dispatcher)
return;
... | cwe | CWE-399 | Unknown |
void Compute(OpKernelContext* ctx) override {
const Tensor& indices = ctx->input(0);
const auto values = ctx->input(1).flat<Tidx>();
const Tensor& dense_shape = ctx->input(2);
const Tensor& size_t = ctx->input(3);
const auto weights = ctx->input(4).flat<T>();
const int64_t weights_size = weights... | cwe | CWE-125 | Unknown |
function escapeArgDash(arg, interpolation, quoted) {
let result = arg.replace(/\u0000/g, "");
if (interpolation) {
result = result
.replace(/\\/g, "\\\\")
.replace(/\n/g, " ")
.replace(/(^|\s)(~|#)/g, "$1\\$2")
.replace(/(\*|\?)/g, "\\$1")
.replace(/(\$|\;|\&|\|)/g, "\\$1")
... | cwe | CWE-400 | JavaScript |
static int reencrypt_load(struct crypt_device *cd, struct luks2_hdr *hdr,
uint64_t device_size,
const struct crypt_params_reencrypt *params,
struct luks2_reencrypt **rh)
{
int r;
struct luks2_reencrypt *tmp = NULL;
crypt_reencrypt_info ri = LUKS2_reencrypt_status(hdr);
if (ri == CRYPT_REENCRYPT_CLEAN)
r = ... | cwe | CWE-345 | Unknown |
protected function getComment()
{
$comment = $this->commentModel->getById($this->request->getIntegerParam('comment_id'));
if (empty($comment)) {
throw new PageNotFoundException();
}
if (! $this->userSession->isAdmin() && $comment['user_id'] != $this->userSession->getId(... | cwe | CWE-639 | PHP |
def edit(request, user_id):
user = get_object_or_404(User, pk=user_id)
uform = UserForm(data=post_data(request), instance=user)
form = UserProfileForm(data=post_data(request), instance=user.st)
if is_post(request) and all([uform.is_valid(), form.is_valid()]):
uform.save()
form.save()
... | cwe | CWE-601 | Python |
/*
* File operations used by nfsd. Some of these have been ripped from
* other parts of the kernel because they weren't exported, others
* are partial duplicates with added or changed functionality.
*
* Note that several functions dget() the dentry upon which they want
* to act, most notably those that create dir... | cwe | CWE-399 | C/C++ |
/*
* Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available... | cwe | CWE-20 | Java |
static void tcp_illinois_info(struct sock *sk, u32 ext,
struct sk_buff *skb)
{
const struct illinois *ca = inet_csk_ca(sk);
if (ext & (1 << (INET_DIAG_VEGASINFO - 1))) {
struct tcpvegas_info info = {
.tcpv_enabled = 1,
.tcpv_rttcnt = ca->cnt_rtt,
.tcpv_minrtt = ca->base_rtt,
};
u64 t = ca-... | cwe | CWE-189 | C/C++ |
function configure(config, layouts) {
let layout = layouts.basicLayout;
if (config.layout) {
layout = layouts.layout(config.layout.type, config.layout);
}
return fileAppender(
config.filename,
layout,
config.maxLogSize,
config.backups,
config,
config.timezoneOffset
);
} | cwe | CWE-276 | JavaScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.