code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
iperf_json_printf(const char *format, ...) { cJSON* o; va_list argp; const char *cp; char name[100]; char* np; cJSON* j; o = cJSON_CreateObject(); if (o == NULL) return NULL; va_start(argp, format); np = name; for (cp = format; *cp != '\0'; ++cp) { switch (*cp) { ...
cwe
CWE-119
Unknown
ExtensionsGuestViewMessageFilter::ExtensionsGuestViewMessageFilter( int render_process_id, BrowserContext* context) : GuestViewMessageFilter(kFilteredMessageClasses, base::size(kFilteredMessageClasses), render_process_id, ...
cwe
CWE-362
C/C++
// 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++
async single(obj, args) { return WIKI.models.groups.query().findById(args.id) }
cwe
CWE-287
JavaScript
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
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++
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
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
bool DataReductionProxyConfig::IsFetchInFlight() const { DCHECK(thread_checker_.CalledOnValidThread()); return warmup_url_fetcher_->IsFetchInFlight(); }
cwe
CWE-416
C/C++
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
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
/* * 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
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++
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++
/*! * 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
$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
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
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++
/* * 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++
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++
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++
/* * 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++
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
void Compute(OpKernelContext* const context) override { // node_id_range const Tensor* node_id_range_t; OP_REQUIRES_OK(context, context->input("node_id_range", &node_id_range_t)); const auto node_id_range = node_id_range_t->vec<int32>(); OP_REQUIRES( context, node_id_range_t->dims() == 1, ...
cwe
CWE-476
C/C++
static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *chroma_image, *image, *resize_image; InterlaceType interlace; MagickBooleanType status; register const Quantum *chroma_pixels; register ssize_t x; register Quantum *q; register u...
cwe
CWE-772
C/C++
'use strict'; const _ = require('lodash'); const UPDATE_THROTTLE = 5000; function boot (env, language) { function startBoot(ctx, next) { console.log('Executing startBoot'); ctx.runtimeState = 'booting'; ctx.settings = env.settings; ctx.bus = require('../bus')(env.settings, ctx); ctx.adminnoti...
cwe
CWE-79
JavaScript
static MagickBooleanType WriteDPXImage(const ImageInfo *image_info,Image *image, ExceptionInfo *exception) { const char *value; const StringInfo *profile; DPXInfo dpx; GeometryInfo geometry_info; MagickBooleanType status; MagickOffsetType offset; MagickStatusType flags;...
cwe
CWE-401
C/C++
/* * Copyright 2021 ThoughtWorks, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agr...
cwe
CWE-77
Java
void Compute(OpKernelContext* context) override { // Here's the basic idea: // Batch and depth dimension are independent from row and col dimension. And // because FractionalAvgPool currently only support pooling along row and // col, we can basically think of this 4D tensor backpropagation as // op...
cwe
CWE-787
Unknown
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; r...
cwe
CWE-119
C/C++
static int pop_fetch_headers (CONTEXT *ctx) { int i, ret, old_count, new_count, deleted; unsigned short hcached = 0, bcached; POP_DATA *pop_data = (POP_DATA *)ctx->data; progress_t progress; #ifdef USE_HCACHE header_cache_t *hc = NULL; void *data; hc = pop_hcache_open (pop_data, ctx->path); #endif ti...
cwe
CWE-119
Unknown
def move(request, topic_id): topic = get_object_or_404(Topic, pk=topic_id) form = CommentMoveForm(topic=topic, data=request.POST) if form.is_valid(): comments = form.save() for comment in comments: comment_posted(comment=comment, mentions=None) topic.decrease_commen...
cwe
CWE-601
Python
def allowed_for_local_cluster(session, action) pcs_config = PCSConfig.new(Cfgsync::PcsdSettings.from_file('{}').text()) return pcs_config.permissions_local.allows?( session[:username], session[:usergroups], action ) end
cwe
CWE-384
Ruby
function readKey() { let length = src[position++] if (length >= 0xa0 && length < 0xc0) { // fixstr, potentially use key cache length = length - 0xa0 if (srcStringEnd >= position) // if it has been extracted, must use it (and faster anyway) return srcString.slice(position - srcStringStart, (position += length...
cwe
CWE-754
JavaScript
gdk_pixbuf__gif_image_load_increment (gpointer data, const guchar *buf, guint size, GError **error) { gint retval; GifContext *context = (GifContext *) data; context->error = error; if (context->amount_needed == 0) { /* w...
cwe
CWE-20
Unknown
function init_args() { $args = new stdClass(); $args->req_id = isset($_REQUEST['requirement_id']) ? $_REQUEST['requirement_id'] : 0; $args->compare_selected_versions = isset($_REQUEST['compare_selected_versions']); $args->left_item_id = isset($_REQUEST['left_item_id']) ? intval($_REQUEST['left_item_id']) : -1;...
cwe
CWE-89
PHP
package com.salesmanager.shop.admin.model.secutity; import com.salesmanager.core.model.user.User; import java.io.Serializable; /** * Entity used in the cahange passord page * @author csamson777 * */ public class Password implements Serializable { /** * */ private static final long serialVersionUID = 1L;...
cwe
CWE-639
Java
def _map_vol_to_host(self, volume_name, host_name): """Create a mapping between a volume to a host.""" LOG.debug(_('enter: _map_vol_to_host: volume %(volume_name)s to ' 'host %(host_name)s') % {'volume_name': volume_name, 'host_name': host_name}) # Check i...
cwe
CWE-78
Python
int HevcVpsUnit::deserialize() { int rez = HevcUnit::deserialize(); if (rez) return rez; if (m_reader.getBitsLeft() < 128) return NOT_ENOUGH_BUFFER; try { vps_id = m_reader.getBits(4); m_reader.skipBits(2); // reserved vps_max_layers = m_reader.getBits(6) +...
cwe
CWE-22
Unknown
nfsd4_encode_layoutget(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_layoutget *lgp) { struct xdr_stream *xdr = &resp->xdr; const struct nfsd4_layout_ops *ops = nfsd4_layout_ops[lgp->lg_layout_type]; __be32 *p; dprintk("%s: err %d\n", __func__, nfserr); if (nfserr) goto out; nfserr = nfserr_...
cwe
CWE-129
Unknown
void LibRaw::parse_exif(int base) { unsigned entries, tag, type, len, save, c; double expo, ape; unsigned kodak = !strncmp(make, "EASTMAN", 7) && tiff_nifds < 3; entries = get2(); if (!strncmp(make, "Hasselblad", 10) && (tiff_nifds > 3) && (entries > 512)) return; INT64 fsize = ifp->size(); while (e...
cwe
CWE-787
C/C++
int ZlibInStream::pos() { return offset + ptr - start; }
cwe
CWE-787
C/C++
header_put_be_8byte (SF_PRIVATE *psf, sf_count_t x) { if (psf->headindex < SIGNED_SIZEOF (psf->header) - 8) { psf->header [psf->headindex++] = 0 ; psf->header [psf->headindex++] = 0 ; psf->header [psf->headindex++] = 0 ; psf->header [psf->headindex++] = 0 ; psf->header [psf->headindex++] = (x >> 24) ; psf->h...
cwe
CWE-119
C/C++
/** * A simple, static http GET server. * * (C) 2015 TekMonks. All rights reserved. * License: See enclosed file. */ const extensions = []; const fs = require("fs"); const zlib = require("zlib"); const path = require("path"); const http = require("http"); const https = require("https"); let access; let error; ...
cwe
CWE-79
JavaScript
void SoftG711::onQueueFilled(OMX_U32 /* portIndex */) { if (mSignalledError) { return; } List<BufferInfo *> &inQueue = getPortQueue(0); List<BufferInfo *> &outQueue = getPortQueue(1); while (!inQueue.empty() && !outQueue.empty()) { BufferInfo *inInfo = *inQueue.begin(); OMX_BUFFERHEADERTYPE *inHeader =...
cwe
CWE-119
C/C++
BGD_DECLARE(void) gdImageXbmCtx(gdImagePtr image, char* file_name, int fg, gdIOCtx * out) { int x, y, c, b, sx, sy, p; char *name, *f; size_t i, l; name = file_name; if ((f = strrchr(name, '/')) != NULL) name = f+1; if ((f = strrchr(name, '\\')) != NULL) name = f+1; name = strdup(name); if ((f = strrchr(name, ...
cwe
CWE-119
Unknown
remove: function (from, callback) { var that = this, cmd = ''; fs.lstat(from, function (err, stats) { if (err) { callback(err); } else { if (that._win32) { // windows if (stats.isDirectory()) { cmd = 'rd /s /q "' + from + '"'; } else if...
cwe
CWE-77
JavaScript
/* radare - LGPL - Copyright 2015-2018 - Dax89, pancake */ #include <string.h> #include <r_types.h> #include <r_lib.h> #include <r_bin.h> #include "../i/private.h" #include "psxexe/psxexe.h" static bool check_buffer(RBinFile *bf, RBuffer *b) { ut8 magic[PSXEXE_ID_LEN]; if (r_buf_read_at (b, 0, magic, sizeof (magic)...
cwe
CWE-400
C/C++
function insertAdult(firstName, lastName, username, password, packNumber, leaderType, rankType, phoneNumber, connection) { var temp= selectAdult(username, connection); if(temp.databaseObject.adult_id<1) { return temp; } var strQuery = "INSERT INTO adult VALUES('"+firstName+"', '"+lastName+"', '"+ username +...
cwe
CWE-89
JavaScript
xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) { const xmlChar *elemName; const xmlChar *attrName; xmlEnumerationPtr tree; if (CMP9(CUR_PTR, '<', '!', 'A', 'T', 'T', 'L', 'I', 'S', 'T')) { xmlParserInputPtr input = ctxt->input; SKIP(9); if (!IS_BLANK_CH(CUR)) { xmlFatalErrMsg(ctxt, XML_ERR_S...
cwe
CWE-119
C/C++
QPDF::isEncrypted(int& R, int& P, int& V, encryption_method_e& stream_method, encryption_method_e& string_method, encryption_method_e& file_method) { if (this->m->encp->encrypted) { QPDFObjectHandle trailer = getTrailer(); QPDFObjectHandle encrypt = traile...
cwe
CWE-787
Unknown
@frappe.whitelist(allow_guest=True) def send_message(subject="Website Query", message="", sender="", status="Open"): from frappe.www.contact import send_message as website_send_message lead = customer = None website_send_message(subject, message, sender) customer = frappe.db.sql("""select distinct dl.link_name fr...
cwe
CWE-89
Python
LOG_FileWrite(LOG_FileID id, const char *format, ...) { va_list other_args; int banner; if (id < 0 || id >= n_filelogs || !logfiles[id].name) return; if (!logfiles[id].file) { char filename[PATH_MAX], *logdir = CNF_GetLogDir(); if (logdir[0] == '\0') { LOG(LOGS_WARN, "logdir not specified")...
cwe
CWE-59
Unknown
package api type Shortcut struct { ID int `json:"id"` // Standard fields RowStatus RowStatus `json:"rowStatus"` CreatorID int `json:"creatorId"` CreatedTs int64 `json:"createdTs"` UpdatedTs int64 `json:"updatedTs"` // Domain specific fields Title string `json:"title"` Payload string `json:"p...
cwe
CWE-285
Go
# -*- 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-613
Python
spell_move_to( win_T *wp, int dir, // FORWARD or BACKWARD int allwords, // TRUE for "[s"/"]s", FALSE for "[S"/"]S" int curline, hlf_T *attrp) // return: attributes of bad word or NULL // (only when "dir" is FORWARD) { linenr_T lnum; pos_T found_pos; int found_len = 0; char_...
cwe
CWE-416
C/C++
int ndpi_netbios_name_interpret(char *in, size_t in_len, char *out, u_int out_len) { u_int ret = 0, len, idx = in_len, out_idx = 0; len = (*in++)/2; out_len--; out[out_idx] = 0; if((len > out_len) || (len < 1) || ((2*len) > in_len)) return(-1); while((len--) && (out_idx < out_len)) { if((idx < 2)...
cwe
CWE-787
Unknown
Init_ossl_cipher(void) { #if 0 mOSSL = rb_define_module("OpenSSL"); eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError); #endif /* Document-class: OpenSSL::Cipher * * Provides symmetric algorithms for encryption and decryption. The * algorithms that are available dep...
cwe
CWE-310
Unknown
static void do_show_pages(QPDF& pdf, Options& o) { QPDFPageDocumentHelper dh(pdf); std::vector<QPDFPageObjectHelper> pages = dh.getAllPages(); int pageno = 0; for (std::vector<QPDFPageObjectHelper>::iterator iter = pages.begin(); iter != pages.end(); ++iter) { QPDFPageObjectHelper& ...
cwe
CWE-787
Unknown
bool CModules::GetModPathInfo(CModInfo& ModInfo, const CString& sModule, const CString& sModPath, CString& sRetMsg) { ModInfo.SetName(sModule); ModInfo.SetPath(sModPath); ModHandle p = OpenModule(sModule, sModPath, ModInfo, sRetMsg); if (!p) return false; dlclose(p); ...
cwe
CWE-264
Unknown
static int php_iconv_stream_filter_append_bucket( php_iconv_stream_filter *self, php_stream *stream, php_stream_filter *filter, php_stream_bucket_brigade *buckets_out, const char *ps, size_t buf_len, size_t *consumed, int persistent TSRMLS_DC) { php_stream_bucket *new_bucket; char *out_buf = NULL; size_t o...
cwe
CWE-835
C/C++
sph_enc16le(void *dst, unsigned val) { ((unsigned char *)dst)[0] = val; ((unsigned char *)dst)[1] = val >> 8; }
cwe
CWE-787
Unknown
bool DDeviceDiskInfoPrivate::openDataStream(int index) { if (process) { process->deleteLater(); } process = new QProcess(); QObject::connect(process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), process, [this] (int code, QProcess::ExitS...
cwe
CWE-59
C/C++
private void sendAllJSON(HttpExchange pExchange, ParsedUri pParsedUri, JSONAware pJson) throws IOException { OutputStream out = null; try { Headers headers = pExchange.getResponseHeaders(); if (pJson != null) { headers.set("Content-Type", getMimeType(pParsedUri) +...
cwe
CWE-79
Java
const bootbox = require('bootbox'); const Requisition = require('../model/Requisition'); require('../services/Requisitions'); require('../services/Synchronize'); /** * @author Alejandro Galue <agalue@opennms.org> * @copyright 2014 The OpenNMS Group, Inc. */ (function() { 'use strict'; angular.module('onms-req...
cwe
CWE-352
Java
/* * Copyright (c) 2006, 2018 Oracle and/or its affiliates. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main director...
cwe
CWE-416
C/C++
const fs = require('fs') const fsProm = require('fs/promises'); const os = require('os'); const path = require('path') const url = require('url') const {Menu: menu, shell, dialog, clipboard, nativeImage, ipcMain, app, BrowserWindow} = require('electron') const crc = require('crc'); const zlib = require('zlib'); const...
cwe
CWE-20
JavaScript
import Controller from "@ember/controller"; import { action } from "@ember/object"; import { getAbsoluteURL } from "discourse-common/lib/get-url"; import discourseComputed, { afterRender, } from "discourse-common/utils/decorators"; import { longDateNoYear } from "discourse/lib/formatter"; import Sharing from "discour...
cwe
CWE-276
JavaScript
public static function loadFrom(Db $zdb, $id, $mailing, $new = true) { try { $select = $zdb->select(self::TABLE); $select->where('mailing_id = ' . $id); $results = $zdb->execute($select); $result = $results->current(); return $mailing->loadFromHi...
cwe
CWE-89
PHP
int lpEncodeGetType(unsigned char *ele, uint32_t size, unsigned char *intenc, uint64_t *enclen) { int64_t v; if (lpStringToInt64((const char*)ele, size, &v)) { if (v >= 0 && v <= 127) { /* Single byte 0-127 integer. */ intenc[0] = v; *enclen = 1; } else if (v ...
cwe
CWE-190
Unknown
/* Copyright JS Foundation and other contributors, http://js.foundation * * 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 r...
cwe
CWE-476
C/C++
"""Tornado handlers for kernels.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import json import logging from tornado import gen, web from tornado.concurrent import Future from tornado.ioloop import IOLoop from IPython.utils.jsonutil import date_default from...
cwe
CWE-79
Python
static void xen_netbk_fill_frags(struct xen_netbk *netbk, struct sk_buff *skb) { struct skb_shared_info *shinfo = skb_shinfo(skb); int nr_frags = shinfo->nr_frags; int i; for (i = 0; i < nr_frags; i++) { skb_frag_t *frag = shinfo->frags + i; struct xen_netif_tx_request *txp; struct page *page; u16 pending_...
cwe
CWE-399
C/C++
R_API void r_core_fini(RCore *c) { if (!c) { return; } r_core_task_break_all (&c->tasks); r_core_task_join (&c->tasks, NULL, -1); r_core_wait (c); /* TODO: it leaks as shit */ //update_sdb (c); // avoid double free r_list_free (c->ropchain); r_event_free (c->ev); free (c->cmdlog); free (c->lastsearch); R...
cwe
CWE-703
C/C++
static void *__ns_get_path(struct path *path, struct ns_common *ns) { struct vfsmount *mnt = nsfs_mnt; struct qstr qname = { .name = "", }; struct dentry *dentry; struct inode *inode; unsigned long d; rcu_read_lock(); d = atomic_long_read(&ns->stashed); if (!d) goto slow; dentry = (struct dentry *)d; if (!...
cwe
CWE-416
C/C++
int LUKS2_config_set_requirements(struct crypt_device *cd, struct luks2_hdr *hdr, uint32_t reqs, bool commit) { json_object *jobj_config, *jobj_requirements, *jobj_mandatory, *jobj; int i, r = -EINVAL; if (!hdr) return -EINVAL; jobj_mandatory = json_object_new_array(); if (!jobj_mandatory) return -ENOMEM; ...
cwe
CWE-345
Unknown