[v10.x backport] fs: improve truncate length validation#21171
[v10.x backport] fs: improve truncate length validation#21171codebytere wants to merge 3 commits intonodejs:v10.x-stagingfrom codebytere:backport-20851-to-v10.x
Conversation
This commit adds validation to the length parameter of fs.truncate(). Prior to this commit, passing a non-number would trigger a CHECK() in the binding layer. PR-URL: #20851 Fixes: #20844 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
The length used by ftruncate() is 64 bits in the binding layer. This commit removes the 32 bit restriction in the JS layer. PR-URL: #20851 Fixes: #20844 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
|
@codebytere Thanks for the PR :) These commits don't apply cleanly to v10.x because of other previous PRs that need a backport. I opened #21172 for that and it includes the commits that this PR attempts to backport. |
|
@targos These commits to seem to apply cleanly to me? Would there be any issue with landing these first and then rebasing your larger backport PR against it? |
|
What I meant is that these commits from master don't apply cleanly (that's why they have the backport-requested label).
No. There won't be many conflicts to solve. |
|
Oh, that makes more sense… I guess in that case it might be easier to do it your way |
This allows validation of integers that are not int32 or uint32. PR-URL: #20851 Fixes: #20844 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Backport-PR-URL: #21171 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit adds validation to the length parameter of fs.truncate(). Prior to this commit, passing a non-number would trigger a CHECK() in the binding layer. Backport-PR-URL: #21171 PR-URL: #20851 Fixes: #20844 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Backport-PR-URL: #21171 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
The length used by ftruncate() is 64 bits in the binding layer. This commit removes the 32 bit restriction in the JS layer. Backport-PR-URL: #21171 PR-URL: #20851 Fixes: #20844 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Backport-PR-URL: #21171 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
|
Landed in 16ef09f...0577312 🎉 |
The length used by ftruncate() is 64 bits in the binding layer. This commit removes the 32 bit restriction in the JS layer. Backport-PR-URL: #21171 PR-URL: #20851 Fixes: #20844 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Backport-PR-URL: #21171 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This allows validation of integers that are not int32 or uint32. PR-URL: #20851 Fixes: #20844 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Backport-PR-URL: #21171 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit adds validation to the length parameter of fs.truncate(). Prior to this commit, passing a non-number would trigger a CHECK() in the binding layer. Backport-PR-URL: #21171 PR-URL: #20851 Fixes: #20844 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Backport-PR-URL: #21171 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
The length used by ftruncate() is 64 bits in the binding layer. This commit removes the 32 bit restriction in the JS layer. Backport-PR-URL: #21171 PR-URL: #20851 Fixes: #20844 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Backport-PR-URL: #21171 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Original PR: #20851
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes