File tree Expand file tree Collapse file tree 6 files changed +26
-6
lines changed Expand file tree Collapse file tree 6 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -2119,7 +2119,11 @@ fromList :: [a] -> Vector a
2119
2119
{-# INLINE fromList #-}
2120
2120
fromList = G. fromList
2121
2121
2122
- -- | /O(n)/ Convert the first @n@ elements of a list to a vector.
2122
+ -- | /O(n)/ Convert the first @n@ elements of a list to a vector. It's
2123
+ -- expected that the supplied list will be exactly @n@ elements long. As
2124
+ -- an optimization, this function allocates a buffer for @n@ elements, which
2125
+ -- could be used for DoS-attacks by exhausting the memory if an attacker controls
2126
+ -- that parameter.
2123
2127
--
2124
2128
-- @
2125
2129
-- fromListN n xs = 'fromList' ('take' n xs)
Original file line number Diff line number Diff line change @@ -664,7 +664,7 @@ unfoldrN n f = unfoldrNM n (return . f)
664
664
-- | Unfold at most @n@ elements with a monadic function.
665
665
unfoldrNM :: Monad m => Int -> (s -> m (Maybe (a , s ))) -> s -> Bundle m u a
666
666
{-# INLINE_FUSED unfoldrNM #-}
667
- unfoldrNM n f s = fromStream (S. unfoldrNM n f s) ( Max (delay_inline max n 0 ))
667
+ unfoldrNM n f s = fromStream (S. unfoldrNM n f s) Unknown
668
668
669
669
-- | Unfold exactly @n@ elements
670
670
--
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 the supplied list will be exactly @n@ elements long. As
2302
+ -- an optimization, this function allocates a buffer for @n@ elements, which
2303
+ -- could be used for DoS-attacks by exhausting the memory if an attacker controls
2304
+ -- that 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 the supplied list will be exactly @n@ elements long. As
1791
+ -- an optimization, this function allocates a buffer for @n@ elements, which
1792
+ -- could be used for DoS-attacks by exhausting the memory if an attacker controls
1793
+ -- that 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 the supplied list will be exactly @n@ elements long. As
1837
+ -- an optimization, this function allocates a buffer for @n@ elements, which
1838
+ -- could be used for DoS-attacks by exhausting the memory if an attacker controls
1839
+ -- that 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 the supplied list will be exactly @n@ elements long. As
1883
+ -- an optimization, this function allocates a buffer for @n@ elements, which
1884
+ -- could be used for DoS-attacks by exhausting the memory if an attacker controls
1885
+ -- that 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