text stringlengths 79 3.72M |
|---|
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-h6q6-9hqw-rwfv<commit_description>* fix!: Preserve quotes in DOCTYPE declaration
Since the only purpose of parsing the DOCTYPE is to be able to restore it when serializing,
we decided that it would be best to leave the parsed publicId and systemId as ... |
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-h6q6-9hqw-rwfv<commit_description>* fix!: Preserve quotes in DOCTYPE declaration
Since the only purpose of parsing the DOCTYPE is to be able to restore it when serializing,
we decided that it would be best to leave the parsed publicId and systemId as ... |
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-h6q6-9hqw-rwfv<commit_description>* fix!: Preserve quotes in DOCTYPE declaration
Since the only purpose of parsing the DOCTYPE is to be able to restore it when serializing,
we decided that it would be best to leave the parsed publicId and systemId as ... |
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-h6q6-9hqw-rwfv<commit_description>* fix!: Preserve quotes in DOCTYPE declaration
Since the only purpose of parsing the DOCTYPE is to be able to restore it when serializing,
we decided that it would be best to leave the parsed publicId and systemId as ... |
<vulnerable_code>// uncomment after placing your favicon in /public
//app.use(favicon(__dirname + '/public/favicon.ico'));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use(mu... |
<vulnerable_code>
angular.module('xdLocalStorage', [])
.service('xdLocalStorage', ['$q', '$rootScope', function ($q, $rootScope) {
var iframeReady = false;
var apiReady = $q.defer();
var unregister = $rootScope.$watch(function () {
return iframeReady;
}, function () {
if (iframeReady === ... |
<vulnerable_code><commit_title>[PATCH] Fix DDOS and SSRF issue :<commit_description><fixed_code>
package com.distrimind.upnp_igd.transport;
/*
Copyright or © or Copr. Jason Mahdjoub (01/04/2013)
jason.mahdjoub@distri-mind.fr
This software (Object Oriented Database (OOD)) is a computer program
whose purpose is to man... |
<vulnerable_code>@ApplicationScoped
public class RouterImpl implements Router {
private static Logger log = Logger.getLogger(Router.class.getName());
protected UpnpServiceConfiguration configuration;
protected ProtocolFactory protocolFactory;
try {
if (log.isLoggable(Le... |
<vulnerable_code>
package com.distrimind.upnp_igd.transport.impl;
import com.distrimind.upnp_igd.transport.Router;
import com.distrimind.upnp_igd.model.message.OutgoingDatagramMessage;
import com.distrimind.upnp_igd.transport.spi.DatagramIO;
import com.distrimind.upnp_igd.transport.spi.DatagramProcessor;
import com.di... |
<vulnerable_code>
package com.distrimind.upnp_igd.transport.impl;
import com.distrimind.upnp_igd.transport.Router;
import com.distrimind.upnp_igd.transport.spi.DatagramProcessor;
import com.distrimind.upnp_igd.transport.spi.InitializationException;
multicastAddress.getAddress() instanceof I... |
<vulnerable_code> * @param datagramProcessor Reads and writes datagrams.
* @throws InitializationException If the service could not be initialized or started.
*/
public void init(InetAddress bindAddress, Router router, DatagramProcessor datagramProcessor) throws InitializationException;
/**
... |
<vulnerable_code>GIFInput::read_subimage_data()
{
GifColorType* colormap = NULL;
if (m_gif_file->Image.ColorMap) { // local colormap
colormap = m_gif_file->Image.ColorMap->Colors;
} else if (m_gif_file->SColorMap) { // global colormap
colormap = m_gif_file->SColorMap->Colors;
} else {
... |
<vulnerable_code> previewHeight = max (int (h / (w * a) * previewWidth + .5f), 1);
previewPixels.resizeErase (previewHeight, previewWidth);
float fx = (previewWidth > 0)? (float (w - 1) / (previewWidth - 1)): 1;
float fy = (previewHeight > 0)? (float (h - 1) / (previewHeight - 1)): 1;
float m = M... |
<vulnerable_code> if_descriptor->bDescriptorType = *(uint8_t *)(buf + 1);
if_descriptor->bInterfaceNumber = *(uint8_t *)(buf + 2);
if_descriptor->bAlternateSetting = *(uint8_t *)(buf + 3);
if_descriptor->bNumEndpoints = *(uint8_t *)(buf + 4);
if_descriptor->bInterfaceClass = *(uint8_t *)(buf + 5)... |
<vulnerable_code>
port_number = edge_port->port->port_number;
if (edge_port->lsr_event) {
edge_port->lsr_event = 0;
dev_dbg(dev, "%s ===== Port %u LSR Status = %02x, Data = %02x ======\n",
__func__, port_number, edge_port->lsr_mask, *data);<commit_title>[PATCH] USB: serial: io_ti: fix information leak in comp... |
<vulnerable_code>
pattern: expected => value => expected.test(value),
lowercase: () => value => /^([a-z]+\s*)+$/.test(value),
uppercase: () => value => /^([A-Z]+\s*)+$/.test(value),
vowel: () => value => /^[aeiou]+$/i.test(value),
<commit_title>[PATCH] fix inefficient regular expressions on lowercase and<com... |
<vulnerable_code> struct sctp_chunk auth;
sctp_ierror_t ret;
/* set-up our fake chunk so that we can process it */
auth.skb = chunk->auth_chunk;
auth.asoc = chunk->asoc;<commit_title>[PATCH] net: sctp: fix sctp_sf_do_5_1D_ce to verify if we/peer is<commit_description><fixed_code>
struct sctp_chunk auth;
s... |
<vulnerable_code> return result;
}
log.info("Session is created and sessionId is :{}.", sessionId);
Map<String, String> data = new HashMap<>();
data.put(Constants.SESSION_ID, sessionId);<commit_title>[PATCH] fix security issue<commit_description><fixed_code>
retu... |
<vulnerable_code>
#include "dhcps.h"
#include "tcpip.h"
//static struct dhcp_server_state dhcp_server_state_machine;
static uint8_t dhcp_server_state_machine = DHCP_SERVER_STATE_IDLE;
/* recorded the client MAC addr(default sudo mac) */
/* UDP Protocol Control Block(PCB) */
static struct udp_pcb *dhcps_pcb;
static s... |
<vulnerable_code> OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS,
OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST,
OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE,
get_excluded_urls,
)
if isinstance(point, NumberDataPoint):
... |
<vulnerable_code>Note:
The environment variable names used to capture HTTP headers are still experimental, and thus are subject to change.
API
---
"""
normalise_request_header_name,
normalise_response_header_name,
remove_url_credentials,
)
_HTTP_VERSION_PREFIX = "HTTP/"
"""
result = {
... |
<vulnerable_code> OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS,
OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST,
OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE,
)
)
self.assertTrue(number_data_point_seen and histogram_data_point_seen)
... |
<vulnerable_code> "OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE"
)
# List of recommended metrics attributes
_duration_attrs = {
SpanAttributes.HTTP_METHOD,
key = header.lower().replace("-", "_")
return f"http.response.header.{key}"
def get_custom_headers(env_var: str) -> List[str]:
cu... |
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-5rv5-6h4r-h22v<commit_description>* Fix unbound cardinality for label http_method in wsgi based middlewares
* cr: rename file
* cr: change label UNKNOWN to NONSTANDARD
* Update instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/ins... |
<vulnerable_code> success: function(file, response) {
//manage error on uploaded file
if (response.error !== 0) {
errorElem.append('<p>' + file.name + ': ' + response.error + '</p>');
this.removeFile(file);
return;
}
}
//appen... |
<vulnerable_code><commit_title>[PATCH] SERVER-25335 avoid group and other permissions when creating<commit_description><fixed_code>
// Test that when running the shell for the first time creates the ~/.dbshell file, and it has
// appropriate permissions (where relevant).
(function() {
"use strict";
// Use dat... |
<vulnerable_code>/* Save the history in the specified file. On success 0 is returned
* otherwise -1 is returned. */
int linenoiseHistorySave(const char* filename) {
FILE* fp = fopen(filename, "wt");
if (fp == NULL) {
return -1;
}
fprintf(fp, "%s\n", history[j]);
}
}
fclo... |
<vulnerable_code>_Py_normpath_and_size(wchar_t *path, Py_ssize_t size, Py_ssize_t *normsize)
{
assert(path != NULL);
if (!path[0] && size < 0 || size == 0) {
*normsize = 0;
return path;
}<commit_title>[PATCH] gh-106242: Minor fixup to avoid compiler warnings<commit_description><fixed_code>
_... |
<vulnerable_code>int main(int argc, char **argv)
{
opj_decompress_parameters parameters; /* decompression parameters */
opj_image_t* image = NULL;
opj_stream_t *l_stream = NULL; /* Stream */
opj_codec_t* l_codec = NULL; /* Handle to a decompressor */
opj_codestr... |
<vulnerable_code> bSvgFilters = false
)
{
return DOMPurify.sanitize(
sanitizeDom(text)
.replaceAll('<', '<')
.replaceAll('<', '<')
.replaceAll('<', '<')
.replaceAll('>', '>')
.replaceAll('>', '>')
.replaceAll('&#... |
<vulnerable_code> execFile(command[0], command.slice(1));
} else if (process.platform === 'win32') {
//Adding `"` wasn't safe/functional on Win systems
command = 'taskkill /IM ' + (this.options.imageName || path.basename(this.cmd);
debug('Executing shutdown taskkil', command);
command ... |
<vulnerable_code>from PyPDF2._page import PageObject
from PyPDF2.constants import PageAttributes as PG
from PyPDF2.generic import DictionaryObject, NameObject, RectangleObject
from tests import get_pdf_from_url
TESTS_ROOT = os.path.abspath(os.path.dirname(__file__))
PROJECT_ROOT = os.path.dirname(TESTS_ROOT)<commit_ti... |
<vulnerable_code>from PyPDF2.constants import Ressources as RES
from PyPDF2.errors import PdfReadError, PdfReadWarning
from PyPDF2.filters import _xobj_to_image
from tests import get_pdf_from_url
TESTS_ROOT = os.path.abspath(os.path.dirname(__file__))
PROJECT_ROOT = os.path.dirname(TESTS_ROOT)<commit_title>[PATCH] Rel... |
<vulnerable_code>
from PyPDF2 import PdfReader
from PyPDF2.constants import PageAttributes as PG
from tests import get_pdf_from_url
TESTS_ROOT = os.path.abspath(os.path.dirname(__file__))
PROJECT_ROOT = os.path.dirname(TESTS_ROOT)<commit_title>[PATCH] Relative import<commit_description><fixed_code>
from PyPDF2 import... |
<vulnerable_code> var events = 'onmousedown|onmousemove|onmmouseup|onmouseover|onmouseout|onload|onunload|onfocus|onblur|onchange';
events += '|onsubmit|ondblclick|onclick|onkeydown|onkeyup|onkeypress|onmouseenter|onmouseleave|onerror|onselect|onreset|onabort|ondragdrop|onresize|onactivate|onafterprint|onmoveend';
... |
<vulnerable_code>
line += PKT_LEN_SIZE;
/*
* TODO: How do we deal with empty lines? Try again? with the next
* line?
*/
if (len == PKT_LEN_SIZE) {
*head = NULL;
*out = line;
return 0;
}
if (len == 0) { /* Flush pkt */<commit_title>[PATCH] smart_pkt: treat empty packet lines as error<commit_description... |
<vulnerable_code> line_len -= (line_end - line);
line = line_end;
/* When a valid packet with no content has been
* read, git_pkt_parse_line does not report an
* error, but the pkt pointer has not been set.
* Handle this by skipping over empty packets.
*/
if (pkt == NULL)
continue;
error = add... |
<vulnerable_code> return file_stream.read()
def read_templates(
self,
filenames: List[str],
custom_template_directory: Optional[str] = None,
autoescape: bool = False,
) -> List[jinja2.Template]:
"""Load a list of template files from disk using the given variab... |
<vulnerable_code> "recaptcha_siteverify_api",
"https://www.recaptcha.net/recaptcha/api/siteverify",
)
self.recaptcha_template = self.read_templates(
["recaptcha.html"], autoescape=True
)[0]
def generate_config_section(self, **kwargs):
return """\<c... |
<vulnerable_code>
def read_config(self, config, **kwargs):
consent_config = config.get("user_consent")
self.terms_template = self.read_templates(["terms.html"], autoescape=True)[0]
if consent_config is None:
return<commit_title>[PATCH] Remove unused parameter.<commit_description... |
<vulnerable_code> add_threepid_template_success_html,
],
template_dir,
autoescape=True,
)
# Render templates that do not contain any placeholders
self.email_notif_template_html,
self.email_notif_t... |
<vulnerable_code> self.session_lifetime = session_lifetime
# The success template used during fallback auth.
self.fallback_success_template = self.read_templates(
["auth_success.html"], autoescape=True
)[0]
def generate_config_section(self, generate_secrets=False, **kwar... |
<vulnerable_code> "sso_auth_bad_user.html",
],
template_dir,
autoescape=True,
)
# These templates have no placeholders, so render them here<commit_title>[PATCH] Remove unused parameter.<commit_description><fixed_code>
"sso_auth_bad_user... |
<vulnerable_code> from: rel.from,
to: rel.to,
label: rel.type,
title: rel.comment,
color: {
opacity: 1.0,
}<commit_title>[PATCH] fix: [security] XSS in event-graph relationship tooltip<commit_description><... |
<vulnerable_code> (unsigned long long)fs->fat_start,
(unsigned long long)fs->fat_start / lss);
printf("%10d FATs, %d bit entries\n", b->fats, fs->fat_bits);
printf("%10d bytes per FAT (= %u sectors)\n", fs->fat_size,
fs->fat_size / lss);
if (!fs->root_cluster) {
printf("Root directory starts at ... |
<vulnerable_code> self.ca_cert_dir,
self.ca_cert_data,
)
# If no cert was provided, use only the default options for server
# certificate validation<commit_title>[PATCH] Merge pull request from GHSA-5phf-pp7p-vc2r<commit_description>* Enable hostname verification for HTTP... |
<vulnerable_code> yield cfg
@pytest.fixture
def ip_san_server(tmp_path_factory):
tmpdir = tmp_path_factory.mktemp("certs")<commit_title>[PATCH] Merge pull request from GHSA-5phf-pp7p-vc2r<commit_description>* Enable hostname verification for HTTPS proxies with default cert.
Signed-off-by: Jorge Lopez Silv... |
<vulnerable_code>
r = http.request("GET", "%s/" % self.https_url)
assert r.status == 200<commit_title>[PATCH] Merge pull request from GHSA-5phf-pp7p-vc2r<commit_description>* Enable hostname verification for HTTPS proxies with default cert.
Signed-off-by: Jorge Lopez Silva <jalopezsilva@gmail.c... |
<vulnerable_code> replace_dataset_placeholders,
replace_version,
)
from fides.api.util.unsafe_file_util import verify_zip
from fides.config import CONFIG
)
elif info.filename.endswith(".svg"):
if not icon_contents:
icon_contents = str_to_b64_s... |
<vulnerable_code>from typing import Optional
from zipfile import ZipFile
MAX_FILE_SIZE = 16 * 1024 * 1024 # 16 MB
CHUNK_SIZE = 1024
def verify_zip(zip_file: ZipFile, max_file_size: Optional[int] = None) -> None:
"""
Function to safely verify the contents of zipped files. It prevents potential<commit_title>[... |
<vulnerable_code>
import pytest
from fides.api.util.unsafe_file_util import verify_zip
from tests.ops.test_helpers.saas_test_utils import create_zip_file
class TestVerifyZip:
@pytest.fixture
def zip_file(self) -> BytesIO:<commit_title>[PATCH] Merge pull request from GHSA-3rw2-wfc8-wmj5<commit_description>* A... |
<vulnerable_code>
/* Don't allow subnamespace setups: */
{SCMP_SYS (unshare), EPERM},
{SCMP_SYS (mount), EPERM},
{SCMP_SYS (pivot_root), EPERM},
#if defined(__s390__) || defined(__s390x__) || defined(__CRIS__)<commit_title>[PATCH] run: Block setns()<commit_description>If we don't allow unshare() or clon... |
<vulnerable_code>
package com.google.common.io;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Arrays;
/**
// Write data to go over the threshold
if (chunk2 > 0) {
write(out, data, chunk1, chunk2, singleByte);
file = out.getFile();
assertEqual... |
<vulnerable_code>
package com.google.common.io;
import static com.google.common.truth.Truth.assertThat;
import java.io.File;
import junit.framework.TestCase;
/**
* @author Chris Nokleberg
*/
public class FilesCreateTempDirTest extends TestCase {
public void testCreateTempDir() {
File temp = Files.createTemp... |
<vulnerable_code>
package com.google.common.io;
import static java.util.Objects.requireNonNull;
import com.google.common.annotations.Beta;
* An {@link OutputStream} that starts buffering to a byte array, but switches to file buffering
* once the data reaches a configurable size.
*
* <p>Temporary files created by ... |
<vulnerable_code>@ElementTypesAreNonnullByDefault
public final class Files {
/** Maximum loop count when creating temp directories. */
private static final int TEMP_DIR_ATTEMPTS = 10000;
private Files() {}
/**
* Atomically creates a new directory somewhere beneath the system's temporary directory (as
*... |
<vulnerable_code><commit_title>[PATCH] Restrict permissions when creating temporary files and<commit_description><fixed_code>
/*
* Copyright 2019 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a ... |
<vulnerable_code><commit_title>[PATCH] Restrict permissions when creating temporary files and<commit_description><fixed_code>
/*
* Copyright (C) 2007 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtai... |
<vulnerable_code> if(Object.keys(req.files).length !== 0){
pic_path = req.files.fileUpload.path;
}else{
var base64Data = req.rawBody.replace(/^data:image\/png;base64,/, "");
require("fs").writeFile("out.png", base64Data, 'base64', function(err) {
console.log(err);
});
}<commit_title>[PATCH] ... |
<vulnerable_code> def config_file_paths(self):
path = jupyter_config_path()
if self.config_dir not in path:
path.insert(0, self.config_dir)
path.insert(0, os.getcwd())
return path
data_dir = Unicode()<commit_title>[PATCH] Merge pull request from GHSA-m678-f26j-3hrp<co... |
<vulnerable_code>
def test_load_config():
config_dir = mkdtemp()
wd = mkdtemp()
with open(pjoin(config_dir, "dummy_app_config.py"), "w", encoding="utf-8") as f:
f.write("c.DummyApp.m = 1\n")
f.write("c.DummyApp.n = 1")
with patch.object(os, "getcwd", lambda: wd):
app = DummyApp(c... |
<vulnerable_code>
# test if fails when wrong password is provided
result = self.app.patch("/api/password/change", headers=headers, json={
"current_password": "wrong_password1!",
"new_password": "a_new_password"
})
self.assertEqual(result.status_code, 401)
... |
<vulnerable_code>
class CollaborationInputSchema(Schema):
""" Schema for validating input for a creating a collaboration. """
name = fields.String(required=True, validate=Length(max=_MAX_LEN_NAME))
organization_ids = fields.List(fields.Integer(), required=True)
encrypted = fields.Boolean(required=True)
... |
<vulnerable_code> "does not exist"}, HTTPStatus.NOT_FOUND # 404
# check permissions
org_id = data["organization_id"]
user_org_id = g.user.organization.id
if not self.r.c_glo.can():
own = not org_id or org_id == user_org_id
HTTPStat... |
<vulnerable_code> # set the organization id
organization_id = (
data['organization_id']
if data['organization_id'] else g.user.organization_id
)
# verify that the organization for which we create a role exists
if not db.Organization.get(organization_id):
... |
<vulnerable_code> # check if the organization has been provided, if this is the case the
# user needs global permissions in case it is not their own
organization_id = g.user.organization_id
if data['organization_id']:
if data['organization_id'] != organization_id:
... |
<vulnerable_code> company = self.filtered(
lambda p: not (p.title and p.firstname and not p.is_company))
for p in company:
p.salutation = _("Dear friends of compassion")
p.short_salutation = p.salutation
p.informal_salutation = _("Dear friend of Compassion"... |
<vulnerable_code> children = self.get_objects()
attachments = self.env['ir.attachment']
for child in children:
pic = child.pictures_ids[0]
attachment = self.env['ir.attachment'].search([
('res_model', '=', 'compassion.child.pictures'... |
<vulnerable_code> lambda t: t.product_id.product_tmpl_id == self.env.ref(
'website_event_compassion.product_template_single_room'))
product = single_room_ticket.product_id
invl_vals.append({
'quantity': 1.0,
'price_unit': single_... |
<vulnerable_code> )
text = html_file.read()
html_file.close()
return text
def form_init(self, request, main_object=None, **kw):
form = super(MuskathlonRegistrationForm, self).form_init(
main_object.with_delay().notify_new_registration()
... |
<vulnerable_code>from . import queue_job
from . import payment_transaction
from . import survey_user_input<commit_title>[PATCH 1/9] CO-2587 Salutation full name<commit_description><fixed_code>
from . import queue_job
from . import payment_transaction
from . import survey_user_input
from . import privacy_statement |
<vulnerable_code><commit_title>[PATCH 1/9] CO-2587 Salutation full name<commit_description><fixed_code>
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2019 Compassion CH (http://www.compassion.ch)
# @author: Emanuel Cino <ecino@compassion.c... |
<vulnerable_code> ambassador_id = fields.Many2one('res.partner')
event_id = fields.Many2one('crm.event.compassion')
invoice_id = fields.Many2one('account.invoice')
@property
def _form_fieldsets(self):
'partner_street', 'partner_zip', 'partner_city',
... |
<vulnerable_code> ], 'Hotel room')
double_room_person = fields.Char('I want to share the room with:')
comments = fields.Text(default='')
def _form_load_single_double_room(
self, fname, field, value, **req_values):
'title': _('Your spoken languages'),
... |
<vulnerable_code>from . import event_faq
from . import res_country_vaccine
from . import survey_user_input<commit_title>[PATCH 1/9] CO-2587 Salutation full name<commit_description><fixed_code>
from . import event_faq
from . import res_country_vaccine
from . import survey_user_input
from . import privacy_statement |
<vulnerable_code> 'views/description_views.xml',
'data/lang_data.xml',
'views/res_country_view.xml',
'data/ir.advanced.translation.csv',
],
'demo': [],<commit_title>[PATCH 1/9] CO-2587 Salutation full name<commit_description><fixed_code>
'views/description_views.xml',
... |
<vulnerable_code>from . import project_compassion
from . import lang_compassion
from . import res_country<commit_title>[PATCH 1/9] CO-2587 Salutation full name<commit_description><fixed_code>
from . import project_compassion
from . import lang_compassion
from . import res_country
from . import field_office |
<vulnerable_code><commit_title>[PATCH 1/9] CO-2587 Salutation full name<commit_description><fixed_code>
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus'... |
<vulnerable_code> source_id = self.config_id.source_id.id
def _replace_link(match):
full_link = match.group(1).replace('&', '&')
short_link = self.env['link.tracker'].create({
'url': full_link,
]
})
return attachments
def get... |
<vulnerable_code> def _process_reconciliation(self, counterpart_aml_dicts=None,
payment_aml_rec=None, new_aml_dicts=None):
"""Bank statement line reconciliation job"""
return super(BankStatementLine, self).process_reconciliation(
counterpart_aml_dicts, paym... |
<vulnerable_code>class FieldOffice(models.Model):
_inherit = 'compassion.field.office'
# French document
fr_country_info_pdf = fields.Binary(
string='Country information French',
attachment=True
)
fr_filename = fields.Char(string='fr_filename')
# German document
de_country_... |
<vulnerable_code> })
# Country information
country_info_lang_pdf = self.get_objects().child_id.field_office_id \
.get_country_info_pdf_lang(lang=self.partner_id.lang)
if country_info_lang_pdf:
attachments.update({
_('country information.pdf'): [
... |
<vulnerable_code> 'data/sponsorship_server_actions.xml',
'data/sponsorship_action_rules.xml',
'data/utm_data.xml',
'report/child_picture.xml',
'views/communication_job_view.xml',
'views/download_child_pictures_view.xml',<commit_title>[PATCH 1/9] CO-2587 Salutation full nam... |
<vulnerable_code> if country_pdf:
attachments.update({
field_office.name + ".pdf": [
'country_information_pdf',
country_pdf
]
})<commit_title>[PATCH 1/9] CO-2587 Salutation full name<commit... |
<vulnerable_code> }
}
if ((tag != LBER_ERROR) && (len != -1)) {
goto parsing_error;
}
slapi_log_err(SLAPI_LOG_FILTER, "get_extensible_filter", "<= %i\n", rc);<commit_title>[PATCH] Issue 5242- Craft message may crash the server<commit_description>Bug description:
A craft request can res... |
<vulnerable_code> /* position in x and y of tile */
OPJ_UINT32 p, q;
/* preconditions */
assert(p_cp != 00);
assert(p_image != 00);
q = p_tileno / p_cp->tw;
/* find extent of tile */
*p_tx0 = opj_int_max((OPJ_INT32)(p_cp->tx0 + p * p_cp->tdx),
(OPJ_INT32)p_image... |
<vulnerable_code>{
mpl::ClientLogger<MountReply> logger{mpl::level_from(request->verbosity_level()), *config->logger, server};
QFileInfo source_dir(QString::fromStdString(request->source_path()));
if (!source_dir.exists())
{<commit_title>[PATCH] [daemon] refuse to mount when disabled<commit_description... |
<vulnerable_code> "local.bridged-network=<name>` to correct. See `multipass networks` for valid names."));
}
} // namespace<commit_title>[PATCH] [daemon] refuse to mount when disabled<commit_description><fixed_code>
"local.bridged-network=<name>` to correct. See `mult... |
<vulnerable_code> * used_address->name_len is initialized to UINT_MAX so that the first
* destination address never matches.
*/
if (used_address && used_address->name_len == msg_sys->msg_namelen &&
!memcmp(&used_address->name, msg->msg_name,
used_address->name_len)) {
err = sock_sendmsg_nosec(sock, m... |
<vulnerable_code> u32 i, ring_idx;
struct Vmxnet3_RxDesc *rxd;
for (ring_idx = 0; ring_idx < 2; ring_idx++) {
for (i = 0; i < rq->rx_ring[ring_idx].size; i++) {
#ifdef __BIG_ENDIAN_BITFIELD<commit_title>[PATCH] net: vmxnet3: fix possible NULL pointer dereference in<commit_description><fixed_code>
u32 i, ring_idx;... |
<vulnerable_code>import random
from html import escape
from os import remove
import magic
from flask import Flask, abort, request
from PIL import Image
): # if it is not over the limit, it will skip. if it is, it does this.
# if we have gone over our cache limit, let's delete the first entry.
file... |
<vulnerable_code> permission = Permission(RuleNeed(self.name, scope, operation))
self.__setattr__(f'{operation.value}_{scope.value}', permission)
def can_by_org(self, operation: Operation, subject_org_id: int,
own_org: Organization) -> bool:
"""
Check if an operati... |
<vulnerable_code> args = request.args
if 'organization_id' in args:
if not self.r.can_by_org(P.VIEW, args['organization_id'],
auth.organization):
return {
'msg': 'You lack the permission view nodes from the '
... |
<vulnerable_code> q = q.filter(db.Organization.country == args['country'])
if 'collaboration_id' in args:
# TODO we also need to check here if the user is part of the collab
if not self.r.can_for_collaboration(
P.VIEW, args['collaboration_id'],
... |
<vulnerable_code>
# filter by collaboration id
if 'collaboration_id' in args:
if not self.r.can_for_collaboration(
P.VIEW, args['collaboration_id'],
self.obtain_auth_collaborations()
):
return {
'msg': 'You lack ... |
<vulnerable_code>from vantage6.common import logger_name
from vantage6.server import db
from vantage6.server.permission import (
PermissionManager,
Scope as S,
Operation as P
add(scope=S.GLOBAL, operation=P.VIEW,
description="view any run")
add(scope=S.ORGANIZATION, operation=P.VIEW, assign... |
<vulnerable_code>from vantage6.common.task_status import TaskStatus, has_task_finished
from vantage6.server import db
from vantage6.server.permission import (
Scope as S,
PermissionManager,
Operation as P
"""
add = permissions.appender(module_name)
add(scope=S.GLOBAL, operation=P.VIEW,
... |
<vulnerable_code> if param in args:
q = q.filter(getattr(db.User, param).like(args[param]))
if 'organization_id' in args:
if not self.r.can_by_org(P.VIEW, args['organization_id'],
g.user.organization):
return {
... |
<vulnerable_code><commit_title>[PATCH] added tests<commit_description><fixed_code>
TestCase("[Commons - XSS Utils] sanitize method", {
'test given html without script or inline js when sanitize is called then content remains the same': function() {
var html = "<div>Hello World</div>";
var outputHT... |
<vulnerable_code>
int parse_unix(grpc_uri *uri, grpc_resolved_address *resolved_addr) {
struct sockaddr_un *un = (struct sockaddr_un *)resolved_addr->addr;
un->sun_family = AF_UNIX;
strncpy(un->sun_path, uri->path, sizeof(un->sun_path) - 1 /* null term'd */);
un->sun_path[sizeof(un->sun_path) - 1] = '\0';
re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.