code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
def register_user(request): settings = request.registry.settings if not is_registration_enabled(settings): raise exc.exception_response(503) handle_history(request) _ = request.translate config = Config(load(get_path_to_form_config('auth.xml', 'ringo'))) form_config = config.get_form('re...
cwe
CWE-327
Python
void jpc_qmfb_split_colgrp(jpc_fix_t *a, int numrows, int stride, int parity) { int bufsize = JPC_CEILDIVPOW2(numrows, 1); jpc_fix_t splitbuf[QMFB_SPLITBUFSIZE * JPC_QMFB_COLGRPSIZE]; jpc_fix_t *buf = splitbuf; jpc_fix_t *srcptr; jpc_fix_t *dstptr; register jpc_fix_t *srcptr2; register jpc_fix_t *dstptr2; re...
cwe
CWE-189
Unknown
static int qemu_gluster_create(const char *filename, QemuOpts *opts, Error **errp) { struct glfs *glfs; struct glfs_fd *fd; int ret = 0; int prealloc = 0; int64_t total_size = 0; char *tmp = NULL; GlusterConf *gconf = g_malloc0(sizeof(GlusterConf)); glfs = ...
vuln
Vulnerable
C/C++
/* CSV Parse Please look at the [project documentation](https://csv.js.org/parse/) for additional information. */ const { Transform } = require('stream') const ResizeableBuffer = require('./ResizeableBuffer') const cr = 13 const nl = 10 const space = 32 const tab = 9 const bom_utf8 = Buffer.from([239, 187, 191]) c...
cwe
CWE-20
Java
import contextlib import logging import os import pathlib import sys from typing import ( Any, Dict, Generator, Mapping, NoReturn, Optional, Sequence, TextIO, Tuple, ) import click import yaml import vault_cli from vault_cli import client, environment, exceptions, settings, ssh, ty...
cwe
CWE-74
Python
static av_cold int concat_open(URLContext *h, const char *uri, int flags) { char *node_uri = NULL; int err = 0; int64_t size; size_t len, i; URLContext *uc; struct concat_data *data = h->priv_data; struct concat_nodes *nodes; av_strstart(uri, "concat:", &uri); for (i = 0, len = 1; ...
vuln
Vulnerable
C/C++
static int mount_entry(const char *fsname, const char *target, const char *fstype, unsigned long mountflags, const char *data, int optional) { #ifdef HAVE_STATVFS struct statvfs sb; #endif if (mount(fsname, target, fstype, mountflags & ~MS_REMOUNT, data)) { if (optional) { INFO("failed to moun...
cwe
CWE-59
C/C++
// Copyright (c) 2015 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #include "shell/browser/electron_navigation_throttle.h" #include "content/public/browser/navigation_handle.h" #include "shell/browser/api/electron_api_web_contents.h" namespace elect...
cwe
CWE-20
JavaScript
public int decryptWithAd(byte[] ad, byte[] ciphertext, int ciphertextOffset, byte[] plaintext, int plaintextOffset, int length) throws ShortBufferException, BadPaddingException { int space; if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) throw new IllegalArgumentException(); else spa...
vuln
Safe
Java
@Override public BlockRenderType getRenderType(BlockState state) { return BlockRenderType.INVISIBLE; }
vuln
Vulnerable
Java
static always_inline int _pte_check (mmu_ctx_t *ctx, int is_64b, target_ulong pte0, target_ulong pte1, int h, int rw, int type) { target_ulong ptem, mmask; int access, ret, pteh, ptev, pp; access = 0; ret = -1; #if defined(TA...
vuln
Vulnerable
C/C++
srtp_unprotect(srtp_ctx_t *ctx, void *srtp_hdr, int *pkt_octet_len) { srtp_hdr_t *hdr = (srtp_hdr_t *)srtp_hdr; uint32_t *enc_start; /* pointer to start of encrypted portion */ uint32_t *auth_start; /* pointer to start of auth. portion */ unsigned int enc_octet_len = 0;/* number of octets in encr...
cwe
CWE-119
Unknown
/* * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * * 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-787
C/C++
# -*- coding: utf-8 -*- """ RDFa 1.1 parser, also referred to as a “RDFa Distiller”. It is deployed, via a CGI front-end, on the U{W3C RDFa 1.1 Distiller page<http://www.w3.org/2012/pyRdfa/>}. For details on RDFa, the reader should consult the U{RDFa Core 1.1<http://www.w3.org/TR/rdfa-core/>}, U{XHTML+RDFa1.1<http://w...
cwe
CWE-74
Python
private void setOptions() { if (!getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) return; SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); swConfirmLinks.setChecked(prefs.getBoolean("confirm_links", true)); swCheckLi...
vuln
Safe
Java
process_plane(uint8 * in, int width, int height, uint8 * out, int size) { int indexw; int indexh; int code; int collen; int replen; int color; int x; int revcode; uint8 * last_line; uint8 * this_line; uint8 * org_in; uint8 * org_out; org_in = in; org_out = out; last_line = 0; indexh = 0; while (indexh...
cwe
CWE-787
Unknown
def delete_access(request, pk): topic_private = TopicPrivate.objects.for_delete_or_404(pk, request.user) if request.method == 'POST': topic_private.delete() if request.user.pk == topic_private.user_id: return redirect(reverse("spirit:topic:private:index")) return redirect(...
cwe
CWE-601
Python
/* * Copyright (c) 2016, The OpenThread Authors. * 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. Redistributions of source code must retain the above copyright * notice, this ...
vuln
Safe
C/C++
/* * This file is part of Espruino, a JavaScript interpreter for Microcontrollers * * Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http...
cwe
CWE-190
C/C++
/* * * Copyright 2019 Asylo 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 agree...
vuln
Vulnerable
C/C++
private Runnable heartBeatReportThread() { return () -> { while (isRunnable()) { try { TaskSnapshotRequest taskSnapshotRequest = getHeartBeat(); httpManager.doSentPost(reportSnapshotUrl, taskSnapshotRequest); if (LOGGER.isDe...
vuln
Safe
Java
__rta_reserve(struct sk_buff *skb, int attrtype, int attrlen) { struct rtattr *rta; int size = RTA_LENGTH(attrlen); rta = (struct rtattr*)skb_put(skb, RTA_ALIGN(size)); rta->rta_type = attrtype; rta->rta_len = size; return rta; }
cwe
CWE-200
Unknown
SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms, unsigned int *nbytes, struct kvec *iov, int n_vec) { struct smb_rqst rqst; int rc = 0; struct smb2_write_req *req = NULL; struct smb2_write_rsp *rsp = NULL; int resp_buftype; struct kvec rsp_iov; int flags = 0; unsigned int total_len; *nby...
cwe
CWE-416
Unknown
static void gf_dump_vrml_field(GF_SceneDumper *sdump, GF_Node *node, GF_FieldInfo field) { u32 i, sf_type; Bool needs_field_container; GF_ChildNodeItem *list; void *slot_ptr; switch (field.fieldType) { case GF_SG_VRML_SFNODE: assert ( *(GF_Node **)field.far_ptr); if (sdump->XMLDump) { if (!sdump->X3DDump...
cwe
CWE-476
C/C++
int parse_host_src_port(struct sockaddr_in *haddr, struct sockaddr_in *saddr, const char *input_str) { char *str = strdup(input_str); char *host_str = str; char *src_str; const char *src_str2; char *ptr; if ((ptr = strchr(str,','))) *p...
vuln
Vulnerable
C/C++
public void close() { this.running = false; this.sequenceNumber = 0L; this.lastBuffer = null; if(mic != null) { mic.stop(); mic.flush(); mic.close(); thread = null; mic = null; } synchronized (this) { ...
vuln
Safe
Java
@Override public Uni<SecurityIdentity> authenticate(RoutingContext context, IdentityProviderManager identityProviderManager) { if (authEnabled) { if (clientSecret.isEmpty()) { //if no secret is present, try to authenticate with oidc provider return oidcAuthenticat...
vuln
Safe
Java
function escapeArgBash(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") ...
vuln
Vulnerable
JavaScript
/** * @file * Send/receive commands to/from an IMAP server * * @authors * Copyright (C) 1996-1998,2010,2012 Michael R. Elkins <me@mutt.org> * Copyright (C) 1996-1999 Brandon Long <blong@fiction.net> * Copyright (C) 1999-2009,2011 Brendan Cully <brendan@kublai.com> * * @copyright * This program is free softwar...
vuln
Vulnerable
C/C++
void requestResetPassword() throws Exception { when(this.authorizationManager.hasAccess(Right.PROGRAM)).thenReturn(true); UserReference userReference = mock(UserReference.class); ResetPasswordRequestResponse requestResponse = mock(ResetPasswordRequestResponse.class); when(this.resetP...
cwe
CWE-640
Java
void NativeCodeGenerator::CodeGen(PageAllocator * pageAllocator, CodeGenWorkItem* workItem, const bool foreground) { if(foreground) { // Func::Codegen has a lot of things on the stack, so probe the stack here instead PROBE_STACK(scriptContext, Js::Constants::MinStackJITCompile); } #if ENABL...
vuln
Safe
C/C++
function msgpack (options) { var encodingTypes = [] var decodingTypes = new Map() options = options || { forceFloat64: false, compatibilityMode: false, // if true, skips encoding Dates using the msgpack // timestamp ext format (-1) disableTimestampEncoding: false, preferMap: false } ...
cwe
CWE-1321
JavaScript
/* bubblewrap * Copyright (C) 2016 Alexander Larsson * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * ...
vuln
Safe
C/C++
function apiAdminEndpoints(app) { if (!app) return; app.get("/v1/admin/is-multi-user-mode", [validApiKey], (_, response) => { /* #swagger.tags = ['Admin'] #swagger.description = 'Check to see if the instance is in multi-user-mode first. Methods are disabled until multi user mode is enabled via the UI....
vuln
Vulnerable
JavaScript
pixman_format_code_t qemu_default_pixman_format(int bpp, bool native_endian) { if (native_endian) { switch (bpp) { case 15: return PIXMAN_x1r5g5b5; case 16: return PIXMAN_r5g6b5; case 24: return PIXMAN_r8g8b8; case 32: return PI...
vuln
Vulnerable
C/C++
def user_chpass(user, host='localhost', password=None, password_hash=None, allow_passwordless=False, unix_socket=None, password_column=None, **connection_args): ''' Change password for a MySQL user ...
vuln
Vulnerable
Python
/* Parser-tokenizer link implementation */ #include "pgenheaders.h" #include "tokenizer.h" #include "node.h" #include "grammar.h" #include "parser.h" #include "parsetok.h" #include "errcode.h" #include "graminit.h" /* Forward */ static node *parsetok(struct tok_state *, grammar *, int, perrdetail *, int *); static ...
cwe
CWE-125
Python
private String pwdEncode(String pwd) { if (bcryptPattern.matcher(pwd).matches()) { return pwd; } return pwdEncoder.encode(pwd); }
vuln
Safe
Java
def html_message key = keys.last.to_s.gsub('_', ' ').gsub(/\b('?[a-z])/) { $1.capitalize } %(<span class="translation_missing" title="translation missing: #{keys.join('.')}">#{key}</span>)
cwe
CWE-79
Ruby
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // DragonFly BSD system calls. // This file is compiled as ordinary Go code, // but it is also input to mksyscall, // which parses the //sys lines and generates...
cwe
CWE-287
Go
static int do_siocgstampns(struct net *net, struct socket *sock, unsigned int cmd, void __user *up) { mm_segment_t old_fs = get_fs(); struct timespec kts; int err; set_fs(KERNEL_DS); err = sock_do_ioctl(net, sock, cmd, (unsigned long)&kts); set_fs(old_fs); if (!err) err = compat_put_timespec(&kts, up...
vuln
Safe
C/C++
def _get_degree_2(user_id, cnx): """Get all users of degree 2 follow that are not currently followed. Example: this user (follows) user B (follows) user B AND user (does NOT follow) user B means that user B will be in the list Args: user_id (int): id of user cnx: DB c...
cwe
CWE-89
Python
def get_acls(session, cib_dom=nil) unless cib_dom cib_dom = get_cib_dom(session) return {} unless cib_dom end acls = { 'role' => {}, 'group' => {}, 'user' => {}, 'target' => {} } cib_dom.elements.each('/cib/configuration/acls/*') { |e| type = e.name[4..-1] if e.name == 'acl_r...
cwe
CWE-384
Ruby
package migrations import ( "context" "fmt" "github.com/answerdev/answer/internal/base/data" "github.com/answerdev/answer/internal/entity" "xorm.io/xorm" ) const minDBVersion = 0 // answer 1.0.0 // Migration describes on migration from lower version to high version type Migration interface { Description() str...
cwe
CWE-862
Go
public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset, int length) throws ShortBufferException { int space; if (ciphertextOffset > ciphertext.length) space = 0; else space = ciphertext.length - ciphertextOffset; if (!haskey) { // The key i...
cwe
CWE-787
Java
function listTagsHelper(tags, options) { if (!options && (!tags || !Object.prototype.hasOwnProperty.call(tags, 'length'))) { options = tags; tags = this.site.tags; } if (!tags || !tags.length) return ''; options = options || {}; const { style = 'list', transform, separator = ', ', suffix = '' } = op...
cwe
CWE-79
JavaScript
static int StreamTcpPacketStateSynSent(ThreadVars *tv, Packet *p, StreamTcpThread *stt, TcpSession *ssn, PacketQueue *pq) { if (ssn == NULL) return -1; SCLogDebug("ssn %p: pkt received: %s", ssn, PKT_IS_TOCLIENT(p) ? "toclient":"toserver"); /* RST */ if (...
cwe
CWE-74
C/C++
private static int interpolateColours(final int c1, final int c2, final float ratio) { final int c1B = c1 & 0xff; final int c1G = c1 >> 8 & 0xff; final int c1R = c1 >> 16 & 0xff; final int c2B = c2 & 0xff; final int c2G = c2 >> 8 & 0xff; final int c2R = c2 >> 16 & 0xff; final ...
vuln
Safe
Java
void luaD_callnoyield (lua_State *L, StkId func, int nResults) { incXCcalls(L); if (getCcalls(L) <= CSTACKERR) /* possible stack overflow? */ luaE_freeCI(L); luaD_call(L, func, nResults); decXCcalls(L); }
cwe
CWE-119
C/C++
public void doSyncOSSNvdInfo() { vulnerabilityMapper.updateOssRecheckVulnFlag(); List<String> notUsedOssList = new ArrayList<>(); Map<String, OssMaster> reCalcOssInfoMap = new HashMap<>(); List<String> _prjMailList = new ArrayList<>(); List<String> _reCalcPrjMailList = new ArrayList<>(); List<String> _rem...
vuln
Safe
Java
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteEmbeddingLookupSparseParams*>(node->builtin_data); TfLiteTensor* output; TF_LITE_ENSURE_OK(context, GetOutputSafe(context, node, 0, &output)); const TfLiteTensor* ids; TF_LITE_ENSURE_OK(context, GetInputS...
cwe
CWE-190
C/C++
SCK_RemoveSocket(int sock_fd) { union sockaddr_all saddr; socklen_t saddr_len; saddr_len = sizeof (saddr); if (getsockname(sock_fd, &saddr.sa, &saddr_len) < 0) { DEBUG_LOG("getsockname() failed : %s", strerror(errno)); return 0; } if (saddr_len > sizeof (saddr) || saddr_len <= sizeof (saddr.sa.sa...
vuln
Vulnerable
Unknown
"""Identity related views.""" from reversion import revisions as reversion from django.contrib.auth import mixins as auth_mixins from django.contrib.auth.decorators import ( login_required, permission_required, user_passes_test ) from django.shortcuts import render from django.template.loader import render_to_str...
cwe
CWE-352
Python
static int16_t decodeSample(ms_adpcm_state &state, uint8_t code, const int16_t *coefficient) { int linearSample = (state.sample1 * coefficient[0] + state.sample2 * coefficient[1]) >> 8; linearSample += ((code & 0x08) ? (code - 0x10) : code) * state.delta; linearSample = clamp(linearSample, MIN_INT16, MAX_INT16)...
cwe
CWE-190
C/C++
const got = require('@/utils/got'); const cheerio = require('cheerio'); const parser = require('@/utils/rss-parser'); module.exports = async (ctx) => { const { domain = 'news', category } = ctx.params; const baseUrl = `https://${domain}.gamme.com.tw`; const feed = await parser.parseURL(`${baseUrl + (catego...
cwe
CWE-918
JavaScript
var mxIsElectron = navigator.userAgent != null && navigator.userAgent.toLowerCase().indexOf(' electron/') > -1; var GOOGLE_APPS_MAX_AREA = 25000000; var GOOGLE_SHEET_MAX_AREA = 1048576; //1024x1024 //TODO Add support for loading math from a local folder Editor.initMath((remoteMath? 'https://app.diagrams.net/' : '') +...
cwe
CWE-79
JavaScript
public static Optional<String> doSingleStringContentQuery(Uri uri, String columnName) { try (Cursor cursor = getContext().getContentResolver().query(uri, new String[]{columnName}, null, null, null)) { if (cursor.moveToFirst() && !cursor.isNull(0)) { return Optional.of...
vuln
Vulnerable
Java
/* @license Papa Parse v5.1.1 https://github.com/mholt/PapaParse License: MIT */ (function(root, factory) { /* globals define */ if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define([], factory); } else if (typeof module === 'object' && typeof exports !== 'undefine...
cwe
CWE-1333
JavaScript
# -*- coding: utf-8 -*- # pylint: disable=too-many-lines # """ Drag and Drop v2 XBlock """ # Imports ########################################################### from __future__ import absolute_import from collections import Counter import copy import json import logging import six.moves.urllib.error # pylint: disa...
cwe
CWE-79
Python
/* vi:set ts=8 sts=4 sw=4 noet: * * VIM - Vi IMproved by Bram Moolenaar * * Do ":help uganda" in Vim to read copying and usage conditions. * Do ":help credits" in Vim to see a list of people who contributed. * See README.txt for an overview of the Vim source code. */ #include "vim.h" /* * Vim originated fro...
cwe
CWE-125
C/C++
public function get($params = false) { $params2 = array(); if (is_string($params)) { $params = parse_str($params, $params2); $params = $params2; } if (isset($params['content_id'])) { $params['rel_type'] = 'content'; $params['rel_id'] =...
vuln
Safe
PHP
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteMulParams*>(node->builtin_data); OpData* data = reinterpret_cast<OpData*>(node->user_data); const TfLiteTensor* input1 = GetInput(context, node, kInputTensor1); const TfLiteTensor* input2 = GetInput(context, nod...
cwe
CWE-125
C/C++
void bm_fillrect(Bitmap *b, int x0, int y0, int x1, int y1) { int x,y; if(x1 < x0) { x = x0; x0 = x1; x1 = x; } if(y1 < y0) { y = y0; y0 = y1; y1 = y; } for(y = MAX(y0, b->clip.y0); y < MIN(y1 + 1, b->clip.y1); y++) { for(x = MAX(x0, b->cli...
vuln
Vulnerable
C/C++
# Generated by Django 3.0.5 on 2020-04-25 12:43 import InvenTree.fields import django.core.validators from django.db import migrations, models import django.db.models.deletion import markdownx.models import mptt.fields class Migration(migrations.Migration): dependencies = [ ('part', '0035_auto_20200406_...
vuln
Vulnerable
Python
bool operator()(const OpKernelContext* context, typename TTypes<float, 4>::ConstTensor grads, typename TTypes<float, 2>::ConstTensor boxes, typename TTypes<int32, 1>::ConstTensor box_index, typename TTypes<T, 4>::Tensor grads_image, ...
cwe
CWE-703
Unknown
"""Implementation of the WebSocket protocol. `WebSockets <http://dev.w3.org/html5/websockets/>`_ allow for bidirectional communication between the browser and server. .. warning:: The WebSocket protocol was recently finalized as `RFC 6455 <http://tools.ietf.org/html/rfc6455>`_ and is not yet supported in al...
cwe
CWE-203
Python
static void gatherSecurityPolicyViolationEventData( SecurityPolicyViolationEventInit& init, ExecutionContext* context, const String& directiveText, const ContentSecurityPolicy::DirectiveType& effectiveType, const KURL& blockedURL, const String& header, RedirectStatus redirectStatus, Cont...
cwe
CWE-200
C/C++
@app.route('/lookup_assets') def lookup_assets(): start = request.args.get('start') con = psycopg2.connect(**config.POSTGRES) cur = con.cursor() query = "SELECT aname FROM assets WHERE aname LIKE '"+start+"%'" cur.execute(query) results = cur.fetchall() con.close() return jsonify(resul...
cwe
CWE-89
Python
"""Identity related views.""" from reversion import revisions as reversion from django.contrib.auth import mixins as auth_mixins from django.contrib.auth.decorators import ( login_required, permission_required, user_passes_test ) from django.shortcuts import render from django.template.loader import render_to_str...
cwe
CWE-352
Python
function authenticationEndpoints(app) { if (!app) return; app.get("/auth/auto-onboard", async (_, response) => { try { const completeSetup = (await User.count({ role: "admin" })) > 0; if (completeSetup) { response.status(200).json({ completed: true }); return; } const o...
cwe
CWE-287
JavaScript
@Override public void create() { if (!isClient()) return; GuiParent left = new GuiParent(GuiFlow.STACK_Y).setAlign(Align.STRETCH); add(left); LittleElement element = ItemLittleChisel.getElement(tool.get()); Color color = new Color(element.color);...
vuln
Safe
Java
var GoogleSitesDialog=function(b,e){function f(){var E=null!=C&&null!=C.getTitle()?C.getTitle():this.defaultFilename;if(z.checked&&""!=q.value){var G="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(q.value));null!=E&&(G+="&title="+encodeURIComponent(E));0<L.length&&(G+="&s="+L);...
vuln
Safe
JavaScript
int ocfs2_set_acl(handle_t *handle, struct inode *inode, struct buffer_head *di_bh, int type, struct posix_acl *acl, struct ocfs2_alloc_context *meta_ac, struct ocfs2_alloc_context *data_ac) { int name_index; void *value = NULL; size_t size = 0; int ret; if (S_ISLNK(inode->i_mode)) retur...
cwe
CWE-862
Unknown
void BrowserContextDestroyer::FinishDestroyContext() { DCHECK_EQ(pending_hosts_, 0U); delete context_; context_ = nullptr; delete this; }
vuln
Vulnerable
C/C++
int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, struct ieee80211_rx_stats *rx_stats) { struct net_device *dev = ieee->dev; struct ieee80211_hdr_4addr *hdr; size_t hdrlen; u16 fc, type, stype, sc; struct net_device_stats *stats; unsigned int frag; u8 *payload; u16 ethertype; #ifdef NOT_YE...
vuln
Safe
Unknown
@Override public void doGet(HttpServletRequest req, HttpServletResponse res) throws java.io.IOException, ServletException { log.trace(">doGet()"); final AuthenticationToken admin = getAuthenticationToken(req); final CAInterfaceBean caBean = SessionBeans.getCaBean(req); // Keep this...
vuln
Safe
Java
static int yuv4_write_header(AVFormatContext *s) { int* first_pkt = s->priv_data; if (s->nb_streams != 1) return AVERROR(EIO); if (s->streams[0]->codec->pix_fmt == PIX_FMT_YUV411P) { av_log(s, AV_LOG_ERROR, "Warning: generating rarely used 4:1:1 YUV stream, some mjpegtools might not work.\n"...
vuln
Vulnerable
C/C++
static jlong Region_createFromParcel(JNIEnv* env, jobject clazz, jobject parcel) { if (parcel == NULL) { return NULL; } android::Parcel* p = android::parcelForJavaObject(env, parcel); const size_t size = p->readInt32(); const void* regionData = p->readInplace(size); if (regionData == NULL) { retur...
cwe
CWE-264
Unknown
/** * <a href="http://www.openolat.org"> * OpenOLAT - Online Learning and Training</a><br> * <p> * Licensed under the Apache License, Version 2.0 (the "License"); <br> * you may not use this file except in compliance with the License.<br> * You may obtain a copy of the License at the * <a href="http://www.apache...
cwe
CWE-22
Java
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* vim: set sw=4 sts=4 expandtab: */ /* rsvg.c: SAX-based renderer for SVG files into a GdkPixbuf. Copyright (C) 2000 Eazel, Inc. Copyright (C) 2002 Dom Lachowicz <cinamod@hotmail.com> This program is free software; you can redi...
cwe
CWE-255
C/C++
# Natural Language Toolkit: Interface to MaltParser # # Author: Dan Garrette <dhgarrette@gmail.com> # Contributor: Liling Tan, Mustufain, osamamukhtar11 # # Copyright (C) 2001-2021 NLTK Project # URL: <https://www.nltk.org/> # For license information, see LICENSE.TXT import inspect import os import subprocess import s...
cwe
CWE-1333
Python
foreach ( $metric_group_members as $index => $metric_name ) { print " <A HREF=\"./graph_all_periods.php?mobile=1&" . $g_metrics[$metric_name]['graph'] . "\"> <IMG BORDER=0 ALT=\"$clustername\" SRC=\"./graph.php?" . $g_metrics[$metric_name]['graph'] . "\"></A>"; }
cwe
CWE-79
PHP
function renderBreadcrumb() { var bcDiv = _$('.odFilesBreadcrumb'); if (bcDiv == null) return; bcDiv.innerHTML = ''; for (var i = 0; i < breadcrumb.length - 1; i++) { var folder = document.createElement('span'); folder.className = 'odBCFolder'; folder.innerHTML = mxUtils.htmlEntities(bread...
cwe
CWE-94
JavaScript
bool PxMDecoder::readData( Mat& img ) { int color = img.channels() > 1; uchar* data = img.ptr(); PaletteEntry palette[256]; bool result = false; const int bit_depth = CV_ELEM_SIZE1(m_type)*8; const int src_pitch = divUp(m_width*m_bpp*(bit_depth/8), 8); int nch = CV_MAT_CN(m_type); int...
vuln
Safe
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...
cwe
CWE-20
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
Safe
Java
void PngImg::InitStorage_() { rowPtrs_.resize(info_.height, nullptr); data_ = new png_byte[info_.height * info_.rowbytes]; for(size_t i = 0; i < info_.height; ++i) { rowPtrs_[i] = data_ + i * info_.rowbytes; } }
cwe
CWE-190
C/C++
void operator()(OpKernelContext* ctx, const CPUDevice& d, int64 num_batches, int64 samples_per_batch, int64 num_elements, typename TTypes<T>::ConstFlat means, typename TTypes<T>::ConstFlat stddevs, typename TTypes<T>::ConstFlat minvals, ...
cwe
CWE-703
Unknown
static av_cold int vqa_decode_init(AVCodecContext *avctx) { VqaContext *s = avctx->priv_data; int i, j, codebook_index; s->avctx = avctx; avctx->pix_fmt = PIX_FMT_PAL8; /* make sure the extradata made it */ if (s->avctx->extradata_size != VQA_HEADER_SIZE) { av_log(s->avctx, AV_LOG_ERRO...
cwe
CWE-119
C/C++
import json from tornado import web from ...base.handlers import IPythonHandler, json_errors class NbconvertRootHandler(IPythonHandler): SUPPORTED_METHODS = ('GET',) @web.authenticated @json_errors def get(self): try: from IPython.nbconvert.exporters.export import exporter_map ...
cwe
CWE-79
Python
static void cirrus_invalidate_region(CirrusVGAState * s, int off_begin, int off_pitch, int bytesperline, int lines) { int y; int off_cur; int off_cur_end; for (y = 0; y < lines; y++) { off_cur = off_begin; off_cur_end = (off_cur + bytesperline) & s->cirrus_addr_mas...
cwe
CWE-125
C/C++
static void cleanup_infolist(CommandLineParameterInfoList *head) { CommandLineParameterInfoList *pre_entry, *cur, *del_entry; cur = head; while (cur->next) { pre_entry = head; while (pre_entry != cur->next) { if (!strcmp(pre_entry->value->name, cur->next->value->name)) { ...
vuln
Vulnerable
C/C++
/* * * * Copyright (c) 2016. David Sowerby * * * * 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...
vuln
Safe
Java
USBDevice *usb_msd_init(const char *filename) { static int nr=0; char id[8]; QemuOpts *opts; DriveInfo *dinfo; USBDevice *dev; int fatal_error; const char *p1; char fmt[32]; snprintf(id, sizeof(id), "usb%d", nr++); opts = qemu_opts_create(&qemu_drive_opts, id, 0); p1 = s...
vuln
Vulnerable
C/C++
ssize_t oe_recvfrom( int sockfd, void* buf, size_t len, int flags, const struct oe_sockaddr* src_addr, oe_socklen_t* addrlen) { ssize_t ret = -1; oe_fd_t* sock; if (!(sock = oe_fdtable_get(sockfd, OE_FD_TYPE_SOCKET))) OE_RAISE_ERRNO(oe_errno); ret = sock->ops.socket.rec...
cwe
CWE-552
Unknown
target_ulong helper_load_slb_esid(CPUPPCState *env, target_ulong rb) { target_ulong rt; if (ppc_load_slb_esid(env, rb, &rt) < 0) { helper_raise_exception_err(env, POWERPC_EXCP_PROGRAM, POWERPC_EXCP_INVAL); } return rt; }
vuln
Vulnerable
C/C++
main(int argc, char* argv[]) { uint16 bitspersample, shortv; uint32 imagewidth, imagelength; uint16 config = PLANARCONFIG_CONTIG; uint32 rowsperstrip = (uint32) -1; uint16 photometric = PHOTOMETRIC_RGB; uint16 *rmap, *gmap, *bmap; uint32 row; int cmap = -1; TIFF *in, *out; int c; #if !HAVE_DECL_OPTARG exter...
vuln
Vulnerable
C/C++
function handleMultipart (opts = {}) { if (!this.isMultipart()) { throw new InvalidMultipartContentTypeError() } this.log.debug('starting multipart parsing') let values = [] let pendingHandler = null // only one file / field can be processed at a time // "null" will close the consum...
cwe
CWE-770
JavaScript
int ssl3_get_key_exchange(SSL *s) { #ifndef OPENSSL_NO_RSA unsigned char *q, md_buf[EVP_MAX_MD_SIZE * 2]; #endif EVP_MD_CTX md_ctx; unsigned char *param, *p; int al, j, ok; long i, param_len, n, alg_k, alg_a; EVP_PKEY *pkey = NULL; const EVP_MD *md = NULL; #ifndef OPENSSL_NO_RSA RSA *rsa...
vuln
Vulnerable
Unknown
static inline struct old_rng_alg *crypto_old_rng_alg(struct crypto_rng *tfm) { return &crypto_rng_tfm(tfm)->__crt_alg->cra_rng; }
vuln
Vulnerable
C/C++