Projects
openEuler:24.03:SP1:Everything
thin-provisioning-tools
_service:tar_scm:0008-thin_show_metadata-Fix-ou...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:0008-thin_show_metadata-Fix-out-of-bounds-access.patch of Package thin-provisioning-tools
From 0004dced935879e190dd660e1f82f1d751454c78 Mon Sep 17 00:00:00 2001 From: Ming-Hung Tsai <mtsai@redhat.com> Date: Tue, 1 Jun 2021 11:24:11 +0800 Subject: [PATCH] [thin_show_metadata] Fix out-of-bounds access --- thin-provisioning/thin_show_metadata.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/thin-provisioning/thin_show_metadata.cc b/thin-provisioning/thin_show_metadata.cc index bdbab3f7..dbc7a80c 100644 --- a/thin-provisioning/thin_show_metadata.cc +++ b/thin-provisioning/thin_show_metadata.cc @@ -206,7 +206,8 @@ namespace { void run() { auto line_length = 80; - for (block_address b = 0; b < 2000; b++) { + block_address nr_blocks = std::min<block_address>(2000, bm_.get_nr_blocks()); + for (block_address b = 0; b < nr_blocks; b++) { block_manager::read_ref rr = bm_.read_lock(b); if (!(b % line_length)) {
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2