We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 890241a commit 83e3330Copy full SHA for 83e3330
crypto/ivgen-essiv.c
@@ -79,7 +79,7 @@ static int qcrypto_ivgen_essiv_calculate(QCryptoIVGen *ivgen,
79
uint8_t *data = g_new(uint8_t, ndata);
80
81
sector = cpu_to_le64(sector);
82
- memcpy(data, (uint8_t *)§or, ndata);
+ memcpy(data, (uint8_t *)§or, MIN(sizeof(sector), ndata));
83
if (sizeof(sector) < ndata) {
84
memset(data + sizeof(sector), 0, ndata - sizeof(sector));
85
}
0 commit comments