fix(qat): fenrir 586 guard exit memcpy on error path

This commit is contained in:
David Garske
2026-05-18 13:53:07 -07:00
parent a211f74a8d
commit 0ea4fa0f97
+6 -3
View File
@@ -1100,9 +1100,12 @@ exit:
}
/* Capture the inline decrypt into the output. */
XMEMCPY(out, dataBuf, inOutSz);
if (cipherDirection == CPA_CY_SYM_CIPHER_DIRECTION_ENCRYPT) {
if (authTag != NULL && authTagSz > 0) {
if (ret == 0 && dataBuf != NULL) {
XMEMCPY(out, dataBuf, inOutSz);
}
if (ret == 0 &&
cipherDirection == CPA_CY_SYM_CIPHER_DIRECTION_ENCRYPT) {
if (authTag != NULL && authTagSz > 0 && authTagBuf != NULL) {
XMEMCPY(authTag, authTagBuf, authTagSz);
}
}