code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static Image *ReadTEXTImage(const ImageInfo *image_info,Image *image,
char *text,ExceptionInfo *exception)
{
char
filename[MaxTextExtent],
geometry[MaxTextExtent],
*p;
DrawInfo
*draw_info;
Image
*texture;
MagickBooleanType
status;
PointInfo
delta;
RectangleInfo
page;
... | cwe | CWE-120 | C/C++ |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 shavitmichael, OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | cwe | CWE-352 | JavaScript |
void luaT_getvarargs (lua_State *L, CallInfo *ci, StkId where, int wanted) {
int i;
int nextra = ci->u.l.nextraargs;
if (wanted < 0) {
wanted = nextra; /* get all extra arguments available */
checkstackp(L, nextra, where); /* ensure stack space */
L->top = where + nextra; /* next instruction will n... | cwe | CWE-787 | Unknown |
mbed_connect_step3(struct Curl_easy *data, struct connectdata *conn,
int sockindex)
{
CURLcode retcode = CURLE_OK;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
struct ssl_backend_data *backend = connssl->backend;
DEBUGASSERT(ssl_connect_3 == connssl->connecting_state);
if(SSL... | cwe | CWE-290 | Unknown |
friend H AbslHashValue(H h, const TensorKey& k) {
const uint8* d = static_cast<uint8*>(k.data());
size_t s = k.AllocatedBytes();
std::vector<uint8> vec;
vec.reserve(s);
for (int i = 0; i < s; i++) {
vec.push_back(d[i]);
}
return H::combine(std::move(h), s);
} | cwe | CWE-120 | C/C++ |
# -*- coding: utf-8 -*-
# rdiffweb, A web interface to rdiff-backup repositories
# Copyright (C) 2012-2021 rdiffweb contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version ... | cwe | CWE-521 | Python |
def cluster_destroy(params, request, session)
if not allowed_for_local_cluster(session, Permissions::FULL)
return 403, 'Permission denied'
end
out, errout, retval = run_cmd(session, PCS, "cluster", "destroy")
if retval == 0
return [200, "Successfully destroyed cluster"]
else
return [400, "Error de... | cwe | CWE-384 | Ruby |
TfLiteStatus PrepareSimple(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
OpContext op_context(context, node);
TF_LITE_ENSURE_TYPES_EQ(context, op_context.axis->type, kTfLiteInt32);
TF_LITE_ENSURE_OK(context, Initia... | cwe | CWE-125 | C/C++ |
static const char *GetMagickPropertyLetter(const ImageInfo *image_info,
Image *image,const char letter)
{
char
value[MaxTextExtent];
const char
*string;
assert(image != (Image *) NULL);
assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(Trac... | cwe | CWE-476 | 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-125 | C/C++ |
void Compute(OpKernelContext* ctx) override {
const Tensor& input_0 = ctx->input(0);
const Tensor& input_1 = ctx->input(1);
const Device& eigen_device = ctx->eigen_device<Device>();
bool error = false;
bool* const error_ptr = Functor::has_errors ? &error : nullptr;
// NOTE: Handle three simple ... | cwe | CWE-617 | C/C++ |
int is_regular_file(struct dirent *dent, const char *dirname)
{
if (dent->d_type == DT_REG)
return 1;
if (dent->d_type != DT_UNKNOWN)
return 0;
char *fullname = xasprintf("%s/%s", dirname, dent->d_name);
struct stat statbuf;
int r = lstat(fullname, &statbuf);
free(fullname);
... | cwe | CWE-20 | Unknown |
const got = require('@/utils/got');
const { parseDate } = require('@/utils/parse-date');
const parseStatuses = (data) =>
data.map((item) => {
// docs on: https://docs.joinmastodon.org/entities/status/
const accountRepostedBy = item.reblog ? item.account : null;
item = item.reblog ? item.re... | cwe | CWE-918 | JavaScript |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from psycopg2 import OperationalError, Error
from odoo import api, fields, models, _
from odoo.exceptions import UserError, ValidationError
from odoo.osv import expression
from odoo.tools.float_utils import float_compar... | cwe | CWE-269 | Python |
bool ParseVP9SuperFrameIndex(const std::uint8_t* frame,
std::size_t frame_length, Ranges* frame_ranges) {
if (frame == nullptr || frame_length == 0 || frame_ranges == nullptr)
return false;
bool parse_ok = false;
const std::uint8_t marker = frame[frame_length - 1];
const std::u... | cwe | CWE-125 | C/C++ |
package saml
import (
"bytes"
"compress/flate"
"crypto"
"crypto/tls"
"crypto/x509"
"encoding/base64"
"encoding/xml"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
"regexp"
"strconv"
"text/template"
"time"
"github.com/beevik/etree"
xrv "github.com/mattermost/xml-roundtrip-validator"
dsig "github.... | cwe | CWE-770 | Go |
dao_input_nonstoring(void)
{
#if RPL_WITH_NON_STORING
uip_ipaddr_t dao_sender_addr;
uip_ipaddr_t dao_parent_addr;
rpl_dag_t *dag;
rpl_instance_t *instance;
unsigned char *buffer;
uint16_t sequence;
uint8_t instance_id;
uint8_t lifetime;
uint8_t prefixlen;
uint8_t flags;
uint8_t subopt_type;
uip_... | cwe | CWE-703 | Unknown |
pci_cfgrw(struct vmctx *ctx, int vcpu, int in, int bus, int slot, int func,
int coff, int bytes, uint32_t *eax)
{
struct businfo *bi;
struct slotinfo *si;
struct pci_vdev *dev;
struct pci_vdev_ops *ops;
int idx, needcfg;
uint64_t addr, bar, mask;
bool decode, ignore_reg_unreg = false;
bi = pci_businfo[bus];... | cwe | CWE-617 | C/C++ |
int tfm_load_file(const char *filename, TFMInfo *info)
{
int lf, lh, bc, ec, nw, nh, nd, ne;
int i, n;
Uchar *tfm;
Uchar *ptr;
struct stat st;
int size;
FILE *in;
Int32 *cb;
Int32 *charinfo;
Int32 *widths;
Int32 *heights;
Int32 *depths;
Uint32 checksum;
in = fopen(filename, "rb");
if(in == NULL)
retur... | cwe | CWE-20 | Unknown |
void *ztrymalloc_usable(size_t size, size_t *usable) {
void *ptr = malloc(size+PREFIX_SIZE);
if (!ptr) return NULL;
#ifdef HAVE_MALLOC_SIZE
size = zmalloc_size(ptr);
update_zmalloc_stat_alloc(size);
if (usable) *usable = size;
return ptr;
#else
*((size_t*)ptr) = size;
update_zmalloc_sta... | cwe | CWE-190 | Unknown |
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if y... | cwe | CWE-79 | Java |
krb5_ldap_put_principal(krb5_context context, krb5_db_entry *entry,
char **db_args)
{
int l=0, kerberos_principal_object_type=0;
unsigned int ntrees=0, tre=0;
krb5_error_code st=0, tempst=0;
LDAP *ld=NULL;
... | cwe | CWE-703 | Unknown |
async config(obj, args, context, info) {
return {
host: WIKI.config.host,
title: WIKI.config.title,
company: WIKI.config.company,
contentLicense: WIKI.config.contentLicense,
logoUrl: WIKI.config.logoUrl,
...WIKI.config.seo,
...WIKI.config.features,
.... | cwe | CWE-79 | JavaScript |
int jp2_encode(jas_image_t *image, jas_stream_t *out, const char *optstr)
{
jp2_box_t *box;
jp2_ftyp_t *ftyp;
jp2_ihdr_t *ihdr;
jas_stream_t *tmpstream;
int allcmptssame;
jp2_bpcc_t *bpcc;
long len;
uint_fast16_t cmptno;
jp2_colr_t *colr;
char buf[4096];
uint_fast32_t overhead;
jp2_cdefchan_t *cdefchanent;
... | cwe | CWE-476 | C/C++ |
nv_replace(cmdarg_T *cap)
{
char_u *ptr;
int had_ctrl_v;
long n;
if (checkclearop(cap->oap))
return;
#ifdef FEAT_JOB_CHANNEL
if (bt_prompt(curbuf) && !prompt_curpos_editable())
{
clearopbeep(cap->oap);
return;
}
#endif
// get another character
if (cap->nchar == Ctrl_V)
{
h... | cwe | CWE-416 | C/C++ |
int hci_req_sync(struct hci_dev *hdev, int (*req)(struct hci_request *req,
unsigned long opt),
unsigned long opt, u32 timeout, u8 *hci_status)
{
int ret;
if (!test_bit(HCI_UP, &hdev->flags))
return -ENETDOWN;
/* Serialize all requests */
hci_req_sync_lock(hdev);
ret = __hci_req_sync(hdev, req, opt, ... | cwe | CWE-362 | Unknown |
function validateAdult(username, password, connection)
{
var strQuery = "SELECT * FROM adult WHERE username= '" +connection.escape(username)+"'" +"AND password= '"
+ hashPassword(password)+"'";
connection.query( strQuery, function(err, rows)
{if(err) {
throw err;
}else{
temp= rows[0];
temp.passwor... | cwe | CWE-89 | JavaScript |
int __gfs2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
{
int error;
int len;
char *data;
const char *name = gfs2_acl_name(type);
if (acl && acl->a_count > GFS2_ACL_MAX_ENTRIES(GFS2_SB(inode)))
return -E2BIG;
if (type == ACL_TYPE_ACCESS) {
umode_t mode = inode->i_mode;
error = posix_acl_... | cwe | CWE-285 | C/C++ |
static Image *ReadSIXELImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
char
*sixel_buffer;
Image
*image;
MagickBooleanType
status;
register char
*p;
register ssize_t
x;
register Quantum
*q;
size_t
length;
ssize_t
i,
j,
y;
unsigned char
... | cwe | CWE-401 | Unknown |
void ih264d_init_decoder(void * ps_dec_params)
{
dec_struct_t * ps_dec = (dec_struct_t *)ps_dec_params;
dec_slice_params_t *ps_cur_slice;
pocstruct_t *ps_prev_poc, *ps_cur_poc;
/* Free any dynamic buffers that are allocated */
ih264d_free_dynamic_bufs(ps_dec);
ps_cur_slice = ps_dec->ps_... | cwe | CWE-20 | C/C++ |
ripng_print(netdissect_options *ndo, const u_char *dat, unsigned int length)
{
register const struct rip6 *rp = (const struct rip6 *)dat;
register const struct netinfo6 *ni;
register u_int amt;
register u_int i;
int j;
int trunc;
if (ndo->ndo_snapend < dat)
return;
amt = ndo->ndo_snapend - dat;
i = min(leng... | cwe | CWE-125 | C/C++ |
TfLiteRegistration AddOpRegistration() {
TfLiteRegistration reg = {nullptr, nullptr, nullptr, nullptr};
reg.custom_name = "my_add";
reg.builtin_code = tflite::BuiltinOperator_CUSTOM;
reg.prepare = [](TfLiteContext* context, TfLiteNode* node) {
// Set output size to input size
const TfLiteTensor* input... | cwe | CWE-125 | C/C++ |
static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image,
ExceptionInfo *exception)
{
BMPInfo
bmp_info;
BMPSubtype
bmp_subtype;
const char
*option;
const StringInfo
*profile;
MagickBooleanType
have_color_info,
status;
MagickOffsetType
scene;
Memor... | cwe | CWE-835 | C/C++ |
ProcScreenSaverUnsetAttributes(ClientPtr client)
{
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
REQUEST(xScreenSaverUnsetAttributesReq);
PanoramiXRes *draw;
int rc, i;
rc = dixLookupResourceByClass((void **) &draw, stuff->drawable,
XRC_DRA... | cwe | CWE-20 | C/C++ |
chrand_principal3_2_svc(chrand3_arg *arg, struct svc_req *rqstp)
{
static chrand_ret ret;
krb5_keyblock *k;
int nkeys;
char *prime_arg, *funcname;
gss_buffer_desc client_name,
service_name;
OM_uint32 ... | cwe | CWE-772 | C/C++ |
psf_asciiheader_printf (SF_PRIVATE *psf, const char *format, ...)
{ va_list argptr ;
int maxlen ;
char *start ;
maxlen = strlen ((char*) psf->header) ;
start = ((char*) psf->header) + maxlen ;
maxlen = sizeof (psf->header) - maxlen ;
va_start (argptr, format) ;
vsnprintf (start, maxlen, format, argptr) ;
va_... | cwe | CWE-119 | C/C++ |
else{var z=c.getFileData(!0,null,null,null,null,!0),L=A.getGraphBounds(),M=Math.floor(L.width*m/A.view.scale),n=Math.floor(L.height*m/A.view.scale);if(z.length<=MAX_REQUEST_SIZE&&M*n<MAX_AREA)if(c.hideDialog(),"png"!=g&&"jpg"!=g&&"jpeg"!=g||!c.isExportToCanvas()){var y={globalVars:A.getExportVariables()};x&&(y.grid={si... | cwe | CWE-20 | JavaScript |
static struct pending_op *acquire_write(struct external_chrc *chrc,
struct btd_device *device,
struct gatt_db_attribute *attrib,
unsigned int id,
const uint8_t *value, size_t len,
uint8_t link_type)
{
struct pending_op *op;
bool acquiring = !queue_isempty(chrc->pending_writes);
op = pending... | cwe | CWE-416 | Unknown |
function breakQueryString(qs) {
if (!qs) {
return {}
}
if (qs.includes("?")) {
qs = qs.split("?")[1]
}
const params = qs.split("&")
let paramObj = {}
for (let param of params) {
const split = param.split("=")
paramObj[split[0]] = split.slice(1).join("=")
}
return paramObj
} | cwe | CWE-913 | JavaScript |
int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
const ASN1_ITEM *it,
int tag, int aclass, char opt, ASN1_TLC *ctx)
{
const ASN1_TEMPLATE *tt, *errtt = NULL;
const ASN1_COMPAT_FUNCS *cf;
const ASN1_EXTERN_FUNCS *ef;
const ASN1_AUX *aux... | cwe | CWE-200 | Unknown |
void OneClickSigninSyncStarter::UntrustedSigninConfirmed(
StartSyncMode response) {
if (response == UNDO_SYNC) {
CancelSigninAndDelete();
} else {
if (response == CONFIGURE_SYNC_FIRST)
start_mode_ = response;
SigninManager* signin = SigninManagerFactory::GetForProfile(profile_);
signin... | cwe | CWE-200 | C/C++ |
# -*- coding:Utf-8 -*-
import os, sys, stat, re
import config
from io import open
from ldap3 import Server, Connection, ALL
from ldap3.utils.dn import escape_rdn
from flask import request
from sqlalchemy import exc
from sqlalchemy.orm import sessionmaker
from app import app, db
from app.models_mod import user, targe... | cwe | CWE-20 | Go |
function Yi(e){let t=Y[e];if(!t)throw"Component not found: "+e;return t} | cwe | CWE-352 | JavaScript |
static int get_recurse_data_length(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend,
BOOL *needs_control_head, BOOL *has_quit, BOOL *has_accept)
{
int length = 1;
int size;
PCRE2_SPTR alternative;
BOOL quit_found = FALSE;
BOOL accept_found = FALSE;
BOOL setsom_found = FALSE;
BOOL setmark_found = FALSE;
BOOL c... | cwe | CWE-703 | C/C++ |
void Compute(OpKernelContext* context) override {
const Tensor* reverse_index_map_t;
const Tensor* grad_values_t;
OP_REQUIRES_OK(context,
context->input("reverse_index_map", &reverse_index_map_t));
OP_REQUIRES_OK(context, context->input("grad_values", &grad_values_t));
const CPUD... | cwe | CWE-617 | C/C++ |
int bpf_check(struct bpf_prog **prog, union bpf_attr *attr)
{
struct bpf_verifier_env *env;
struct bpf_verifer_log *log;
int ret = -EINVAL;
/* no program is valid */
if (ARRAY_SIZE(bpf_verifier_ops) == 0)
return -EINVAL;
/* 'struct bpf_verifier_env' can be global, but since it's not small,
* allocate/free i... | cwe | CWE-20 | Unknown |
static int parse_eops(extop **result, bool critical, int elem)
{
extop *eop = NULL, *prev = NULL;
extop **tail = result;
int sign;
int i = tokval.t_type;
int oper_num = 0;
bool do_subexpr = false;
*tail = NULL;
/* End of string is obvious; ) ends a sub-expression list e.g. DUP */
f... | cwe | CWE-416 | C/C++ |
Error ImageLoaderTGA::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) {
Vector<uint8_t> src_image;
int src_image_len = f->get_len();
ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT);
ERR_FAIL_COND_V(src_image_len < (int)sizeof(tga_header_s), ERR_FILE_CORRUPT);
src_image.resiz... | cwe | CWE-20 | Unknown |
toMathMLclass: function (attr) {
var CLASS = []; if (this["class"]) {CLASS.push(this["class"])}
if (this.isa(MML.TeXAtom) && SETTINGS.texHints) {
var TEXCLASS = ["ORD","OP","BIN","REL","OPEN","CLOSE","PUNCT","INNER","VCENTER"][this.texClass];
if (TEXCLASS) {
CLASS.push("MJX-TeXAtom... | cwe | CWE-79 | JavaScript |
protected function generateVerifyCode()
{
if ($this->minLength > $this->maxLength) {
$this->maxLength = $this->minLength;
}
if ($this->minLength < 3) {
$this->minLength = 3;
}
if ($this->maxLength > 20) {
$this->maxLength = 20;
}
... | cwe | CWE-330 | PHP |
win_enter_ext(
win_T *wp,
int undo_sync,
int curwin_invalid,
int trigger_new_autocmds,
int trigger_enter_autocmds,
int trigger_leave_autocmds)
{
int other_buffer = FALSE;
if (wp == curwin && !curwin_invalid) /* nothing to do */
return;
#ifdef FEAT_JOB_CHANNEL
if (!curwin_inv... | cwe | CWE-416 | C/C++ |
/**
* Scans an object for all keys that are either objects or arrays
* and returns an array of those keys only.
* @param {Object|Array} obj The object to scan.
* @returns {[string]} An array of string keys.
* @private
*/
const _iterableKeys = (obj) => {
return Object.entries(obj).reduce((arr, [key, val]) => {
... | cwe | CWE-20 | JavaScript |
function preprocessRFC2822(s) {
// Remove comments and folding whitespace and replace multiple-spaces with a single space
return s
.replace(/\([^)]*\)|[\n\t]/g, ' ')
.replace(/(\s\s+)/g, ' ')
.replace(/^\s\s*/, '')
.replace(/\s\s*$/, '');
} | cwe | CWE-1333 | JavaScript |
import config from 'config';
import { authHeader, handleResponse } from '@/_helpers';
export const userService = {
getAll,
createUser,
deleteUser,
setPasswordFromToken,
updateCurrentUser,
changePassword,
};
function getAll() {
const requestOptions = { method: 'GET', headers: authHeader() };
return fet... | cwe | CWE-74 | JavaScript |
# -*- coding: utf-8 -*-
import random
import socket
import string
import js2py
from .check import is_mapping
def random_string(length):
seq = string.ascii_letters + string.digits + string.punctuation
return "".join(random.choice(seq) for _ in range(length))
def is_plural(value):
try:
n = abs(... | cwe | CWE-94 | Python |
PJ_DEF(pj_status_t) pjmedia_rtcp_fb_build_rpsi(
pjmedia_rtcp_session *session,
void *buf,
pj_size_t *length,
const pjmedia_rtcp_fb_rpsi *rpsi)
{
pjmedia_rtcp_common *hdr;
pj_uint8_t *p;
unsigned bitlen, padlen, len;
PJ_ASSERT_RETURN(session && buf && length && rpsi,... | cwe | CWE-787 | C/C++ |
# (from BackInTime)
# Copyright (C) 2015-2017 Germar Reitze
#
# 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 p... | cwe | CWE-362 | Python |
PHP_FUNCTION(mcrypt_generic)
{
zval *mcryptind;
char *data;
int data_len;
php_mcrypt *pm;
unsigned char* data_s;
int block_size, data_size;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &mcryptind, &data, &data_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(pm, php_mcrypt *, &mcryptind, -... | cwe | CWE-190 | C/C++ |
void IndexBoundsBuilder::_translatePredicate(const MatchExpression* expr,
const BSONElement& elt,
const IndexEntry& index,
OrderedIntervalList* oilOut,
... | cwe | CWE-754 | Unknown |
z_jpx_decode(i_ctx_t * i_ctx_p)
{
os_ptr op = osp;
ref *sop = NULL;
ref *csname = NULL;
stream_jpxd_state state;
/* it's our responsibility to call set_defaults() */
state.memory = imemory->non_gc_memory;
if (s_jpxd_template.set_defaults)
(*s_jpxd_template.set_defaults)((stream_state ... | cwe | CWE-704 | Unknown |
app.get('/static/*', function(req, res)
{
res.header("Server", serverName);
var filePath = path.normalize(__dirname + "/.." + req.url.split("?")[0]);
res.sendfile(filePath, { maxAge: exports.maxAge });
}); | cwe | CWE-22 | JavaScript |
gboolean lxterminal_socket_initialize(LXTermWindow * lxtermwin, gint argc, gchar * * argv)
{
/* Normally, LXTerminal uses one process to control all of its windows.
* The first process to start will create a Unix domain socket in /tmp.
* It will then bind and listen on this socket.
* The subsequent p... | cwe | CWE-284 | C/C++ |
// SPDX-License-Identifier: GPL-2.0+
//
// Freescale i.MX7ULP LPSPI driver
//
// Copyright 2016 Freescale Semiconductor, Inc.
// Copyright 2018 NXP Semiconductors
#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/dmaengine.h>
#include <linux/dma-mapping.h>
#include <linux/er... | cwe | CWE-401 | C/C++ |
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
| Copyrigh... | cwe | CWE-119 | C/C++ |
function list_process($bp,$display,$bdd){
$sql = "select name from bp where is_define = 1 and name!='".$bp."' and priority = '" . $display . "'";
$req = $bdd->query($sql);
$process = $req->fetchall();
echo json_encode($process);
} | cwe | CWE-78 | PHP |
static inline int ip6_ufo_append_data(struct sock *sk,
int getfrag(void *from, char *to, int offset, int len,
int odd, struct sk_buff *skb),
void *from, int length, int hh_len, int fragheaderlen,
int transhdrlen, int mtu,unsigned int flags,
struct rt6_info *rt)
{
struct sk_buff *skb;
int err;
/* The... | cwe | CWE-264 | Unknown |
static pj_status_t STATUS_FROM_SSL_ERR2(char *action, pj_ssl_sock_t *ssock,
int ret, int err, int len)
{
unsigned long ssl_err = err;
if (err == SSL_ERROR_SSL) {
ssl_err = ERR_peek_error();
}
/* Dig for more from OpenSSL error queue */
SSLLogErrors(action, ret, err, len, ssock);
ssock->... | cwe | CWE-362 | C/C++ |
void *gdImageJpegPtr (gdImagePtr im, int *size, int quality)
{
void *rv;
gdIOCtx *out = gdNewDynamicCtx (2048, NULL);
gdImageJpegCtx (im, out, quality);
rv = gdDPExtractData (out, size);
out->gd_free (out);
return rv;
} | cwe | CWE-415 | C/C++ |
/**
* Given an Accept header and a list of possible content types, pick
* the most suitable one to respond with
* @param {string} accept
* @param {string[]} types
*/
export function negotiate(accept, types) {
/** @type {Array<{ type: string, subtype: string, q: number, i: number }>} */
const parts = [];
accept... | cwe | CWE-918 | JavaScript |
static void mbochs_remove(struct mdev_device *mdev)
{
struct mdev_state *mdev_state = dev_get_drvdata(&mdev->dev);
mbochs_used_mbytes -= mdev_state->type->mbytes;
vfio_unregister_group_dev(&mdev_state->vdev);
kfree(mdev_state->pages);
kfree(mdev_state->vconfig);
kfree(mdev_state);
} | cwe | CWE-401 | Unknown |
function set( root, space, value ){
var i, c,
val,
nextSpace,
curSpace = root;
space = parse(space);
val = space.pop();
for( i = 0, c = space.length; i < c; i++ ){
nextSpace = space[ i ];
if ( isUndefined(curSpace[nextSpace]) ){
curSpace[ nextSpace ] = {};
}
curSpace = curSpace[ nextSp... | cwe | CWE-1321 | JavaScript |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node, bool is_arg_max) {
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
const TfLiteTensor* axis = GetInput(context, node, kAxis);
TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
if (IsDynamicTensor(output)) {
TF_LITE_... | cwe | CWE-125 | C/C++ |
Status AuthorizationManager::_initializeUserFromPrivilegeDocument(User* user,
const BSONObj& privDoc) {
V2UserDocumentParser parser;
std::string userName = parser.extractUserNameFromUserDocument(privDoc);
if (userName != user->getName().getUs... | cwe | CWE-613 | Unknown |
void HTMLCanvasElement::Dispose() {
if (PlaceholderFrame())
ReleasePlaceholderFrame();
if (context_) {
context_->DetachHost();
context_ = nullptr;
}
if (canvas2d_bridge_) {
canvas2d_bridge_->SetCanvasResourceHost(nullptr);
canvas2d_bridge_ = nullptr;
}
if (gpu_memory_usage_) {
... | cwe | CWE-416 | C/C++ |
function setupJitsiLocalStorage() {
const urlParams = parseURLParams(window.location);
if (shouldUseHostPageLocalStorage(urlParams)) {
try {
const localStorageContent = JSON.parse(urlParams['appData.localStorageContent']);
if (typeof localStorageContent === 'object') {
... | cwe | CWE-1321 | JavaScript |
package com.salesmanager.shop.model.catalog.product.attribute.api;
public class ReadableProductAttributeEntity extends ProductAttributeEntity {
/**
*
*/
private static final long serialVersionUID = 1L;
private String productAttributeWeight;
private String productAttributePrice;
private ReadableProductOp... | cwe | CWE-79 | Java |
async render(body, style = null, options = null) {
if (!options) options = {};
if (!options.postMessageSyntax) options.postMessageSyntax = 'postMessage';
if (!options.paddingBottom) options.paddingBottom = '0';
if (!options.highlightedKeywords) options.highlightedKeywords = [];
if (!options.codeTheme) options... | cwe | CWE-79 | JavaScript |
static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
const ImageInfo *IMimage_info,Image *IMimage,ExceptionInfo *exception)
{
char
im_vers[32],
libpng_runv[32],
libpng_vers[32],
zlib_runv[32],
zlib_vers[32];
Image
*image;
ImageInfo
*image_info;
char
*name,
s[2];
... | cwe | CWE-787 | C/C++ |
DLLEXPORT unsigned long tjBufSizeYUV2(int width, int pad, int height,
int subsamp)
{
int retval = 0, nc, i;
if (subsamp < 0 || subsamp >= NUMSUBOPT)
THROWG("tjBufSizeYUV2(): Invalid argument");
nc = (subsamp == TJSAMP_GRAY ? 1 : 3);
for (i = 0; i < nc; i++) {
int ... | cwe | CWE-787 | Unknown |
/*
* 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-200 | C/C++ |
static int _gd2GetHeader(gdIOCtxPtr in, int *sx, int *sy, int *cs, int *vers, int *fmt, int *ncx, int *ncy, t_chunk_info ** chunkIdx)
{
int i;
int ch;
char id[5];
t_chunk_info *cidx;
int sidx;
int nc;
GD2_DBG(php_gd_error("Reading gd2 header info"));
for (i = 0; i < 4; i++) {
ch = gdGetC(in);
if (ch == EO... | cwe | CWE-190 | C/C++ |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Patrick Pichler <ppichler+ansible@mgit.at>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
modu... | cwe | CWE-116 | C/C++ |
sync_create_state_control(Slapi_Entry *e, LDAPControl **ctrlp, int type, Sync_Cookie *cookie)
{
int rc;
BerElement *ber;
struct berval *bvp;
char *uuid;
Slapi_Attr *attr;
Slapi_Value *val;
if (type == LDAP_SYNC_NONE || ctrlp == NULL || (ber = der_alloc()) == NULL) {
return (LDAP_OPE... | cwe | CWE-476 | C/C++ |
__archive_read_filter_consume(struct archive_read_filter * filter,
int64_t request)
{
int64_t skipped;
if (request == 0)
return 0;
skipped = advance_file_pointer(filter, request);
if (skipped == request)
return (skipped);
/* We hit EOF before we satisfied the skip request. */
if (skipped < 0) /* Map er... | cwe | CWE-125 | Unknown |
def listAllUsers(usernamePrefix: String): Action[Unit] = GetAction { request =>
// Authorization check: Is a member? Add MemberGetAction?
request.theMember
val json = listAllUsersImpl(usernamePrefix, request)
OkSafeJson(json)
}
SECURITY // user listing disabled? [8FKU2A4] | cwe | CWE-613 | Scala |
function submitCommentForm(event) {
event.preventDefault();
var formData = $(this).serializeArray();
if (!validateFormData(formData)) {
return;
}
$.post($(this).attr('action'), $(this).serialize(), function(jsonResponse) {
var jsonData = false;
try {
jsonData = JSON.parse(j... | cwe | CWE-79 | JavaScript |
static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh,
char **target)
{
uint32_t data[1024];
uint32_t *p;
uint32_t len;
struct packet *nfs_packet;
/*
* struct READLINK3args {
* nfs_fh3 symlink;
* };
*
* struct READLINK3resok {
* post_op_attr symlink_attributes;
* nfspath3 d... | cwe | CWE-787 | C/C++ |
static int read_uids_guids(long long *table_start)
{
int res, i;
int bytes = SQUASHFS_ID_BYTES(sBlk.s.no_ids);
int indexes = SQUASHFS_ID_BLOCKS(sBlk.s.no_ids);
long long id_index_table[indexes];
TRACE("read_uids_guids: no_ids %d\n", sBlk.s.no_ids);
id_table = malloc(bytes);
if(id_table == NULL) {
ERR... | cwe | CWE-190 | C/C++ |
miniflow_extract(struct dp_packet *packet, struct miniflow *dst)
{
const struct pkt_metadata *md = &packet->md;
const void *data = dp_packet_data(packet);
size_t size = dp_packet_size(packet);
uint64_t *values = miniflow_values(dst);
struct mf_ctx mf = { FLOWMAP_EMPTY_INITIALIZER, values,
... | cwe | CWE-400 | Unknown |
static void mark_screen_rdonly(struct mm_struct *mm)
{
pgd_t *pgd;
pud_t *pud;
pmd_t *pmd;
pte_t *pte;
spinlock_t *ptl;
int i;
pgd = pgd_offset(mm, 0xA0000);
if (pgd_none_or_clear_bad(pgd))
goto out;
pud = pud_offset(pgd, 0xA0000);
if (pud_none_or_clear_bad(pud))
goto out;
pmd = pmd_offset(pud, 0x... | cwe | CWE-264 | C/C++ |
ExtensionsGuestViewMessageFilter::MaybeCreateThrottle(
NavigationHandle* handle) {
DCHECK(content::MimeHandlerViewMode::UsesCrossProcessFrame());
if (!handle->GetParentFrame()) {
return nullptr;
}
int32_t parent_process_id = handle->GetParentFrame()->GetProcess()->GetID();
auto& map = *GetProcessIdToF... | cwe | CWE-787 | C/C++ |
ast_for_expr_stmt(struct compiling *c, const node *n)
{
REQ(n, expr_stmt);
/* expr_stmt: testlist_star_expr (annassign | augassign (yield_expr|testlist) |
('=' (yield_expr|testlist_star_expr))*)
annassign: ':' test ['=' test]
testlist_star_expr: (test|star_expr) (',' te... | cwe | CWE-125 | C/C++ |
function d(e,t){var n=document.implementation.createHTMLDocument(""),i=n.createElement("base"),r=n.createElement("a");return n.head.appendChild(i),n.body.appendChild(r),i.href=t||document.baseURI||(document.querySelector("base")||{}).href||location.href,r.href=e,r.href} | cwe | CWE-79 | JavaScript |
public function uploadImage()
{
$filesCheck = array_filter($_FILES);
if (!empty($filesCheck) && $this->approvedFileExtension($_FILES['file']['name'], 'image') && strpos($_FILES['file']['type'], 'image/') !== false) {
ini_set('upload_max_filesize', '10M');
ini_set('post_max_size', '10M');
$tempFile = $_FIL... | cwe | CWE-79 | PHP |
RList *r_bin_ne_get_relocs(r_bin_ne_obj_t *bin) {
RList *segments = bin->segments;
if (!segments) {
return NULL;
}
RList *entries = bin->entries;
if (!entries) {
return NULL;
}
RList *symbols = bin->symbols;
if (!symbols) {
return NULL;
}
ut16 *modref = calloc (bin->ne_header->ModRefs, sizeof (ut16));
... | cwe | CWE-125 | C/C++ |
/*
* demod_flex.c
*
* Copyright 2004,2006,2010 Free Software Foundation, Inc.
* Copyright (C) 2015 Craig Shelley (craig@microtron.org.uk)
*
* FLEX Radio Paging Decoder - Adapted from GNURadio for use with Multimon
*
* GNU Radio is free software; you can redistribute it and/or modify
* ... | cwe | CWE-119 | C/C++ |
/*
* nf_nat_snmp_basic.c
*
* Basic SNMP Application Layer Gateway
*
* This IP NAT module is intended for use with SNMP network
* discovery and monitoring applications where target networks use
* conflicting private address realms.
*
* Static NAT is used to remap the networks from the view of the network
* man... | cwe | CWE-787 | C/C++ |
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This 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 of
* th... | cwe | CWE-79 | Java |
void AOClient::pktEditEvidence(AreaData* area, int argc, QStringList argv, AOPacket packet)
{
if (!checkEvidenceAccess(area))
return;
bool is_int = false;
int idx = argv[0].toInt(&is_int);
AreaData::Evidence evi = {argv[1], argv[2], argv[3]};
if (is_int && idx <= area->evidence().size() && i... | cwe | CWE-129 | C/C++ |
public DataSource createNewDataSource(Map<String, ?> params) throws IOException {
String refName = (String) JNDI_REFNAME.lookUp(params);
try {
return (DataSource) GeoTools.getInitialContext().lookup(refName);
} catch (Exception e) {
throw new DataSourceException("Could no... | cwe | CWE-20 | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.