code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt, struct net_device *orig_dev)
{
struct sock *sk;
struct packet_sock *po;
struct sockaddr_ll *sll;
union tpacket_uhdr h;
u8 *skb_head = skb->data;
int skb_len = skb->len;
unsigned int snaplen, res;
unsigned long s... | cwe | CWE-119 | C/C++ |
void Compute(OpKernelContext* context) override {
INDEX_TYPE first_dimension;
OP_REQUIRES_OK(context, GetFirstDimensionSize(context, &first_dimension));
vector<INDEX_TYPE> output_size;
OP_REQUIRES_OK(context,
CalculateOutputSize(first_dimension, context, &output_size));
vector<IND... | cwe | CWE-369 | Unknown |
static int msg_parse_fetch (IMAP_HEADER *h, char *s)
{
char tmp[SHORT_STRING];
char *ptmp;
if (!s)
return -1;
while (*s)
{
SKIPWS (s);
if (ascii_strncasecmp ("FLAGS", s, 5) == 0)
{
if ((s = msg_parse_flags (h, s)) == NULL)
return -1;
}
else if (ascii_strncasecmp ("UID"... | cwe | CWE-787 | C/C++ |
#include "Python.h"
/* Our own locale-independent ctype.h-like macros */
const unsigned int _Py_ctype_table[256] = {
0, /* 0x0 '\x00' */
0, /* 0x1 '\x01' */
0, /* 0x2 '\x02' */
0, /* 0x3 '\x03' */
0, /* 0x4 '\x04' */
0, /* 0x5 '\x05' */
0, /* 0x6 '\x06' */
0, /* 0x7 '\x07' */
0, /*... | cwe | CWE-125 | Python |
# -*- 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-269 | Python |
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-284 | Unknown |
/*-
* Copyright (c) 2003-2010 Tim Kientzle
* Copyright (c) 2012 Michihiro NAKAJIMA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the abo... | cwe | CWE-20 | C/C++ |
E=J}return E};Graph.prototype.getCellsById=function(u){var E=[];if(null!=u)for(var J=0;J<u.length;J++)if("*"==u[J]){var T=this.model.getRoot();E=E.concat(this.model.filterDescendants(function(Q){return Q!=T},T))}else{var N=this.model.getCell(u[J]);null!=N&&E.push(N)}return E};var S=Graph.prototype.isCellVisible;Graph.p... | cwe | CWE-20 | JavaScript |
static int build_audio_procunit(struct mixer_build *state, int unitid,
void *raw_desc, struct procunit_info *list,
char *name)
{
struct uac_processing_unit_descriptor *desc = raw_desc;
int num_ins = desc->bNrInPins;
struct usb_mixer_elem_info *cval;
struct snd_kcontrol *kctl;
int i, err, nameid, type, len;... | cwe | CWE-125 | C/C++ |
function Server (torrent, opts = {}) {
const server = http.createServer()
if (!opts.origin) opts.origin = '*' // allow all origins by default
const sockets = []
const pendingReady = []
let closed = false
const _listen = server.listen
const _close = server.close
server.listen = (...args) => {
close... | cwe | CWE-79 | JavaScript |
/*
** $Id: ltm.c $
** Tag methods
** See Copyright Notice in lua.h
*/
#define ltm_c
#define LUA_CORE
#include "lprefix.h"
#include <string.h>
#include "lua.h"
#include "ldebug.h"
#include "ldo.h"
#include "lgc.h"
#include "lobject.h"
#include "lstate.h"
#include "lstring.h"
#include "ltable.h"
#include "ltm.h"
#i... | cwe | CWE-125 | C/C++ |
local int dynamic(struct state *s)
{
int nlen, ndist, ncode; /* number of lengths in descriptor */
int index; /* index of lengths[] */
int err; /* construct() return value */
boost::int16_t lengths[MAXCODES]; /* descriptor code l... | cwe | CWE-20 | Unknown |
status_t OMXNodeInstance::emptyBuffer(
OMX::buffer_id buffer,
OMX_U32 rangeOffset, OMX_U32 rangeLength,
OMX_U32 flags, OMX_TICKS timestamp, int fenceFd) {
Mutex::Autolock autoLock(mLock);
OMX_BUFFERHEADERTYPE *header = findBufferHeader(buffer, kPortIndexInput);
if (header == N... | cwe | CWE-200 | C/C++ |
function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r} | cwe | CWE-331 | JavaScript |
QPDF_Stream::replaceDict(QPDFObjectHandle new_dict)
{
this->stream_dict = new_dict;
setDictDescription();
QPDFObjectHandle length_obj = new_dict.getKey("/Length");
if (length_obj.isInteger())
{
this->length = length_obj.getIntValue();
}
else
{
this->length = 0;
}
} | cwe | CWE-787 | Unknown |
public void update(DatabaseTypeUpdateRequest request) {
databaseTypeDao.selectOptionalById(request.getId()).ifPresent(data -> {
if (DatabaseTypes.has(data.getDatabaseType())) {
throw DomainErrors.MUST_NOT_MODIFY_SYSTEM_DEFAULT_DATABASE_TYPE.exception();
}
Dat... | cwe | CWE-20 | Java |
win_close(win_T *win, int free_buf)
{
win_T *wp;
int other_buffer = FALSE;
int close_curwin = FALSE;
int dir;
int help_window = FALSE;
tabpage_T *prev_curtab = curtab;
frame_T *win_frame = win->w_frame->fr_parent;
#ifdef FEAT_DIFF
int had_diffmode = win->w_p_diff;
#endif
#ifdef ME... | cwe | CWE-122 | Unknown |
static SSL_METHOD *ssl23_get_client_method(int ver)
{
#ifndef OPENSSL_NO_SSL2
if (ver == SSL2_VERSION)
return(SSLv2_client_method());
#endif
if (ver == SSL3_VERSION)
return(SSLv3_client_method());
else if (ver == TLS1_VERSION)
return(TLSv1_client_method());
else
return(NULL);
} | cwe | CWE-310 | Unknown |
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distribute... | cwe | CWE-200 | Java |
fiber_switch(mrb_state *mrb, mrb_value self, mrb_int len, const mrb_value *a, mrb_bool resume, mrb_bool vmexec)
{
struct mrb_context *c = fiber_check(mrb, self);
struct mrb_context *old_c = mrb->c;
mrb_value value;
fiber_check_cfunc(mrb, c);
if (resume && c->status == MRB_FIBER_TRANSFERRED) {
mrb_... | cwe | CWE-125 | C/C++ |
decrypt_response(struct sc_card *card, unsigned char *in, size_t inlen, unsigned char *out, size_t * out_len)
{
size_t cipher_len;
size_t i;
unsigned char iv[16] = { 0 };
unsigned char plaintext[4096] = { 0 };
epass2003_exdata *exdata = NULL;
if (!card->drv_data)
return SC_ERROR_INVALID_ARGUMENTS;
exdata = ... | cwe | CWE-119 | C/C++ |
static int getTokenValue(Ejs *ejs, EjsObj *obj, cchar *fullToken, cchar *token, MprBuf *buf, EjsAny *missing,
EjsString *join)
{
EjsAny *vp;
EjsString *svalue;
EjsName qname;
char *rest, *first, *str;
rest = (char*) (schr(token, '.') ? sclone(token) : token);
first = stok... | cwe | CWE-476 | C/C++ |
public static function makeSafeFilename($filename)
{
/* Strip out *nix directories. */
$filenameParts = explode('/', $filename);
$filename = end($filenameParts);
/* Strip out Windows directories. */
$filenameParts = explode('\\', $filename);
$filename = end($filename... | cwe | CWE-434 | PHP |
mp_capable_print(netdissect_options *ndo,
const u_char *opt, u_int opt_len, u_char flags)
{
const struct mp_capable *mpc = (const struct mp_capable *) opt;
if (!(opt_len == 12 && flags & TH_SYN) &&
!(opt_len == 20 && (flags & (TH_SYN | TH_ACK)) == TH_ACK))
r... | cwe | CWE-787 | Unknown |
/*
* History:
* Started: Aug 9 by Lawrence Foard (entropy@world.std.com),
* to allow user process control of SCSI devices.
* Development Sponsored by Killy Corp. NY NY
*
* Original driver (sg.c):
* Copyright (C) 1992 Lawrence Foard
* Version 2 and 3 extensions to driver:
* Copyright ... | cwe | CWE-200 | C/C++ |
this.disableChatSoundAdmin = function(inst)
{
if (inst.prop('tagName') != 'I') {
inst = inst.find('> i.material-icons');
}
if (inst.text() == 'volume_off'){
$.get(this.wwwDir+ 'user/setsettingajax/chat_message/1');
confLH.new_message_sound_admin_enabled = 1;
inst... | cwe | CWE-352 | JavaScript |
int oidc_oauth_check_userid(request_rec *r, oidc_cfg *c) {
/* check if this is a sub-request or an initial request */
if (!ap_is_initial_req(r)) {
if (r->main != NULL)
r->user = r->main->user;
else if (r->prev != NULL)
r->user = r->prev->user;
if (r->user != NULL) {
/* this is a sub-request and we ... | cwe | CWE-287 | Unknown |
def get_requested_month(self, date):
data = dict()
month_start, month_end = self.get_epoch_month(date)
data['interval'] = {'from': self.convert_local_ts_to_utc(month_start, self.local_timezone), 'to': self.convert_local_ts_to_utc(month_end, self.local_timezone)}
month_total = 0
... | cwe | CWE-89 | Python |
public FileSelection(UserRequest ureq, String currentContainerRelPath) {
if (currentContainerRelPath.equals("/")) currentContainerRelPath = "";
this.currentContainerRelPath = currentContainerRelPath;
parse(ureq);
} | cwe | CWE-23 | Java |
/* 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-190 | Python |
/* package tap wraps a set of interfaces and object to provide a generic interface to a delegated authentication
proxy */
package tap
// AuthRegisterBackend is an interface to provide storage for profiles loaded into TAP
type AuthRegisterBackend interface {
Init(interface{})
SetKey(key string, orgId string, val inte... | cwe | CWE-287 | Go |
get_function_line(
exarg_T *eap,
char_u **line_to_free,
int indent,
getline_opt_T getline_options)
{
char_u *theline;
if (eap->getline == NULL)
theline = getcmdline(':', 0L, indent, 0);
else
theline = eap->getline(':', eap->cookie, indent, getline_options);
if (theline != NULL)
{
if (*eap... | cwe | CWE-416 | 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-770 | Python |
public function getValidator()
{
$validator = [];
$fieldName = $this->getName();
switch ($fieldName) {
case 'birthday':
$funcName = ['name' => 'lessThanToday'];
$validator[] = $funcName;
break;
case 'targetenddate':
case 'actualenddate':
case 'enddate':
$funcName = ['name' => 'greater... | cwe | CWE-20 | PHP |
TfLiteStatus SimpleOpEval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input1 = tflite::GetInput(context, node, /*index=*/0);
const TfLiteTensor* input2 = tflite::GetInput(context, node, /*index=*/1);
TfLiteTensor* output = GetOutput(context, node, /*index=*/0);
int32_t* output_data = outpu... | cwe | CWE-787 | C/C++ |
void ssl3_cbc_copy_mac(unsigned char* out,
const SSL3_RECORD *rec,
unsigned md_size,unsigned orig_len)
{
#if defined(CBC_MAC_ROTATE_IN_PLACE)
unsigned char rotated_mac_buf[EVP_MAX_MD_SIZE*2];
unsigned char *rotated_mac;
#else
unsigned char rotated_mac[EVP_MAX_MD_SIZE];
#endif
/* mac_end is the i... | cwe | CWE-310 | Unknown |
package edu.stanford.nlp.ie.machinereading.common;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.... | cwe | CWE-611 | Java |
static void ImportCbYCrYQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const unsigned char *magick_restrict p,
Quantum *magick_restrict q,ExceptionInfo *exception)
{
QuantumAny
range;
register ssize_t
x;
unsigned int
pixel;
assert(image != (Image *) N... | cwe | CWE-125 | C/C++ |
int fpm_log_write(char *log_format) /* {{{ */
{
char *s, *b;
char buffer[FPM_LOG_BUFFER+1];
int token, test;
size_t len, len2;
struct fpm_scoreboard_proc_s proc, *proc_p;
struct fpm_scoreboard_s *scoreboard;
char tmp[129];
char format[129];
time_t now_epoch;
#ifdef HAVE_TIMES
clock_t tms_total;
#endif
if (!... | cwe | CWE-119 | C/C++ |
bool config_save(const config_t *config, const char *filename) {
assert(config != NULL);
assert(filename != NULL);
assert(*filename != '\0');
char *temp_filename = osi_calloc(strlen(filename) + 5);
if (!temp_filename) {
LOG_ERROR("%s unable to allocate memory for filename.", __func__);
return fal... | cwe | CWE-284 | C/C++ |
ssize_t sys_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen)
{
ssize_t ret;
do {
ret = recvfrom(s, buf, len, flags, from, fromlen);
#if defined(EWOULDBLOCK)
} while (ret == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
#else
} while (ret == -1 && ... | cwe | CWE-20 | Unknown |
get_html_data (MAPI_Attr *a)
{
VarLenData **body = XCALLOC(VarLenData*, a->num_values + 1);
int j;
for (j = 0; j < a->num_values; j++)
{
body[j] = XMALLOC(VarLenData, 1);
body[j]->len = a->values[j].len;
body[j]->data = CHECKED_XCALLOC(unsigned char, a->values[j].len);
memmove (body[j]->data, a->va... | cwe | CWE-125 | 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-754 | Python |
gst_date_time_new_from_iso8601_string (const gchar * string)
{
gint year = -1, month = -1, day = -1, hour = -1, minute = -1;
gint gmt_offset_hour = -99, gmt_offset_min = -99;
gdouble second = -1.0;
gfloat tzoffset = 0.0;
guint64 usecs;
gint len, ret;
g_return_val_if_fail (string != NULL, NULL);
GST_DE... | cwe | CWE-125 | 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 | C/C++ |
wc_push_to_iso2022(Str os, wc_wchar_t cc, wc_status *st)
{
wc_uchar g = 0;
wc_bool is_wide = WC_FALSE, retry = WC_FALSE;
wc_wchar_t cc2;
while (1) {
switch (WC_CCS_TYPE(cc.ccs)) {
case WC_CCS_A_CS94:
if (cc.ccs == WC_CCS_US_ASCII)
cc.ccs = st->g0_ccs;
g = cs94_gmap[WC_CCS_INDEX(cc.ccs) - W... | cwe | CWE-125 | C/C++ |
static void avrc_msg_cback(uint8_t handle, uint8_t label, uint8_t cr,
BT_HDR* p_pkt) {
uint8_t opcode;
tAVRC_MSG msg;
uint8_t* p_data;
uint8_t* p_begin;
bool drop = false;
bool do_free = true;
BT_HDR* p_rsp = NULL;
uint8_t* p_rsp_data;
int xx;
bool reject = false;
const char* p_d... | cwe | CWE-125 | C/C++ |
if ($current_realm_id == -1 || is_realm_allowed($current_realm_id) || !isset($user_auth_realm_filenames{basename($item_url)})) {
/* draw normal (non sub-item) menu item */
$item_url = $config['url_path'] . $item_url;
if (is_menu_pick_active($item_url)) {
print "<li><a role='menuitem' class='pic... | cwe | CWE-79 | PHP |
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* ... | cwe | CWE-91 | Java |
xmlValidNormalizeAttributeValue(xmlDocPtr doc, xmlNodePtr elem,
const xmlChar *name, const xmlChar *value) {
xmlChar *ret, *dst;
const xmlChar *src;
xmlAttributePtr attrDecl = NULL;
if (doc == NULL) return(NULL);
if (elem == NULL) return(NULL);
if (name == NULL) return(NULL);
if ... | cwe | CWE-416 | Unknown |
func extractTarDirectory(root, prefix string, r io.Reader) error {
tr := tar.NewReader(r)
for {
header, err := tr.Next()
if err != nil {
if err == io.EOF {
return nil
}
return err
}
// Name check
name := header.Name
path, err := filepath.Rel(prefix, name)
if err != nil {
return err
}
... | cwe | CWE-59 | Go |
// Copyright 2008-present Contributors to the OpenImageIO project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/OpenImageIO/oiio
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#define AVOID_WIN32_FILEIO
#include <tiffio.h>
#include <zlib.h>
#include <OpenImageIO/dassert... | cwe | CWE-125 | C/C++ |
static void parse_version(std::string const& full_version_string,
std::string& version, int& extension_level)
{
PointerHolder<char> vp(true, QUtil::copy_string(full_version_string));
char* v = vp.getPointer();
char* p1 = strchr(v, '.');
char* p2 = (p1 ? strchr(1 + p1, '.') : 0)... | cwe | CWE-125 | Unknown |
from urllib.parse import urlparse, urlunparse
from corsheaders.conf import conf as cors_conf
from corsheaders.middleware import CorsMiddleware
def origin_from_url(url: str) -> str:
parts = urlparse(url)
new = [parts[0], parts[1], "", "", "", ""]
return urlunparse(new)
def allow_redirect_url(url: str) -... | cwe | CWE-601 | Python |
function saveRecipePicture(result, location)
{
$recipeId = Grocy.EditObjectId || result.created_object_id;
Grocy.Components.UserfieldsForm.Save(() =>
{
if (jsonData.hasOwnProperty("picture_file_name") && !Grocy.DeleteRecipePictureOnSave)
{
Grocy.Api.UploadFile($("#recipe-picture")[0].files[0], 'recipepicture... | cwe | CWE-79 | JavaScript |
static struct dirent *local_readdir(FsContext *ctx, V9fsFidOpenState *fs)
{
struct dirent *entry;
again:
entry = readdir(fs->dir.stream);
if (!entry) {
return NULL;
}
if (ctx->export_flags & V9FS_SM_MAPPED) {
entry->d_type = DT_UNKNOWN;
} else if (ctx->export_flags & V9FS_SM_MA... | cwe | CWE-732 | Unknown |
package de.presti.ree6.sql.entities.webhook;
import de.presti.ree6.sql.base.annotations.Table;
/**
* SQL Entity for the News-Webhooks.
*/
@Table(name = "NewsWebhooks")
public class WebhookNews extends Webhook {
/**
* Constructor.
*/
public WebhookNews() {
}
/**
* @inheritDoc
*/... | cwe | CWE-863 | Java |
package middleware
import (
"errors"
jwt "github.com/appleboy/gin-jwt/v2"
"github.com/gin-gonic/gin"
"github.com/px-org/PanIndex/module"
log "github.com/sirupsen/logrus"
"net/http"
"net/url"
"strings"
"time"
)
const (
LoginTimeOut = 24 * 365
identityKey = "id"
)
func JWTMiddlewar() (*jwt.GinJWTMiddleware... | cwe | CWE-798 | Go |
postprocess_terminfo(TERMTYPE2 *tp)
{
/*
* TERMINFO-TO-TERMINFO MAPPINGS FOR SOURCE TRANSLATION
* ----------------------------------------------------------------------
*/
/*
* Translate AIX forms characters.
*/
if (PRESENT(box_chars_1)) {
char buf2[MAX_TERMCAP_LENGTH];
string_de... | cwe | CWE-125 | Unknown |
void SyncManager::SyncInternal::OnIPAddressChanged() {
DVLOG(1) << "IP address change detected";
if (!observing_ip_address_changes_) {
DVLOG(1) << "IP address change dropped.";
return;
}
#if defined (OS_CHROMEOS)
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&SyncInterna... | cwe | CWE-399 | C/C++ |
/*****************************************************************
|
| AP4 - hdlr Atoms
|
| Copyright 2002-2008 Axiomatic Systems, LLC
|
|
| This file is part of Bento4/AP4 (MP4 Atom Processing Library).
|
| Unless you have obtained Bento4 under a difference license,
| this version of Bento4 is Bento4|G... | cwe | CWE-125 | C/C++ |
/*
* Copyright (c) 2011-2015 The original author or authors
* ------------------------------------------------------
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distr... | cwe | CWE-287 | Java |
const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
ctx.params.lang = ctx.params.lang || 'www';
ctx.params.platform = ctx.params.platform || '';
ctx.params.year = ctx.params.year || '';
const rootUrl = `https://${ctx.params.lang === 'en' ? 'www' : ... | cwe | CWE-918 | JavaScript |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_spi.c - implementation of Stream Priority Iterator.
*/
#include <assert.h>
#include <inttypes.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/queue.h>
#include <sys/types.h>
#ifdef WIN32
#include <vc_co... | cwe | CWE-476 | C/C++ |
void SoftMP3::onQueueFilled(OMX_U32 /* portIndex */) {
if (mSignalledError || mOutputPortSettingsChange != NONE) {
return;
}
List<BufferInfo *> &inQueue = getPortQueue(0);
List<BufferInfo *> &outQueue = getPortQueue(1);
while ((!inQueue.empty() || (mSawInputEos && !mSignalledOutputEos)) && !outQueue.empty()) {
... | cwe | CWE-264 | C/C++ |
ikev2_t_print(netdissect_options *ndo, int tcount,
const struct isakmp_gen *ext, u_int item_len,
const u_char *ep)
{
const struct ikev2_t *p;
struct ikev2_t t;
uint16_t t_id;
const u_char *cp;
const char *idstr;
const struct attrmap *map;
size_t nmap;
const u_char *ep2;
p = (const struct ikev2_... | cwe | CWE-125 | C/C++ |
#define PGEN
#include "tokenizer.c"
#define PGEN
#include "tokenizer.c"
| cwe | CWE-125 | Python |
static ssize_t match_busid_show(struct device_driver *drv, char *buf)
{
int i;
char *out = buf;
spin_lock(&busid_table_lock);
for (i = 0; i < MAX_BUSID; i++)
if (busid_table[i].name[0])
out += sprintf(out, "%s ", busid_table[i].name);
spin_unlock(&busid_table_lock);
out += sprintf(out, "\n");
return out -... | cwe | CWE-362 | Unknown |
static void bump_cpu_timer(struct k_itimer *timer, u64 now)
{
int i;
u64 delta, incr;
if (timer->it.cpu.incr == 0)
return;
if (now < timer->it.cpu.expires)
return;
incr = timer->it.cpu.incr;
delta = now + incr - timer->it.cpu.expires;
/* Don't use (incr*2 < delta), incr*2 might overflow. */
for (i = 0; ... | cwe | CWE-190 | Unknown |
int ssl3_send_client_key_exchange(SSL *s)
{
unsigned char *p,*d;
int n;
unsigned long alg_k;
#ifndef OPENSSL_NO_RSA
unsigned char *q;
EVP_PKEY *pkey=NULL;
#endif
#ifndef OPENSSL_NO_KRB5
KSSL_ERR kssl_err;
#endif /* OPENSSL_NO_KRB5 */
#ifndef OPENSSL_NO_ECDH
EC_KEY *clnt_ecdh = NULL;
const EC_POINT *srvr_ecpoin... | cwe | CWE-476 | Unknown |
/*
* 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 |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-190 | C/C++ |
int my_redel(const char *org_name, const char *tmp_name,
time_t backup_time_stamp, myf MyFlags)
{
int error=1;
DBUG_ENTER("my_redel");
DBUG_PRINT("my",("org_name: '%s' tmp_name: '%s' MyFlags: %d",
org_name,tmp_name,MyFlags));
if (my_copystat(org_name,tmp_name,MyFlags) < 0)
goto end;
if... | cwe | CWE-362 | Unknown |
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.... | cwe | CWE-611 | Java |
XSetCommand (
Display *dpy,
Window w,
char **argv,
int argc)
{
register int i;
size_t nbytes;
register char *buf, *bp;
for (i = 0, nbytes = 0; i < argc; i++) {
nbytes += safestrlen(argv[i]) + 1;
}
if ((bp = buf = Xmalloc(nbytes))) {
/* copy arguments into single buffer */
for (i = 0; i < argc; i++... | cwe | CWE-120 | Unknown |
package io.hawt.system;
import java.lang.management.ManagementFactory;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArra... | cwe | CWE-918 | Java |
static int get_client_master_key(SSL *s)
{
int is_export, i, n, keya;
unsigned int num_encrypted_key_bytes, key_length;
unsigned long len;
unsigned char *p;
const SSL_CIPHER *cp;
const EVP_CIPHER *c;
const EVP_MD *md;
unsigned char rand_premaster_secret[SSL_MAX_MASTER_KEY_LENGTH];
un... | cwe | CWE-310 | Unknown |
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++ |
XML_GetBuffer(XML_Parser parser, int len)
{
switch (ps_parsing) {
case XML_SUSPENDED:
errorCode = XML_ERROR_SUSPENDED;
return NULL;
case XML_FINISHED:
errorCode = XML_ERROR_FINISHED;
return NULL;
default: ;
}
if (len > bufferLim - bufferEnd) {
/* FIXME avoid integer overflow */
int ... | cwe | CWE-119 | C/C++ |
asmlinkage long sys_oabi_semtimedop(int semid,
struct oabi_sembuf __user *tsops,
unsigned nsops,
const struct timespec __user *timeout)
{
struct sembuf *sops;
struct timespec local_timeout;
long err;
int i;
if (nsops < 1 || nsops > SEMOPM)
return -EINVAL;
sops = kmalloc(sizeof(*sops) * ... | cwe | CWE-264 | Unknown |
def resource_stop(params, request, session)
if not allowed_for_local_cluster(session, Permissions::WRITE)
return 403, 'Permission denied'
end
stdout, stderr, retval = run_cmd(
session, PCS, "resource", "disable", params[:resource]
)
if retval == 0
return JSON.generate({"success" => "true"})
else... | cwe | CWE-384 | Ruby |
long ContentEncoding::ParseCompressionEntry(long long start, long long size,
IMkvReader* pReader,
ContentCompression* compression) {
assert(pReader);
assert(compression);
long long pos = start;
const long long stop = start + size;
bool valid = false;
while (pos < stop) {
long long id, size;
const long st... | cwe | CWE-20 | C/C++ |
package com.salesmanager.shop.admin.model.userpassword;
import org.apache.commons.rng.UniformRandomProvider;
import org.apache.commons.rng.simple.RandomSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class UserReset
{
final static String CHAR_LIST_WITHNUM = "abcdefghijklmnopqrstuvwxyzABCDEF... | cwe | CWE-79 | Java |
OMX_ERRORTYPE SoftMP3::internalSetParameter(
OMX_INDEXTYPE index, const OMX_PTR params) {
switch (index) {
case OMX_IndexParamStandardComponentRole:
{
const OMX_PARAM_COMPONENTROLETYPE *roleParams =
(const OMX_PARAM_COMPONENTROLETYPE *)params;
if (strncmp((const ... | cwe | CWE-119 | C/C++ |
Ins_IUP( INS_ARG )
{
IUP_WorkerRec V;
FT_Byte mask;
FT_UInt first_point; /* first point of contour */
FT_UInt end_point; /* end point (last+1) of contour */
FT_UInt first_touched; /* first touched point in contour */
FT_UInt cur_touched; /* current touched po... | cwe | CWE-787 | C/C++ |
/**
*
*/
package com.salesmanager.shop.admin.model.digital;
import com.salesmanager.core.model.catalog.product.Product;
import com.salesmanager.core.model.catalog.product.file.DigitalProduct;
import javax.validation.constraints.NotEmpty;
import org.springframework.web.multipart.MultipartFile;
import javax.validati... | cwe | CWE-639 | Java |
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache... | cwe | CWE-91 | Java |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% M M AAA TTTTT L AAA BBBB ... | cwe | CWE-617 | C/C++ |
static MYSQL *db_connect(char *host, char *database,
char *user, char *passwd)
{
MYSQL *mysql;
if (verbose)
fprintf(stdout, "Connecting to %s\n", host ? host : "localhost");
if (!(mysql= mysql_init(NULL)))
return 0;
if (opt_compress)
mysql_options(mysql,MYSQL_OPT_COMPRESS,Nu... | cwe | CWE-295 | Unknown |
static MOBI_RET mobi_decompress_huffman_internal(MOBIBuffer *buf_out, MOBIBuffer *buf_in, const MOBIHuffCdic *huffcdic, size_t depth) {
if (depth > MOBI_HUFFMAN_MAXDEPTH) {
debug_print("Too many levels of recursion: %zu\n", depth);
return MOBI_DATA_CORRUPT;
}
MOBI_RET ret = MOBI_SUCCESS;
... | cwe | CWE-125 | Unknown |
tt_sbit_decoder_init( TT_SBitDecoder decoder,
TT_Face face,
FT_ULong strike_index,
TT_SBit_MetricsRec* metrics )
{
FT_Error error;
FT_Stream stream = face->root.stream;
FT_ULong ebdt_size;
er... | cwe | CWE-189 | Unknown |
MagickExport MagickBooleanType RegisterStaticModule(const char *module,
ExceptionInfo *exception)
{
char
module_name[MagickPathExtent];
PolicyRights
rights;
const CoderInfo
*p;
size_t
extent;
ssize_t
i;
/*
Assign module name from alias.
*/
assert(module != (const char *) N... | cwe | CWE-362 | Unknown |
# -*- coding: utf-8 -*-
# Copyright 2020 The Matrix.org Foundation C.I.C.
#
# 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 require... | cwe | CWE-20 | Python |
package common
import (
"errors"
"os"
"path/filepath"
"strconv"
"time"
"github.com/sirupsen/logrus"
)
// Default service addresses and URLS of Argo CD internal services
const (
// DefaultRepoServerAddr is the gRPC address of the Argo CD repo server
DefaultRepoServerAddr = "argocd-repo-server:8081"
// Defaul... | cwe | CWE-863 | Go |
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.eperson;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util... | cwe | CWE-863 | Java |
static ssize_t print_cpus_nohz_full(struct device *dev,
struct device_attribute *attr, char *buf)
{
return sprintf(buf, "%*pbl\n", cpumask_pr_args(tick_nohz_full_mask));
} | cwe | CWE-787 | Unknown |
int dns_read_name(unsigned char *buffer, unsigned char *bufend,
unsigned char *name, char *destination, int dest_len,
int *offset)
{
int nb_bytes = 0, n = 0;
int label_len;
unsigned char *reader = name;
char *dest = destination;
while (1) {
/* Name compression i... | cwe | CWE-835 | Unknown |
TfLiteRegistration FakeFusedRegistration() {
TfLiteRegistration reg = {nullptr};
reg.custom_name = "fake_fused_op";
// Different flavors of the delegate kernel's Invoke(), dependent on
// testing parameters.
if (fail_delegate_node_invoke_) {
reg.invoke = [](TfLiteContext* context,... | cwe | CWE-125 | C/C++ |
function peg$parseinline_part() {
var s0, s1;
s0 = peg$parsespecial();
if (s0 === peg$FAILED) {
s0 = peg$parsereference();
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = peg$parseliteral();
if (s1 !== peg$FAILED) {
peg$reportedPos = s0;
... | cwe | CWE-1321 | JavaScript |
'use strict';
const path = require('path');
const { exec } = require('child_process');
const promisify = require('util.promisify');
const inspect = require('object-inspect');
const colors = require('colors/safe');
const copyFileCB = require('fs-copy-file');
const copyFile = promisify(copyFileCB);
const readFile = pro... | cwe | CWE-78 | JavaScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.