mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-07 02:02:54 +03:00
oss-fuzz: Fix complaint about memcpy()
This commit is contained in:
1 parent
ef97823845
commit
c1b1ffa27d
1 file changed
+5
-3
+5
-3
@@ -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];
|
||||
|
||||
Reference in new issue
Block a user