Sakthipriyan Vairamani (thefourtheye)
f83d035c50
buffer: convert offset & length to int properly
As per ecma-262 2015's #sec-%typedarray%-buffer-byteoffset-length,
`offset` would be an integer, not a 32 bit unsigned integer. Also,
`length` would be an integer with the maximum value of 2^53 - 1, not a
32 bit unsigned integer.
This would be a problem because, if we create a buffer from an
arraybuffer, from an offset which is greater than 2^32, it would be
actually pointing to a different location in arraybuffer. For example,
if we use 2^40 as offset, then the actual value used will be 0,
because `byteOffset >>>= 0` will convert `byteOffset` to a 32 bit
unsigned int, which is based on 2^32 modulo.
This is a redo, as the ca37fa527f broke
CI.
Refer: https://github.com/nodejs/node/pull/9814
Refer: https://github.com/nodejs/node/pull/9492
PR-URL: https://github.com/nodejs/node/pull/9815
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Backport-Of: https://github.com/nodejs/node/pull/9815
PR-URL: https://github.com/nodejs/node/pull/11176
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-03-08 17:10:14 -08:00
..
2017-03-08 17:10:14 -08:00
2016-08-24 07:54:48 -05:00
2017-01-31 17:07:48 -05:00
2016-10-11 12:26:53 -04:00
2017-01-31 17:07:44 -05:00
2016-09-09 11:06:06 -04:00
2016-06-15 21:50:05 -05:00
2017-03-08 17:10:13 -08:00
2016-12-20 14:57:20 -05:00
2015-10-08 17:32:08 -07:00
2015-04-15 17:02:21 -06:00
2015-01-21 16:21:31 -05:00
2016-10-19 14:06:40 +01:00
2016-10-11 12:30:40 -04:00
2016-11-15 13:31:46 -05:00
2016-11-18 19:03:52 -05:00
2017-01-31 17:07:45 -05:00
2016-11-15 13:31:46 -05:00
2017-01-31 17:07:45 -05:00
2016-11-11 14:58:44 -05:00
2016-09-13 17:04:47 -07:00
2017-03-08 17:10:14 -08:00
2016-12-21 13:43:20 -05:00
2016-10-11 12:30:44 -04:00
2016-04-26 12:16:38 -07:00
2016-12-20 14:42:45 -05:00
2016-09-13 17:04:42 -07:00
2016-10-11 12:33:09 -04:00
2016-10-11 12:30:37 -04:00
2016-11-15 13:31:46 -05:00
2016-12-21 13:58:05 -05:00
2017-01-31 17:07:49 -05:00
2015-09-23 00:23:08 +05:30
2016-03-23 10:34:40 -07:00
2016-12-13 15:48:34 -05:00
2016-11-15 13:31:46 -05:00
2016-07-05 22:09:12 +02:00
2016-10-11 12:27:11 -04:00
2015-01-27 16:35:05 +11:00
2016-10-11 12:31:51 -04:00
2016-05-17 08:01:12 -05:00
2016-10-11 12:33:04 -04:00
2017-01-31 17:07:50 -05:00
2015-09-23 00:23:08 +05:30
2016-09-13 16:13:09 -07:00
2015-06-04 10:59:43 +03:00
2017-01-31 17:07:46 -05:00
2016-10-11 12:31:51 -04:00
2016-08-11 10:58:11 -04:00
2017-01-31 17:07:48 -05:00
2016-11-22 15:01:58 +08:00
2016-10-11 12:31:51 -04:00
2016-09-13 17:04:43 -07:00
2016-06-02 22:41:58 +10:00