mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
COVA11294: check mpi_write_binary retcode
This commit is contained in:
parent
dd14603156
commit
4739c3234b
2 changed files with 6 additions and 3 deletions
|
@ -196,7 +196,9 @@ int lws_issue_raw(struct lws *wsi, unsigned char *buf, size_t len)
|
|||
lwsl_debug("%p new partial sent %d from %lu total\n", wsi, m,
|
||||
(unsigned long)real_len);
|
||||
|
||||
lws_buflist_append_segment(&wsi->buflist_out, buf + m, real_len - m);
|
||||
if (lws_buflist_append_segment(&wsi->buflist_out, buf + m,
|
||||
real_len - m) < 0)
|
||||
return -1;
|
||||
|
||||
lws_stats_atomic_bump(wsi->context, pt, LWSSTATS_C_WRITE_PARTIALS, 1);
|
||||
lws_stats_atomic_bump(wsi->context, pt,
|
||||
|
|
|
@ -146,8 +146,9 @@ lws_genrsa_new_keypair(struct lws_context *context, struct lws_genrsa_ctx *ctx,
|
|||
if (!el[n].buf)
|
||||
goto cleanup;
|
||||
el[n].len = mbedtls_mpi_size(mpi[n]);
|
||||
mbedtls_mpi_write_binary(mpi[n], el[n].buf,
|
||||
el[n].len);
|
||||
if (mbedtls_mpi_write_binary(mpi[n], el[n].buf,
|
||||
el[n].len))
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue