f0bb967
shared: correctly propagate possible allocation errors instead of just asserting in case the memstream couldn't be resized. Found by Nallocufuzz. (cherry picked from commit 3575c371697a07995c3e65ae03aed55262ab00ed)