Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants