about summary refs log tree commit diff
path: root/src/libutil
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-05-04T09·50+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-05-04T09·50+0200
commit33de2bc080dd08a6767440e61ceba6ce33234761 (patch)
treebb14bf5f2c829ef597cd9389916e2435002be073 /src/libutil
parentf435f8247553656774dd1b2c88e9de5d59cab203 (diff)
Fix segfault in xz compression/decompression
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/compression.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libutil/compression.cc b/src/libutil/compression.cc
index 4d15d2acdd4e..ec63855f6c4b 100644
--- a/src/libutil/compression.cc
+++ b/src/libutil/compression.cc
@@ -11,7 +11,7 @@ namespace nix {
 
 static ref<std::string> compressXZ(const std::string & in)
 {
-    lzma_stream strm;
+    lzma_stream strm(LZMA_STREAM_INIT);
 
     // FIXME: apply the x86 BCJ filter?
 
@@ -54,7 +54,7 @@ static ref<std::string> compressXZ(const std::string & in)
 
 static ref<std::string> decompressXZ(const std::string & in)
 {
-    lzma_stream strm;
+    lzma_stream strm(LZMA_STREAM_INIT);
 
     lzma_ret ret = lzma_stream_decoder(
         &strm, UINT64_MAX, LZMA_CONCATENATED);