code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
protected void getTypes(List<Type> types, Set<Feature> visitedFeatures) { visitedFeatures.add(this); getFeatureTypes(types, visitedFeatures); Conjugation conjugator = getOwnedConjugator(); if (conjugator != null) { Type originalType = conjugator.getOriginalType(); if (originalType instanceof Feature) { ...
vuln
Safe
Java
static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode, ExceptionInfo *exception) { CacheInfo *magick_restrict cache_info, source_info; char format[MaxTextExtent], message[MaxTextExtent]; const char *type; MagickSizeType length, number_pixels; MagickStatusTyp...
vuln
Safe
C/C++
def delete(request, pk, remove=True): comment = get_object_or_404(Comment, pk=pk) if is_post(request): (Comment.objects .filter(pk=pk) .update(is_removed=remove)) return safe_redirect(request, 'next', comment.get_absolute_url()) return render( request=request, ...
vuln
Safe
Python
// Copyright 2020 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 "chrome/browser/renderer_context_menu/link_to_text_menu_observer.h" #include <memory> #include "base/memory/ptr_util.h" #include "base/no_destr...
cwe
CWE-416
C/C++
long Cluster::GetNext( const BlockEntry* pCurr, const BlockEntry*& pNext) const { assert(pCurr); assert(m_entries); assert(m_entries_count > 0); size_t idx = pCurr->GetIndex(); assert(idx < size_t(m_entries_count)); assert(m_entries[idx] == pCurr); ++idx; if (idx >= size_t...
vuln
Vulnerable
C/C++
async single(obj, args) { return WIKI.models.groups.query().findById(args.id) }
cwe
CWE-287
JavaScript
public String[] getDownloadLocations() { return downloadLocations != null ? downloadLocations.clone() : null; }
vuln
Safe
Java
int dtls1_get_record(SSL *s) { int ssl_major, ssl_minor; int i, n; SSL3_RECORD *rr; unsigned char *p = NULL; unsigned short version; DTLS1_BITMAP *bitmap; unsigned int is_next_epoch; rr = &(s->s3->rrec); again: /* * The epoch may have changed. If so, process all the pending ...
vuln
Vulnerable
Unknown
def _request( self, conn, host, absolute_uri, request_uri, method, body, headers, redirections, cachekey, ): """Do the actual request using the connection object and also follow one level of redirects if necessary""" auths = [(auth.depth(request_uri), auth) for auth in self.authoriz...
vuln
Safe
Python
SchedulerObject::remove(std::string key, std::string &reason, std::string &text) { PROC_ID id = getProcByString(key.c_str()); if (id.cluster < 0 || id.proc < 0) { dprintf(D_FULLDEBUG, "Remove: Failed to parse id: %s\n", key.c_str()); text = "Invalid Id"; r...
cwe
CWE-20
C/C++
/* 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-190
Python
int am_check_url(request_rec *r, const char *url) { const char *i; if (url == NULL) { return HTTP_BAD_REQUEST; } for (i = url; *i; i++) { if (*i >= 0 && *i < ' ') { /* Deny all control-characters. */ AM_LOG_RERROR(APLOG_MARK, APLOG_ERR, HTTP_BAD_REQUEST, r, ...
vuln
Safe
C/C++
createenv(const struct rule *rule) { struct env *env; u_int i; env = malloc(sizeof(*env)); if (!env) err(1, NULL); RB_INIT(&env->root); env->count = 0; if (rule->options & KEEPENV) { extern char **environ; for (i = 0; environ[i] != NULL; i++) { struct envnode *node; const char *e, *eq; size_t l...
cwe
CWE-909
C/C++
/** @odoo-module **/ import { registry } from "@web/core/registry"; import { Many2ManyTagsAvatarUserField, KanbanMany2ManyTagsAvatarUserField, many2ManyTagsAvatarUserField, kanbanMany2ManyTagsAvatarUserField, listMany2ManyTagsAvatarUserField, } from "@mail/web/fields/many2many_avatar_user_field/man...
vuln
Vulnerable
JavaScript
static int do_tkill(pid_t tgid, pid_t pid, int sig) { struct siginfo info; info.si_signo = sig; info.si_errno = 0; info.si_code = SI_TKILL; info.si_pid = task_tgid_vnr(current); info.si_uid = from_kuid_munged(current_user_ns(), current_uid()); return do_send_specific(tgid, pid, sig, &info); }
cwe
CWE-399
C/C++
static int i40e_setup_macvlans(struct i40e_vsi *vsi, u16 macvlan_cnt, u16 qcnt, struct net_device *vdev) { struct i40e_pf *pf = vsi->back; struct i40e_hw *hw = &pf->hw; struct i40e_vsi_context ctxt; u16 sections, qmap, num_qps; struct i40e_channel *ch; int i, pow, ret = 0; u8 offset = 0; if (vsi->typ...
cwe
CWE-401
C/C++
static void sig_print_starting(TEXT_DEST_REC *dest) { IRC_SERVER_REC *rec; if (printing_splits) return; if (!IS_IRC_SERVER(dest->server)) return; if (!server_ischannel(dest->server, dest->target)) return; rec = IRC_SERVER(dest->server); if (rec->split_servers != NULL) print_splits(rec, NULL); }
cwe
CWE-416
Unknown
static __init int seqgen_init(void) get_random_bytes(random_int_secret, sizeof(random_int_secret)); return 0; }
vuln
Safe
C/C++
BlockDriverAIOCB *bdrv_aio_read(BlockDriverState *bs, int64_t sector_num, uint8_t *buf, int nb_sectors, BlockDriverCompletionFunc *cb, void *opaque) { BlockDriver *drv = bs->drv; BlockDriverAIOCB *ret; if (!drv) return NULL; if...
vuln
Safe
C/C++
public function read($sessionId) { $sql = "SELECT $this->dataCol FROM $this->table WHERE $this->idCol = :id"; try { $stmt = $this->pdo->prepare($sql); $stmt->bindParam(':id', $sessionId, \PDO::PARAM_STR); $stmt->execute(); // We use fetchAll instead ...
vuln
Vulnerable
JavaScript
public static File createTempFile(String prefix, String suffix, File directory) throws IOException { if (javaVersion() >= 7) { if (directory == null) { return Files.createTempFile(prefix, suffix).toFile(); } return Files.createTempFile(directory.toPath(), pref...
cwe
CWE-668
Java
{% load i18n %} {% load inventree_extras %} {% load status_codes %} /* globals attachSelect, closeModal, constructField, constructFormBody, getFormFieldValue, global_settings, handleFormErrors, imageHoverIcon, inventreeDelete, inventreeGet, inventreePut, launchModalForm,...
vuln
Vulnerable
Python
public static Object retryOrThrowException( StatusRuntimeException ex, boolean retry, RetryCallInterface<?> retryCallInterface, Integer requestTimeout) { String errorMessage = ex.getMessage(); LOGGER.debug(errorMessage); if (ex.getStatus().getCode().value() == Code.UNAVAILABLE_VALUE)...
vuln
Vulnerable
Java
/* * This file is provided under a dual BSD/GPLv2 license. When using or * redistributing this file, you may do so under either license. * * Copyright(c) 2012 Intel Corporation. All rights reserved. * * GPL LICENSE SUMMARY * * This program is free software; you can redistribute it and/or modify * it under the...
vuln
Vulnerable
Java
static void GetOutboundPinholeTimeout(struct upnphttp * h, const char * action, const char * ns) { int r; static const char resp[] = "<u:%sResponse " "xmlns:u=\"%s\">" "<OutboundPinholeTimeout>%d</OutboundPinholeTimeout>" "</u:%sResponse>"; char body[512]; int bodylen; struct NameValueParserData data; c...
vuln
Vulnerable
C/C++
bool DataReductionProxyConfig::IsFetchInFlight() const { DCHECK(thread_checker_.CalledOnValidThread()); return warmup_url_fetcher_->IsFetchInFlight(); }
cwe
CWE-416
C/C++
htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur, const char *encoding ATTRIBUTE_UNUSED) { xmlChar *value; /* * The html output method should not escape a & character * occurring in an attribute value immediately followed by * a { character (see Section B.7.1 ...
vuln
Vulnerable
C/C++
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
vuln
Vulnerable
Python
import { FlowRouter } from 'meteor/ostrio:flow-router-extra' import dayjs from 'dayjs' import utc from 'dayjs/plugin/utc' import customParseFormat from 'dayjs/plugin/customParseFormat' import randomColor from 'randomcolor' import { t } from '../../utils/i18n.js' import { emojify, getUserSetting, getGlobalSetting,...
cwe
CWE-79
JavaScript
static char* allocFromUTF32(const char32_t* in, size_t len) { if (len == 0) { return getEmptyString(); } const ssize_t resultStrLen = utf32_to_utf8_length(in, len) + 1; if (resultStrLen < 1) { return getEmptyString(); } SharedBuffer* buf = SharedBuffer::alloc(resultStrLen);...
vuln
Safe
C/C++
xfs_attr3_leaf_list_int( struct xfs_buf *bp, struct xfs_attr_list_context *context) { struct attrlist_cursor_kern *cursor; struct xfs_attr_leafblock *leaf; struct xfs_attr3_icleaf_hdr ichdr; struct xfs_attr_leaf_entry *entries; struct xfs_attr_leaf_entry *entry; int retval; int i; struct xfs_mount *m...
vuln
Safe
C/C++
int rtl_usb_probe(struct usb_interface *intf, const struct usb_device_id *id, struct rtl_hal_cfg *rtl_hal_cfg) { int err; struct ieee80211_hw *hw = NULL; struct rtl_priv *rtlpriv = NULL; struct usb_device *udev; struct rtl_usb_priv *usb_priv; hw = ieee80211_alloc_hw(sizeof(struct rtl_priv) + sizeof(s...
vuln
Vulnerable
C/C++
def load(klass): """ Insantiates the configuration by attempting to load the configuration from YAML files specified by the CONF_PATH module variable. This should be the main entry point for configuration. """ config = klass() for path in klass.CONF_PATHS: ...
vuln
Vulnerable
Python
QPDF::initializeEncryption() { if (this->m->encryption_initialized) { return; } this->m->encryption_initialized = true; // After we initialize encryption parameters, we must used stored // key information and never look at /Encrypt again. Otherwise, // things could go wrong if someone mut...
cwe
CWE-125
Unknown
static int udp_v6_push_pending_frames(struct sock *sk) { struct sk_buff *skb; struct udphdr *uh; struct udp_sock *up = udp_sk(sk); struct inet_sock *inet = inet_sk(sk); struct flowi6 *fl6 = &inet->cork.fl.u.ip6; int err = 0; int is_udplite = IS_UDPLITE(sk); __wsum csum = 0; /* Grab the skbuff where UDP heade...
cwe
CWE-399
C/C++
static char *load_text_file(const char *path, unsigned flags) { FILE *fp = fopen(path, "r"); if (!fp) { if (!(flags & DD_FAIL_QUIETLY_ENOENT)) perror_msg("Can't open file '%s'", path); return (flags & DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE ? NULL : xstrdup("")); } struct st...
cwe
CWE-264
Unknown
from collections import defaultdict from typing import Iterable import graphene from django.core.exceptions import ValidationError from django.db import transaction from django.db.models import Exists, OuterRef, Q, Subquery from django.db.models.fields import IntegerField from django.db.models.functions import Coalesc...
cwe
CWE-20
Python
static void huffman_decode_row(x3f_info_t *I, x3f_directory_entry_t *DE, int bits, int row, int offset, int *minimum) { x3f_directory_entry_header_t *DEH = &DE->header; x3f_image_data_t *ID = &DEH->data_subsection.image_data; x3f_huffman_t *HUF = ID->huffman; int16_t c[3] = {(int...
cwe
CWE-125
C/C++
static int rd_build_device_space(struct rd_dev *rd_dev) { u32 i = 0, j, page_offset = 0, sg_per_table, sg_tables, total_sg_needed; u32 max_sg_per_table = (RD_MAX_ALLOCATION_SIZE / sizeof(struct scatterlist)); struct rd_dev_sg_table *sg_table; struct page *pg; struct scatterlist *sg; if (rd_dev->rd_page_count...
cwe
CWE-264
Unknown
@Override public void reportSaturationBombardmentFinished(InteractionDialogAPI dialog, MarketAPI market, MarketCMD.TempData actionData) { List<FactionAPI> hostile = actionData.willBecomeHostile; Map<String, Integer> atrocities = getAtrocitiesByFaction(); for (FactionAPI rage : hostile) { NexUtils.modifyMapEnt...
vuln
Vulnerable
Java
@Override public void getAuthToken( IAccountManagerResponse response, final Account account, final String authTokenType, final boolean notifyOnAuthFailure, final boolean expectActivityLaunch, final Bundle loginOptions) { Bundle.setDefus...
vuln
Vulnerable
Java
static int acm_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct usb_cdc_union_desc *union_header = NULL; struct usb_cdc_call_mgmt_descriptor *cmgmd = NULL; unsigned char *buffer = intf->altsetting->extra; int buflen = intf->altsetting->extralen; struct usb_interface *control_interf...
vuln
Vulnerable
C/C++
/********************************************************************************/ /* */ /* Marshalling and unmarshalling of state */ /* Written by Stefan Berger */ /* IBM Thomas J. Watson Research Center */ /* */ /* (c) Copyright IBM Corporation 2017,2018. */ /* ...
vuln
Safe
C/C++
static void xhci_intr_raise(XHCIState *xhci, int v) { PCIDevice *pci_dev = PCI_DEVICE(xhci); xhci->intr[v].erdp_low |= ERDP_EHB; xhci->intr[v].iman |= IMAN_IP; xhci->usbsts |= USBSTS_EINT; if (!(xhci->intr[v].iman & IMAN_IE)) { if (!(xhci->usbcmd & USBCMD_INTE)) { if (msix_enabled(pci_dev)) ...
vuln
Vulnerable
C/C++
static CharDriverState *qemu_chr_open_stdio(ChardevStdio *opts) { CharDriverState *chr; if (is_daemonized()) { error_report("cannot use stdio with -daemonize"); return NULL; } old_fd0_flags = fcntl(0, F_GETFL); tcgetattr (0, &oldtty); qemu_set_nonblock(0); atexit(term_exit); ...
vuln
Vulnerable
C/C++
// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later /* Copyright 2020 IBM Corp. */ #ifndef pr_fmt #define pr_fmt(fmt) "EDK2_COMPAT: " fmt #endif #include <opal.h> #include <string.h> #include <time.h> #include <unistd.h> #include <stdint.h> #include <ccan/endian/endian.h> #include <mbedtls/error.h> #include <de...
vuln
Safe
C/C++
/* * Copyright 2016 Red Hat, Inc. and/or its affiliates * and other contributors as indicated by the @author tags. * * 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.apach...
cwe
CWE-287
Java
uint64_t helper_tick_get_count(void *opaque) { #if !defined(CONFIG_USER_ONLY) return cpu_tick_get_count(opaque); #else return 0; #endif }
vuln
Vulnerable
C/C++
static void property_get_enum(Object *obj, Visitor *v, void *opaque, const char *name, Error **errp) { EnumProperty *prop = opaque; int value; value = prop->get(obj, errp); visit_type_enum(v, &value, prop->strings, NULL, name, errp); }
vuln
Vulnerable
C/C++
static int apparmor_setprocattr(struct task_struct *task, char *name, void *value, size_t size) { char *command, *args = value; size_t arg_size; int error; if (size == 0) return -EINVAL; /* args points to a PAGE_SIZE buffer, AppArmor requires that * the buffer must be null terminated or have size <= PAGE_...
cwe
CWE-20
C/C++
SQLWCHAR* _single_string_alloc_and_expand( LPCSTR in ) { SQLWCHAR *chr; int len = 0; if ( !in ) { return in; } while ( in[ len ] != 0 ) { len ++; } chr = malloc( sizeof( SQLWCHAR ) * ( len + 1 )); len = 0; while ( in[ len ] != 0 ) { chr[ len ] ...
vuln
Vulnerable
C/C++
static int mkv_write_attachments(AVFormatContext *s) { MatroskaMuxContext *mkv = s->priv_data; AVIOContext *dyn_cp, *pb = s->pb; ebml_master attachments; AVLFG c; int i, ret; if (!mkv->have_attachments) return 0; mkv->attachments = av_mallocz(sizeof(*mkv->attachments)); if (!mkv-...
vuln
Safe
C/C++
char *qdist_pr_plain(const struct qdist *dist, size_t n) { struct qdist binned; char *ret; if (dist->n == 0) { return g_strdup(QDIST_EMPTY_STR); } qdist_bin__internal(&binned, dist, n); ret = qdist_pr_internal(&binned); qdist_destroy(&binned); return ret; }
vuln
Safe
C/C++
// SPDX-License-Identifier: GPL-2.0-only /* * linux/kernel/fork.c * * Copyright (C) 1991, 1992 Linus Torvalds */ /* * 'fork.c' contains the help-routines for the 'fork' system call * (see also entry.S and others). * Fork is rather simple, once you get the hang of it, but the memory * management can be a bi...
vuln
Vulnerable
C/C++
bool run(OperationContext* opCtx, const string& dbname, const BSONObj& cmdObj, BSONObjBuilder& result) { auth::CreateOrUpdateUserArgs args; Status status = auth::parseCreateOrUpdateUserCommands(cmdObj, "updateUser", dbname, &args); if (!status.isOK()) { ...
vuln
Safe
Unknown
static js_Ast *logand(js_State *J, int notin) { js_Ast *a = bitor(J, notin); if (jsP_accept(J, TK_AND)) { INCREC(); a = EXP2(LOGAND, a, logand(J, notin)); DECREC(); } return a; }
vuln
Safe
Unknown
TPMI_DH_PARENT_Unmarshal(TPMI_DH_PARENT *target, BYTE **buffer, INT32 *size, BOOL allowNull) { TPM_RC rc = TPM_RC_SUCCESS; TPMI_DH_PARENT orig_target = *target; // libtpms added if (rc == TPM_RC_SUCCESS) { rc = TPM_HANDLE_Unmarshal(target, buffer, size); } if (rc == TPM_RC_SUCCESS) { BOOL i...
vuln
Safe
Unknown
static int pxa2xx_ssp_load(QEMUFile *f, void *opaque, int version_id) { PXA2xxSSPState *s = (PXA2xxSSPState *) opaque; int i; s->enable = qemu_get_be32(f); qemu_get_be32s(f, &s->sscr[0]); qemu_get_be32s(f, &s->sscr[1]); qemu_get_be32s(f, &s->sspsp); qemu_get_be32s(f, &s->ssto); qemu_get_...
vuln
Vulnerable
C/C++
NORET_TYPE void do_exit(long code) { struct task_struct *tsk = current; int group_dead; profile_task_exit(tsk); WARN_ON(atomic_read(&tsk->fs_excl)); if (unlikely(in_interrupt())) panic("Aiee, killing interrupt handler!"); if (unlikely(!tsk->pid)) panic("Attempted to kill the idle task!"); tracehook_repor...
vuln
Safe
Unknown
void CClient::EchoMessage(const CMessage& Message) { CMessage EchoedMessage = Message; for (CClient* pClient : GetClients()) { if (pClient->HasEchoMessage() || (pClient != this && (m_pNetwork->IsChan(Message.GetParam(0)) || pClient->HasSelfMessage()))) { ...
cwe
CWE-476
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-22
Go
/************************************************************************** * * Copyright (c) 2000-2003 Intel Corporation * All rights reserved. * Copyright (c) 2012 France Telecom All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provid...
cwe
CWE-284
C/C++
static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset, ssize_t size, void *private) { ext4_io_end_t *io_end = iocb->private; struct workqueue_struct *wq; /* if not async direct IO or dio with 0 bytes write, just return */ if (!io_end || !size) return; ext_debug("ext4_end_io_dio(): io_end ...
vuln
Vulnerable
Unknown
status_t Parcel::readUtf8FromUtf16(std::string* str) const { size_t utf16Size = 0; const char16_t* src = readString16Inplace(&utf16Size); if (!src) { return UNEXPECTED_NULL; } if (utf16Size == 0u) { str->clear(); return NO_ERROR; } // Allow for closing '\0' ssize_t utf8Size = utf1...
vuln
Safe
C/C++
parse_keyblock_image (iobuf_t iobuf, int pk_no, int uid_no, const u32 *sigstatus, kbnode_t *r_keyblock) { gpg_error_t err; PACKET *pkt; kbnode_t keyblock = NULL; kbnode_t node, *tail; int in_cert, save_mode; u32 n_sigs; int pk_count, uid_count; *r_keyblock = NULL; pkt = xtrymal...
vuln
Vulnerable
Unknown
/*! * fullPage 4.0.4 * https://github.com/alvarotrigo/fullPage.js * * @license GPLv3 for open source use only * or Fullpage Commercial License for commercial use * http://alvarotrigo.com/fullPage/pricing/ * * Copyright (C) 2018 http://alvarotrigo.com/fullPage - A project by Alvaro Trigo */ (function (global, factory) ...
cwe
CWE-79
JavaScript
v3_keyid (gcry_mpi_t a, u32 *ki) { byte *buffer, *p; size_t nbytes; if (gcry_mpi_print (GCRYMPI_FMT_USG, NULL, 0, &nbytes, a )) BUG (); /* fixme: allocate it on the stack */ buffer = xmalloc (nbytes); if (gcry_mpi_print( GCRYMPI_FMT_USG, buffer, nbytes, NULL, a )) BUG (); if (nbytes < 8) /* oops ...
cwe
CWE-20
Unknown
def get_comment_msg(comment): """ Checks for the comment kind. If the comment is identified as a system comment, it is formatted accordindly. """ context = webserver_context.get_context() message = comment.message.decode('utf-8') sys_comment = comment_kind_from_thrift_type(ttypes.CommentKind...
vuln
Vulnerable
Python
'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...
vuln
Vulnerable
JavaScript
# -*- 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
Vulnerable
Python
static inline void i2ulaw_array (const int *ptr, int count, unsigned char *buffer) { while (--count >= 0) { if (ptr [count] == INT_MIN) buffer [count] = ulaw_encode [INT_MAX >> (16 + 4)] ; else if (ptr [count] >= 0) buffer [count] = ulaw_encode [ptr [count] >> (16 + 2)] ; else buffer [count] = 0x7F & ulaw...
vuln
Safe
C/C++
$value = str_replace($originalName, $cleanedName, $value); } unset($value); } $result = hash_equals(GeneralUtility::hmac(serialize($fieldChangeFunctions)), $this->parameters['fieldChangeFuncHash']); } return $result; }
cwe
CWE-327
PHP
static int cg_opendir(const char *path, struct fuse_file_info *fi) { struct fuse_context *fc = fuse_get_context(); const char *cgroup; struct file_info *dir_info; char *controller = NULL; if (!fc) return -EIO; if (strcmp(path, "/cgroup") == 0) { cgroup = NULL; controller = NULL; } else { // return list...
cwe
CWE-264
C/C++
package com.nexblocks.authguard.service.exceptions.codes; public enum ErrorCode { ACCOUNT_DOES_NOT_EXIST("AC.011"), ACCOUNT_DUPLICATE_EMAILS("AC.031"), ACCOUNT_DUPLICATE_PHONE_NUMBER("AC.032"), ACCOUNT_EMAIL_REQUIRED("AC.032"), ACCOUNT_PHONE_NUMBER_REQUIRED("AC.032"), APP_DOES_NOT_EXIST("AP.01...
cwe
CWE-287
Java
bool initiate_stratum(struct pool *pool) { bool ret = false, recvd = false, noresume = false, sockd = false; char s[RBUFSIZE], *sret = NULL, *nonce1, *sessionid; json_t *val = NULL, *res_val, *err_val; json_error_t err; int n2size; resend: if (!setup_stratum_socket(pool)) { sockd = false; goto out; } sock...
cwe
CWE-119
C/C++
static ssize_t _hostsock_recv( oe_fd_t* sock_, void* buf, size_t count, int flags) { ssize_t ret = -1; sock_t* sock = _cast_sock(sock_); oe_errno = 0; if (!sock || (count && !buf)) OE_RAISE_ERRNO(OE_EINVAL); if (buf) { if (oe_memset_s(buf, count, 0, count) != O...
cwe
CWE-552
Unknown
import { noopTest, edit, merge } from './helpers.js'; /** * Block-Level Grammar */ export const block = { newline: /^(?: *(?:\n|$))+/, code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/, hr: /^ {0,3}((?:- *){...
cwe
CWE-400
JavaScript
glob_vector (pat, dir, flags) char *pat; char *dir; int flags; { DIR *d; register struct dirent *dp; struct globval *lastlink, *e, *dirlist; register struct globval *nextlink; register char *nextname, *npat, *subdir; unsigned int count; int lose, skip, ndirs, isdir, sdlen, add_current, patl...
vuln
Safe
C/C++
static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long param) { int drive = (long)bdev->bd_disk->private_data; int type = ITYPE(drive_state[drive].fd_device); int i; int ret; int size; union inparam { struct floppy_struct g; /* geometry */ struct format_descr...
cwe
CWE-416
Unknown
static int tm2_read_deltas(TM2Context *ctx, int stream_id) { int d, mb; int i, v; d = get_bits(&ctx->gb, 9); mb = get_bits(&ctx->gb, 5); av_assert2(mb < 32); if ((d < 1) || (d > TM2_DELTAS) || (mb < 1)) { av_log(ctx->avctx, AV_LOG_ERROR, "Incorrect delta table: %i deltas x %i bits\n", d...
vuln
Safe
C/C++
str_lower_case_match(OnigEncoding enc, int case_fold_flag, const UChar* t, const UChar* tend, const UChar* p, const UChar* end) { int lowlen; UChar *q, lowbuf[ONIGENC_MBC_CASE_FOLD_MAXLEN]; while (t < tend) { lowlen = ONIGENC_MBC_CASE_FOLD(enc, case_fold_flag, &p, en...
cwe
CWE-125
C/C++
v8::Local<v8::Value> V8Debugger::collectionEntries(v8::Local<v8::Context> context, v8::Local<v8::Object> object) { if (!enabled()) { NOTREACHED(); return v8::Undefined(m_isolate); } v8::Local<v8::Value> argv[] = { object }; v8::Local<v8::Value> entriesValue = callDebuggerMethod("getCo...
vuln
Safe
C/C++
static void mpeg4_encode_gop_header(MpegEncContext *s) { int hours, minutes, seconds; int64_t time; put_bits(&s->pb, 16, 0); put_bits(&s->pb, 16, GOP_STARTCODE); time = s->current_picture_ptr->f->pts; if (s->reordered_input_picture[1]) time = FFMIN(time, s->reordered_input_picture[1]->...
vuln
Vulnerable
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-732
Java
/* 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-787
C/C++
/* * Copyright (C) 2006 The Android Open Source Project * * 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 app...
cwe
CWE-269
Java
bool IDNSpoofChecker::SafeToDisplayAsUnicode(base::StringPiece16 label, bool is_tld_ascii) { UErrorCode status = U_ZERO_ERROR; int32_t result = uspoof_check(checker_, label.data(), base::checked_cast<int32_t>(label.size()), NULL, &status); if (...
cwe
CWE-20
C/C++
TfLiteStatus SparseToDenseImpl(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* indices = GetInput(context, node, kIndicesTensor); const TfLiteTensor* output_shape = GetInput(context, node, kOutputShapeTensor); const TfLiteTensor* values = GetInput(context, node, kValueInputTensor); const T...
cwe
CWE-125
C/C++
static void virtio_balloon_save(QEMUFile *f, void *opaque) { VirtIOBalloon *s = opaque; virtio_save(&s->vdev, f); qemu_put_be32(f, s->num_pages); qemu_put_be32(f, s->actual); }
vuln
Safe
C/C++
gss_unwrap_iov (minor_status, context_handle, conf_state, qop_state, iov, iov_count) OM_uint32 * minor_status; gss_ctx_id_t context_handle; int * conf_state; gss_qop_t *qop_state; gss_iov_buffer_desc * iov; int iov_count; { /* EXPO...
cwe
CWE-415
C/C++
TfLiteStatus DecodeCenterSizeBoxes(TfLiteContext* context, TfLiteNode* node, OpData* op_data) { // Parse input tensor boxencodings const TfLiteTensor* input_box_encodings = GetInput(context, node, kInputTensorBoxEncodings); TF_LITE_ENSURE_EQ(context, input_box_encodings->d...
cwe
CWE-787
C/C++
/* * Copyright (c) 2022 the Eclipse Milo Authors * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 * which is available at https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 */ package org.eclipse.milo.opcua.sdk.serve...
cwe
CWE-770
Java
bool VaapiVideoDecodeAccelerator::VaapiH264Accelerator::SubmitSlice( const H264PPS* pps, const H264SliceHeader* slice_hdr, const H264Picture::Vector& ref_pic_list0, const H264Picture::Vector& ref_pic_list1, const scoped_refptr<H264Picture>& pic, const uint8_t* data, size_t size) { VASl...
cwe
CWE-362
C/C++
static void shifter_out_im(TCGv var, int shift) { TCGv tmp = tcg_temp_new_i32(); if (shift == 0) { tcg_gen_andi_i32(tmp, var, 1); } else { tcg_gen_shri_i32(tmp, var, shift); if (shift != 31) tcg_gen_andi_i32(tmp, tmp, 1); } gen_set_CF(tmp); tcg_temp_free_i32(t...
vuln
Safe
C/C++
dissect_u3v(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { gint offset = 0; proto_tree *u3v_tree = NULL, *ccd_tree_flag, *u3v_telegram_tree = NULL, *ccd_tree = NULL; gint data_length = 0; gint req_id = 0; gint command_id = -1; gint status = 0; guint prefix = 0; proto_...
cwe
CWE-476
C/C++
flatpak_dir_ensure_bundle_remote (FlatpakDir *self, GFile *file, GBytes *extra_gpg_data, FlatpakDecomposed **out_ref, char **out_checksum,...
cwe
CWE-276
C/C++
import base64 import simplejson import cgi from twisted.web import server, resource from twisted.application import internet from twisted.web.server import Site, GzipEncoderFactory import twisted.web.resource from twisted.web.resource import Resource, EncodingResourceWrapper, \ Forbidd...
vuln
Safe
Python
/* * Copyright (C) the libgit2 contributors. All rights reserved. * * This file is part of libgit2, distributed under the GNU GPL v2 with * a Linking Exception. For full terms see the included COPYING file. */ #include "index.h" #include <stddef.h> #include "repository.h" #include "tree.h" #include "tree-cache....
cwe
CWE-415
C/C++
public void encodeDefaultContent(FacesContext context, Tag tag) throws IOException { ResponseWriter writer = context.getResponseWriter(); if (tag.getIcon() != null) { String iconStyleClass = getStyleClassBuilder(context) .add(Tag.ICON_CLASS) .add(tag....
vuln
Vulnerable
Java
Curves16Data* CurvesAlloc(cmsContext ContextID, int nCurves, int nElements, cmsToneCurve** G) { int i, j; Curves16Data* c16; c16 = (Curves16Data*)_cmsMallocZero(ContextID, sizeof(Curves16Data)); if (c16 == NULL) return NULL; c16 ->nCurves = nCurves; c16 ->nElements = nElements; c16->Curve...
cwe
CWE-125
Unknown