code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
FileReaderLoader::FileReaderLoader(ReadType read_type,
FileReaderLoaderClient* client)
: read_type_(read_type),
client_(client),
handle_watcher_(FROM_HERE, mojo::SimpleWatcher::ArmingPolicy::AUTOMATIC),
binding_(this) {} | cwe | CWE-787 | C/C++ |
sysServices_handler(snmp_varbind_t *varbind, uint32_t *oid)
{
snmp_api_set_time_ticks(varbind, oid, clock_seconds() * 100);
} | cwe | CWE-125 | C/C++ |
static int jas_cmshapmatlut_set(jas_cmshapmatlut_t *lut, jas_icccurv_t *curv)
{
jas_cmreal_t gamma;
int i;
gamma = 0;
jas_cmshapmatlut_cleanup(lut);
if (curv->numents == 0) {
lut->size = 2;
if (!(lut->data = jas_malloc(lut->size * sizeof(jas_cmreal_t))))
goto error;
lut->data[0] = 0.0;
lut->data[1] = 1.... | cwe | CWE-189 | Unknown |
protected HtmlRenderable htmlBody() {
return HtmlElement.li().content(
HtmlElement.span(HtmlAttribute.cssClass("artifact")).content(
HtmlElement.a(HtmlAttribute.href(getUrl()))
.content(getFileName())
)
);
} | cwe | CWE-79 | Java |
static void php_snmp_error(zval *object, const char *docref, int type, const char *format, ...)
{
va_list args;
php_snmp_object *snmp_object = NULL;
if (object) {
snmp_object = Z_SNMP_P(object);
if (type == PHP_SNMP_ERRNO_NOERROR) {
memset(snmp_object->snmp_errstr, 0, sizeof(snmp_object->snmp_errstr));
} e... | cwe | CWE-20 | Unknown |
static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define RMT_EQUAL_RGB 1
#define RMT_NONE 0
#define RMT_RAW 2
#define RT_STANDARD 1
#define RT_ENCODED 2
#define RT_FORMAT_RGB 3
typedef struct _SUNInfo
{
unsigned int
magic,
width,
height,
depth,
... | cwe | CWE-125 | Unknown |
{% load i18n %}
/* globals
makeIconButton,
renderLink,
*/
/* exported
addAttachmentButtonCallbacks,
loadAttachmentTable,
reloadAttachmentTable,
*/
/*
* Add callbacks to buttons for creating new attachments.
*
* Note: Attachments can also be external links!
*/
function addAttachmentButtonCall... | cwe | CWE-79 | Python |
const CuePoint* Cues::GetNext(const CuePoint* pCurr) const {
if (pCurr == NULL)
return NULL;
assert(pCurr->GetTimeCode() >= 0);
assert(m_cue_points);
assert(m_count >= 1);
#if 0
const size_t count = m_count + m_preload_count;
size_t index = pCurr->m_index;
assert(index < count);
CuePoint*... | cwe | CWE-20 | C/C++ |
/*
* Copyright 2017 - 2018 Anton Tananaev (anton@traccar.org)
*
* 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 b... | cwe | CWE-611 | Java |
Deploy(const char* packageName)
{
int deployStatus = DEPLOY_SUCCESS;
char* command = NULL;
int deploymentResult = 0;
char *nics;
char* cleanupCommand;
uint8 archiveType;
uint8 flags;
bool forceSkipReboot = false;
Bool cloudInitEnabled = FALSE;
const char *cloudInitConfigFilePath = "/etc/cl... | cwe | CWE-362 | Unknown |
int rsa_pkcs1_decrypt( rsa_context *ctx,
int mode, size_t *olen,
const unsigned char *input,
unsigned char *output,
size_t output_max_len)
{
switch( ctx->padding )
{
case RSA_PKCS_V15:
return rsa_rsae... | cwe | CWE-310 | Unknown |
TEST_F(ConnectionHandlerTest, ListenerFilterTimeout) {
InSequence s;
TestListener* test_listener = addListener(1, true, false, "test_listener");
Network::MockListener* listener = new Network::MockListener();
Network::ListenerCallbacks* listener_callbacks;
EXPECT_CALL(dispatcher_, createListener_(_, _, _))
... | cwe | CWE-835 | Unknown |
XQueryExtension(
register Display *dpy,
_Xconst char *name,
int *major_opcode, /* RETURN */
int *first_event, /* RETURN */
int *first_error) /* RETURN */
{
xQueryExtensionReply rep;
register xQueryExtensionReq *req;
LockDisplay(dpy);
GetReq(QueryExtension, req);
req->nbytes =... | cwe | CWE-120 | Unknown |
static int vnc_refresh_server_surface(VncDisplay *vd)
{
int width = pixman_image_get_width(vd->guest.fb);
int height = pixman_image_get_height(vd->guest.fb);
int y;
uint8_t *guest_row0 = NULL, *server_row0;
int guest_stride = 0, server_stride;
int cmp_bytes;
VncState *vs;
int has_dirty =... | cwe | CWE-125 | Unknown |
package service
import (
"context"
"github.com/fleetdm/fleet/v4/server/fleet"
"github.com/fleetdm/fleet/v4/server/ptr"
)
////////////////////////////////////////////////////////////////////////////////
// Get Global Schedule
////////////////////////////////////////////////////////////////////////////////
type ge... | cwe | CWE-863 | Go |
gsicc_open_search(const char* pname, int namelen, gs_memory_t *mem_gc,
const char* dirname, int dirlen, stream**strp)
{
char *buffer;
stream* str;
/* Check if we need to prepend the file name */
if ( dirname != NULL) {
/* If this fails, we will still try the file by itself an... | cwe | CWE-20 | C/C++ |
read_applet_private_values_from_gconf (NMSetting *setting,
ReadFromGConfInfo *info)
{
if (NM_IS_SETTING_802_1X (setting)) {
const char *setting_name = nm_setting_get_name (setting);
gboolean value;
if (nm_gconf_get_bool_helper (info->client, info->dir,
... | cwe | CWE-310 | Unknown |
static int interpret_errors(void)
{
char bad;
if (inr != 7) {
DPRINT("-- FDC reply error\n");
fdc_state[current_fdc].reset = 1;
return 1;
}
/* check IC to find cause of interrupt */
switch (reply_buffer[ST0] & ST0_INTR) {
case 0x40: /* error occurred during command execution */
if (reply_buffer[ST1] & ... | cwe | CWE-416 | Unknown |
$scope.add = function() {
bootbox.prompt('Please enter the name for the new requisition', function(foreignSource) {
if (foreignSource) {
// Validate Requisition
if (foreignSource.match(/[/\\?:&*'"]/)) {
bootbox.alert('Cannot add the requisition ' + foreignSource + ' because... | cwe | CWE-79 | JavaScript |
pci_set_cfgdata8(struct pci_vdev *dev, int offset, uint8_t val)
{
assert(offset <= PCI_REGMAX);
*(uint8_t *)(dev->cfgdata + offset) = val;
} | cwe | CWE-617 | C/C++ |
static long mem_seek(jas_stream_obj_t *obj, long offset, int origin)
{
jas_stream_memobj_t *m = (jas_stream_memobj_t *)obj;
long newpos;
JAS_DBGLOG(100, ("mem_seek(%p, %ld, %d)\n", obj, offset, origin));
switch (origin) {
case SEEK_SET:
newpos = offset;
break;
case SEEK_END:
newpos = m->len_ - offset;
br... | cwe | CWE-369 | Unknown |
package io.onedev.server.web.page.simple.security;
import java.util.Arrays;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.shiro.authc.credential.PasswordService;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.feedback.FencedFeedbackPanel;
import org.apache.wicket.mark... | cwe | CWE-338 | Java |
static int open_user_core(uid_t uid, uid_t fsuid, pid_t pid, char **percent_values)
{
proc_cwd = open_cwd(pid);
if (proc_cwd == NULL)
return -1;
errno = 0;
/* http://article.gmane.org/gmane.comp.security.selinux/21842 */
security_context_t newcon;
if (compute_selinux_con_for_new_file(p... | cwe | CWE-200 | C/C++ |
export default function ansiRegex({onlyFirst = false} = {}) {
const pattern = [
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
].join('|');
return new RegExp(pattern, onlyFirst ? undefined : 'g');
} | cwe | CWE-1333 | JavaScript |
static void start_auth_request(PgSocket *client, const char *username)
{
int res;
PktBuf *buf;
client->auth_user = client->db->auth_user;
/* have to fetch user info from db */
client->pool = get_pool(client->db, client->db->auth_user);
if (!find_server(client)) {
client->wait_for_user_conn = true;
retu... | cwe | CWE-287 | C/C++ |
String HHVM_FUNCTION(ldap_escape,
const String& value,
const String& ignores /* = "" */,
int flags /* = 0 */) {
char esc[256] = {};
if (flags & k_LDAP_ESCAPE_FILTER) { // llvm.org/bugs/show_bug.cgi?id=18389
esc['*'*1u] = esc['('*1u] = esc[')'*1u] =... | cwe | CWE-22 | C/C++ |
(function (mw, $) {
"use strict";
mw.PluginManager.add('share', mw.KBaseScreen.extend({
defaultConfig: {
parent: "topBarContainer",
order: 5,
align: "right",
tooltip: gM( 'mwe-embedplayer-share' ),
title: gM( 'mwe-embedplayer-share' ),
showTooltip: true,
displayImportance: 'medium',
temp... | cwe | CWE-79 | JavaScript |
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.
package export
import (
"context"
"encoding/json"
"fmt"
"net"
"strconv"
"strings"
"text/template"
"time"
"github.com/coreos/go-semver/semver"
"github.com/docker/go-units"
"github.com/go-sql-driver/mysql"
"github.com/google/uuid"
"github.com/ping... | cwe | CWE-134 | Go |
/*****************************************************************************
* rtpfmt.c: RTP payload formats
*****************************************************************************
* Copyright (C) 2003-2004 VLC authors and VideoLAN
* Copyright © 2007 Rémi Denis-Courmont
* $Id$
*
* Authors: Laurent Aimar ... | cwe | CWE-119 | C/C++ |
def mode_input(self, request):
"""
This is called by render_POST when the client
is sending data to the server.
Args:
request (Request): Incoming request.
"""
csessid = request.args.get('csessid')[0]
self.last_alive[csessid] = (time.time(), False)
... | cwe | CWE-79 | Python |
function Karma (updater, socket, iframe, opener, navigator, location, document) {
this.updater = updater
var startEmitted = false
var self = this
var queryParams = util.parseQueryParams(location.search)
var browserId = queryParams.id || util.generateId('manual-')
var displayName = queryParams.displayName
... | cwe | CWE-601 | JavaScript |
bool Extension::InitFromValue(const DictionaryValue& source, int flags,
std::string* error) {
URLPattern::ParseOption parse_strictness =
(flags & STRICT_ERROR_CHECKS ? URLPattern::PARSE_STRICT
: URLPattern::PARSE_LENIENT);
if (source.HasKey(key... | cwe | CWE-20 | Unknown |
size_t jsuGetFreeStack() {
#ifdef ARM
void *frame = __builtin_frame_address(0);
size_t stackPos = (size_t)((char*)frame);
size_t stackEnd = (size_t)((char*)&LINKER_END_VAR);
if (stackPos < stackEnd) return 0; // should never happen, but just in case of overflow!
return stackPos - stackEnd;
#elif defined(LINU... | cwe | CWE-190 | 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-125 | Python |
PyMemoTable_Set(PyMemoTable *self, PyObject *key, Py_ssize_t value)
{
PyMemoEntry *entry;
assert(key != NULL);
entry = _PyMemoTable_Lookup(self, key);
if (entry->me_key != NULL) {
entry->me_value = value;
return 0;
}
Py_INCREF(key);
entry->me_key = key;
entry->me_value ... | cwe | CWE-190 | C/C++ |
ext4_xattr_put_super(struct super_block *sb)
{
mb_cache_shrink(sb->s_bdev);
} | cwe | CWE-19 | C/C++ |
'use strict';
const socketUser = require('./user');
const socketGroup = require('./groups');
const image = require('../image');
const meta = require('../meta');
const inProgress = {};
const uploads = module.exports;
uploads.upload = async function (socket, data) {
const methodToFunc = {
'user.uploadCroppedPictur... | cwe | CWE-79 | Java |
PrimitiveStatus TrustedPrimitives::UntrustedCall(uint64_t untrusted_selector,
MessageWriter *input,
MessageReader *output) {
int ret;
UntrustedCacheMalloc *untrusted_cache = UntrustedCacheMalloc::Instance();
SgxPar... | cwe | CWE-125 | C/C++ |
njs_generate_try_end(njs_vm_t *vm, njs_generator_t *generator,
njs_parser_node_t *node)
{
njs_int_t ret;
njs_index_t exit_index;
const njs_str_t *dest_label;
njs_vmcode_finally_t *finally;
njs_generator_patch_t *patch;
njs_generator_block_t *blo... | cwe | CWE-754 | C/C++ |
/*
* . .o8 oooo
* .o8 "888 `888
* .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo
* 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P'
* 888 888 888 888 8... | cwe | CWE-190 | JavaScript |
DefineSequence(ParseState *pstate, CreateSeqStmt *seq)
{
FormData_pg_sequence seqform;
FormData_pg_sequence_data seqdataform;
bool need_seq_rewrite;
List *owned_by;
CreateStmt *stmt = makeNode(CreateStmt);
Oid seqoid;
ObjectAddress address;
Relation rel;
HeapTuple tuple;
TupleDesc tupDesc;
Datum value... | cwe | CWE-94 | Unknown |
GF_Err HintFile(GF_ISOFile *file, u32 MTUSize, u32 max_ptime, u32 rtp_rate, u32 base_flags, Bool copy_data, Bool interleave, Bool regular_iod, Bool single_group, Bool hint_no_offset)
{
GF_ESD *esd;
GF_InitialObjectDescriptor *iod;
u32 i, val, res, streamType;
u32 sl_mode, prev_ocr, single_ocr, nb_done, tot_bw, bw, ... | cwe | CWE-476 | C/C++ |
public String render(TemplateEngineTypeEnum engineType, String templateContent, Map<String, Object> context) {
if (StrUtil.isEmpty(templateContent)) {
return StrUtil.EMPTY;
}
TemplateEngine templateEngine = templateEngineMap.get(engineType);
Assert.notNull(templateEngine, "未找到对应的模板引擎:{}", engineType);
retu... | cwe | CWE-20 | Java |
package auth.sso.oidc.custom;
import com.nimbusds.oauth2.sdk.AuthorizationGrant;
import com.nimbusds.oauth2.sdk.AuthorizationCode;
import com.nimbusds.oauth2.sdk.AuthorizationCodeGrant;
import com.nimbusds.oauth2.sdk.ParseException;
import com.nimbusds.oauth2.sdk.TokenErrorResponse;
import com.nimbusds.oauth2.sdk.Toke... | cwe | CWE-502 | Java |
/* 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-369 | Python |
function P(){var T=
Q.target;T.innerHTML="";H.isResolved=!H.isResolved;mxUtils.write(T,H.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var X=H.isResolved?"none":"",ba=V(H).replies,ja=Editor.isDarkMode()?"transparent":H.isResolved?"ghostWhite":"white",Z=0;Z<ba.length;Z++){ba[Z].style.backgroundCol... | cwe | CWE-94 | JavaScript |
int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk,
__be32 saddr, __be32 daddr, struct ip_options *opt)
{
struct inet_sock *inet = inet_sk(sk);
struct rtable *rt = skb_rtable(skb);
struct iphdr *iph;
/* Build the IP header. */
skb_push(skb, sizeof(struct iphdr) + (opt ? opt->optlen : 0));
skb_re... | cwe | CWE-362 | Unknown |
#!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from typing import Optional
from uuid import UUID
import azure.functions as func
import jwt
from onefuzztypes.enums import ErrorCode
from onefuzztypes.models import Error, Result, UserInfo
def get_bearer_token(request: ... | cwe | CWE-346 | Python |
static struct ion_handle *ion_handle_get_by_id(struct ion_client *client,
int id)
{
struct ion_handle *handle;
mutex_lock(&client->lock);
handle = idr_find(&client->idr, id);
if (handle)
ion_handle_get(handle);
mutex_unlock(&client->lock);
return handle ? handle : ERR_PTR(-EINVAL);
} | cwe | CWE-416 | C/C++ |
package com.salesmanager.core.model.catalog.product.image;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;... | cwe | CWE-79 | Java |
Sfdouble_t sh_strnum(Shell_t *shp, const char *str, char **ptr, int mode) {
Sfdouble_t d;
char *last;
if (*str == 0) {
if (ptr) *ptr = (char *)str;
return 0;
}
errno = 0;
d = number(str, &last, shp->inarith ? 0 : 10, NULL);
if (*last) {
if (*last != '.' || last[1] !=... | cwe | CWE-77 | C/C++ |
send_results(struct iperf_test *test)
{
int r = 0;
cJSON *j;
cJSON *j_streams;
struct iperf_stream *sp;
cJSON *j_stream;
int sender_has_retransmits;
iperf_size_t bytes_transferred;
int retransmits;
j = cJSON_CreateObject();
if (j == NULL) {
i_errno = IEPACKAGERESULTS;
r = -1;
... | cwe | CWE-119 | Unknown |
/* vi:set ts=8 sts=4 sw=4 noet:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
/*
* register.c: functions for managing re... | cwe | CWE-122 | C/C++ |
# (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-94 | Python |
__mod_timer(struct timer_list *timer, unsigned long expires, bool pending_only)
{
struct timer_base *base, *new_base;
unsigned int idx = UINT_MAX;
unsigned long clk = 0, flags;
int ret = 0;
BUG_ON(!timer->function);
/*
* This is a common optimization triggered by the networking code - if
* the timer is re-m... | cwe | CWE-200 | Unknown |
# (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-20 | Python |
package com.salesmanager.shop.admin.controller.merchant;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.inject.Inject;
import javax.servlet.http.H... | cwe | CWE-639 | Java |
GetNumSameData(const byte * curPtr, const int maxnum)
{
int count = 1;
if (1 == maxnum) {
return (1);
}
while (*curPtr == *(curPtr + count) && maxnum > count) {
count++;
}
return (count);
} | cwe | CWE-787 | Unknown |
def populate_custom_grains_and_pillar():
'''
Populate local salt-minion grains and pillar fields values as specified in
config file.
For example:
custom_grains_pillar:
grains:
- selinux: selinux:enabled
- release: osrelease
pillar:
- ntps... | cwe | CWE-78 | Python |
(function(module) {
"use strict";
var Comments = {};
var db = require.main.require('./src/database');
var meta = require.main.require('./src/meta');
var posts = require.main.require('./src/posts');
var topics = require.main.require('./src/topics');
var user = require.main.require('./src/user');
var groups = r... | cwe | CWE-352 | JavaScript |
func (err ErrInvalidCloneAddr) Error() string {
return fmt.Sprintf("invalid clone address [is_url_error: %v, is_invalid_path: %v, is_permission_denied: %v]",
err.IsURLError, err.IsInvalidPath, err.IsPermissionDenied)
} | cwe | CWE-918 | Go |
void parseInclusion(ParseContext* ctx,
BSONElement elem,
ProjectionPathASTNode* parent,
boost::optional<FieldPath> fullPathToParent) {
// There are special rules about _id being included. _id may be included in both inclusion and
// exclusion projectio... | cwe | CWE-732 | Unknown |
static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define ThrowDCMException(exception,message) \
{ \
RelinquishDCMMemory(&info,&map,stream_info,stack,data); \
ThrowReaderException((exception),(message)); \
}
char
explicit_vr[MagickPathExtent],
implicit_vr[MagickPathExtent... | cwe | CWE-416 | C/C++ |
ltree_in(PG_FUNCTION_ARGS)
{
char *buf = (char *) PG_GETARG_POINTER(0);
char *ptr;
nodeitem *list,
*lptr;
int num = 0,
totallen = 0;
int state = LTPRS_WAITNAME;
ltree *result;
ltree_level *curlevel;
int charlen;
int pos = 0;
ptr = buf;
while (*ptr)
{
charlen = pg_mblen(ptr);
... | cwe | CWE-189 | C/C++ |
jbig2_immediate_generic_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segment_data)
{
Jbig2RegionSegmentInfo rsi;
byte seg_flags;
int8_t gbat[8];
int offset;
int gbat_bytes = 0;
Jbig2GenericRegionParams params;
int code = 0;
Jbig2Image *image = NULL;
Jbig2WordStream ... | cwe | CWE-190 | C/C++ |
bool matches(const Http::RequestHeaderMap& headers) const override {
if (BaseMatcherImpl::matchRoute(headers)) {
const Http::HeaderString& path = headers.Path()->value();
const absl::string_view query_string = Http::Utility::findQueryStringStart(path);
absl::string_view path_view = path.getStringV... | cwe | CWE-476 | Unknown |
validate_exec(const char *path)
{
struct stat buf;
int is_r;
int is_x;
#ifdef WIN32
char path_exe[MAXPGPATH + sizeof(".exe") - 1];
/* Win32 requires a .exe suffix for stat() */
if (strlen(path) >= strlen(".exe") &&
pg_strcasecmp(path + strlen(path) - strlen(".exe"), ".exe") != 0)
{
strcpy(path_exe, pa... | cwe | CWE-119 | Unknown |
int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b)
{
int result = -1;
if (!a || !b || a->type != b->type)
return -1;
switch (a->type) {
case V_ASN1_OBJECT:
result = OBJ_cmp(a->value.object, b->value.object);
break;
case V_ASN1_BOOLEAN:
result = a->value.boole... | cwe | CWE-119 | C/C++ |
function renderWarning(node) {
var gui = '';
if (node.message) {
gui += '<div class="warning"><span>' + node.message + '</span></div>';
}
return gui;
} | cwe | CWE-79 | JavaScript |
static int iccalternatespace(i_ctx_t * i_ctx_p, ref *space, ref **r, int *CIESubst)
{
int components, code = 0;
ref *tempref, ICCdict;
if (!r_is_array(space))
return_error(gs_error_typecheck);
/* Validate parameters, check we have enough operands */
if (r_size(space) != 2)
return_er... | cwe | CWE-704 | Unknown |
"use strict";
var exec = require("child_process").exec;
var fs = require("fs");
var flag = process.argv[2] || "--exists";
// Normally |pkg-config opencv ...| could report either OpenCV 2.x or OpenCV 3.y
// depending on what is installed. To enable both 2.x and 3.y to co-exist on
// the same machine, the opencv.pc fo... | cwe | CWE-77 | JavaScript |
xmlParseStartTag2(xmlParserCtxtPtr ctxt, const xmlChar **pref,
const xmlChar **URI, int *tlen) {
const xmlChar *localname;
const xmlChar *prefix;
const xmlChar *attname;
const xmlChar *aprefix;
const xmlChar *nsname;
xmlChar *attvalue;
const xmlChar **atts = ctxt->atts;
... | cwe | CWE-119 | C/C++ |
/*
* Marvell Wireless LAN device driver: PCIE specific handling
*
* Copyright (C) 2011-2014, Marvell International Ltd.
*
* This software file (the "File") is distributed by Marvell International
* Ltd. under the terms of the GNU General Public License Version 2, June 1991
* (the "License"). You may use, redist... | cwe | CWE-401 | C/C++ |
$this->admin->json_response = ['status' => 'error', 'message' => $e->getMessage()]; | cwe | CWE-79 | PHP |
public SAXReader(String xmlReaderClassName) throws SAXException {
if (xmlReaderClassName != null) {
this.xmlReader = XMLReaderFactory
.createXMLReader(xmlReaderClassName);
}
} | cwe | CWE-611 | Java |
ImagingPcxDecode(Imaging im, ImagingCodecState state, UINT8* buf, Py_ssize_t bytes)
{
UINT8 n;
UINT8* ptr;
if (strcmp(im->mode, "1") == 0 && state->xsize > state->bytes * 8) {
state->errcode = IMAGING_CODEC_OVERRUN;
return -1;
} else if (strcmp(im->mode, "P") == 0 && state->xsize > stat... | cwe | CWE-125 | C/C++ |
var pythonMirror = process.env.npm_config_python_mirror || process.env.PYTHON_MIRROR || 'https://www.python.org/ftp/python/'
var buildTools = {
installerName: 'BuildTools_Full.exe',
installerUrl: 'http://download.microsoft.com/download/5/f/7/5f7acaeb-8363-451f-9425-68a90f98b238/visualcppbuildtools_full.exe',
log... | cwe | CWE-310 | JavaScript |
fbPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
{
srcRepeat = FALSE;
if (maskTransform)
maskRepeat = FALSE;
if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, xSrc, ySrc,
xMask, yMask, xDst, yDst, width, height))
return;
n = REGION_NUM_RECTS (®ion);
... | cwe | CWE-189 | C/C++ |
void * calloc(size_t n, size_t lb)
{
if (lb && n > GC_SIZE_MAX / lb)
return NULL;
# if defined(GC_LINUX_THREADS) /* && !defined(USE_PROC_FOR_LIBRARIES) */
/* libpthread allocated some memory that is only pointed to by */
/* mmapped thread stacks. Make sure it's not collectable. */... | cwe | CWE-189 | C/C++ |
// imagew-api.c
// Part of ImageWorsener, Copyright (c) 2011 by Jason Summers.
// For more information, see the readme.txt file.
// Most of the functions declared in imagew.h are defined here.
#include "imagew-config.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include "imagew-internals.h"
// Tr... | cwe | CWE-369 | C/C++ |
static int read_private_key(RSA *rsa)
{
int r;
sc_path_t path;
sc_file_t *file;
const sc_acl_entry_t *e;
u8 buf[2048], *p = buf;
size_t bufsize, keysize;
r = select_app_df();
if (r)
return 1;
sc_format_path("I0012", &path);
r = sc_select_file(card, &path, &file);
if (r) {
fprintf(stderr, "Unable to sel... | cwe | CWE-415 | Unknown |
static void ipmr_destroy_unres(struct mfc_cache *c)
{
struct sk_buff *skb;
atomic_dec(&cache_resolve_queue_len);
while((skb=skb_dequeue(&c->mfc_un.unres.unresolved))) {
if (skb->nh.iph->version == 0) {
struct nlmsghdr *nlh = (struct nlmsghdr *)skb_pull(skb, sizeof(struct iphdr));
nlh->nlmsg_type = NLMSG_ER... | cwe | CWE-200 | Unknown |
package server
import (
"context"
"encoding/json"
"fmt"
"time"
"github.com/pkg/errors"
"github.com/usememos/memos/api"
metric "github.com/usememos/memos/plugin/metrics"
"github.com/usememos/memos/server/profile"
"github.com/usememos/memos/store"
"github.com/usememos/memos/store/db"
"github.com/gorilla/ses... | cwe | CWE-79 | Go |
static ssize_t __cgroup_procs_write(struct kernfs_open_file *of, char *buf,
bool threadgroup)
{
struct cgroup *src_cgrp, *dst_cgrp;
struct task_struct *task;
ssize_t ret;
bool locked;
dst_cgrp = cgroup_kn_lock_live(of->kn, false);
if (!dst_cgrp)
return -ENODEV;
task = cgroup_procs_write_start(buf, th... | cwe | CWE-269 | Unknown |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-399 | C/C++ |
function braceExpand (pattern, options) {
if (!options) {
if (this instanceof Minimatch) {
options = this.options
} else {
options = {}
}
}
pattern = typeof pattern === 'undefined'
? this.pattern : pattern
if (typeof pattern === 'undefined') {
throw new TypeError('undefined pat... | cwe | CWE-400 | JavaScript |
/*
* . .o8 oooo
* .o8 "888 `888
* .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo
* 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P'
* 888 888 888 888 8... | cwe | CWE-200 | JavaScript |
show(text, options) {
options = options || {}
options.timeout = (!options.timeout) ? TOAST_PERMANENT_TIMEOUT : options.timeout
const toast = showMessage(text, options)
toast.toastElement.toastify = toast
return $(toast.toastElement)
} | cwe | CWE-79 | JavaScript |
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11,
# andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh,
# falgh1, grunjol, csitk... | cwe | CWE-352 | Python |
def resource_change_group(params, request, session)
if not allowed_for_local_cluster(session, Permissions::WRITE)
return 403, 'Permission denied'
end
if params[:resource_id].nil? or params[:group_id].nil?
return [400, 'resource_id and group_id have to be specified.']
end
if params[:group_id].empty?
... | cwe | CWE-384 | Ruby |
int dd_reset_ownership(struct dump_dir *dd)
{
const int r =lchown(dd->dd_dirname, dd->dd_uid, dd->dd_gid);
if (r < 0)
{
perror_msg("Can't change '%s' ownership to %lu:%lu", dd->dd_dirname,
(long)dd->dd_uid, (long)dd->dd_gid);
}
return r;
} | cwe | CWE-20 | Unknown |
void RegKey::getBinary(const TCHAR* valname, void** data, int* length, void* def, int deflen) const {
try {
getBinary(valname, data, length);
} catch(rdr::Exception&) {
if (deflen) {
*data = new char[deflen];
memcpy(*data, def, deflen);
} else
*data = 0;
*length = deflen;
}
} | cwe | CWE-787 | C/C++ |
{% load i18n %}
{% load inventree_extras %}
/* globals
createNewModal,
inventreeFormDataUpload,
inventreeGet,
inventreePut,
modalEnable,
modalShowSubmitButton,
renderBuild,
renderCompany,
renderManufacturerPart,
renderOwner,
renderPart,
renderPartCategory,
renderPart... | cwe | CWE-1236 | Python |
static ssize_t _hostfs_read(oe_fd_t* desc, void* buf, size_t count)
{
ssize_t ret = -1;
file_t* file = _cast_file(desc);
if (!file)
OE_RAISE_ERRNO(OE_EINVAL);
/* Call the host to perform the read(). */
if (oe_syscall_read_ocall(&ret, file->host_fd, buf, count) != OE_OK)
OE_RAISE_ER... | cwe | CWE-200 | Unknown |
function escapeArgBash(arg, interpolation, quoted) {
let result = arg.replace(/\u0000/g, "");
if (interpolation) {
result = result
.replace(/\\/g, "\\\\")
.replace(/^(~|#)/g, "\\$1")
.replace(/(\*|\?)/g, "\\$1")
.replace(/(\$|\;|\&|\|)/g, "\\$1")
.replace(/(\(|\)|\<|\>)/g, "\\$1")... | cwe | CWE-74 | JavaScript |
package com.salesmanager.shop.admin.controller.products;
import com.salesmanager.core.business.services.catalog.product.ProductService;
import com.salesmanager.core.business.services.catalog.product.file.DigitalProductService;
import com.salesmanager.core.business.utils.ajax.AjaxResponse;
import com.salesmanager.core.... | cwe | CWE-79 | Java |
/**
* This file is part of the Gribbit Web Framework.
*
* https://github.com/lukehutch/gribbit
*
* @author Luke Hutchison
*
* --
*
* @license Apache 2.0
*
* Copyright 2015 Luke Hutchison
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in com... | cwe | CWE-346 | Java |
/* 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 not... | cwe | CWE-444 | C/C++ |
def get_error_days(cur, error_percent):
"""Fetches the days in which requests led to errors.
Fetches the days in which the specified percentage
of requests led to errors.
Args:
cur(obj): The cursor to execute the query.
error_percent(int): The percentage of requests that led to errors.... | cwe | CWE-89 | Python |
import namedavatar from 'namedavatar'
import { i18nReady, t } from './i18n.js'
import { Globalsettings } from '../api/globalsettings/globalsettings.js'
const clientTimecards = new Mongo.Collection('clientTimecards')
function getGlobalSetting(name) {
return Globalsettings.findOne({ name }) ? Globalsettings.findOne({... | cwe | CWE-79 | JavaScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.