summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@torproject.org>2023-04-20 21:43:59 +0000
committerMike Perry <mikeperry-git@torproject.org>2023-05-04 16:31:08 +0000
commit9ee71eaf5ad83efec8366ecf17da5ba57ab47cde (patch)
treeaaeae6d47efbc4d6cb1a1226354dd82cdb845bc4 /src
parentbdf4fef2db193d6704d79289ea3fbba0061918fc (diff)
downloadtor-9ee71eaf5ad83efec8366ecf17da5ba57ab47cde.tar.gz
tor-9ee71eaf5ad83efec8366ecf17da5ba57ab47cde.zip
CID 1524707: Quiet coverity noise
Diffstat (limited to 'src')
-rw-r--r--src/core/or/conflux_cell.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/or/conflux_cell.c b/src/core/or/conflux_cell.c
index 9d81a4ba3b..fa0bb1c23e 100644
--- a/src/core/or/conflux_cell.c
+++ b/src/core/or/conflux_cell.c
@@ -53,8 +53,11 @@ build_link_cell(const conflux_cell_link_t *link, uint8_t *cell_out)
trn_cell_conflux_link_payload_v1_set_desired_ux(payload, link->desired_ux);
/* Encode payload. */
- trn_cell_conflux_link_setlen_payload(cell,
- trn_cell_conflux_link_payload_v1_encoded_len(payload));
+ ssize_t pay_len = trn_cell_conflux_link_payload_v1_encoded_len(payload);
+ tor_assert(pay_len >= 0);
+
+ trn_cell_conflux_link_setlen_payload(cell, pay_len);
+
trn_cell_conflux_link_payload_v1_encode(
trn_cell_conflux_link_getarray_payload(cell),
trn_cell_conflux_link_getlen_payload(cell), payload);