diff options
author | Brian Goff <cpuguy83@gmail.com> | 2020-01-10 09:19:43 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-10 09:19:43 -0800 |
commit | 9d4c722c53ec9e81405106f361e56620ae3d17f3 (patch) | |
tree | 14f980a2b2bb4a20e62c0f7d9847909ff7ca20de | |
parent | f7065313ec87960bde830a1092331d4cf91a826c (diff) | |
parent | 339fb74cbcd2e39295e40484c013100ad404fbdf (diff) | |
download | docker-9d4c722c53ec9e81405106f361e56620ae3d17f3.tar.gz |
Merge pull request #40361 from thaJeztah/no_panic
prevent panic if TINI_COMMIT isn't set during build
-rw-r--r-- | daemon/info_unix.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/daemon/info_unix.go b/daemon/info_unix.go index f34a03307c..06a67271b5 100644 --- a/daemon/info_unix.go +++ b/daemon/info_unix.go @@ -72,7 +72,9 @@ func (daemon *Daemon) fillPlatformInfo(v *types.Info, sysInfo *sysinfo.SysInfo) v.InitCommit.ID = "N/A" } else { v.InitCommit.ID = commit - v.InitCommit.Expected = dockerversion.InitCommitID[0:len(commit)] + if len(dockerversion.InitCommitID) > len(commit) { + v.InitCommit.Expected = dockerversion.InitCommitID[0:len(commit)] + } } } else { logrus.Warnf("failed to retrieve %s version: %s", defaultInitBinary, err) |