DescriptionMore robust handling of GSSAPI error strings
RFC 2744 does not require string types to be NULL terminated, because their length is explicitly passed as part of the gss_buffer_desc (see Section 3.2.). As such, when printing error strings, the length should be explicitly stated. This is shown in the example code of gss_display_status in Section 5.11. While in practice this is the case (at least from checking MIT and Heimdal's error handling code), it doesn't hurt to be defensive.
In addition, there are some conditions where value may be NULL or length may be 0, so make sure to check for these prior to calling StringPrintf, so as not to crash. Finally, for the extreme defensive case, make sure that the length (which is a size_t) is capped at INT_MAX prior to printing.
Contributed by ryan.sleevi@gmail.com
BUG=33033
TEST=None
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=49299
Patch Set 1 #
Total comments: 2
Patch Set 2 : Individual status message limit of 4K, total message of 8K-1 #
Total comments: 1
Messages
Total messages: 9 (0 generated)
|