hsa: http_cli coverity fix 86/41486/2
authorMatus Fabian <[email protected]>
Wed, 28 Aug 2024 07:36:11 +0000 (09:36 +0200)
committerFlorin Coras <[email protected]>
Wed, 28 Aug 2024 15:41:26 +0000 (15:41 +0000)
Type: fix
Change-Id: I23c55e6be08cc02332da9375d2eb19b74b79427c
Signed-off-by: Matus Fabian <[email protected]>
src/plugins/hs_apps/http_cli.c

index 814f5f1..17624b3 100644 (file)
@@ -196,7 +196,7 @@ start_send_data (hcs_session_t *hs, http_status_code_t status)
 
   if (rv != vec_len (hs->tx_buf))
     {
-      hs->tx_offset = rv;
+      hs->tx_offset = (rv > 0) ? rv : 0;
       svm_fifo_add_want_deq_ntf (ts->tx_fifo, SVM_FIFO_WANT_DEQ_NOTIF);
     }
   else