Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unsafe casting for mysql Service #1381

Merged
merged 1 commit into from
Nov 20, 2017
Merged

Conversation

irfanhabib
Copy link
Contributor

@irfanhabib irfanhabib commented Nov 20, 2017

Fixes issue #1380.

In SCF mysql service port is a float. That is not true for other CF environments. Instead doing a coerced cast (int)(dbCredentials["port"].(float64)) which causes a panic if the value is not a float, we do a safer "cast" db.Port, _ = strconv.Atoi(fmt.Sprintf("%v", dbCredentials["port"]))

Copy link
Contributor

@richard-cox richard-cox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested with SCF and mysql

@richard-cox richard-cox merged commit f8feb44 into master Nov 20, 2017
@richard-cox richard-cox deleted the mysql-service-port branch November 20, 2017 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants