code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static int
DefragInOrderSimpleTest(void)
{
Packet *p1 = NULL, *p2 = NULL, *p3 = NULL;
Packet *reassembled = NULL;
int id = 12;
int i;
int ret = 0;
DefragInit();
p1 = BuildTestPacket(IPPROTO_ICMP, id, 0, 1, 'A', 8);
if (p1 == NULL)
goto end;
p2 = BuildTestPacket(IPPROTO_ICMP... | vuln | Safe | C/C++ |
public void disconnect(int reason, String description) {
if (description == null)
description = "Failure";
disconnectStarted = new Date();
if(Log.isInfoEnabled()) {
Log.info("Disconnect {} {}",
getConnectionAddress().toString(),
description);
}
postMessage(new DisconnectMessage(reason, descri... | vuln | Vulnerable | Java |
static int init_sig_algs(SSL *s, unsigned int context)
{
/* Clear any signature algorithms extension received */
OPENSSL_free(s->s3->tmp.peer_sigalgs);
s->s3->tmp.peer_sigalgs = NULL;
return 1;
} | vuln | Vulnerable | Unknown |
static void sdhci_do_adma(SDHCIState *s)
{
unsigned int begin, length;
const uint16_t block_size = s->blksize & BLOCK_SIZE_MASK;
ADMADescr dscr = {};
int i;
if (s->trnmod & SDHC_TRNS_BLK_CNT_EN && !s->blkcnt) {
/* Stop Multiple Transfer */
sdhci_end_transfer(s);
return;
... | vuln | Vulnerable | Unknown |
public InteractionResult blockPlace(Level level, BlockPos pos, BlockState blockState, @Nullable Entity entity) {
if (entity instanceof ServerPlayer && FTBChunksAPI.getManager().protect(entity, InteractionHand.MAIN_HAND, pos, Protection.EDIT_BLOCK).get()) {
return InteractionResult.FAIL;
}
return InteractionRe... | vuln | Safe | Java |
function ecrecover(recId, sigr, sigs, message) {
// 1.0 For j from 0 to h (h == recId here and the loop is outside this function)
// 1.1 Let x = r + jn
const x = addmod(uint256(sigr), P.muln(recId >> 1), P)
// 1.2. Convert the integer x to an octet string X of length mlen using the... | vuln | Vulnerable | JavaScript |
PHP_FUNCTION(bcadd)
{
char *left, *right;
long scale_param = 0;
bc_num first, second, result;
int left_len, right_len;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
if (argc... | vuln | Safe | Unknown |
private boolean processOnClickOrPress(final int position) {
if (position == usernameRow || position == setUsernameRow) {
final String username;
if (userId != 0) {
final TLRPC.User user = getMessagesController().getUser(userId);
if (user == null || user.use... | vuln | Vulnerable | Java |
SECURITY_STATUS ntlm_server_AuthenticateComplete(NTLM_CONTEXT* context)
{
UINT32 flags = 0;
size_t cbAvFlags;
NTLM_AV_PAIR* AvFlags = NULL;
NTLM_AUTHENTICATE_MESSAGE* message;
if (!context)
return SEC_E_INVALID_PARAMETER;
if (ntlm_get_state(context) != NTLM_STATE_COMPLETION)
return SEC_E_OUT_OF_SEQUENCE;
... | vuln | Safe | C/C++ |
void ConnectionImpl::onHeaderValue(const char* data, size_t length) {
if (header_parsing_state_ == HeaderParsingState::Done) {
// Ignore trailers.
return;
}
const absl::string_view header_value = absl::string_view(data, length);
if (strict_header_validation_) {
if (!Http::HeaderUtility::headerIsVa... | vuln | Safe | Unknown |
static cchar *getPakVersion(cchar *name, cchar *version)
{
MprDirEntry *dp;
MprList *files;
if (!version || smatch(version, "*")) {
name = ssplit(sclone(name), "#", (char**) &version);
if (*version == '\0') {
files = mprGetPathFiles(mprJoinPath(app->paksCacheDir, nam... | vuln | Safe | C/C++ |
static inline uint16_t mipsdsp_sat16_sub(int16_t a, int16_t b,
CPUMIPSState *env)
{
int16_t temp;
temp = a - b;
if (MIPSDSP_OVERFLOW_SUB(a, b, temp, 0x8000)) {
if (a >= 0) {
temp = 0x7FFF;
} else {
temp = 0x8000;
}
... | vuln | Safe | C/C++ |
_prolog_error(batch_job_launch_msg_t *req, int rc)
{
char *err_name_ptr, err_name[256], path_name[MAXPATHLEN];
char *fmt_char;
int fd;
if (req->std_err || req->std_out) {
if (req->std_err)
strncpy(err_name, req->std_err, sizeof(err_name));
else
strncpy(err_name, req->std_out, sizeof(err_name));
if ((fm... | vuln | Safe | C/C++ |
package jsonpatch
import (
"bytes"
"encoding/json"
"fmt"
"strconv"
"strings"
)
const (
eRaw = iota
eDoc
eAry
)
type lazyNode struct {
raw *json.RawMessage
doc partialDoc
ary partialArray
which int
}
type operation map[string]*json.RawMessage
// Patch is an ordered collection of operations.
type P... | vuln | Vulnerable | Go |
# -*- 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 ... | vuln | Safe | Python |
static int tipc_nl_retrieve_key(struct nlattr **attrs,
struct tipc_aead_key **pkey)
{
struct nlattr *attr = attrs[TIPC_NLA_NODE_KEY];
struct tipc_aead_key *key;
if (!attr)
return -ENODATA;
if (nla_len(attr) < sizeof(*key))
return -EINVAL;
key = (struct tipc_aead_key *)nla_data(attr);
if (key->keylen > T... | vuln | Safe | Unknown |
void hbitmap_reset(HBitmap *hb, uint64_t start, uint64_t count)
{
uint64_t last = start + count - 1;
trace_hbitmap_reset(hb, start, count,
start >> hb->granularity, last >> hb->granularity);
start >>= hb->granularity;
last >>= hb->granularity;
hb->count -= hb_count_betwe... | vuln | Vulnerable | C/C++ |
document.createElement("tr");ja.className="gePropHeader";var Ba=document.createElement("th");Ba.className="gePropHeaderCell";var Da=document.createElement("img");Da.src=Sidebar.prototype.expandedImage;Da.style.verticalAlign="middle";Ba.appendChild(Da);mxUtils.write(Ba,mxResources.get("property"));ja.style.cursor="point... | vuln | Safe | JavaScript |
static int process_options(int argc, char *argv[], char *operation)
{
int error= 0;
int i= 0;
/* Parse and execute command-line options */
if ((error= handle_options(&argc, &argv, my_long_options, get_one_option)))
goto exit;
/* If the print defaults option used, exit. */
if (opt_print_defaults)
{... | vuln | Safe | Unknown |
# -*- 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 ... | vuln | Vulnerable | Python |
@Override
public void tune(ProgramSelector selector) {
if (selector == null) {
throw new IllegalArgumentException("The argument must not be a null pointer");
}
Slog.i(TAG, "Tuning to " + selector);
synchronized (mLock) {
checkNotClosedLocked();
if ... | vuln | Vulnerable | Java |
package com.salesmanager.shop.admin.controller.products;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.salesmanager.core.business.services.catalog.category.CategoryService;
import com.salesmanager.core.business.services.catalog.product.ProductService;
import com.salesmanager.core.business.services.cat... | vuln | Safe | Java |
public function portalAudit($type = 'insert', $rec = '', array $auditvals, $oelog = true, $error = true)
{
$return = false;
$result = false;
$audit = array ();
if ($type != 'insert') {
$audit['date'] = $auditvals['date'] ? $auditvals['date'] : date("Y-m-d H:i:s");
... | vuln | Safe | PHP |
async function generateCsrfCookie (opts) {
let secret = isCookieSigned
? this.unsignCookie(this.request.cookies[cookieKey] || '').value
: this.request.cookies[cookieKey]
if (!secret) {
secret = await tokens.secret()
this.setCookie(cookieKey, secret, Object.assign({}, cookieOpts, opts))
... | vuln | Vulnerable | 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... | vuln | Safe | Python |
wb_print(netdissect_options *ndo,
register const void *hdr, register u_int len)
{
register const struct pkt_hdr *ph;
ph = (const struct pkt_hdr *)hdr;
if (len < sizeof(*ph) || !ND_TTEST(*ph)) {
ND_PRINT((ndo, "%s", tstr));
return;
}
len -= sizeof(*ph);
if (ph->ph_flags)
ND_PRINT((ndo, "*"));
swi... | vuln | Safe | Unknown |
static int ntlm_read_message_header(wStream* s, NTLM_MESSAGE_HEADER* header)
{
if (Stream_GetRemainingLength(s) < 12)
return -1;
Stream_Read(s, header->Signature, 8);
Stream_Read_UINT32(s, header->MessageType);
if (strncmp((char*) header->Signature, NTLM_SIGNATURE, 8) != 0)
return -1;
return 1;
} | vuln | Safe | C/C++ |
VTerm *vterm_new_with_allocator(int rows, int cols, VTermAllocatorFunctions *funcs, void *allocdata)
{
/* Need to bootstrap using the allocator function directly */
VTerm *vt = (*funcs->malloc)(sizeof(VTerm), allocdata);
if (vt == NULL)
return NULL;
vt->allocator = funcs;
vt->allocdata = allocdata;
vt... | vuln | Safe | Unknown |
static void *spapr_create_fdt_skel(const char *cpu_model,
hwaddr initrd_base,
hwaddr initrd_size,
hwaddr kernel_size,
const char *boot_device,
co... | vuln | Safe | C/C++ |
}static inline void WriteResourceLong(unsigned char *p,
}
static inline void WriteResourceLong(unsigned char *p,
const unsigned int quantum)
{ | vuln | Safe | C/C++ |
import { isTestSuiteActive } from "../../support/page_objects/projectConstants";
import { mainPage } from "../../support/page_objects/mainPage";
export const genTest = (apiType, dbType) => {
if (!isTestSuiteActive(apiType, dbType)) return;
describe(`${apiType.toUpperCase()} api - Lock view`, () => {
/... | vuln | Vulnerable | JavaScript |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input;
TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInputTensor, &input));
TfLiteTensor* output;
TF_LITE_ENSURE_OK(context,
GetOutputSafe(context, node, kOutputTensor, &output));
const int num_elem... | vuln | Safe | C/C++ |
static av_cold int libgsm_encode_init(AVCodecContext *avctx) {
if (avctx->channels > 1) {
av_log(avctx, AV_LOG_ERROR, "Mono required for GSM, got %d channels\n",
avctx->channels);
return -1;
if (avctx->sample_rate != 8000) {
av_log(avctx, AV_LOG_ERROR, "Sample rate 8000Hz ... | vuln | Vulnerable | C/C++ |
int qcow2_snapshot_delete(BlockDriverState *bs,
const char *snapshot_id,
const char *name,
Error **errp)
{
BDRVQcowState *s = bs->opaque;
QCowSnapshot sn;
int snapshot_index, ret;
snapshot_index = find_snapshot_by_id_and_... | vuln | Vulnerable | C/C++ |
def close(self):
if self.lock:
self.lock.release() | vuln | Safe | Python |
static pxa2xx_timer_info *pxa2xx_timer_init(target_phys_addr_t base,
qemu_irq *irqs)
{
int i;
int iomemtype;
pxa2xx_timer_info *s;
s = (pxa2xx_timer_info *) qemu_mallocz(sizeof(pxa2xx_timer_info));
s->base = base;
s->irq_enabled = 0;
s->oldclock = 0;
s->clock = 0;
s->... | vuln | Safe | C/C++ |
def remove_resource(self, data, _suffix=''):
"""
Remove an entry of resource. This removes it from the student
view, and prevents students from being able to add it back.
Args:
data: dict in JSON format
data['id']: the ID of the resouce to be removed
... | vuln | Vulnerable | Python |
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2015, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and... | vuln | Safe | C/C++ |
eval_next_non_blank(char_u *arg, evalarg_T *evalarg, int *getnext)
{
char_u *p = skipwhite(arg);
*getnext = FALSE;
if (in_vim9script()
&& evalarg != NULL
&& (evalarg->eval_cookie != NULL || evalarg->eval_cctx != NULL
|| *p == NL)
&& (*p == NUL || *p == NL
|| (vim9_comment_... | vuln | Safe | Unknown |
import base64
import datetime
import json
import logging
import re
from typing import Dict, List, Optional, Set, Tuple
from flask import g, session, url_for
from flask_babel import lazy_gettext as _
from flask_jwt_extended import current_user as current_user_jwt
from flask_jwt_extended import JWTManager
from flask_log... | vuln | Vulnerable | Python |
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
import { FlowRouter } from 'meteor/ostrio:flow-router-extra'
import { saveAs } from 'file-saver'
import { NullXlsx } from '@neovici/nullxlsx'
import './dailytimetable.html'
import './pagination.js'
import './limitpicker.js'
import {
getGlobalSetting,
numb... | vuln | Safe | JavaScript |
@Override
public int fillFields( byte[] data, int offset,
EscherRecordFactory recordFactory )
{
int bytesRemaining = readHeader( data, offset );
short propertiesCount = readInstance( data, offset );
int pos = offset + 8;
EscherPropertyFactory f = new EscherPropertyFa... | vuln | Vulnerable | Java |
private void initTmpDir() {
try {
temporaryDirectory = Files.createTempDirectory("benchmark-reports").toFile();
} catch (IOException e) {
e.printStackTrace();
}
} | vuln | Safe | Java |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite (interfaces: RevocationHandler)
// Package internal is a generated GoMock package.
package internal
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
fosite "github.com/ory/fosite"
)
// MockRevocationH... | vuln | Vulnerable | Go |
def remote_remove_nodes(params, request, session)
if not allowed_for_local_cluster(session, Permissions::FULL)
return 403, 'Permission denied'
end
count = 0
out = ""
node_list = []
options = []
while params["nodename-" + count.to_s]
node_list << params["nodename-" + count.to_s]
count = count +... | vuln | Vulnerable | Ruby |
int fb_get_bit(const fb_t a, size_t bit) {
int d;
RLC_RIP(bit, d, bit);
return (a[d] >> bit) & 1;
} | vuln | Safe | C/C++ |
GF_Err iloc_box_read(GF_Box *s, GF_BitStream *bs)
{
u32 item_count, extent_count, i, j;
GF_ItemLocationBox *ptr = (GF_ItemLocationBox *)s;
ISOM_DECREASE_SIZE(ptr, 2)
ptr->offset_size = gf_bs_read_int(bs, 4);
ptr->length_size = gf_bs_read_int(bs, 4);
ptr->base_offset_size = gf_bs_read_int(bs, 4);
if (ptr->versio... | vuln | Safe | C/C++ |
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator p... | vuln | Vulnerable | Java |
'use strict'
var join = require('path').join
var EventEmitter = require('events')
var pull = require('pull-stream')
var ref = require('ssb-ref')
var ssbKeys = require('ssb-keys')
var createDB = require('./db')
var extras = require('./extras')
var u = require('./util')
function isString (s) {
return typeof s === 's... | vuln | Safe | JavaScript |
static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{
struct lg_drv_data *drv_data = hid_get_drvdata(hdev);
struct usb_device_descriptor *udesc;
__u16 bcdDevice, rev_maj, rev_min;
if ((drv_data->quirks & LG_RDESC) && *rsize >= 91 && rdesc[83] == 0x26 &&
rdesc[84] == 0x8c &&... | vuln | Safe | C/C++ |
lvm_status_t
lvm_set_type(lvm_instance_t *p, node_type_t type)
{
if(p->end + sizeof(node_type_t) >= DB_VM_BYTECODE_SIZE) {
PRINTF("Error: overflow in lvm_set_type\n");
return LVM_STACK_OVERFLOW;
}
*(node_type_t *)(p->code + p->end) = type;
p->end += sizeof(type);
return LVM_TRUE;
} | vuln | Safe | C/C++ |
PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv)
{
int i, rv;
const char *user = NULL;
char *password;
unsigned int slot_num = 0;
int is_a_screen_saver = 0;
struct configuration_st *configuration;
int pkcs11_pam_fail = PAM_AUTHINFO_UNAVAIL;
pkcs11_handle_t ... | vuln | Vulnerable | Unknown |
public static void openUrl(String url, Context context) {
Uri uri = Uri.parse(url);
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(uri);
context.startActivity(intent);
} | vuln | Vulnerable | Java |
static MagickBooleanType WritePICONImage(const ImageInfo *image_info,
Image *image)
{
#define ColormapExtent 155
#define GraymapExtent 95
#define PiconGeometry "48x48>"
static unsigned char
Colormap[]=
{
0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x06, 0x00, 0x05, 0x00, 0xf4, 0x05,
0x00, 0x00, 0x00... | vuln | Safe | C/C++ |
static void pmac_dma_read(BlockBackend *blk,
int64_t offset, unsigned int bytes,
void (*cb)(void *opaque, int ret), void *opaque)
{
DBDMA_io *io = opaque;
MACIOIDEState *m = io->opaque;
IDEState *s = idebus_active_if(&m->bus);
dma_addr_t dma_addr, dma_... | vuln | Safe | C/C++ |
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode != FILECHOOSER_RESULTCODE || filePathCallback == null)
return;
if (resultCode != RESULT_OK || intent == null) {
filePathCallback.onReceiveValue(null);
retu... | vuln | Vulnerable | Java |
package dsig
import (
"bytes"
"crypto/rsa"
"crypto/x509"
"encoding/base64"
"errors"
"fmt"
"regexp"
"github.com/beevik/etree"
"github.com/russellhaering/goxmldsig/etreeutils"
"github.com/russellhaering/goxmldsig/types"
)
var uriRegexp = regexp.MustCompile("^#[a-zA-Z_][\\w.-]*$")
var whiteSpace = regexp.Must... | vuln | Safe | Go |
@Override
public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder viewHolder, final int pos) {
if (viewHolder.getItemViewType() == ListItem.ITEM_TYPE_NORMAL) {
final ItemViewHolder holder = (ItemViewHolder) viewHolder;
final int p = holder.getAbsoluteAdapterPosition();
final ListItem item = data... | vuln | Safe | Java |
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Pragma", "no-cache");
response.setDateHeader("Expires", -1);
String name = request.getParameter("name");... | vuln | Vulnerable | Java |
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* 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 rights
* to use, copy,... | vuln | Vulnerable | Java |
public void addVideo(List<Vod> items) {
if (checkLastSize(items)) return;
List<ListRow> rows = new ArrayList<>();
for (List<Vod> part : Lists.partition(items, Prefers.getColumn())) {
mLast = new ArrayObjectAdapter(new VodPresenter(this));
mLast.setItems(part, null);
... | vuln | Vulnerable | Java |
void groupGenerate(const std::string &rule, std::vector<Proxy> &nodelist, string_array &filtered_nodelist, bool add_direct, extra_settings &ext)
{
std::string real_rule;
if(startsWith(rule, "[]") && add_direct)
{
filtered_nodelist.emplace_back(rule.substr(2));
}
#ifndef NO_JS_RUNTIME
else if... | vuln | Safe | C/C++ |
static int bfi_decode_frame(AVCodecContext *avctx, void *data,
int *data_size, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data, *buf_end = avpkt->data + avpkt->size;
int buf_size = avpkt->size;
BFIContext *bfi = avctx->priv_data;
uint8_t *dst = bfi->dst;
uint8_t *src,... | vuln | Vulnerable | C/C++ |
long target_mmap(target_ulong start, target_ulong len, int prot,
int flags, int fd, target_ulong offset)
{
target_ulong ret, end, real_start, real_end, retaddr, host_offset, host_len;
long host_start;
#if defined(__alpha__) || defined(__sparc__) || defined(__x86_64__) || \
defined(__ia6... | vuln | Safe | C/C++ |
static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
int* buf_size, int type,
uint32_t **lace_buf, int *laces)
{
int res = 0, n, size = *buf_size;
uint8_t *data = *buf;
uint32_t *lace_size;
if (!type) {
*la... | vuln | Safe | C/C++ |
static void drive_backup_prepare(BlkActionState *common, Error **errp)
{
DriveBackupState *state = DO_UPCAST(DriveBackupState, common, common);
BlockDriverState *bs;
DriveBackup *backup;
Error *local_err = NULL;
assert(common->action->type == TRANSACTION_ACTION_KIND_DRIVE_BACKUP);
backup = commo... | vuln | Safe | C/C++ |
static BOOL ntlm_av_pair_add_copy(NTLM_AV_PAIR* pAvPairList, size_t cbAvPairList,
NTLM_AV_PAIR* pAvPair, size_t cbAvPair)
{
UINT16 pair;
size_t avLen;
if (!ntlm_av_pair_check(pAvPair, cbAvPair))
return FALSE;
if (!ntlm_av_pair_get_id(pAvPair, cbAvPair, &pair))
return FALSE;
... | vuln | Safe | C/C++ |
int ClientHandler::read_clear() {
auto should_break = false;
rb_.ensure_chunk();
for (;;) {
if (rb_.rleft() && on_read() != 0) {
return -1;
}
if (rb_.rleft() == 0) {
rb_.reset();
} else if (rb_.wleft() == 0) {
conn_.rlimit.stopw();
return 0;
}
if (!ev_is_active(&co... | vuln | Safe | Unknown |
/* p_lx_elf.cpp --
This file is part of the UPX executable compressor.
Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2020 Laszlo Molnar
Copyright (C) 2000-2020 John F. Reiser
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them... | vuln | Safe | C/C++ |
private void deletePackageVersionVulnerabilityData(String externalVulnerabilityId, Long vulnerabilityId, DSLContext context) {
var packageVersionIds = context.select(VulnerabilitiesXPackageVersions.VULNERABILITIES_X_PACKAGE_VERSIONS.PACKAGE_VERSION_ID)
.from(VulnerabilitiesXPackageVersions.VULNE... | vuln | Vulnerable | Java |
static av_cold int atrac1_decode_init(AVCodecContext *avctx)
{
AT1Ctx *q = avctx->priv_data;
avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
if (avctx->channels < 1 || avctx->channels > AT1_MAX_CHANNELS) {
av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels: %d\n",
avctx->channels);
... | vuln | Vulnerable | C/C++ |
"""
Version information for InvenTree.
Provides information on the current InvenTree version
"""
import re
import subprocess
import django
import common.models
from InvenTree.api_version import INVENTREE_API_VERSION
# InvenTree software version
INVENTREE_SW_VERSION = "0.7.1"
def inventreeInstanceName():
""" R... | vuln | Vulnerable | Python |
def CveMatch(cve, dep_metadata):
'''Heuristically match dependency metadata against CVE.
In general, we allow false positives but want to keep the noise low, to avoid
the toil around having to populate IGNORES_CVES.
Args:
cve: Cve object to match against.
dep_metadata: dependency metadata dictionary.
... | vuln | Vulnerable | Python |
void dkim_exim_verify_finish(void) {
pdkim_signature *sig = NULL;
int dkim_signers_size = 0;
int dkim_signers_ptr = 0;
dkim_signers = NULL;
/* Delete eventual previous signature chain */
dkim_signatures = NULL;
/* If we have arrived here with dkim_collect_input == FALSE, it
means there was a proces... | vuln | Safe | C/C++ |
public function remove()
{
$this->checkCSRFParam();
$project = $this->getProject();
$filter = $this->getCustomFilter($project);
$this->checkPermission($project, $filter);
if ($this->customFilterModel->remove($filter['id'])) {
$this->flash->success(t('Custom filt... | vuln | Safe | PHP |
function parseBuffer(buffer) {
const _entries = []
let cursor = 0
while (cursor < buffer.length) {
const space = buffer.indexOf(32, cursor)
if (space === -1) {
throw new InternalError(
`GitTree: Error parsing buffer at byte location ${cursor}: Could not find the next space character.`
... | vuln | Vulnerable | JavaScript |
private Document parseDocumentImpl(Reader reader, ParserOptions parserOptions) throws InvalidSyntaxException {
BiFunction<GraphqlParser, GraphqlAntlrToLanguage, Object[]> nodeFunction = (parser, toLanguage) -> {
GraphqlParser.DocumentContext documentContext = parser.document();
Document ... | vuln | Vulnerable | Java |
/*
* 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... | vuln | Vulnerable | Java |
static int __mkroute_input(struct sk_buff *skb,
const struct fib_result *res,
struct in_device *in_dev,
__be32 daddr, __be32 saddr, u32 tos)
{
struct fib_nh_exception *fnhe;
struct rtable *rth;
int err;
struct in_device *out_dev;
unsigned int flags = 0;
bool do_cache;
u32 itag = 0;
/* get a w... | vuln | Vulnerable | C/C++ |
static gboolean qio_channel_websock_handshake_send(QIOChannel *ioc,
GIOCondition condition,
gpointer user_data)
{
QIOTask *task = user_data;
QIOChannelWebsock *wioc = QIO_CHANNEL_WEBSOCK(
qio_task_get_s... | vuln | Safe | C/C++ |
static NTSTATUS idmap_sid_to_xid(struct idmap_context *idmap_ctx,
TALLOC_CTX *mem_ctx,
const struct dom_sid *sid,
struct unixid *unixid)
{
int ret;
NTSTATUS status;
struct ldb_context *ldb = idmap_ctx->ldb_ctx;
struct ldb_dn *dn;
struct ldb_message *hwm_msg, *map_msg, *sam_msg;
struct ldb_result *r... | vuln | Safe | Unknown |
static int on_part_data(
multipart_parser *parser, const char *at, size_t length)
{
multipart_parser_data_t *data = NULL;
ogs_assert(parser);
data = multipart_parser_get_data(parser);
ogs_assert(data);
if (at && length) {
SWITCH(data->part[data->num_of_part].content_type)
C... | vuln | Vulnerable | Unknown |
long do_sigreturn(CPUCRISState *env)
{
struct target_signal_frame *frame;
abi_ulong frame_addr;
target_sigset_t target_set;
sigset_t set;
int i;
frame_addr = env->regs[R_SP];
if (!lock_user_struct(VERIFY_WRITE, frame, frame_addr, 1))
goto badframe;
if (__get_user(target_set.sig[0], &frame->sc.oldmask))
... | vuln | Vulnerable | C/C++ |
add_one_setting (GHashTable *settings,
NMConnection *connection,
NMSetting *setting,
GError **error)
{
GHashTable *secrets;
g_return_val_if_fail (settings != NULL, FALSE);
g_return_val_if_fail (connection != NULL, FALSE);
g_return_val_if_fail (setting != NULL, FAL... | vuln | Vulnerable | Unknown |
userauth_gssapi(struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
gss_OID_desc goid = {0, NULL};
Gssctxt *ctxt = NULL;
int r, present;
u_int mechs;
OM_uint32 ms;
size_t len;
u_char *doid = NULL;
if ((r = sshpkt_get_u32(ssh, &mechs)) != 0)
fatal("%s: %s", __func__, ssh_err(r));
if (mechs == 0) {... | vuln | Safe | C/C++ |
static int xan_decode_frame_type1(AVCodecContext *avctx)
{
XanContext *s = avctx->priv_data;
uint8_t *ybuf, *src = s->scratch_buffer;
int cur, last;
int i, j;
int ret;
if ((ret = xan_decode_chroma(avctx, bytestream2_get_le32(&s->gb))) != 0)
return ret;
bytestream2_seek(&s->gb, 16, SE... | vuln | Safe | C/C++ |
int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
struct kvm_sregs *sregs)
{
int mmu_reset_needed = 0;
int pending_vec, max_bits, idx;
struct desc_ptr dt;
dt.size = sregs->idt.limit;
dt.address = sregs->idt.base;
kvm_x86_ops->set_idt(vcpu, &dt);
dt.size = sregs->gdt.limit;
dt.address = sregs->gdt.... | vuln | Vulnerable | Unknown |
function B(ia,ra,aa,ca,na){na||(ea.innerText="",M(),S=ia,Y=ca);var la=null;if(aa){la=document.createElement("table");
la.className="geTempDlgDiagramsListGrid";var qa=document.createElement("tr"),ta=document.createElement("th");ta.style.width="50%";ta.innerHTML=mxUtils.htmlEntities(mxResources.get("diagram"));qa.appendC... | vuln | Safe | JavaScript |
/*-
* Copyright (c) 2004-2013 Tim Kientzle
* Copyright (c) 2011-2012,2014 Michihiro NAKAJIMA
* Copyright (c) 2013 Konrad Kleine
* 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. Redi... | vuln | Vulnerable | C/C++ |
def config_restore(params, request, auth_user)
if params[:name]
code, response = send_request_with_token(
auth_user, params[:name], 'config_restore', true,
{:tarball => params[:tarball]}
)
else
if not allowed_for_local_cluster(auth_user, Permissions::FULL)
return 403, 'Permission denie... | vuln | Safe | Ruby |
int redisContextConnectUnix(redisContext *c, const char *path, const struct timeval *timeout) {
int blocking = (c->flags & REDIS_BLOCK);
struct sockaddr_un sa;
long timeout_msec = -1;
if (redisCreateSocket(c,AF_UNIX) < 0)
return REDIS_ERR;
if (redisSetBlocking(c,0) != REDIS_OK)
retu... | vuln | Vulnerable | C/C++ |
/* jshint unused: false */
// eslint-disable-next-line no-unused-vars
/* global window, $, Backbone, document, d3, ReactDOM, React */
/* global arangoHelper, btoa, atob, _, frontendConfig */
(function () {
'use strict';
let isCurrentCoordinator = false;
window.Router = Backbone.Router.extend({
toUpdate: [],... | vuln | Safe | C/C++ |
PHP_FUNCTION(sqlite_open)
{
long mode = 0666;
char *filename, *fullpath = NULL;
int filename_len;
zval *errmsg = NULL;
zval *object = getThis();
zend_error_handling error_handling;
zend_replace_error_handling(object ? EH_THROW : EH_NORMAL, sqlite_ce_exception, &error_handling TSRMLS_CC);
if (FAILURE == zend_pa... | vuln | Vulnerable | Unknown |
void ff_jpeg2000_cleanup(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty)
{
int reslevelno, bandno, precno;
for (reslevelno = 0;
comp->reslevel && reslevelno < codsty->nreslevels;
reslevelno++) {
Jpeg2000ResLevel *reslevel = comp->reslevel + reslevelno;
for (bandno = 0; b... | vuln | Vulnerable | Unknown |
NotificationsNativeHandler::NotificationsNativeHandler(ScriptContext* context)
: ObjectBackedNativeHandler(context) {
RouteFunction(
"GetNotificationImageSizes", "notifications",
base::Bind(&NotificationsNativeHandler::GetNotificationImageSizes,
base::Unretained(this)));
} | vuln | Safe | C/C++ |
long long Segment::CreateInstance(
if (result < 0) // error
return result;
if (result > 0) // underflow (weird)
return (pos + 1);
if ((segment_stop >= 0) && ((pos + len) > segment_stop))
return E_FILE_FORMAT_INVALID;
if ((pos + len) > available)
return pos + len;
co... | vuln | Safe | C/C++ |
static int celt_header(AVFormatContext *s, int idx)
{
struct ogg *ogg = s->priv_data;
struct ogg_stream *os = ogg->streams + idx;
AVStream *st = s->streams[idx];
struct oggcelt_private *priv = os->private;
uint8_t *p = os->buf + os->pstart;
if (os->psize == 60 &&
!memcmp(p, ff_celt_codec... | vuln | Safe | C/C++ |
static int genh_read_header(AVFormatContext *s)
{
unsigned start_offset, header_size, codec, coef_type, coef[2];
GENHDemuxContext *c = s->priv_data;
av_unused unsigned coef_splitted[2];
int align, ch, ret;
AVStream *st;
avio_skip(s->pb, 4);
st = avformat_new_stream(s, NULL);
if (!st)
... | vuln | Vulnerable | C/C++ |
struct resource_pool *dce120_create_resource_pool(
uint8_t num_virtual_links,
struct dc *dc)
{
struct dce110_resource_pool *pool =
kzalloc(sizeof(struct dce110_resource_pool), GFP_KERNEL);
if (!pool)
return NULL;
if (construct(num_virtual_links, dc, pool))
return &pool->base;
BREAK_TO_DEBUGGER();
return... | vuln | Vulnerable | C/C++ |
static int
mptctl_eventreport (MPT_ADAPTER *ioc, unsigned long arg)
{
struct mpt_ioctl_eventreport __user *uarg = (void __user *) arg;
struct mpt_ioctl_eventreport karg;
int numBytes, maxEvents, max;
if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventreport))) {
printk(KERN_ERR MYNAM "%s@%d::mptctl... | vuln | Safe | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.