mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-30 18:17:09 +03:00
oss-fuzz: Fix complaint about memcpy()
This commit is contained in:
1 parent
784d0d083d
commit
7cf476bc23
1 file changed
+5
-3
+5
-3
@@ -368,9 +368,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];
|
||||
|
||||
Reference in new issue
Block a user