[
https://issues.apache.org/jira/browse/THRIFT-2156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15344682#comment-15344682
]
ASF GitHub Bot commented on THRIFT-2156:
----------------------------------------
Github user tpcwang commented on a diff in the pull request:
https://github.com/apache/thrift/pull/1033#discussion_r68087439
--- Diff: lib/cpp/src/thrift/transport/TServerSocket.cpp ---
@@ -520,23 +523,23 @@ void TServerSocket::listen() {
if (retries > retryLimit_) {
char errbuf[1024];
if (!path_.empty()) {
- sprintf(errbuf, "TServerSocket::listen() PATH %s", path_.c_str());
+ snprintf(errbuf, 1024, "TServerSocket::listen() PATH %s",
path_.c_str());
--- End diff --
ditto here with sizeof(errbuf)
> TServerSocket::listen() is throwing exceptions with misleading information
> --------------------------------------------------------------------------
>
> Key: THRIFT-2156
> URL: https://issues.apache.org/jira/browse/THRIFT-2156
> Project: Thrift
> Issue Type: Bug
> Components: C++ - Library
> Affects Versions: 0.9
> Reporter: Frank Meerkoetter
> Assignee: James E. King, III
> Priority: Minor
> Attachments: errno_copy.patch
>
>
> Due to a problem with bind() an exception was thrown.
> The text was:
> "Could not bind: Transport endpoint is not connected"
> which doesn't make sense.
> It turned out that errno had been overwritten.
> The correct text would have been:
> "Could not bind: Address already in use"
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)