-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buffer.alloc v4: Incorrectly returns zero-filled buffer when encoding is passed #9226
Comments
/cc @nodejs/buffer |
Working on this. The issue is that |
Previously, the implementation of Buffer.alloc() called Buffer#fill() with another Buffer as an argument. However, in v4.x, Buffer#fill does not support a Buffer as a parameter. As a workaround, call binding.fill() directly in the Buffer.alloc() implementation. Fixes: nodejs#9226
Ow, that was my backport. Btw, it probably means that there is no testcase for that in |
@ChALkeR would you be able to do a Pr? On Sun, Oct 23, 2016, 10:45 AM Сковорода Никита Андреевич <
|
@thealphanerd You mean the testcases update? I will take a look at that. |
Previously, the implementation of Buffer.alloc() called Buffer#fill() with another Buffer as an argument. However, in v4.x, Buffer#fill does not support a Buffer as a parameter. As a workaround, call binding.fill() directly in the Buffer.alloc() implementation. Fixes: #9226 PR-URL: #9238 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: James M Snell <[email protected]>
fixed in dc3e45f and will land in v4.6.2 |
Previously, the implementation of Buffer.alloc() called Buffer#fill() with another Buffer as an argument. However, in v4.x, Buffer#fill does not support a Buffer as a parameter. As a workaround, call binding.fill() directly in the Buffer.alloc() implementation. Fixes: #9226 PR-URL: #9238 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: James M Snell <[email protected]>
Buffer.alloc(size, data, enc)
:Also, the
Buffer.alloc(size, data, enc)
docs example fails:The text was updated successfully, but these errors were encountered: