BUG/MINOR: ssl: don't truncate the file descriptor to 16 bits in debug mode
authorWilly Tarreau <w@1wt.eu>
Tue, 2 Mar 2021 18:32:39 +0000 (19:32 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 5 Mar 2021 07:30:08 +0000 (08:30 +0100)
Errors reported by ssl_sock_dump_errors() to stderr would only report the
16 lower bits of the file descriptor because it used to be casted to ushort.
This can be backported to all versions but has really no importance in
practice since this is never seen.

src/ssl_sock.c

index 2abd666..d3a3a03 100644 (file)
@@ -646,8 +646,8 @@ static forceinline void ssl_sock_dump_errors(struct connection *conn)
                        ret = ERR_get_error();
                        if (ret == 0)
                                return;
-                       fprintf(stderr, "fd[%04x] OpenSSL error[0x%lx] %s: %s\n",
-                               (unsigned short)conn->handle.fd, ret,
+                       fprintf(stderr, "fd[%#x] OpenSSL error[0x%lx] %s: %s\n",
+                               conn->handle.fd, ret,
                                ERR_func_error_string(ret), ERR_reason_error_string(ret));
                }
        }