Bug 1234218 - [CID 1242869] check return values in cmsencode.c, r=franziskus
authordimi <dlee@mozilla.com>
Fri, 11 Mar 2016 10:07:06 +0800
changeset 11986 7947fd4431c579dabf087fd3b4ff1696d773cc4b
parent 11983 2fceba406eee8ee058a009783f55c848fed76851
child 11987 c03680bf22ec81f2b544064324c2272b5a14391e
push id1059
push userfranziskuskiefer@gmail.com
push dateMon, 14 Mar 2016 11:25:04 +0000
reviewersfranziskus
bugs1234218, 1242869
Bug 1234218 - [CID 1242869] check return values in cmsencode.c, r=franziskus
lib/smime/cmsencode.c
--- a/lib/smime/cmsencode.c
+++ b/lib/smime/cmsencode.c
@@ -643,16 +643,21 @@ NSS_CMSEncoder_Cancel(NSSCMSEncoderConte
      * Finish any inner decoders before us so that all the encoded data is flushed
      * This basically finishes all the decoders from the innermost to the outermost.
      * Finishing an inner decoder may result in data being updated to the outer decoder
      * while we are already in NSS_CMSEncoder_Finish, but that's allright.
      */
     if (p7ecx->childp7ecx) {
 	rv = NSS_CMSEncoder_Cancel(p7ecx->childp7ecx); /* frees p7ecx->childp7ecx */
 	/* remember rv for now */
+#ifdef CMSDEBUG
+	if (rv != SECSuccess) {
+	    fprintf(stderr, "Fail to cancel inner encoder\n");
+	}
+#endif
     }
 
     /*
      * On the way back up, there will be no more data (if we had an
      * inner encoder, it is done now!)
      * Flush out any remaining data and/or finish digests.
      */
     rv = nss_cms_encoder_work_data(p7ecx, NULL, NULL, 0, PR_TRUE, (p7ecx->childp7ecx == NULL));