Skip to content
Permalink
Browse files

Buffer, bugfix: crash when method resize was invoked in async namespa…

…ce (#491)
  • Loading branch information...
asionius authored and xicilion committed Apr 20, 2019
1 parent 98e8819 commit 8498cb3f3e3c9863b632406491faf7d15e59bd5b
Showing with 5 additions and 1 deletion.
  1. +5 −1 fibjs/src/global/Buffer.cpp
@@ -358,7 +358,11 @@ result_t Buffer::resize(int32_t sz)

m_data.resize(sz);

if (sz > sz1 && holder()->m_safe_buffer)
Isolate* isolate = get_holder();
if (!isolate)
return 0;

if (sz > sz1 && isolate->m_safe_buffer)
memset(&m_data[sz1], 0, sz - sz1);

return 0;

0 comments on commit 8498cb3

Please sign in to comment.
You can’t perform that action at this time.