oss-fuzz: Fix complaint about memcpy()

This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2026-03-16 14:49:56 +00:00
1 parent ef97823845
commit c1b1ffa27d
1 file changed
+5 -3
+5 -3
View File
@@ -370,9 +370,11 @@ oscore_generate_nonce(cose_encrypt0_t *ptr,
if (tmp_len > 5) {
tmp_len = 5;
}
memcpy(&(buffer[size - tmp_len]),
ptr->partial_iv.s,
tmp_len);
if (tmp_len) {
memcpy(&(buffer[size - tmp_len]),
ptr->partial_iv.s,
tmp_len);
}
/* XOR */
for (int i = 0; i < size; i++) {
buffer[i] = buffer[i] ^ (uint8_t)ctx->common_iv->s[i];