code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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 3 of the License, or # (at your option) an...
cwe
CWE-74
Python
package com.salesmanager.shop.admin.controller.orders; import com.salesmanager.core.business.modules.email.Email; import com.salesmanager.core.business.services.catalog.product.PricingService; import com.salesmanager.core.business.services.customer.CustomerService; import com.salesmanager.core.business.services.order....
cwe
CWE-639
Java
import { mainPage } from "../../support/page_objects/mainPage"; import { loginPage } from "../../support/page_objects/navigation"; import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; export const genTest = (apiType, dbType) => { if (!isTestSuiteActive(apiType, dbType)) return; des...
cwe
CWE-918
JavaScript
TightDecoder::FilterGradient24(const rdr::U8 *inbuf, const PixelFormat& pf, PIXEL_T* outbuf, int stride, const Rect& r) { int x, y, c; rdr::U8 prevRow[TIGHT_MAX_WIDTH*3]; rdr::U8 thisRow[TIGHT_MAX_WIDTH*3]; rdr::U8 pix[3]; int est[3]; memset(p...
cwe
CWE-787
Unknown
def visitField(self, field, name, sum=None, prod=None, depth=0): ctype = get_c_type(field.type) if field.opt: check = "exists_not_none(obj, &PyId_%s)" % (field.name,) else: check = "_PyObject_HasAttrId(obj, &PyId_%s)" % (field.name,) self.emit("if (%s) {" % (check...
cwe
CWE-125
C/C++
SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags) { struct fs_struct *fs, *new_fs = NULL; struct files_struct *fd, *new_fd = NULL; struct cred *new_cred = NULL; struct nsproxy *new_nsproxy = NULL; int do_sysvsem = 0; int err; /* * If unsharing a user namespace must also unshare the thread. */ if (unsh...
cwe
CWE-264
C/C++
package jadx.core.export; import java.io.File; import java.io.IOException; import java.io.StringReader; import java.util.Arrays; import java.util.HashSet; import java.util.Set; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.slf4j.Logger; import org.slf4j.LoggerF...
cwe
CWE-611
Java
static inline int rtnetlink_fill_iwinfo(struct sk_buff * skb, struct net_device * dev, int type, char * event, int event_len) { struct ifinfomsg *r; struct nlmsghdr *nlh; unsigned char *b = skb->tail; nlh = NLMSG_PUT(skb, 0, 0, type, sizeof(*r)); r = NLMSG_DATA(nlh); r->ifi_family = A...
cwe
CWE-200
Unknown
package imap import ( "bytes" "crypto/tls" "fmt" "regexp" "strconv" "time" "github.com/emersion/go-imap" "github.com/emersion/go-imap/client" "github.com/emersion/go-message/charset" log "github.com/gophish/gophish/logger" "github.com/gophish/gophish/models" "github.com/jordan-wright/email" ) // Client ...
cwe
CWE-918
Go
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 3); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* start = GetInput(context, node, kStartTensor); const TfLiteTensor* limit = GetInput(context, node, kLimitTensor); const TfLiteT...
cwe
CWE-787
C/C++
def join_in(request, topic_id): # todo: replace by create_access()? # This is for topic creators who left their own topics and want to join again topic = get_object_or_404( Topic, pk=topic_id, user=request.user, category_id=settings.ST_TOPIC_PRIVATE_CATEGORY_PK) form = To...
cwe
CWE-601
Python
/* global host, bridge, data, context */ 'use strict'; const { Object: localObject, Array: localArray, Error: LocalError, Reflect: localReflect, Proxy: LocalProxy, WeakMap: LocalWeakMap, Function: localFunction, Promise: localPromise, eval: localEval } = global; const { freeze: localObjectFreeze } = localO...
cwe
CWE-913
JavaScript
show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) { struct mm_struct *mm = vma->vm_mm; struct file *file = vma->vm_file; struct proc_maps_private *priv = m->private; vm_flags_t flags = vma->vm_flags; unsigned long ino = 0; unsigned long long pgoff = 0; unsigned long start, end; dev_t dev ...
cwe
CWE-119
Unknown
function initUi() { if (firstInitUi) { firstInitUi = false; mxEvent.addListener(div, 'scroll', function(evt) { if (div.scrollTop + div.clientHeight >= div.scrollHeight) { addTemplates(); mxEvent.consume(evt); } }); } if (customCatCount > 0) { var titleCss = 'font-w...
cwe
CWE-94
JavaScript
void AllocateDataSet(cmsIT8* it8) { TABLE* t = GetTable(it8); if (t -> Data) return; // Already allocated t-> nSamples = atoi(cmsIT8GetProperty(it8, "NUMBER_OF_FIELDS")); t-> nPatches = atoi(cmsIT8GetProperty(it8, "NUMBER_OF_SETS")); t-> Data = (char**)AllocChunk (it8, ((cmsUInt32Number...
cwe
CWE-190
C/C++
static void ip_expire(unsigned long arg) { struct ipq *qp; struct net *net; qp = container_of((struct inet_frag_queue *) arg, struct ipq, q); net = container_of(qp->q.net, struct net, ipv4.frags); spin_lock(&qp->q.lock); if (qp->q.last_in & INET_FRAG_COMPLETE) goto out; ipq_kill(qp); IP_INC_STATS_BH(net,...
cwe
CWE-703
C/C++
static bool add_line(String &buffer,char *line,char *in_string, bool *ml_comment, bool truncated) { uchar inchar; char buff[80], *pos, *out; COMMANDS *com; bool need_space= 0; bool ss_comment= 0; DBUG_ENTER("add_line"); if (!line[0] && buffer.is_empty()) DBUG_RETURN(0); #ifdef HA...
cwe
CWE-863
C/C++
create_worker_threads(uint n) { comp_thread_ctxt_t *threads; uint i; threads = (comp_thread_ctxt_t *) my_malloc(sizeof(comp_thread_ctxt_t) * n, MYF(MY_FAE)); for (i = 0; i < n; i++) { comp_thread_ctxt_t *thd = threads + i; thd->num = i + 1; thd->started = FALSE; thd->cancelled = FALSE; thd->data_a...
cwe
CWE-703
Unknown
function createWhereClause($owner, $filter, $search, $daterange, $ok, $warning, $critical, $unknown) { $where_clause = ""; // owner if($owner == "owned"){ $where_clause .= " AND owner != ''"; } elseif($owner == "not owned"){ $where_clause .= " AND owner = ''"; } // advanced search (with *) if($search != ""){ ...
cwe
CWE-78
PHP
rdp_in_unistr(STREAM s, int in_len, char **string, uint32 * str_size) { /* Dynamic allocate of destination string if not provided */ *string = xmalloc(in_len * 2); *str_size = in_len * 2; #ifdef HAVE_ICONV size_t ibl = in_len, obl = *str_size - 1; char *pin = (char *) s->p, *pout = *string; static iconv_t iconv_...
cwe
CWE-787
Unknown
// SPDX-License-Identifier: LGPL-2.1-or-later /* * * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2014 Google Inc. * * */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <sys/uio.h> #include <errno.h> #include "src/shared/att.h" #include "lib/bluetooth.h" #include "lib/uuid.h" #inc...
cwe
CWE-787
C/C++
""" JupyterHub Spawner to spawn user notebooks on a Kubernetes cluster. This module exports `KubeSpawner` class, which is the actual spawner implementation that should be used by JupyterHub. """ from functools import partial # noqa from datetime import datetime import json import os import sys import string import m...
cwe
CWE-863
Python
/* Copyright 2015 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-20
Python
ngx_mail_read_command(ngx_mail_session_t *s, ngx_connection_t *c) { ssize_t n; ngx_int_t rc; ngx_str_t l; ngx_mail_core_srv_conf_t *cscf; if (s->buffer->last < s->buffer->end) { n = c->recv(c, s->buffer->last, s->buffer->end - s->buffer...
cwe
CWE-295
C/C++
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) /* Copyright (C) 2017-2018 Netronome Systems, Inc. */ #include <linux/etherdevice.h> #include <linux/lockdep.h> #include <linux/pci.h> #include <linux/skbuff.h> #include <linux/vmalloc.h> #include <net/devlink.h> #include <net/dst_metadata.h> #include "main.h...
cwe
CWE-400
C/C++
static int tipc_nl_compat_link_dump(struct tipc_nl_compat_msg *msg, struct nlattr **attrs) { struct nlattr *link[TIPC_NLA_LINK_MAX + 1]; struct tipc_link_info link_info; int err; if (!attrs[TIPC_NLA_LINK]) return -EINVAL; err = nla_parse_nested(link, TIPC_NLA_LINK_MAX, attrs[TIPC_NLA_LINK], N...
cwe
CWE-200
C/C++
static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n) { struct net *net = sock_net(skb->sk); struct tcmsg *tcm; struct nlattr *tca[TCA_MAX + 1]; struct net_device *dev; u32 clid; struct Qdisc *q, *p; int err; if (!capable(CAP_NET_ADMIN)) return -EPERM; replay: /* Reinit, just in case somethin...
cwe
CWE-264
Unknown
pci_emul_dinit(struct vmctx *ctx, struct pci_vdev *dev, char *opts) { int error; struct pci_emul_dummy *dummy; dummy = calloc(1, sizeof(struct pci_emul_dummy)); dev->arg = dummy; pci_set_cfgdata16(dev, PCIR_DEVICE, 0x0001); pci_set_cfgdata16(dev, PCIR_VENDOR, 0x10DD); pci_set_cfgdata8(dev, PCIR_CLASS, 0x02); ...
cwe
CWE-617
C/C++
PHP_FUNCTION(imageaffinematrixconcat) { double m1[6]; double m2[6]; double mr[6]; zval **tmp; zval *z_m1; zval *z_m2; int i, nelems; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "aa", &z_m1, &z_m2) == FAILURE) { return; } if (((nelems = zend_hash_num_elements(Z_ARRVAL_P(z_m1))) != 6) || (nelems ...
cwe
CWE-189
C/C++
exec (command, args, callback) { var eargs = []; if (typeof args === "function") { callback = args; args = null; } // Handle spawn if (Array.isArray(args)) { eargs.push("git", [command].concat(args)); } else { eargs.push("...
cwe
CWE-77
JavaScript
public function getBranches() { if (null === $this->branches) { $branches = array(); $bookmarks = array(); $this->process->execute('hg branches', $output, $this->repoDir); foreach ($this->process->splitLines($output) as $branch) { if ($branch ...
cwe
CWE-20
PHP
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { TfLiteTensor* output = GetOutput(context, node, kOutputTensor); const TfLiteTensor* input = GetInput(context, node, kInputTensor); const TfLiteTensor* diag = GetInput(context, node, kDiagonalTensor); FillDiagHelper(input, diag, output); return kTfL...
cwe
CWE-125
C/C++
resetPassword(req) { const config = req.config; if (!config) { this.invalidRequest(); } if (!config.publicServerURL) { return this.missingPublicServerURL(); } const { username, token, new_password } = req.body; if ((!username || !token || !new_password) && req.xhr === false) ...
cwe
CWE-863
JavaScript
/* radare - LGPL - Copyright 2009-2019 - nibble, pancake */ #if 0 * Use RList * Support callback for null command (why?) * Show help of commands - long commands not yet tested at all - added interface to export command list into an autocompletable argc, argv for dietline * r_cmd must provide a nesting char tabl...
cwe
CWE-78
C/C++
/* Library for accessing X3F Files ---------------------------------------------------------------- BSD-style License ---------------------------------------------------------------- * Copyright (c) 2010, Roland Karlsson (roland@proxel.se) * All rights reserved. * * Redistribution and use in source and binary forms, w...
cwe
CWE-787
C/C++
[H],"{1} ago"));F.setAttribute("title",I.toLocaleDateString()+" "+I.toLocaleTimeString())}function k(I){var F=document.createElement("img");F.className="geCommentBusyImg";F.src=IMAGE_PATH+"/spin.gif";I.appendChild(F);I.busyImg=F}function l(I){I.style.border="1px solid red";I.removeChild(I.busyImg)}function p(I){I.style...
cwe
CWE-94
JavaScript
/* * Copyright © 2015-2018 Aeneas Rekkas <aeneas+oss@aeneas.io> * * 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...
cwe
CWE-754
Go
static CACHE_BITMAP_V3_ORDER* update_read_cache_bitmap_v3_order(rdpUpdate* update, wStream* s, UINT16 flags) { BYTE bitsPerPixelId; BITMAP_DATA_EX* bitmapData; UINT32 new_len; BYTE* new_data; CACHE_BITMAP_V3_ORDER* cache_bitmap_v3; if (!update || !s...
cwe
CWE-125
Unknown
/* Copyright (c) 2014. The YARA 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 list of conditions and the followi...
cwe
CWE-119
C/C++
def password_reset(token, db): """Will check if there is a password reset token is valid. The function will reset the password of the user. The new generated password is returned. :token: password reset token :db: db connection :returns: tupe of user and password """ try: token ...
cwe
CWE-327
Python
public static IESParameterSpec guessParameterSpec(BufferedBlockCipher iesBlockCipher) { if (iesBlockCipher == null) { return new IESParameterSpec(null, null, 128); } else { BlockCipher underlyingCipher = iesBlockCipher.getUnderlyingCipher(); ...
cwe
CWE-310
Java
/* SPDX-License-Identifier: LGPL-2.1-or-later */ #include <ctype.h> #include <errno.h> #include <limits.h> #include <stdlib.h> #include <sys/mman.h> #include <sys/time.h> #include <sys/timerfd.h> #include <sys/types.h> #include <unistd.h> #include "alloc-util.h" #include "fd-util.h" #include "fileio.h" #include "fs-u...
cwe
CWE-193
C/C++
setkey_principal3_2_svc(setkey3_arg *arg, struct svc_req *rqstp) { static generic_ret ret; char *prime_arg; gss_buffer_desc client_name, service_name; OM_uint32 minor_stat; kadm5_server_handle_t handle; ...
cwe
CWE-772
C/C++
void delete_run_files(pid_t pid) { delete_bandwidth_run_file(pid); delete_network_run_file(pid); delete_name_run_file(pid); delete_x11_run_file(pid); delete_profile_run_file(pid); }
cwe
CWE-269
Unknown
/** * @file * Read/parse/write an NNTP config file of subscribed newsgroups * * @authors * Copyright (C) 1998 Brandon Long <blong@fiction.net> * Copyright (C) 1999 Andrej Gritsenko <andrej@lucky.net> * Copyright (C) 2000-2017 Vsevolod Volkov <vvv@mutt.org.ua> * * @copyright * This program is free software: yo...
cwe
CWE-19
C/C++
#!/usr/bin/env python # # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import sys from typing import List, Optional from uuid import UUID from onefuzztypes.enums import ( OS, Architecture, ContainerType, ErrorCode, NodeState, ScalesetState, Ta...
cwe
CWE-285
Python
// mkerrors.sh // Code generated by the command above; see README.md. DO NOT EDIT. // +build arm,darwin // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_CCITT = 0xa AF_CHAOS ...
cwe
CWE-287
Go
/** * @file 历史记录 * @author life * */ define('history', [], function() { var tpl = ['<div class="modal fade history-modal" tabindex="-1" role="dialog" aria-hidden="true">', '<div class="modal-dialog modal-lg ">', '<div class="modal-content">', '<div class="modal...
cwe
CWE-79
JavaScript
initialize(int argc, VALUE argv[], VALUE self) { ffi_cif * cif; ffi_type **arg_types; ffi_status result; VALUE ptr, args, ret_type, abi, kwds; long i; rb_scan_args(argc, argv, "31:", &ptr, &args, &ret_type, &abi, &kwds); if(NIL_P(abi)) abi = INT2NUM(FFI_DEFAULT_ABI); Check_Type(args, T...
cwe
CWE-119
C/C++
void intel_guc_ads_reset(struct intel_guc *guc) { if (!guc->ads_vma) return; __guc_ads_init(guc); }
cwe
CWE-20
Unknown
/* * Copyright (C) 2003-2004 The FFmpeg project * Copyright (C) 2019 Peter Ross * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 ...
cwe
CWE-476
C/C++
/* * Copyright (c) 2018-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #include <fizz/record/EncryptedRecordLayer.h> #include <fizz/crypto/aead/IOBufUtil.h> namespace fizz {...
cwe
CWE-400
C/C++
SetDeviceIndicators(char *wire, DeviceIntPtr dev, unsigned changed, int num, int *status_rtrn, ClientPtr client, xkbExtensionDeviceNotify * ev, xkbSetDeviceInfoReq * stuff) { x...
cwe
CWE-787
Unknown
/* 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-617
Python
TIFFRGBAImageOK(TIFF* tif, char emsg[1024]) { TIFFDirectory* td = &tif->tif_dir; uint16 photometric; int colorchannels; if (!tif->tif_decodestatus) { sprintf(emsg, "Sorry, requested compression method is not configured"); return (0); } switch (td->td_bitspersample) { case 1: case 2: case 4: case 8: ...
cwe
CWE-119
Unknown
static MagickBooleanType WriteSIXELImage(const ImageInfo *image_info,Image *image) { ExceptionInfo *exception; MagickBooleanType status; register const IndexPacket *indexes; register ssize_t i, x; ssize_t opacity, y; sixel_output_t *output; unsigned char sixel_pal...
cwe
CWE-119
C/C++
static struct dst_entry *ip6_sk_dst_check(struct sock *sk, struct dst_entry *dst, const struct flowi6 *fl6) { struct ipv6_pinfo *np = inet6_sk(sk); struct rt6_info *rt = (struct rt6_info *)dst; if (!dst) goto out; /* Yes, checking route validity in not connected * case is not very simple. Take i...
cwe
CWE-20
C/C++
var CommentsWindow=function(b,f,l,d,t,u){function E(){for(var H=N.getElementsByTagName("div"),F=0,J=0;J<H.length;J++)"none"!=H[J].style.display&&H[J].parentNode==N&&F++;K.style.display=0==F?"block":"none"}function c(H,F,J,R){function W(){F.removeChild(U);F.removeChild(Y);V.style.display="block";O.style.display="block"}...
cwe
CWE-94
JavaScript
package commands import ( "context" "crypto/sha256" "encoding/base64" "fmt" "html" "net/http" "os" "strconv" "strings" "time" "github.com/coreos/go-oidc" "github.com/golang-jwt/jwt/v4" log "github.com/sirupsen/logrus" "github.com/skratchdot/open-golang/open" "github.com/spf13/cobra" "golang.org/x/oaut...
cwe
CWE-330
Go
import os import subprocess import logging import time import argparse import datetime from traitlets import Integer, default from traitlets.config import Configurable from functools import partial def execute_cmd(cmd, **kwargs): """ Call given command, yielding output line by line """ yield '$ {}\n'....
cwe
CWE-78
Python
var CommentsWindow=function(b,f,l,d,t,u){function E(){for(var H=N.getElementsByTagName("div"),F=0,J=0;J<H.length;J++)"none"!=H[J].style.display&&H[J].parentNode==N&&F++;K.style.display=0==F?"block":"none"}function c(H,F,J,R){function W(){F.removeChild(U);F.removeChild(Y);V.style.display="block";O.style.display="block"}...
cwe
CWE-94
JavaScript
auto Phase3() -> Local<Value> final { return Boolean::New(Isolate::GetCurrent(), did_set); }
cwe
CWE-913
C/C++
// 话题(帖子)相关js功能 (function(){ emojify.setConfig({ // emojify_tag_type : 'span', only_crawl_id : null, img_dir : SG.EMOJI_DOMAIN, ignored_tags : { //忽略以下几种标签内的emoji识别 'SCRIPT' : 1, 'TEXTAREA': 1, 'A' : 1, 'PRE' : 1, 'CODE' : 1 } }); SG.Topics = function(){} SG....
cwe
CWE-707
Go
connect(config) { config.user = config.username; const connectionConfig = _.pick(config, [ 'user', 'password', 'host', 'database', 'port' ]); connectionConfig.types = { getTypeParser: ConnectionManager.prototype.getTypeParser.bind(this) }; if (config.dialectOptions) { _.merge...
cwe
CWE-20
JavaScript
BITMAP_UPDATE* update_read_bitmap_update(rdpUpdate* update, wStream* s) { UINT32 i; BITMAP_UPDATE* bitmapUpdate = calloc(1, sizeof(BITMAP_UPDATE)); if (!bitmapUpdate) goto fail; if (Stream_GetRemainingLength(s) < 2) goto fail; Stream_Read_UINT16(s, bitmapUpdate->number); /* numberRectangles (2 bytes) */ WL...
cwe
CWE-119
C/C++
checked_xcalloc (size_t num, size_t size) { alloc_limit_assert ("checked_xcalloc", (num *size)); return xcalloc (num, size); }
cwe
CWE-190
C/C++
cupsdSendError(cupsd_client_t *con, /* I - Connection */ http_status_t code, /* I - Error code */ int auth_type)/* I - Authentication type */ { char location[HTTP_MAX_VALUE]; /* Location field */ cupsdLogClient(con, CUPSD_LOG_DEBUG2, "cupsdSendError code=%d, auth_type=%d", code,...
cwe
CWE-120
Unknown
/* Copyright 2021 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-617
Python
#include "source/common/http/filter_manager.h" #include <functional> #include "envoy/http/header_map.h" #include "envoy/matcher/matcher.h" #include "source/common/common/enum_to_int.h" #include "source/common/common/scope_tracked_object_stack.h" #include "source/common/common/scope_tracker.h" #include "source/common...
cwe
CWE-416
C/C++
package com.mayank.rucky.utils; import com.mayank.rucky.R; public class Constants { //HIDModel public static final int HID_OFFLINE = 1; public static final int HID_UPDATE = 2; public static final int HID_DOWNLOAD = 3; //web view public static final String activityTitle = "ACTIVITY_TITLE"; ...
cwe
CWE-327
Java
static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info, ExceptionInfo *exception) { char page_geometry[MaxTextExtent]; Image *image; MagickBooleanType logging; volatile int first_mng_object, object_id, term_chunk_found, skip_to_iend; volatile ssize_t ...
cwe
CWE-835
C/C++
int main(int argc, char **argv) { /* I18n */ setlocale(LC_ALL, ""); #if ENABLE_NLS bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); #endif abrt_init(argv); /* Can't keep these strings/structs static: _() doesn't support that */ const char *program_usage_string = _( "& [-y] ...
cwe
CWE-59
C/C++
/* * The copyright in this software is being made available under the 2-clauses * BSD License, included below. This software may be subject to other third * party and contributor rights, including patent rights, and no such rights * are granted under this license. * * Copyright (c) 2002-2014, Universite catholiqu...
cwe
CWE-400
C/C++
import dayjs from 'dayjs' import utc from 'dayjs/plugin/utc' import { saveAs } from 'file-saver' import { FlowRouter } from 'meteor/ostrio:flow-router-extra' import { NullXlsx } from '@neovici/nullxlsx' import bootstrap from 'bootstrap' import { i18nReady, t } from '../../utils/i18n.js' import Timecards from '../../api...
cwe
CWE-79
JavaScript
static SEND_DCC_REC *dcc_send_create(IRC_SERVER_REC *server, CHAT_DCC_REC *chat, const char *nick, const char *arg) { SEND_DCC_REC *dcc; dcc = g_new0(SEND_DCC_REC, 1); dcc->orig_type = module_get_uniq_id_str("DCC", "GET"); dcc->type = module_get_uniq_id_str("DCC", "SEND"); dcc->fhandle = -1; dc...
cwe
CWE-416
Unknown
import AppCache from './cache'; import Parse from 'parse/node'; import auth from './Auth'; import Config from './Config'; import ClientSDK from './ClientSDK'; import defaultLogger from './logger'; import rest from './rest'; import MongoStorageAdapter from './Adapters/Storage/Mongo/MongoStorageAdapter'; import PostgresS...
cwe
CWE-290
JavaScript
package commands import ( "context" "github.com/openfga/openfga/pkg/logger" tupleUtils "github.com/openfga/openfga/pkg/tuple" "github.com/openfga/openfga/pkg/utils" serverErrors "github.com/openfga/openfga/server/errors" "github.com/openfga/openfga/server/validation" "github.com/openfga/openfga/storage" openf...
cwe
CWE-863
Go
import javax.mail.Session; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession;...
cwe
CWE-89
Java
BOOL region16_union_rect(REGION16* dst, const REGION16* src, const RECTANGLE_16* rect) { const RECTANGLE_16* srcExtents; RECTANGLE_16* dstExtents; const RECTANGLE_16* currentBand, *endSrcRect, *nextBand; REGION16_DATA* newItems = NULL; RECTANGLE_16* dstRect = NULL; UINT32 usedRects, srcNbRects; UINT16 topInt...
cwe
CWE-252
C/C++
decode_rt_routing_info(netdissect_options *ndo, const u_char *pptr, char *buf, u_int buflen) { uint8_t route_target[8]; u_int plen; ND_TCHECK(pptr[0]); plen = pptr[0]; /* get prefix length */ if (0 == plen) { snprintf(buf, buflen, "default route target"); return 1; } if (32 > plen...
cwe
CWE-125
C/C++
# Copyright Red Hat 2017, Jake Hunsaker <jhunsake@redhat.com> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This pr...
cwe
CWE-276
Python
package cz.metacentrum.perun.core.impl; import cz.metacentrum.perun.core.api.ExtSource; import cz.metacentrum.perun.core.api.GroupsManager; import cz.metacentrum.perun.core.api.exceptions.ExtSourceUnsupportedOperationException; import cz.metacentrum.perun.core.api.exceptions.InternalErrorException; import cz.metacentr...
cwe
CWE-732
Java
PHP_FUNCTION(odbc_execute) { zval *pv_res, *pv_param_arr, **tmp; typedef struct params_t { SQLLEN vallen; int fp; } params_t; params_t *params = NULL; char *filename; unsigned char otype; SQLSMALLINT sqltype, ctype, scale; SQLSMALLINT nullable; SQLULEN precision; odbc_result *result; int numArgs, ...
cwe
CWE-20
C/C++
public function getClone($modelId = null) { $this->authorize('view', AssetModel::class); // Check if the model exists if (is_null($model_to_clone = AssetModel::find($modelId))) { return redirect()->route('models.index')->with('error', trans('admin/models/message.does_not_exist'))...
cwe
CWE-284
PHP
'use strict'; var BN = require('bn.js'); var utils = require('../utils'); var assert = utils.assert; function KeyPair(ec, options) { this.ec = ec; this.priv = null; this.pub = null; // KeyPair(ec, { priv: ..., pub: ... }) if (options.priv) this._importPrivate(options.priv, options.privEnc); if (optio...
cwe
CWE-327
Java
protected void engineInit( byte[] params) throws IOException { try { ASN1Sequence s = (ASN1Sequence)ASN1Primitive.fromByteArray(params); if (s.size() == 1) { this.currentSpec = new IESParameterSpec(null, null, ASN1Integer.getInstan...
cwe
CWE-310
Java
bool ASessionDescription::getDimensions( size_t index, unsigned long PT, int32_t *width, int32_t *height) const { *width = 0; *height = 0; char key[20]; sprintf(key, "a=framesize:%lu", PT); AString value; if (!findAttribute(index, key, &value)) { return false; } const char *...
cwe
CWE-284
C/C++
function parseURLParams( url: URL, dontParse: boolean = false, source: string = 'hash'): Object { const paramStr = source === 'search' ? url.search : url.hash; const params = {}; const paramParts = (paramStr && paramStr.substr(1).split('&')) || []; // Detect and ignore hash para...
cwe
CWE-1321
JavaScript
it "should not have settings by default" do Rack::MiniProfiler::ClientSettings.new({}).has_cookie?.should == false end
cwe
CWE-200
Ruby
static ssize_t fuse_file_read_iter(struct kiocb *iocb, struct iov_iter *to) { struct file *file = iocb->ki_filp; struct fuse_file *ff = file->private_data; struct inode *inode = file_inode(file); if (is_bad_inode(inode)) return -EIO; if (FUSE_IS_DAX(inode)) return fuse_dax_read_iter(iocb, to); if (!(ff->op...
cwe
CWE-459
Unknown
/* * Copyright 2019 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
public function testPinCommentAction() { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $this->assertAccessIsGranted($client, '/admin/project/1/details'); $form = $client->getCrawler()->filter('form[name=project_comment_form]')->form(); $client->submit($form, [ ...
cwe
CWE-352
PHP
static struct wildmat *split_wildmats(char *str) { const char *prefix; char pattern[MAX_MAILBOX_BUFFER] = "", *p, *c; struct wildmat *wild = NULL; int n = 0; if ((prefix = config_getstring(IMAPOPT_NEWSPREFIX))) snprintf(pattern, sizeof(pattern), "%s.", prefix); p = pattern + strlen(pattern); ...
cwe
CWE-119
Unknown
unsigned uv__utf8_decode1(const char** p, const char* pe) { unsigned a; a = (unsigned char) *(*p)++; if (a < 128) return a; /* ASCII, common case. */ return uv__utf8_decode1_slow(p, pe, a); }
cwe
CWE-125
Unknown
arguments):(this.addOp(this.lineOp,O,R),this.lastX=O,this.lastY=R)};p.prototype.moveTo=function(O,R){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,O,R),this.lastX=O,this.lastY=R,this.firstX=O,this.firstY=R)};p.prototype.close=function(){this.passThrough?this.originalClose.app...
cwe
CWE-20
JavaScript
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ #include <stdlib.h> #include <stdio.h> #include <errno.h> #include <inttypes.h> #include <string.h> #include <sys/queue.h> #ifdef WIN32 #include <Ws2tcpip.h> #else #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <a...
cwe
CWE-476
C/C++
bool PermissionsRemoveFunction::RunImpl() { scoped_ptr<Remove::Params> params(Remove::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); scoped_refptr<PermissionSet> permissions = helpers::UnpackPermissionSet(params->permissions, &error_); if (!permissions.get()) return false; ...
cwe
CWE-264
C/C++
from __future__ import unicode_literals from itertools import chain import re import six from six.moves.urllib.parse import urlparse from xml.sax.saxutils import unescape from bleach import html5lib_shim from bleach.utils import alphabetize_attributes, force_unicode #: List of allowed tags ALLOWED_TAGS = [ 'a'...
cwe
CWE-1333
Python
selaGetCombName(SELA *sela, l_int32 size, l_int32 direction) { char *selname; char combname[L_BUF_SIZE]; l_int32 i, nsels, sx, sy, found; SEL *sel; PROCNAME("selaGetCombName"); if (!sela) return (char *)ERROR_PTR("sela not defined", procName, NULL); ...
cwe
CWE-787
C/C++
static int aesni_cbc_hmac_sha256_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t len) { EVP_AES_HMAC_SHA256 *key = data(ctx); unsigned int l; size_t plen = key->payload_length, iv = 0, /* explicit...
cwe
CWE-310
Unknown