[ https://issues.apache.org/jira/browse/THRIFT-2156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15344699#comment-15344699 ]
ASF GitHub Bot commented on THRIFT-2156: ---------------------------------------- Github user jeking3 commented on a diff in the pull request: https://github.com/apache/thrift/pull/1033#discussion_r68088614 --- Diff: lib/cpp/src/thrift/transport/TServerSocket.cpp --- @@ -284,7 +284,7 @@ void TServerSocket::listen() { hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG; - sprintf(port, "%d", port_); + snprintf(port, sizeof("65535"), "%d", port_); --- End diff -- I think the allocation of the buffer for port is just as bizarre, but I wanted to remain consistent. Let's see if the build passes; if it fails and I need to rebase on master to kick another because of a transient issue, I can make the changes you suggest. > 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)