Merge pull request #225180 from yvt/patch/fuse-7z-ng-zero-init-fuse-operations

fuse-7z-ng: add patch to zero-init `struct fuse_operations`
This commit is contained in:
Sergei Trofimovich 2023-04-11 18:03:13 +01:00 committed by GitHub
commit 0c0caf53ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -14,6 +14,10 @@ stdenv.mkDerivation rec {
# Drop unused pthread library. pthread_yield()
# fails the configure.
./no-pthread.patch
# Zero-initialize unset fields of `struct fuse_operations` so that
# garbage values don't cause segfault.
# <https://github.com/kedazo/fuse-7z-ng/pull/8>
./zero-init-fuse-operations.patch
];
nativeBuildInputs = [ pkg-config makeWrapper autoconf automake ];

View File

@ -0,0 +1,13 @@
Zero-initialize unset fields of `struct fuse_operations`.
<https://github.com/kedazo/fuse-7z-ng/pull/8>
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -195,7 +195,7 @@ main (int argc, char **argv)
mkdir(param.mountpoint, 0750);
}
- struct fuse_operations fuse7z_oper;
+ struct fuse_operations fuse7z_oper = {0};
fuse7z_oper.init = fuse7z_init;
fuse7z_oper.destroy = fuse7z_destroy;
fuse7z_oper.readdir = fuse7z_readdir;