Skip to content

Commit

Permalink
tls: cast to usigned for computing available size for read
Browse files Browse the repository at this point in the history
(cherry picked from commit 1e67fdd)
(cherry picked from commit aa7d892)
  • Loading branch information
miconda committed Apr 3, 2019
1 parent 1d5272c commit 3d50b94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/tls/tls_server.c
Expand Up @@ -995,8 +995,8 @@ int tls_read_f(struct tcp_connection* c, int* flags)
If it's != 0 is changed only on destroy. It's not possible to have
parallel reads.*/
tls_c = c->extra_data;
bytes_free = c->req.b_size - (int)(r->pos - r->buf);
if (unlikely(bytes_free == 0)) {
bytes_free = c->req.b_size - (unsigned int)(r->pos - r->buf);
if (unlikely(bytes_free <= 0)) {
ERR("Buffer overrun, dropping\n");
r->error = TCP_REQ_OVERRUN;
return -1;
Expand Down

0 comments on commit 3d50b94

Please sign in to comment.