code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
# -*- coding: utf-8 -*-
"""
RDFa 1.1 parser, also referred to as a “RDFa Distiller”. It is
deployed, via a CGI front-end, on the U{W3C RDFa 1.1 Distiller page<http://www.w3.org/2012/pyRdfa/>}.
For details on RDFa, the reader should consult the U{RDFa Core 1.1<http://www.w3.org/TR/rdfa-core/>}, U{XHTML+RDFa1.1<http://w... | cwe | CWE-79 | Python |
/*
* fs/f2fs/acl.c
*
* Copyright (c) 2012 Samsung Electronics Co., Ltd.
* http://www.samsung.com/
*
* Portions of this code from linux/fs/ext2/acl.c
*
* Copyright (C) 2001-2003 Andreas Gruenbacher, <agruen@suse.de>
*
* This program is free software; you can redistribute it and/or modify
* it unde... | cwe | CWE-285 | C/C++ |
void oz_usb_rx(struct oz_pd *pd, struct oz_elt *elt)
{
struct oz_usb_hdr *usb_hdr = (struct oz_usb_hdr *)(elt + 1);
struct oz_usb_ctx *usb_ctx;
spin_lock_bh(&pd->app_lock[OZ_APPID_USB]);
usb_ctx = (struct oz_usb_ctx *)pd->app_ctx[OZ_APPID_USB];
if (usb_ctx)
oz_usb_get(usb_ctx);
spin_unlock_bh(&pd->app_lock[OZ_... | cwe | CWE-119 | C/C++ |
def cama_current_user
return @cama_current_user if defined?(@cama_current_user)
# api current user...
@cama_current_user = cama_calc_api_current_user
return @cama_current_user if @cama_current_user
return nil unless cookies[:auth_token].present?
c = cookies[:auth_token].split("&")
return ni... | cwe | CWE-613 | Ruby |
$ds = self::connectToServer($replicate["host"], $replicate["port"],
$ldap_method['rootdn'],
Toolbox::decrypt($ldap_method['rootdn_passwd'], GLPIKEY),
$ldap_method['use_tls'], $ldap_method['deref_optio... | cwe | CWE-327 | PHP |
static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, u32 features)
{
struct sk_buff *segs = ERR_PTR(-EINVAL);
unsigned int mss;
unsigned int unfrag_ip6hlen, unfrag_len;
struct frag_hdr *fptr;
u8 *mac_start, *prevhdr;
u8 nexthdr;
u8 frag_hdr_sz = sizeof(struct frag_hdr);
int offset;
__wsum csum;
mss ... | cwe | CWE-399 | C/C++ |
static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
target_ulong pc_start)
{
int b, prefixes;
int shift;
TCGMemOp ot, aflag, dflag;
int modrm, reg, rm, mod, op, opreg, val;
target_ulong next_eip, tval;
int rex_w, rex_r;
s->pc_start = s->pc = pc_s... | cwe | CWE-94 | C/C++ |
static OPJ_BOOL opj_pi_next_rpcl(opj_pi_iterator_t * pi)
{
opj_pi_comp_t *comp = NULL;
opj_pi_resolution_t *res = NULL;
OPJ_UINT32 index = 0;
if (!pi->first) {
goto LABEL_SKIP;
} else {
OPJ_UINT32 compno, resno;
pi->first = 0;
pi->dx = 0;
pi->dy = 0;
... | cwe | CWE-125 | Unknown |
static ssize_t yurex_read(struct file *file, char __user *buffer, size_t count,
loff_t *ppos)
{
struct usb_yurex *dev;
int retval = 0;
int bytes_read = 0;
char in_buffer[20];
unsigned long flags;
dev = file->private_data;
mutex_lock(&dev->io_mutex);
if (!dev->interface) { /* already disconnect... | cwe | CWE-20 | C/C++ |
package api
import (
"context"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"os"
"path/filepath"
"sort"
"strings"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/api/response"
"github.com/grafana/grafana/pkg/bus"
"git... | cwe | CWE-22 | C/C++ |
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either ... | cwe | CWE-306 | Go |
// ***************************************************************** -*- C++ -*-
/*
* Copyright (C) 2004-2021 Exiv2 authors
* This program is part of the Exiv2 distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as publish... | cwe | CWE-119 | C/C++ |
/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
* Copyright (c) 2016 Facebook
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in th... | cwe | CWE-119 | C/C++ |
/*
* Copyright (c) 2003 - 2016 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
* Portions Copyright (c) 2009 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided th... | cwe | CWE-320 | C/C++ |
public void handle(HttpServletRequest request, final HttpServletResponse response)
throws Exception
{
// We're sending an XML response, so set the response content type to text/xml
response.setContentType("text/xml");
ByteArrayOutputStream out = new ByteArrayOutputStream();
... | cwe | CWE-200 | Java |
# -*- 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-770 | Python |
static MagickBooleanType ReadPSDLayersInternal(Image *image,
const ImageInfo *image_info,const PSDInfo *psd_info,
const MagickBooleanType skip_layers,ExceptionInfo *exception)
{
char
type[4];
LayerInfo
*layer_info;
MagickSizeType
size;
MagickBooleanType
status;
register ssize_t
i;
... | cwe | CWE-834 | Unknown |
function isLiteral(ast) {
return ast.body.length === 0 ||
ast.body.length === 1 && (
ast.body[0].expression.type === AST.Literal ||
ast.body[0].expression.type === AST.ArrayExpression ||
ast.body[0].expression.type === AST.ObjectExpression);
} | cwe | CWE-74 | JavaScript |
xsltAttrListTemplateProcess(xsltTransformContextPtr ctxt,
xmlNodePtr target, xmlAttrPtr attrs)
{
xmlAttrPtr attr, copy, last;
xmlNodePtr oldInsert, text;
xmlNsPtr origNs = NULL, copyNs = NULL;
const xmlChar *value;
xmlChar *valueAVT;
if ((ctxt == NULL) || (target == NULL) ... | cwe | CWE-399 | Unknown |
acc_ctx_cont(OM_uint32 *minstat,
gss_buffer_t buf,
gss_ctx_id_t *ctx,
gss_buffer_t *responseToken,
gss_buffer_t *mechListMIC,
OM_uint32 *negState,
send_token_flag *return_token)
{
OM_uint32 ret, tmpmin;
gss_OID supportedMech;
spnego_gss_ctx_id_t sc;
unsigned int len;
unsigned ch... | cwe | CWE-476 | Unknown |
/*
* Copyright (c) 2004-2005 Sergey Lyubka <valenok@gmail.com>
* All rights reserved
*
* "THE BEER-WARE LICENSE" (Revision 42):
* Sergey Lyubka wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can ... | cwe | CWE-22 | C/C++ |
mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
size_t nbytes, size_t o, unsigned int cont_level, int mode, int text,
int flip, int recursion_level, int *printed_something,
int *need_separator, int *returnval)
{
uint32_t soffset, offset = ms->offset;
uint32_t lhs;
int rv, oneed_s... | cwe | CWE-399 | C/C++ |
static int send_full_color_rect(VncState *vs, int x, int y, int w, int h)
{
int stream = 0;
ssize_t bytes;
#ifdef CONFIG_VNC_PNG
if (tight_can_send_png_rect(vs, w, h)) {
return send_png_rect(vs, x, y, w, h, NULL);
}
#endif
tight_pack24(vs, vs->tight.tight.buffer, w * h, &vs->tight.tigh... | cwe | CWE-787 | 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-668 | Java |
/*
* Copyright © 1995-1998 Free Software Foundation, Inc.
* Copyright © 2014-2019 Red Hat, Inc
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License... | cwe | CWE-276 | C/C++ |
/* An implementation of Red-Black Trees with invariant node pointers.
* Nodes are allocated using single malloc that includes the key.
* This means that string/struct keys (which are of varying length) can not be copied between nodes.
* So instead of swapping node key/values, positions are swapped when balancing t... | cwe | CWE-120 | 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-668 | Java |
static ssize_t ucma_migrate_id(struct ucma_file *new_file,
const char __user *inbuf,
int in_len, int out_len)
{
struct rdma_ucm_migrate_id cmd;
struct rdma_ucm_migrate_resp resp;
struct ucma_context *ctx;
struct fd f;
struct ucma_file *cur_file;
int ret = 0;
if (copy_from_user(&cmd, inbuf, s... | cwe | CWE-416 | C/C++ |
static void wsgi_setup_access(WSGIDaemonProcess *daemon)
{
/* Setup the umask for the effective user. */
if (daemon->group->umask != -1)
umask(daemon->group->umask);
/* Change to chroot environment. */
if (daemon->group->root) {
if (chroot(daemon->group->root) == -1) {
ap_... | cwe | CWE-264 | C/C++ |
def change_message(self, new_message, logged_user):
update_sql = """
UPDATE Clients
SET message = '{}'
WHERE client_id = '{}'
""".format(new_message, logged_user.get_client_id())
cursor = self.__conn.cursor()
cursor.execute(update_sql)
self._... | cwe | CWE-89 | Python |
/*
Copyright (c) 2009-2018 Roger Light <roger@atchoo.org>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
and Eclipse Distribution License v1.0 which accompany this distribution.
The Eclipse Public License is available at
http:/... | cwe | CWE-254 | C/C++ |
def read_body(socket, block)
return unless socket
if tc = self['transfer-encoding']
case tc
when /chunked/io then read_chunked(socket, block)
else raise HTTPStatus::NotImplemented, "Transfer-Encoding: #{tc}."
end
elsif self['content-length'] || @remaining_size
@... | cwe | CWE-444 | Ruby |
bool IsReshapeOpSupported(const TfLiteRegistration* registration,
const TfLiteNode* node, TfLiteContext* context,
int coreml_version) {
if (coreml_version >= 3) {
return false;
}
if (node->inputs->size == 1) {
const auto* params =
reinterpret_cas... | cwe | CWE-125 | C/C++ |
XAllocNamedColor(
register Display *dpy,
Colormap cmap,
_Xconst char *colorname, /* STRING8 */
XColor *hard_def, /* RETURN */
XColor *exact_def) /* RETURN */
{
long nbytes;
xAllocNamedColorReply rep;
xAllocNamedColorReq *req;
XcmsCCC ccc;
XcmsColor cmsColor_exact;
Status ret;
#ifdef XCMS
... | cwe | CWE-120 | Unknown |
function In(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=Ln(t);t.gutterBackground=O("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPo... | cwe | CWE-79 | JavaScript |
gsm_xsmp_client_disconnect (GsmXSMPClient *client)
{
if (client->priv->watch_id > 0) {
g_source_remove (client->priv->watch_id);
}
if (client->priv->conn != NULL) {
SmsCleanUp (client->priv->conn);
}
if (client->priv->ice_connection != NULL) {
... | cwe | CWE-125 | Unknown |
static INLINE OPJ_BOOL opj_tcd_init_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no,
OPJ_BOOL isEncoder, OPJ_FLOAT32 fraction, OPJ_SIZE_T sizeof_block,
opj_event_mgr_t* manager)
{
OPJ_UINT32(*l_gain_ptr)(OPJ_UINT32) = 00;
OPJ_UINT32 compno, resno, bandno, precno, cblkno;
opj_tcp_t * l_tcp = 00;
... | cwe | CWE-787 | Unknown |
static inline unsigned int ScaleQuantumToMap(const Quantum quantum)
{
if (quantum >= (Quantum) MaxMap)
return((unsigned int) MaxMap);
#if !defined(MAGICKCORE_HDRI_SUPPORT)
return((unsigned int) quantum);
#else
if (quantum < 0.0)
return(0UL);
return((unsigned int) (quantum+0.5));
#endif
} | cwe | CWE-190 | Unknown |
package com.salesmanager.shop.admin.controller.configurations;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import or... | cwe | CWE-639 | Java |
public TMap readMapBegin() throws TException {
int size = readVarint32();
byte keyAndValueType = size == 0 ? 0 : readByte();
return new TMap(
getTType((byte) (keyAndValueType >> 4)), getTType((byte) (keyAndValueType & 0xf)), size);
} | cwe | CWE-770 | Java |
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: https://www.espocrm.com
*
* EspoCRM is free software: you can redistribute i... | cwe | CWE-79 | JavaScript |
static int rtl8xxxu_submit_int_urb(struct ieee80211_hw *hw)
{
struct rtl8xxxu_priv *priv = hw->priv;
struct urb *urb;
u32 val32;
int ret;
urb = usb_alloc_urb(0, GFP_KERNEL);
if (!urb)
return -ENOMEM;
usb_fill_int_urb(urb, priv->udev, priv->pipe_interrupt,
priv->int_buf, USB_INTR_CONTENT_LENGTH,
rtl8x... | cwe | CWE-401 | C/C++ |
static CACHE_BITMAP_V2_ORDER* update_read_cache_bitmap_v2_order(rdpUpdate* update, wStream* s,
BOOL compressed, UINT16 flags)
{
BYTE bitsPerPixelId;
CACHE_BITMAP_V2_ORDER* cache_bitmap_v2;
if (!update || !s)
return NULL;
cache_bitmap_v2 = calloc(1,... | cwe | CWE-125 | C/C++ |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2019
* All rights reserved
*
* This file is part of GPAC / ISO Media File Format sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU L... | cwe | CWE-476 | C/C++ |
static int __net_init sit_init_net(struct net *net)
{
struct sit_net *sitn = net_generic(net, sit_net_id);
struct ip_tunnel *t;
int err;
sitn->tunnels[0] = sitn->tunnels_wc;
sitn->tunnels[1] = sitn->tunnels_l;
sitn->tunnels[2] = sitn->tunnels_r;
sitn->tunnels[3] = sitn->tunnels_r_l;
if (!net_has_fallback_tunn... | cwe | CWE-772 | C/C++ |
void DownloadRequestLimiter::TabDownloadState::DidStartNavigation(
content::NavigationHandle* navigation_handle) {
if (!navigation_handle->IsInMainFrame())
return;
download_seen_ = false;
ui_status_ = DOWNLOAD_UI_DEFAULT;
if (navigation_handle->IsRendererInitiated() &&
(status_ == PROMPT_BEFO... | cwe | CWE-732 | C/C++ |
ssize_t AsyncConnection::handle_connect_msg(ceph_msg_connect &connect, bufferlist &authorizer_bl,
bufferlist &authorizer_reply)
{
ssize_t r = 0;
ceph_msg_connect_reply reply;
bufferlist reply_bl;
memset(&reply, 0, sizeof(reply));
reply.protocol_version = async_msgr... | cwe | CWE-284 | Unknown |
static s32 gf_hevc_read_sps_bs_internal(GF_BitStream *bs, HEVCState *hevc, u8 layer_id, u32 *vui_flag_pos)
{
s32 vps_id, sps_id = -1;
u32 i, nb_CTUs, depth;
HEVC_SPS *sps;
HEVC_VPS *vps;
HEVC_ProfileTierLevel ptl;
Bool multiLayerExtSpsFlag;
u8 sps_ext_or_max_sub_layers_minus1, max_sub_layers_minus1;
if (vui_fl... | cwe | CWE-787 | Unknown |
/* Copyright 2016 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 | Python |
/* Copyright 2016 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 | Python |
stub_charset ()
{
locale = get_locale_var ("LC_CTYPE");
locale = get_locale_var ("LC_CTYPE");
if (locale == 0 || *locale == 0)
return "ASCII";
s = strrchr (locale, '.');
if (s)
{
t = strchr (s, '@');
if (t)
*t = 0;
return ++s;
}
else if (STREQ (locale, "UTF-8"))
... | cwe | CWE-119 | C/C++ |
public RFC3211Wrap()
{
super(new RFC3211WrapEngine(new AESFastEngine()), 16);
} | cwe | CWE-310 | Java |
status_t OMXNodeInstance::updateGraphicBufferInMeta_l(
OMX_U32 portIndex, const sp<GraphicBuffer>& graphicBuffer,
OMX::buffer_id buffer, OMX_BUFFERHEADERTYPE *header) {
if (portIndex != kPortIndexInput && portIndex != kPortIndexOutput) {
return BAD_VALUE;
}
BufferMeta *bufferMeta ... | cwe | CWE-119 | C/C++ |
static Maybe<int64_t> IndexOfValueImpl(Isolate* isolate,
Handle<JSObject> object,
Handle<Object> value,
uint32_t start_from, uint32_t length) {
DCHECK(JSObject::PrototypeHasNoElements(isolate, *object));
Handle<Map> original_... | cwe | CWE-704 | C/C++ |
void Browser::AddNewContents(WebContents* source,
std::unique_ptr<WebContents> new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_rect,
bool user_gesture,
... | cwe | CWE-20 | C/C++ |
def testLoginByToken
users = []
users << {"username" => "user1", "token" => "token1"}
users << {"username" => "user2", "token" => "token2"}
users << {"username" => SUPERUSER, "token" => "tokenS"}
password_file = File.open($user_pass_file, File::RDWR|File::CREAT)
password_file.truncate(0)
pas... | cwe | CWE-384 | Ruby |
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 |
QPDF::parse_xrefEntry(std::string const& line,
qpdf_offset_t& f1, int& f2, char& type)
{
// is_space and is_digit both return false on '\0', so this will
// not overrun the null-terminated buffer.
char const* p = line.c_str();
// Skip zero or more spaces. There aren't supposed to ... | cwe | CWE-125 | Unknown |
/**
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
*
* The Apereo Foundation licenses this file to you under the Educational
* Community License, Version 2.0 (the ... | cwe | CWE-287 | Java |
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 sts=4 expandtab: */
/*
rsvg-file-util.c: SAX-based renderer for SVG files into a GdkPixbuf.
Copyright (C) 2000 Eazel, Inc.
Copyright (C) 2002 Dom Lachowicz <cinamod@hotmail.com>
This program is free software; yo... | cwe | CWE-255 | C/C++ |
int lazy_bdecode(char const* start, char const* end, lazy_entry& ret
, error_code& ec, int* error_pos, int depth_limit, int item_limit)
{
char const* const orig_start = start;
ret.clear();
if (start == end) return 0;
std::vector<lazy_entry*> stack;
stack.push_back(&ret);
while (start <= end)
{
if ... | cwe | CWE-20 | Unknown |
public ResetPasswordRequestResponse requestResetPassword(UserReference userReference) throws ResetPasswordException
{
this.checkUserReference(userReference);
UserProperties userProperties = this.userPropertiesResolver.resolve(userReference);
InternetAddress email = userProperties.getEmail()... | cwe | CWE-640 | Java |
import os.path
import re
from datetime import timedelta
from typing import Iterable, Optional, Tuple
from urllib.parse import urlparse
from django.conf import settings
from django.core.files.temp import NamedTemporaryFile
from django.urls import Resolver404, resolve
from django.utils.translation import gettext as _
i... | cwe | CWE-20 | Python |
public function rules()
{
$rules = [];
$inputs = $this->all();
$validateEmail = false;
$validateUsername = false;
if (!isset($inputs['username']) || !isset($inputs['email'])) {
$validateUsername = true;
}
if (isset($inputs['email']) && !isset(... | cwe | CWE-190 | PHP |
int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[])
{
struct file_list *flist = NULL;
int exit_code = 0, exit_code2 = 0;
char *local_name = NULL;
cleanup_child_pid = pid;
if (!read_batch) {
set_nonblocking(f_in);
set_nonblocking(f_out);
}
io_set_sock_fds(f_in, f_out);
setup_protocol(f_o... | cwe | CWE-59 | 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-369 | C/C++ |
BGD_DECLARE(gdImagePtr) gdImageClone (gdImagePtr src) {
gdImagePtr dst;
register int i, x;
if (src->trueColor) {
dst = gdImageCreateTrueColor(src->sx , src->sy);
} else {
dst = gdImageCreate(src->sx , src->sy);
}
if (dst == NULL) {
return NULL;
}
if (src->trueColor == 0) {
dst->colorsTotal = src->col... | cwe | CWE-476 | Unknown |
static Image *ReadTIFFImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
const char
*option;
float
*chromaticity,
x_position,
y_position,
x_resolution,
y_resolution;
Image
*image;
int
tiff_status;
MagickBooleanType
status;
MagickSizeType
number_pixe... | cwe | CWE-119 | Unknown |
/* Listpack -- A lists of strings serialization format
*
* This file implements the specification you can find at:
*
* https://github.com/antirez/listpack
*
* Copyright (c) 2017, Salvatore Sanfilippo <antirez at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with ... | cwe | CWE-190 | C/C++ |
BROTLI_BOOL BrotliDecoderHuffmanTreeGroupInit(BrotliDecoderState* s,
HuffmanTreeGroup* group, uint32_t alphabet_size_max,
uint32_t alphabet_size_limit, uint32_t ntrees) {
/* Pack two allocations into one */
const size_t max_table_size =
kMaxHuffmanTableSize[(alphabet_size_limit + 31) >> 5];
const si... | cwe | CWE-120 | Unknown |
static int ext4_dax_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
{
return dax_mkwrite(vma, vmf, ext4_get_block_dax,
ext4_end_io_unwritten);
} | cwe | CWE-362 | C/C++ |
ia){ja=fa.getAttribute("section");ba=fa.getAttribute("subsection");if(null==ja&&(ma=ia.indexOf("/"),ja=ia.substring(0,ma),null==ba)){var qa=ia.indexOf("/",ma+1);-1<qa&&(ba=ia.substring(ma+1,qa))}ma=ta[ja];null==ma&&(ya++,ma=[],ta[ja]=ma);ia=fa.getAttribute("clibs");null!=ca[ia]&&(ia=ca[ia]);ia={url:fa.getAttribute("url... | cwe | CWE-20 | JavaScript |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-119 | C/C++ |
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2016 The PHP Group |
+---------... | cwe | CWE-200 | C/C++ |
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-131 | Python |
public int size() {
return ByteUtils.bitLength(n.decode());
} | cwe | CWE-345 | Java |
import { isTestSuiteActive } from "../../support/page_objects/projectConstants";
import { mainPage } from "../../support/page_objects/mainPage";
let storedURL = "";
// 0: all enabled
// 1: field hide
// 2: field sort
// 3: field filter
// 4: default (address table): for view operation validation
// 5: default (countr... | cwe | CWE-918 | JavaScript |
hash_link_ref(const uint8_t *link_ref, size_t length)
{
size_t i;
unsigned int hash = 0;
for (i = 0; i < length; ++i)
hash = tolower(link_ref[i]) + (hash << 6) + (hash << 16) - hash;
return hash;
} | cwe | CWE-400 | C/C++ |
/* 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-617 | Python |
"""
Gather information about a system and report it using plugins
supplied for application-specific information
"""
# sosreport.py
# gather information about a system and report it
# Copyright (C) 2006 Steve Conklin <sconklin@redhat.com>
# This program is free software; you can redistribute it and/or modify
# it unde... | cwe | CWE-200 | Python |
const get = async (req, res) => {
logger.debug('URL file import handler running', null, req.id)
const { debug } = req.companion.options
if (!validateURL(req.body.url, debug)) {
logger.debug('Invalid request body detected. Exiting url import handler.', null, req.id)
res.status(400).json({ error: 'Invalid r... | cwe | CWE-918 | JavaScript |
static bool vtable_is_value_in_text_section(RVTableContext *context, ut64 curAddress, ut64 *value) {
//value at the current address
ut64 curAddressValue;
if (!context->read_addr (context->anal, curAddress, &curAddressValue)) {
return false;
}
//if the value is in text section
bool ret = vtable_addr_in_text_sect... | cwe | CWE-824 | Unknown |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2021
* All rights reserved
*
* This file is part of GPAC / ISO Media File Format sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU L... | cwe | CWE-190 | C/C++ |
function je(t){var e=t.length;return e?t[Zi(0,e-1)]:B} | cwe | CWE-79 | JavaScript |
/* Copyright 2016 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 | Python |
public function copy($path, $newpath)
{
$location = $this->applyPathPrefix($path);
$destination = $this->applyPathPrefix($newpath);
$this->ensureDirectory(dirname($destination));
return copy($location, $destination);
} | cwe | CWE-89 | JavaScript |
private boolean tryUnpackZipFile(final File importSandboxDirectory, final MultipartFile multipartFile) {
/* Extract ZIP contents */
ZipEntry zipEntry = null;
InputStream inputStream = null;
ZipInputStream zipInputStream = null;
boolean foundEntry = false;
try {
... | cwe | CWE-22 | Java |
// Copyright Istio Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in wri... | cwe | CWE-287 | Go |
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-476 | Python |
/*
* 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 |
get_filter_list( Operation *op, BerElement *ber,
Filter **f,
const char **text )
{
Filter **new;
int err;
ber_tag_t tag;
ber_len_t len;
char *last;
Debug( LDAP_DEBUG_FILTER, "begin get_filter_list\n", 0, 0, 0 );
new = f;
for ( tag = ber_first_element( ber, &len, &last );
tag != LBER_DEFAULT;
tag = ber... | cwe | CWE-674 | Unknown |
/* The MIT License (MIT)
*
* Copyright (c) 2015 Main Street Softworks, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the right... | cwe | CWE-732 | C/C++ |
public function gc($maxlifetime)
{
// delete the session records that have expired
$sql = "DELETE FROM $this->table WHERE $this->timeCol < :time";
try {
$stmt = $this->pdo->prepare($sql);
$stmt->bindValue(':time', time() - $maxlifetime, \PDO::PARAM_INT);
... | cwe | CWE-89 | JavaScript |
static int jp2_cdef_getdata(jp2_box_t *box, jas_stream_t *in)
{
jp2_cdef_t *cdef = &box->data.cdef;
jp2_cdefchan_t *chan;
unsigned int channo;
if (jp2_getuint16(in, &cdef->numchans)) {
return -1;
}
if (!(cdef->ents = jas_alloc2(cdef->numchans, sizeof(jp2_cdefchan_t)))) {
return -1;
}
for (channo = 0; channo... | cwe | CWE-476 | Unknown |
def _feed_input_sorters(self):
num_results = 0
with open(self.working_set_filename, 'rb') as work_file:
for line in work_file:
result = pickle.loads(base64.b64decode(line))
if result['project_id'] not in self.project_result_sorters:
self.... | cwe | CWE-502 | Python |
static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary)
return 1;
return 0;
} | cwe | CWE-20 | Unknown |
/* $Id$ */
/*
* Copyright (c) 1991-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission ... | cwe | CWE-125 | C/C++ |
void Ogg::XiphComment::parse(const ByteVector &data)
{
// The first thing in the comment data is the vendor ID length, followed by a
// UTF8 string with the vendor ID.
int pos = 0;
int vendorLength = data.mid(0, 4).toUInt(false);
pos += 4;
d->vendorID = String(data.mid(pos, vendorLength), String::UTF8);
... | cwe | CWE-20 | C/C++ |
int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
{
struct page *page = vmf->page;
loff_t size;
unsigned long len;
int ret;
struct file *file = vma->vm_file;
struct inode *inode = file_inode(file);
struct address_space *mapping = inode->i_mapping;
handle_t *handle;
get_block_t *get_block;... | cwe | CWE-362 | C/C++ |
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-787 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.