Skip to content

Commit 1d43b6f

Browse files
committed
client_msg_cb: Pass correct size to SSL_read_ex()
The amount of space remaining is "buf->size - buf->len" not "buf->size". The non-TLS path already used the correct size. Thanks to Joshua Rogers for finding this.
1 parent 41c4b82 commit 1d43b6f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

logsrvd/logsrvd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* SPDX-License-Identifier: ISC
33
*
4-
* Copyright (c) 2019-2023 Todd C. Miller <[email protected]>
4+
* Copyright (c) 2019-2025 Todd C. Miller <[email protected]>
55
*
66
* Permission to use, copy, modify, and distribute this software for any
77
* purpose with or without fee is hereby granted, provided that the above
@@ -1043,7 +1043,7 @@ client_msg_cb(int fd, int what, void *v)
10431043
#if defined(HAVE_OPENSSL)
10441044
if (closure->ssl != NULL) {
10451045
const int result = SSL_read_ex(closure->ssl, buf->data + buf->len,
1046-
buf->size, &nread);
1046+
buf->size - buf->len, &nread);
10471047
if (result <= 0) {
10481048
const char *errstr;
10491049
switch (SSL_get_error(closure->ssl, result)) {

0 commit comments

Comments
 (0)