mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-29 21:08:24 +00:00
fix UB and possible HF trigger
This commit is contained in:
1 parent
7d53c21efe
commit
a0d9b6a7e0
3 files changed
+4
-2
No files matched your search
@@ -1380,6 +1380,7 @@ long mg_tls_recv(struct mg_connection *c, void *buf, size_t len) {
|
||||
mg_tls_drop_record(c);
|
||||
return MG_IO_WAIT;
|
||||
}
|
||||
if (buf == NULL || len == 0) return 0L;
|
||||
minlen = len < tls->recv_len ? len : tls->recv_len;
|
||||
memmove(buf, recv_buf, minlen);
|
||||
tls->recv_offset += minlen;
|
||||
|
||||
Reference in new issue
Block a user