code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
void unix_notinflight(struct file *fp)
{
struct sock *s = unix_get_socket(fp);
spin_lock(&unix_gc_lock);
if (s) {
struct unix_sock *u = unix_sk(s);
BUG_ON(list_empty(&u->link));
if (atomic_long_dec_and_test(&u->inflight))
list_del_init(&u->link);
unix_tot_inflight--;
}
fp->f_cred->user->unix_infligh... | vuln | Safe | C/C++ |
static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *pict, int *got_packet)
{
A64Context *c = avctx->priv_data;
AVFrame *const p = (AVFrame *) & c->picture;
int frame;
int x, y;
int b_height;
int b_width;
int req_size, ret;
... | vuln | Vulnerable | C/C++ |
int caf_parse(caf_reader_t *reader, int64_t *data_length)
{
uint32_t fcc;
int64_t chunk_size;
int desc_seen = 0;
*data_length = 0;
/* CAFFileHeader */
TRY_IO(pcm_read32be(&reader->io, &fcc));
ENSURE(fcc == M4AF_FOURCC('c','a','f','f'));
TRY_IO(pcm_skip(&reader->io, 4)); /* mFileVersion... | vuln | Safe | Unknown |
def show
Log.add_info(request, params.inspect)
@group_id = params[:group_id]
official_title_id = params[:id]
unless official_title_id.nil? or official_title_id.empty?
@official_title = OfficialTitle.find(official_title_id)
end
render(:layout => (!request.xhr?))
end | cwe | CWE-89 | Ruby |
/* JSON_parser.c */
/* 2005-12-30 */
/*
Copyright (c) 2005 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, mod... | vuln | Vulnerable | C/C++ |
public synchronized int getBytesAvailable() {
return mStoredBytes;
} | vuln | Vulnerable | Java |
static RList *create_cache_bins(RBinFile *bf, RDyldCache *cache) {
RList *bins = r_list_newf ((RListFree)free_bin);
ut16 *depArray = NULL;
cache_imgxtr_t *extras = NULL;
if (!bins) {
return NULL;
}
char *target_libs = NULL;
RList *target_lib_names = NULL;
int *deps = NULL;
target_libs = r_sys_getenv ("R_DYL... | cwe | CWE-703 | Unknown |
// SPDX-License-Identifier: GPL-2.0
/*
* Xen event channels (2-level ABI)
*
* Jeremy Fitzhardinge <jeremy@xensource.com>, XenSource Inc, 2007
*/
#define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt
#include <linux/linkage.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <asm/sync_bitops.h>
#include ... | vuln | Vulnerable | C/C++ |
/**
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
*
* The Apereo Foundation licenses this file to you under the Educational
* Community License, Version 2.0 (the ... | cwe | CWE-863 | Java |
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2021 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except... | vuln | Safe | C/C++ |
static void preinit_thread (lua_State *L, global_State *g) {
G(L) = g;
L->stack = NULL;
L->ci = NULL;
L->nci = 0;
L->stacksize = 0;
L->twups = L; /* thread has no upvalues */
L->errorJmp = NULL;
L->hook = NULL;
L->hookmask = 0;
L->basehookcount = 0;
L->allowhook = 1;
resethookcount(L);
L->ope... | vuln | Safe | Unknown |
static async getAsset(assetPath, res) {
try {
const fileHash = assetHelper.generateHash(assetPath)
const cachePath = path.resolve(WIKI.ROOTPATH, WIKI.config.dataPath, `cache/${fileHash}.dat`)
if (await WIKI.models.assets.getAssetFromCache(assetPath, cachePath, res)) {
return
}
... | vuln | Vulnerable | JavaScript |
static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC) /* {{{ */
{
HashTable *data;
int dirlen = strlen(dir);
phar_zstr key;
char *entry, *found, *save, *str_key;
uint keylen;
ulong unused;
ALLOC_HASHTABLE(data);
zend_hash_init(data, 64, zend_get_hash_value, NULL, 0);
if ((*dir == '... | vuln | Vulnerable | Unknown |
static const char *check_secret(int module, const char *user, const char *group,
const char *challenge, const char *pass)
{
char line[1024];
char pass2[MAX_DIGEST_LEN*2];
const char *fname = lp_secrets_file(module);
STRUCT_STAT st;
int fd, ok = 1;
int user_len = strlen(user);
int group_len = group ? strlen(g... | cwe | CWE-20 | Unknown |
GC_API GC_ATTR_MALLOC void * GC_CALL GC_calloc_explicitly_typed(size_t n,
size_t lb, GC_descr d)
{
word *op;
size_t lg;
GC_descr simple_descr;
complex_descriptor *complex_descr;
int descr_type;
struct LeafDescriptor leaf;
GC_ASSERT(GC_... | vuln | Vulnerable | Unknown |
void Scanner::lex_code_indented() {
const loc_t &loc = tok_loc();
tok = cur;
code:
#line 3086 "src/parse/lex.cc"
{
unsigned char yych;
if ((lim - cur) < 2) { if (!fill(2)) { error("unexpected end of input"); exit(1); } }
yych = (unsigned char)*cur;
if (yych <= '&') {
if (yych <= '\f') {
if (yych <= 0x... | vuln | Vulnerable | Unknown |
static int nc_dns(ASN1_IA5STRING *dns, ASN1_IA5STRING *base)
{
char *baseptr = (char *)base->data;
char *dnsptr = (char *)dns->data;
/* Empty matches everything */
if (!*baseptr)
return X509_V_OK;
/*
* Otherwise can add zero or more components on the left so compare RHS
* and if dn... | cwe | CWE-125 | 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... | vuln | Vulnerable | Java |
public void resetForgottenPassword(TestUtils setup) throws Exception
{
setup.loginAsSuperAdmin();
String userName = "testUser" + RandomStringUtils.randomAlphanumeric(6);
String password = "password";
String newPassword = "newPassword";
// Create a user
setup.createU... | cwe | CWE-200 | Java |
public static String getText(String key) {
if (key == null || key.isBlank()) {
//No benefit to doing a lookup
return key;
}
String value = getString(key);
if (value == null) {
log.debug("Cannot find key '" + key + "' in properties file.");
return key;
}
return value.repl... | vuln | Safe | Java |
@Override
public List<Component> getTooltip(T fluidStack, TooltipFlag tooltipFlag) {
List<Component> tooltip = new ArrayList<>();
IIngredientTypeWithSubtypes<Fluid, T> type = fluidHelper.getFluidIngredientType();
Fluid fluidType = type.getBase(fluidStack);
try {
if (fluidType.isSame(Fluids.EMPTY)) {
ret... | vuln | Safe | Java |
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... | vuln | Vulnerable | C/C++ |
writefile(const char *name, struct string *s)
{
FILE *f;
int ret;
f = fopen(name, "w");
if (!f) {
warn("open %s:", name);
return -1;
}
ret = 0;
if (fwrite(s->s, 1, s->n, f) != s->n || fflush(f) != 0) {
warn("write %s:", name);
ret = -1;
}
fclose(f);
return ret;
} | cwe | CWE-284 | C/C++ |
function escapeArgBash(arg, interpolation, quoted) {
let result = arg.replace(/\u0000/g, "");
if (interpolation) {
result = result
.replace(/\\/g, "\\\\")
.replace(/(^|\s)(~|#)/g, "$1\\$2")
.replace(/(\*|\?)/g, "\\$1")
.replace(/(\$|\;|\&|\|)/g, "\\$1")
.replace(/(\(|\)|\<|\>)/g, ... | vuln | Safe | JavaScript |
keybox_compress (KEYBOX_HANDLE hd)
{
int read_rc, rc;
const char *fname;
FILE *fp, *newfp;
char *bakfname = NULL;
char *tmpfname = NULL;
int first_blob;
KEYBOXBLOB blob = NULL;
u32 cut_time;
int any_changes = 0;
int skipped_deleted;
if (!hd)
return gpg_error (GPG_ERR_INV_HANDLE);
if (!hd->k... | vuln | Vulnerable | Unknown |
static size_t exif_convert_any_to_int(void *value, int format, int motorola_intel TSRMLS_DC)
{
int s_den;
unsigned u_den;
switch(format) {
case TAG_FMT_SBYTE: return *(signed char *)value;
case TAG_FMT_BYTE: return *(uchar *)value;
case TAG_FMT_USHORT: return php_ifd_get16u(value, motorola_int... | cwe | CWE-189 | C/C++ |
cs.get.hsl = function (string) {
if (!string) {
return null;
}
var hsl = /^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/;
var match = string.match(hsl);
if (match) {
var alpha = parseFloat(match[4]);
var h = (parseFloat(match[1]) + 360) ... | vuln | Vulnerable | JavaScript |
static void dec_misc(DisasContext *dc, uint32_t insn)
{
uint32_t op0, op1;
uint32_t ra, rb, rd;
uint32_t L6, K5, K16, K5_11;
int32_t I16, I5_11, N26;
TCGMemOp mop;
TCGv t0;
op0 = extract32(insn, 26, 6);
op1 = extract32(insn, 24, 2);
ra = extract32(insn, 16, 5);
rb = extract32(ins... | vuln | Vulnerable | C/C++ |
def show_article
auto_discovery_feed
respond_to do |format|
format.html do
@comment = Comment.new
@page_title = this_blog.article_title_template.to_title(@article, this_blog, params)
@description = this_blog.article_desc_template.to_title(@article, this_blog, params)
@keyw... | cwe | CWE-863 | Ruby |
bool MemoryManager::validate_user_read(const Process& process, VirtualAddress vaddr) const
{
auto* region = region_from_vaddr(process, vaddr);
return region && region->is_readable();
} | cwe | CWE-119 | C/C++ |
hufDecode
(const Int64 * hcode, // i : encoding table
const HufDec * hdecod, // i : decoding table
const char* in, // i : compressed input buffer
int ni, // i : input size (in bits)
int rlc, // i : run-length code
int no, // i : expected output size (in bytes)
unsigned short* out... | vuln | Vulnerable | C/C++ |
static void do_trace_enable_events(const char *line_buf)
{
const bool enable = ('-' != line_buf[0]);
const char *line_ptr = enable ? line_buf : line_buf + 1;
if (trace_event_is_pattern(line_ptr)) {
TraceEvent *ev = NULL;
while ((ev = trace_event_pattern(line_ptr, ev)) != NULL) {
... | vuln | Safe | C/C++ |
from pathlib import Path
import sys
import os
import elasticsearch
import yaml
from elasticsearch import Elasticsearch
from flask import current_app, g, request
from tinydb import TinyDB, Query, operations
from urllib.parse import urlparse, urljoin
from archivy.config import BaseHooks, Config
def load_config(path="... | vuln | Safe | Python |
findNextBorderPixel(l_int32 w,
l_int32 h,
l_uint32 *data,
l_int32 wpl,
l_int32 px,
l_int32 py,
l_int32 *pqpos,
l_int32 *pnpx,
l_int32 *pnp... | vuln | Safe | C/C++ |
def get(self):
self.send_error(status_code=403) | vuln | Vulnerable | Python |
App.main=function(b,f){function l(k){mxUtils.getAll("1"!=urlParams.dev?[k]:[k,STYLE_PATH+"/default.xml"],function(m){function q(){var n=null!=f?f():new App(new Editor("0"==urlParams.chrome||"min"==uiTheme,null,null,null,"0"!=urlParams.chrome));if(null!=window.mxscript){if("function"===typeof window.DropboxClient&&null=... | cwe | CWE-20 | JavaScript |
IMPEG2D_ERROR_CODES_T impeg2d_vld_decode(
dec_state_t *ps_dec,
WORD16 *pi2_outAddr, /*!< Address where decoded symbols will be stored */
const UWORD8 *pu1_scan, /*!< Scan table to be used */
UWORD8 *pu1_pos, /*!< Scan table to be used */
UWORD16 u2_intra_flag, /*!< Intra Macroblock or not */... | vuln | Vulnerable | Unknown |
function updateCommandCategorieInDB(){
global $pearDB;
$DBRESULT = $pearDB->query("UPDATE `command_categories` SET `category_name` = '".$_POST["category_name"]."' , `category_alias` = '".$_POST["category_alias"]."' , `category_order` = '".$_POST["category_order"]."' WHERE `cmd_category_id` = '".$_POST["cmd_categ... | cwe | CWE-89 | PHP |
@Override
public boolean processNonQuery(PhysicalPlan plan)
throws QueryProcessException, StorageGroupNotSetException, StorageEngineException {
switch (plan.getOperatorType()) {
case DELETE:
delete((DeletePlan) plan);
return true;
case INSERT:
insert((InsertRowPlan) plan)... | vuln | Safe | Java |
def render_dag_dependencies(deps: dict[str, list[DagDependency]]) -> graphviz.Digraph:
"""
Render the DAG dependency to the DOT object.
:param deps: List of DAG dependencies
:return: Graphviz object
"""
if not graphviz:
raise AirflowException(
"Could not import graphviz. Ins... | vuln | Safe | Python |
void grubfs_free (GrubFS *gf) {
if (gf) {
if (gf->file && gf->file->device)
free (gf->file->device->disk);
free (gf->file);
free (gf);
}
} | cwe | CWE-119 | C/C++ |
SchedulerObject::setAttribute(std::string key,
std::string name,
std::string value,
std::string &text)
{
PROC_ID id = getProcByString(key.c_str());
if (id.cluster < 0 || id.proc < 0) {
dprintf(D_FULLDEBUG, "SetAt... | vuln | Vulnerable | C/C++ |
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11,
# andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh,
# falgh1, grunjol, csitk... | vuln | Vulnerable | Python |
static grpc_resolver *dns_create(grpc_exec_ctx *exec_ctx,
grpc_resolver_args *args,
const char *default_port) {
if (0 != strcmp(args->uri->authority, "")) {
gpr_log(GPR_ERROR, "authority based dns uri's not supported");
return NULL;
}
// Ge... | vuln | Safe | C/C++ |
static int ocfs2_prepare_page_for_write(struct inode *inode, u64 *p_blkno,
struct ocfs2_write_ctxt *wc,
struct page *page, u32 cpos,
loff_t user_pos, unsigned user_len,
int new)
{
int ret;
unsigned int map_from = 0, map_to = 0;
unsigned int cluster_start, cluster_end;
unsigned int user_data_from... | vuln | Vulnerable | Unknown |
# -*- coding: utf-8 -*-
'''
Support for the Git SCM
'''
from __future__ import absolute_import
# Import python libs
import os
import re
import subprocess
# Import salt libs
from salt import utils
from salt.exceptions import SaltInvocationError, CommandExecutionError
from salt.ext.six.moves.urllib.parse import urlpars... | vuln | Safe | Python |
/*
* 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 |
static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, DCTELEM *block)
{
int last_index = gb->size_in_bits;
const uint8_t *scan_table = mb->scan_table;
const uint32_t *factor_table = mb->factor_table;
int pos = mb->pos;
int partial_bit_count = mb->partial_bit_count;
int leve... | vuln | Vulnerable | C/C++ |
static int qemu_rbd_snap_list(BlockDriverState *bs,
QEMUSnapshotInfo **psn_tab)
{
BDRVRBDState *s = bs->opaque;
QEMUSnapshotInfo *sn_info, *sn_tab = NULL;
int i, snap_count;
rbd_snap_info_t *snaps;
int max_snaps = RBD_MAX_SNAPS;
do {
snaps = g_malloc(sizeof(... | vuln | Safe | C/C++ |
char *target_strerror(int err)
{
return strerror(target_to_host_errno(err)); | vuln | Vulnerable | 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-125 | Python |
static int json_internal_read_object(const char *cp,
const struct json_attr_t *attrs,
const struct json_array_t *parent,
int offset,
const char **end)
{
enum
{ init, await_attr, in_attr, await_value, in_val_string,
in_escape, in_val_token, post_val, post_array
} state = ... | vuln | Vulnerable | Unknown |
QPDF::lengthNextN(int first_object, int n,
std::list<std::string>& errors)
{
int length = 0;
for (int i = 0; i < n; ++i)
{
QPDFObjGen og(first_object + i, 0);
if (this->m->xref_table.count(og) == 0)
{
errors.push_back(
"no xref table entry for " +
QUtil::int_to_string(first_object + i) + " 0... | cwe | CWE-787 | Unknown |
"""
This contains a bunch of RFC7230 definitions and regular expressions that are
needed to properly parse HTTP messages.
"""
import re
from .compat import tobytes
WS = "[ \t]"
OWS = WS + "{0,}?"
RWS = WS + "{1,}?"
BWS = OWS
# RFC 7230 Section 3.2.6 "Field Value Components":
# tchar = "!" / "#" / "$" / "%"... | cwe | CWE-400 | Python |
status_t OMXNodeInstance::getParameter(
OMX_INDEXTYPE index, void *params, size_t /* size */) {
Mutex::Autolock autoLock(mLock);
OMX_ERRORTYPE err = OMX_GetParameter(mHandle, index, params);
OMX_INDEXEXTTYPE extIndex = (OMX_INDEXEXTTYPE)index;
if (err != OMX_ErrorNoMore) {
CLOG_IF_ERR... | cwe | CWE-200 | C/C++ |
struct mnt_namespace *copy_mnt_ns(unsigned long flags, struct mnt_namespace *ns,
struct user_namespace *user_ns, struct fs_struct *new_fs)
{
struct mnt_namespace *new_ns;
struct vfsmount *rootmnt = NULL, *pwdmnt = NULL;
struct mount *p, *q;
struct mount *old;
struct mount *new;
int copy_flags;
BUG_ON(!ns);
... | cwe | CWE-400 | C/C++ |
package auth
import (
"time"
"github.com/golang-jwt/jwt"
"github.com/sipcapture/homer-app/model"
"github.com/sipcapture/homer-app/utils/logger"
)
// jwt token claims which contains info regarding user
type JwtUserClaim struct {
UserName string `json:"username"`
UserAdmin bool `json:"useradmin"`
... | cwe | CWE-798 | Go |
function _init(index) {
i = keys[index];
path = prefix + i;
schemaType = docSchema.path(path);
// Should still work if not a model-level discriminator, but should not be
// necessary. This is *only* to catch the case where we queried using the
// base model and the discriminated model has a pro... | cwe | CWE-1321 | JavaScript |
static libspdm_return_t libspdm_try_get_capabilities(libspdm_context_t *spdm_context)
{
libspdm_return_t status;
spdm_get_capabilities_request_t *spdm_request;
size_t spdm_request_size;
spdm_capabilities_response_t *spdm_response;
size_t spdm_response_size;
uint8_t *message;
size_t message_s... | vuln | Vulnerable | C/C++ |
htmlParseSystemLiteral(htmlParserCtxtPtr ctxt) {
size_t len = 0, startPosition = 0;
xmlChar *ret = NULL;
if (CUR == '"') {
NEXT;
if (CUR_PTR < BASE_PTR)
return(ret);
startPosition = CUR_PTR - BASE_PTR;
while ((IS_CHAR_CH(CUR)) && (CUR != '"')) {
NEXT;
len++;... | vuln | Safe | Unknown |
static void hci_disconn_loglink_complete_evt(struct hci_dev *hdev,
struct sk_buff *skb)
{
struct hci_ev_disconn_logical_link_complete *ev = (void *) skb->data;
struct hci_chan *hchan;
BT_DBG("%s log handle 0x%4.4x status 0x%2.2x", hdev->name,
le16_to_cpu(ev->handle), ev->status);
if (ev->status)... | cwe | CWE-416 | Unknown |
var http = require('http');
var querystring = require('querystring');
var errorTemplate = require('../templates/error.js');
const snip = require('../snip.js');
const genReqLogLine = ({ head, method, path, params, suffix }) =>
!process.appParams.color
? [
head,
method,
path[0] + (path.leng... | vuln | Safe | JavaScript |
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/permissions/chooser_title_util.h"
#include "components/url_formatter/elide_url.h"
#include "content/public/browser/render_frame_host... | vuln | Safe | C/C++ |
TfLiteStatus lstm_eval(TfLiteContext* context, TfLiteNode* node, Logger* logger,
ErrorReporter* error_reporter) {
const auto* params = static_cast<TfLiteLSTMParams*>(node->builtin_data);
const TfLiteTensor* input;
TF_LITE_ENSURE_OK(
context, GetInputSafe(context, node,
... | vuln | Safe | C/C++ |
def self.execute_action_move(mail_filter, email, val)
mail_folder_id = val
SqlHelper.validate_token([mail_folder_id])
begin
mail_folder = MailFolder.find(mail_folder_id)
rescue => evar
end
if !mail_folder.nil? and (mail_folder.user_id == email.user_id)
email.update_attribute(:mail_... | vuln | Safe | Ruby |
evbuffer_drain(struct evbuffer *buf, size_t len)
{
struct evbuffer_chain *chain, *next;
size_t remaining, old_len;
int result = 0;
EVBUFFER_LOCK(buf);
old_len = buf->total_len;
if (old_len == 0)
goto done;
if (buf->freeze_start) {
result = -1;
goto done;
}
if (len >= old_len && !HAS_PINNED_R(buf)) {
... | vuln | Vulnerable | Unknown |
int redisContextConnectUnix(redisContext *c, const char *path, const struct timeval *timeout) {
int blocking = (c->flags & REDIS_BLOCK);
struct sockaddr_un *sa;
long timeout_msec = -1;
if (redisCreateSocket(c,AF_UNIX) < 0)
return REDIS_ERR;
if (redisSetBlocking(c,0) != REDIS_OK)
ret... | vuln | Vulnerable | C/C++ |
TfLiteStatus EvalSimple(TfLiteContext* context, TfLiteNode* node,
const TfLiteTensor* lookup, const TfLiteTensor* value,
TfLiteTensor* output) {
const int row_size = SizeOfDimension(value, 0);
const int row_bytes = value->bytes / row_size;
char* output_raw = GetTen... | cwe | CWE-369 | C/C++ |
static int timebase_post_load(void *opaque, int version_id)
{
PPCTimebase *tb_remote = opaque;
CPUState *cpu;
PowerPCCPU *first_ppc_cpu = POWERPC_CPU(first_cpu);
int64_t tb_off_adj, tb_off, ns_diff;
int64_t migration_duration_ns, migration_duration_tb, guest_tb, host_ns;
unsigned long freq;
... | vuln | Vulnerable | C/C++ |
public Object[] getAttributes(String attributeName) {
if (StringHelper.isEmpty(attributeName)) {
return null;
}
Object[] values = null;
for (GluuCustomAttribute attribute : getCustomAttributes()) {
if (StringHelper.equalsIgnoreCase(attribute.getName(), attributeName)) {
values = attribute.getValues()... | vuln | Safe | Java |
(function()
{
Sidebar.prototype.addInfographicPalette = function()
{
var w = 100;
var h = 100;
var s = 'whiteSpace=wrap;html=1;shape=mxgraph.infographic.';
var s2 = mxConstants.STYLE_VERTICAL_LABEL_POSITION + '=bottom;' + mxConstants.STYLE_VERTICAL_ALIGN + '=top;html=1;shape=mxgraph.infographic.';
var s3 = ... | cwe | CWE-79 | Java |
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-2016 Facebook, Inc. (http://www.facebook.com) |
| Copyrigh... | cwe | CWE-843 | C/C++ |
exif_data_load_data_entry (ExifData *data, ExifEntry *entry,
const unsigned char *d,
unsigned int size, unsigned int offset)
{
unsigned int s, doff;
entry->tag = exif_get_short (d + offset + 0, data->priv->order);
entry->format = exif_get_short (d + offset + 2, data->priv->order);
entry->com... | vuln | Safe | C/C++ |
/* schema_init.c - init builtin schema */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2020 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as auth... | vuln | Safe | C/C++ |
package runtime
import (
"archive/tar"
"compress/gzip"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"time"
"github.com/containers/image/types"
"github.com/pkg/errors"
)
func UnpackImage(src types.Image, target string) error {
ref := src.Reference()
unpackLayer, err := getLayerUnpacker(ref)
if err != nil {
... | cwe | CWE-22 | Go |
def delete(self, id):
"""
Delete node
---
description: >-
Delete node from organization. Only users that belong to the
organization of the node can delete it.\n
### Permission Table\n
|Rule name|Scope|Operation|Assigned to node|Assigned to contain... | vuln | Safe | Python |
sc_pkcs15emu_esteid_init (sc_pkcs15_card_t * p15card)
{
sc_card_t *card = p15card->card;
unsigned char buff[128];
int r, i;
size_t field_length = 0, modulus_length = 0;
sc_path_t tmppath;
set_string (&p15card->tokeninfo->label, "ID-kaart");
set_string (&p15card->tokeninfo->manufacturer_id, "AS Sertifitseerimisk... | vuln | Vulnerable | C/C++ |
PJ_DEF(pj_status_t) pjmedia_wav_playlist_create(pj_pool_t *pool,
const pj_str_t *port_label,
const pj_str_t file_list[],
int file_count,
unsigned ptime,
unsigned options,
pj_ssize_t buff_size,
pjmedia_port **p_port)
{
struct playlist_port *fport;
pjmedia_audio_format_de... | cwe | CWE-835 | C/C++ |
public static Object instantiate(String classname, Properties info, boolean tryString,
@Nullable String stringarg)
throws ClassNotFoundException, SecurityException, NoSuchMethodException,
IllegalArgumentException, InstantiationException, IllegalAccessException,
InvocationTargetException ... | cwe | CWE-665 | Java |
/* schema_init.c - init builtin schema */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2020 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as auth... | vuln | Safe | C/C++ |
/** BEGIN COPYRIGHT BLOCK
* Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
* Copyright (C) 2005 Red Hat, Inc.
* All rights reserved.
*
* License: GPL (version 3 or any later version).
* See LICENSE for details.
* END COPYRIGHT BLOCK **/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* ldbm_con... | vuln | Safe | C/C++ |
def on_moved
Log.add_info(request, params.inspect)
location_id = params[:id]
if location_id.nil? or location_id.empty?
location = Location.get_for(@login_user)
if location.nil?
location = Location.new
location.user_id = @login_user.id
end
else
begin
loca... | cwe | CWE-89 | Ruby |
package com.salesmanager.shop.admin.controller.products;
import com.salesmanager.core.business.services.catalog.product.manufacturer.ManufacturerService;
import com.salesmanager.core.business.services.reference.language.LanguageService;
import com.salesmanager.core.business.utils.CoreConfiguration;
import com.salesman... | cwe | CWE-79 | Java |
_pickle_PicklerMemoProxy_copy_impl(PicklerMemoProxyObject *self)
/*[clinic end generated code: output=bb83a919d29225ef input=b73043485ac30b36]*/
{
Py_ssize_t i;
PyMemoTable *memo;
PyObject *new_memo = PyDict_New();
if (new_memo == NULL)
return NULL;
memo = self->pickler->memo;
for (i = ... | cwe | CWE-369 | Unknown |
void * CAPSTONE_API cs_winkernel_malloc(size_t size)
{
// Disallow zero length allocation because they waste pool header space and,
// in many cases, indicate a potential validation issue in the calling code.
NT_ASSERT(size);
// FP; a use of NonPagedPool is required for Windows 7 support
#pragma prefast(suppress :... | cwe | CWE-190 | Unknown |
dispose (GObject *object)
{
NMAGConfSettingsPrivate *priv = NMA_GCONF_SETTINGS_GET_PRIVATE (object);
if (priv->disposed)
return;
priv->disposed = TRUE;
g_hash_table_destroy (priv->pending_changes);
if (priv->read_connections_id) {
g_source_remove (priv->read_connections_id);
priv->read_connections_id = 0... | cwe | CWE-200 | Unknown |
static int check_cond_jmp_op(struct bpf_verifier_env *env,
struct bpf_insn *insn, int *insn_idx)
{
struct bpf_verifier_state *this_branch = env->cur_state;
struct bpf_verifier_state *other_branch;
struct bpf_reg_state *regs = this_branch->frame[this_branch->curframe]->regs;
struct bpf_reg_state *dst_reg, *o... | vuln | Vulnerable | C/C++ |
# -*- coding: utf-8 -*-
# rdiffweb, A web interface to rdiff-backup repositories
# Copyright (C) 2012-2021 rdiffweb contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version ... | vuln | Safe | Python |
static void ppp_cp_parse_cr(struct net_device *dev, u16 pid, u8 id,
unsigned int req_len, const u8 *data)
{
static u8 const valid_accm[6] = { LCP_OPTION_ACCM, 6, 0, 0, 0, 0 };
const u8 *opt;
u8 *out;
unsigned int len = req_len, nak_len = 0, rej_len = 0;
if (!(out = kmalloc(len, GFP_ATOMIC))) {
dev->stats... | cwe | CWE-20 | C/C++ |
/*
* Copyright (C) Igor Sysoev
* Copyright (C) NGINX, Inc.
*/
#include <njs_main.h>
static njs_int_t njs_vm_init(njs_vm_t *vm);
static njs_int_t njs_vm_handle_events(njs_vm_t *vm);
const njs_str_t njs_entry_main = njs_str("main");
const njs_str_t njs_entry_module = njs_str("module");
const... | cwe | CWE-416 | C/C++ |
function fromUrl (giturl, opts) {
if (giturl == null || giturl === '') return
var url = fixupUnqualifiedGist(
isGitHubShorthand(giturl) ? 'github:' + giturl : giturl
)
var parsed = parseGitUrl(url)
var shortcutMatch = url.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/) | vuln | Safe | JavaScript |
static av_always_inline void MPV_motion_internal(MpegEncContext *s,
uint8_t *dest_y, uint8_t *dest_cb,
uint8_t *dest_cr, int dir,
uint8_t **ref_picture,
op_pixels_func (*pix_op)[4],
... | vuln | Safe | C/C++ |
bool SM_io_parser<Decorator_>::read_face(SFace_handle f)
{ // syntax: index { fclist, ivlist, loop, mark }
int n, ei, vi, li; Mark m;
if ( !(in >> n) || !check_sep("{") ) return false;
while (in >> ei) {
CGAL_assertion_msg(ei >= 0 && ei < en,
"wrong index in face cycle list.");
... | cwe | CWE-269 | Unknown |
# Copyright (C) 2016 Kristoffer Gronlund <kgronlund@suse.com>
# See COPYING for license information.
#
# Bootstrap:
#
# Supersedes and replaces both the init/add/remove cluster scripts,
# and the ha-cluster-bootstrap scripts.
#
# Implemented as a straight-forward set of python functions for
# simplicity and flexibility... | cwe | CWE-77 | Python |
def fetch(cls) -> "InstanceConfig":
entry = cls.get(get_instance_name())
if entry is None:
entry = cls()
entry.save()
return entry | cwe | CWE-863 | Python |
public String toXml() throws DonkeyElementException {
Writer writer = new StringWriter();
try {
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
transformer.setOutputPr... | vuln | Vulnerable | Java |
public function isLocal() {
$localhosts = array('::1', '127.0.0.1', '0.0.0.0');
return (
in_array(server::get('SERVER_ADDR'), $localhosts) ||
server::get('SERVER_NAME') == 'localhost' ||
str::endsWith(server::get('SERVER_NAME'), '.localhost') ||
str::endsWith(server::get('SERVER_NAME'), ... | cwe | CWE-346 | PHP |
protected function taskBackup()
{
if (!$this->authorizeTask('backup', ['admin.maintenance', 'admin.super'])) {
$this->admin->json_response = [
'status' => 'error',
'message' => $this->admin::translate('PLUGIN_ADMIN.INSUFFICIENT_PERMISSIONS_FOR_TASK')
... | cwe | CWE-79 | PHP |
static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt, struct net_device *orig_dev)
{
struct sock *sk;
struct packet_sock *po;
struct sockaddr_ll *sll;
union tpacket_uhdr h;
u8 *skb_head = skb->data;
int skb_len = skb->len;
unsigned int snaplen, res;
unsigned long s... | vuln | Safe | C/C++ |
# -*- coding: utf-8 -*-
# rdiffweb, A web interface to rdiff-backup repositories
# Copyright (C) 2012-2021 rdiffweb contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version ... | cwe | CWE-770 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.