File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -59,12 +59,20 @@ public static bool IsNullOrEmpty(this Array? array)
5959 /// </summary>
6060 /// <param name="charLimit">Number of characters needed to be a valid string, default 5</param>
6161 /// <returns>String list containing the requested data, null on error</returns>
62+ /// <remarks>A maximum of 16KiB of data can be scanned at a time</remarks>
6263 public static List < string > ? ReadStringsFrom ( this byte [ ] ? input , int charLimit = 5 )
6364 {
6465 // Validate the data
6566 if ( input == null || input . Length == 0 )
6667 return null ;
6768
69+ // Limit to 16KiB of data
70+ if ( input . Length > 16384 )
71+ {
72+ int offset = 0 ;
73+ input = input . ReadBytes ( ref offset , 16384 ) ;
74+ }
75+
6876 // Check for ASCII strings
6977 var asciiStrings = input . ReadStringsWithEncoding ( charLimit , Encoding . ASCII ) ;
7078
You can’t perform that action at this time.
0 commit comments