diff --git a/vendor/github.com/prometheus/procfs/mountstats.go b/vendor/github.com/prometheus/procfs/mountstats.go index fe8f1f6a..6b2b0ba9 100644 --- a/vendor/github.com/prometheus/procfs/mountstats.go +++ b/vendor/github.com/prometheus/procfs/mountstats.go @@ -523,15 +523,19 @@ func parseNFSTransportStats(ss []string, statVersion string) (*NFSTransportStats } // Allocate enough for v1.1 stats since zero value for v1.1 stats will be okay - // in a v1.0 response - ns := make([]uint64, 0, fieldTransport11Len) - for _, s := range ss { + // in a v1.0 response. + // + // Note: slice length must be set to length of v1.1 stats to avoid a panic when + // only v1.0 stats are present. + // See: https://github.com/prometheus/node_exporter/issues/571. + ns := make([]uint64, fieldTransport11Len) + for i, s := range ss { n, err := strconv.ParseUint(s, 10, 64) if err != nil { return nil, err } - ns = append(ns, n) + ns[i] = n } return &NFSTransportStats{ diff --git a/vendor/vendor.json b/vendor/vendor.json index 1928d02f..afe13d7c 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -129,22 +129,22 @@ "revisionTime": "2017-02-20T10:38:46Z" }, { - "checksumSHA1": "cD4xn1qxbkiuXqUExpdnDroCTrY=", + "checksumSHA1": "dA8hiwcAbubYRxTnpocR5VZkqAY=", "path": "github.com/prometheus/procfs", - "revision": "332f6238064950a97bc3ed3f5421f6418537e707", - "revisionTime": "2017-04-21T21:58:51Z" + "revision": "6ac8c5d890d415025dd5aae7595bcb2a6e7e2fad", + "revisionTime": "2017-04-24T20:45:52Z" }, { "checksumSHA1": "eiBAd4edewJTOtTwxh/ubJdjd+I=", "path": "github.com/prometheus/procfs/sysfs", - "revision": "332f6238064950a97bc3ed3f5421f6418537e707", - "revisionTime": "2017-04-21T21:58:51Z" + "revision": "6ac8c5d890d415025dd5aae7595bcb2a6e7e2fad", + "revisionTime": "2017-04-24T20:45:52Z" }, { "checksumSHA1": "xCiFAAwVTrjsfZT1BIJQ3DgeNCY=", "path": "github.com/prometheus/procfs/xfs", - "revision": "332f6238064950a97bc3ed3f5421f6418537e707", - "revisionTime": "2017-04-21T21:58:51Z" + "revision": "6ac8c5d890d415025dd5aae7595bcb2a6e7e2fad", + "revisionTime": "2017-04-24T20:45:52Z" }, { "checksumSHA1": "uozMgPjB4AggpuuJkGq3FgAs4CA=",