Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LogBox doesn't check to see whether text to append will fit #843

Open
tombogle opened this issue Jul 25, 2019 · 3 comments
Open

LogBox doesn't check to see whether text to append will fit #843

tombogle opened this issue Jul 25, 2019 · 3 comments
Assignees

Comments

@tombogle
Copy link
Contributor

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.

@tombogle tombogle changed the title LogBox's doesn't check to see whether text to append will fit LogBox doesn't check to see whether text to append will fit Jul 25, 2019
@tombogle tombogle self-assigned this Jul 25, 2019
@tombogle
Copy link
Contributor Author

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
Copy link
Contributor Author

WIP: #845

@ermshiperete
Copy link
Member

@tombogle is this still an issue, or did #845 fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants