File tree Expand file tree Collapse file tree 4 files changed +20
-4
lines changed Expand file tree Collapse file tree 4 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -2297,7 +2297,11 @@ fromList :: Vector v a => [a] -> v a
2297
2297
{-# INLINE fromList #-}
2298
2298
fromList = unstream . Bundle. fromList
2299
2299
2300
- -- | /O(n)/ Convert the first @n@ elements of a list to a vector.
2300
+ -- | /O(n)/ Convert the first @n@ elements of a list to a vector. It's
2301
+ -- expected that supplied list will be exactly @n@ elements long. As
2302
+ -- optimization this function allocates buffer for @n@ elements and
2303
+ -- could be used to DoS by exhausting memory if attacker controls that
2304
+ -- parameter.
2301
2305
--
2302
2306
-- @
2303
2307
-- fromListN n xs = 'fromList' ('take' n xs)
Original file line number Diff line number Diff line change @@ -1786,7 +1786,11 @@ fromList :: Prim a => [a] -> Vector a
1786
1786
{-# INLINE fromList #-}
1787
1787
fromList = G. fromList
1788
1788
1789
- -- | /O(n)/ Convert the first @n@ elements of a list to a vector.
1789
+ -- | /O(n)/ Convert the first @n@ elements of a list to a vector. It's
1790
+ -- expected that supplied list will be exactly @n@ elements long. As
1791
+ -- optimization this function allocates buffer for @n@ elements and
1792
+ -- could be used to DoS by exhausting memory if attacker controls that
1793
+ -- parameter.
1790
1794
--
1791
1795
-- @
1792
1796
-- fromListN n xs = 'fromList' ('take' n xs)
Original file line number Diff line number Diff line change @@ -1832,7 +1832,11 @@ fromList :: Storable a => [a] -> Vector a
1832
1832
{-# INLINE fromList #-}
1833
1833
fromList = G. fromList
1834
1834
1835
- -- | /O(n)/ Convert the first @n@ elements of a list to a vector.
1835
+ -- | /O(n)/ Convert the first @n@ elements of a list to a vector. It's
1836
+ -- expected that supplied list will be exactly @n@ elements long. As
1837
+ -- optimization this function allocates buffer for @n@ elements and
1838
+ -- could be used to DoS by exhausting memory if attacker controls that
1839
+ -- parameter.
1836
1840
--
1837
1841
-- @
1838
1842
-- fromListN n xs = 'fromList' ('take' n xs)
Original file line number Diff line number Diff line change @@ -1878,7 +1878,11 @@ fromList :: Unbox a => [a] -> Vector a
1878
1878
{-# INLINE fromList #-}
1879
1879
fromList = G. fromList
1880
1880
1881
- -- | /O(n)/ Convert the first @n@ elements of a list to a vector.
1881
+ -- | /O(n)/ Convert the first @n@ elements of a list to a vector. It's
1882
+ -- expected that supplied list will be exactly @n@ elements long. As
1883
+ -- optimization this function allocates buffer for @n@ elements and
1884
+ -- could be used to DoS by exhausting memory if attacker controls that
1885
+ -- parameter.
1882
1886
--
1883
1887
-- @
1884
1888
-- fromListN n xs = 'fromList' ('take' n xs)
You can’t perform that action at this time.
0 commit comments