Open tombogle opened 5 years ago
In practice (and certainly on a 32-bit machine), strings can't really get that big (see: https://stackoverflow.com/questions/140468/what-is-the-maximum-possible-length-of-a-net-string). Long before we get close to MaxLength, we're going to either get an OutOfMemoryException or and AccessViolationException. To make things even crazier, LogBox.Text and LogBox.Rtf currently return values that includes the label Box:, followed by all the non-verbose text, followed by the label Verbose:, followed by all the verbose text (with includes the non-verbose). In the case of Rtf, this is already considerably larger than the plain text. So accessing one of these properties can easily attempt to create a string that could be more than double MaxLength. I don;t know if these implementations are particularly useful or if any existing production code accesses them.
@tombogle is this still an issue, or did #845 fix this?
The RichTextBox control uses the default size limit of MaxValue as its MaxLength. We need to check to see whether the text to append will fit, as described here.