Skip to content

Commit 8aa816a

Browse files
committed
sys/suit: always write size in suit_worker_try_prepare()
1 parent 1a1e104 commit 8aa816a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

sys/include/suit/transport/worker.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ void suit_worker_trigger_prepared(const uint8_t *manifest, size_t size);
6868
* area into which the manifest is to be written. The lock must be released by
6969
* calling @ref suit_worker_trigger_prepared later.
7070
*
71-
* @param[out] buffer On success, buffer into which the image may be
71+
* @param[out] buffer On success, buffer into which the manifest may be
7272
* written.
73-
* @param[in,out] size Requested buffer size. On some errors, this will be
74-
* decreased to a size that would be acceptable.
73+
* @param[in,out] size Requested buffer size. When size is `0` or on some
74+
* errors, this will be set to a size that would be acceptable.
7575
*
7676
* @return 0 on success
7777
* @return -EAGAIN if the worker is currently busy.

sys/suit/transport/worker.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,5 +265,8 @@ int suit_worker_try_prepare(uint8_t **buffer, size_t *size)
265265
}
266266

267267
*buffer = _manifest_buf;
268+
if (!*size) {
269+
*size = SUIT_MANIFEST_BUFSIZE;
270+
}
268271
return 0;
269272
}

0 commit comments

Comments
 (0)