if (nss_cms_before_data(p7dcx) != SECSuccess) {
SEC_ASN1DecoderClearFilterProc(p7dcx->dcx); /* stop all processing */
p7dcx->error = PORT_GetError();
+ PORT_SetError(0); // Clean the thread error since we've returned the error
}
}
if (after && dest == &(cinfo->rawContent)) {
/* we're right after of the data */
- if (nss_cms_after_data(p7dcx) != SECSuccess)
+ if (nss_cms_after_data(p7dcx) != SECSuccess) {
p7dcx->error = PORT_GetError();
+ PORT_SetError(0); // Clean the thread error since we've returned the error
+ }
/* we don't need to see the contents anymore */
SEC_ASN1DecoderClearFilterProc(p7dcx->dcx);
data, len, final);
if (rv != SECSuccess) {
p7dcx->error = PORT_GetError();
+ PORT_SetError(0); // Clean the thread error since we've returned the error
goto loser;
}
SecCmsMessageRef cmsg;
OSStatus result;
+ /* Clear the thread error to clean up dirty threads */
+ PORT_SetError(0);
+
cmsg = SecCmsMessageCreate(pool);
if (cmsg == NULL)
goto loser;
loser:
result = PORT_GetError();
+ PORT_SetError(0); // Clean the thread error since we've returned the error
return result;
}
(void) SEC_ASN1DecoderFinish (p7dcx->dcx);
p7dcx->dcx = NULL;
}
- PORT_SetError (p7dcx->error);
+ PORT_SetError (0); // Clean the thread error since we've returned the error
return p7dcx->error;
}
p7dcx->dcx = NULL;
p7dcx->childp7dcx = NULL;
PORT_Free(p7dcx);
+ PORT_SetError(0); // Clean the thread error since we've returned the error
return result;
}