lshw/lshw-fix-segfault-in-apfs-volume-code.patch
Petr Šabata b3fe1f8007 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/lshw#62fd9654df86d02cc482f2e5f5f6d2f31fd8d4c9
2020-10-15 18:39:59 +02:00

30 lines
881 B
Diff

From 82df4fa7d3705f2f61282ed5b22074d4e0a6efc4 Mon Sep 17 00:00:00 2001
From: Harry Mallon <hjmallon@gmail.com>
Date: Thu, 23 Apr 2020 21:18:47 +0100
Subject: [PATCH] volumes: fix segfault in apfs volume code
---
src/core/volumes.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/core/volumes.cc b/src/core/volumes.cc
index e703523..6fce2ee 100644
--- a/src/core/volumes.cc
+++ b/src/core/volumes.cc
@@ -784,12 +784,13 @@ struct apfs_super_block {
static bool detect_apfs(hwNode & n, source & s)
{
- static char buffer[sizeof(apfs_super_block)];
+ static char buffer[APFS_STANDARD_BLOCK_SIZE];
source apfsvolume;
apfs_super_block *sb = (apfs_super_block*)buffer;
unsigned long block_size;
apfsvolume = s;
+ apfsvolume.blocksize = APFS_STANDARD_BLOCK_SIZE;
if(readlogicalblocks(apfsvolume, buffer, 0, 1)!=1)
return false;