[
https://issues.apache.org/jira/browse/THRIFT-2118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jens Geyer updated THRIFT-2118:
-------------------------------
Attachment: 0001-THRIFT-2118-Certificate-error-handling-still-incorre.patch
The patch is quite trivial.
> Certificate error handling still incorrect
> ------------------------------------------
>
> Key: THRIFT-2118
> URL: https://issues.apache.org/jira/browse/THRIFT-2118
> Project: Thrift
> Issue Type: Bug
> Components: Go - Library
> Affects Versions: 0.9.1
> Reporter: Jens Geyer
> Assignee: Jens Geyer
> Priority: Trivial
> Fix For: 0.9.1
>
> Attachments:
> 0001-THRIFT-2118-Certificate-error-handling-still-incorre.patch
>
>
> The error handling at LoadX509KeyPair() is still incorrect, it may now throw
> a Panic instead of reporting the error.
> Main reason is a slight scoping issue. If I read
> http://golang.org/doc/effective_go.html#redeclaration correctly, then
> {code}
> var err error
> if foo, err := loadFoo(); err == nil {
> doSomething()
> }
> if err != nil {
> return err
> }
> {code}
> is not the same as
> {code}
> var err error
> foo, err := loadFoo()
> if err == nil {
> doSomething()
> }
> if err != nil {
> return err
> }
> {code}
> because in the latter case a reassignment happens, while in the former case
> another, second err variable is declared - see the ยง remark in the linked
> doc. Therefore, in the first case the comparison may fail.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira