mirror of
https://github.com/NGSolve/netgen.git
synced 2025-02-16 15:23:08 +05:00
Fix nullptr deref in archive
Hardened toolchains (eg, mainline Fedora) no longer tolerate null derefs that were silently trapped/ignored in earlier versions. This eliminates a nullptr deref in archive.hpp that was failing several unit tests (and causing crashes) when trying to manipulate default-constructed archive objects.
This commit is contained in:
parent
97d3c1ce9e
commit
5ee4e43393
@ -225,7 +225,8 @@ namespace ngcore
|
|||||||
(*this) & size;
|
(*this) & size;
|
||||||
if(Input())
|
if(Input())
|
||||||
v.resize(size);
|
v.resize(size);
|
||||||
Do(&v[0], size);
|
if(size > 0) // can't deref v[0] if it doesn't exist
|
||||||
|
Do(&v[0], size);
|
||||||
return (*this);
|
return (*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user