Bug 1148374: Revert changeset 9c2345405e0c because it is incorrect.
authorWan-Teh Chang <wtc@google.com>
Wed, 21 Oct 2015 17:16:17 -0700
changeset 11693 a6164e360845ecad34ac11180bbf4025ab748fc4
parent 11692 92cb85d4f95952e87bcbcfa09fc9be80f9f50e03
child 11694 311b58f69300da0f5442556575ef7607d2149ec7
push id834
push userwtc@google.com
push dateThu, 22 Oct 2015 00:16:24 +0000
bugs1148374
Bug 1148374: Revert changeset 9c2345405e0c because it is incorrect.
cmd/lib/derprint.c
--- a/cmd/lib/derprint.c
+++ b/cmd/lib/derprint.c
@@ -498,20 +498,19 @@ prettyPrintItem(FILE *out, const unsigne
 	data += slen;
 
 	lenLen = prettyPrintLength(out, data, end, &slen, &indefinite, lv, raw);
 	if (lenLen < 0)
 	    return lenLen;
 	data += lenLen;
 
 	/*
-	 * Just quit now if slen more bytes puts us off the end,
-	 * or if there's no more data to process.
+	 * Just quit now if slen more bytes puts us off the end.
 	 */
-	if ((data + slen) >= end) {
+	if ((data + slen) > end) {
 	    PORT_SetError(SEC_ERROR_BAD_DER);
 	    return -1;
 	}
 
         if (code & SEC_ASN1_CONSTRUCTED) {
 	    if (slen > 0 || indefinite) {
 		slen = prettyPrintItem(out, data,
 				       slen == 0 ? end : data + slen,