added sprintf solution and found other possible overflow occurences

Signed-off-by: Trenton VanderWert <trenton.vanderwert@gmail.com>
pull/12788/head
Trenton VanderWert 11 months ago
parent 4a45342887
commit ab640a7177
No known key found for this signature in database
GPG Key ID: 4BBE2454B180637A

@ -18,6 +18,7 @@ package driver // import "helm.sh/helm/v3/pkg/storage/driver"
import (
"context"
"fmt"
"strconv"
"strings"
"time"
@ -160,7 +161,7 @@ func (cfgmaps *ConfigMaps) Create(key string, rls *rspb.Release) error {
lbs.init()
lbs.fromMap(rls.Labels)
lbs.set("createdAt", strconv.Itoa(int(time.Now().Unix())))
lbs.set("createdAt", fmt.Sprintf("%v", time.Now().Unix()))
// create a new configmap to hold the release
obj, err := newConfigMapsObject(key, rls, lbs)
@ -188,7 +189,7 @@ func (cfgmaps *ConfigMaps) Update(key string, rls *rspb.Release) error {
lbs.init()
lbs.fromMap(rls.Labels)
lbs.set("modifiedAt", strconv.Itoa(int(time.Now().Unix())))
lbs.set("modifiedAt", fmt.Sprintf("%v", time.Now().Unix()))
// create a new configmap object to hold the release
obj, err := newConfigMapsObject(key, rls, lbs)

@ -18,6 +18,7 @@ package driver // import "helm.sh/helm/v3/pkg/storage/driver"
import (
"context"
"fmt"
"strconv"
"strings"
"time"
@ -151,7 +152,7 @@ func (secrets *Secrets) Create(key string, rls *rspb.Release) error {
lbs.init()
lbs.fromMap(rls.Labels)
lbs.set("createdAt", strconv.Itoa(int(time.Now().Unix())))
lbs.set("createdAt", fmt.Sprintf("%v", time.Now().Unix()))
// create a new secret to hold the release
obj, err := newSecretsObject(key, rls, lbs)
@ -177,7 +178,7 @@ func (secrets *Secrets) Update(key string, rls *rspb.Release) error {
lbs.init()
lbs.fromMap(rls.Labels)
lbs.set("modifiedAt", strconv.FormatInt(time.Now().Unix(), 10))
lbs.set("modifiedAt", fmt.Sprintf("%v", time.Now().Unix()))
// create a new secret object to hold the release
obj, err := newSecretsObject(key, rls, lbs)

Loading…
Cancel
Save