summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2024-12-27 22:15:48 +0100
committerDimitry Andric <dim@FreeBSD.org>2024-12-27 22:25:30 +0100
commit92112892d8323a5261869ff5726adc2e5d44a389 (patch)
treec202916df629cc098c6aa27e1fcca2e964609ca1
parent9b0f6d74f4f722221b350597ba182703ada8f8e5 (diff)
archivers/pbzip2: fix stream decompression after libc++ 19 fix
The patch in bug 283655 to fix the pbzip2 build against libc++ 19 (which finally removed std::char_traits<unsigned char>) had a problem where it did not correctly check the bzip2 header. This only occurred when decompressing from standard input, in the 'BZ2StreamScanner' mode, and would then throw an unexpected "invalid file format" error. PR: 283655 Reported by: wosch MFH: 2024Q4 (cherry picked from commit 89f872ec2ccf488f24cd9daca2e0d1f80e7ee429)
-rw-r--r--archivers/pbzip2/files/patch-BZ2StreamScanner.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/archivers/pbzip2/files/patch-BZ2StreamScanner.cpp b/archivers/pbzip2/files/patch-BZ2StreamScanner.cpp
index e6a3d82b789c..070f227c7ec1 100644
--- a/archivers/pbzip2/files/patch-BZ2StreamScanner.cpp
+++ b/archivers/pbzip2/files/patch-BZ2StreamScanner.cpp
@@ -1,4 +1,4 @@
---- BZ2StreamScanner.cpp.orig 2024-11-03 23:01:39 UTC
+--- BZ2StreamScanner.cpp.orig 2015-12-17 23:32:49 UTC
+++ BZ2StreamScanner.cpp
@@ -49,8 +49,8 @@ int BZ2StreamScanner::init( int hInFile, size_t inBuff
@@ -36,7 +36,7 @@
- int cmpres = pHdr->compare( hsp, pHdr->size() - hsp,
- getInBuffSearchPtr() + hsp, pHdr->size() - hsp );
+ bool cmpres = equal( pHdr->begin() + hsp, pHdr->begin() + pHdr->size() - hsp,
-+ getInBuffSearchPtr() );
++ getInBuffSearchPtr() + hsp );
+
#ifdef PBZIP_DEBUG