Module: kamailio
Branch: master
Commit: 1e67fdd53a1c6dc3964d25e891caad24029b7887
URL:
https://github.com/kamailio/kamailio/commit/1e67fdd53a1c6dc3964d25e891caad2…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-09-07T09:00:50+02:00
tls: cast to usigned for computing available size for read
---
Modified: src/modules/tls/tls_server.c
---
Diff:
https://github.com/kamailio/kamailio/commit/1e67fdd53a1c6dc3964d25e891caad2…
Patch:
https://github.com/kamailio/kamailio/commit/1e67fdd53a1c6dc3964d25e891caad2…
---
diff --git a/src/modules/tls/tls_server.c b/src/modules/tls/tls_server.c
index 7c66e3f550..1de6b94fda 100644
--- a/src/modules/tls/tls_server.c
+++ b/src/modules/tls/tls_server.c
@@ -1014,8 +1014,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;