Skip to content

Commit 4e8fa1b

Browse files
committed
fix: use ParseInt instead of Atoi to prevent potential integer overflow
Signed-off-by: Thorsten Hans <[email protected]>
1 parent caa2ec9 commit 4e8fa1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/controller/shim_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ func (sr *ShimReconciler) createJobManifest(shim *rcmv1.Shim, node *corev1.Node,
462462
}
463463
// set ttl for the installer job only if specified by the user
464464
if ttlStr := os.Getenv("SHIM_NODE_INSTALLER_JOB_TTL"); ttlStr != "" {
465-
if ttl, err := strconv.Atoi(ttlStr); err == nil && ttl > 0 {
465+
if ttl, err := strconv.ParseInt(ttlStr, 10, 32); err == nil && ttl > 0 {
466466
job.Spec.TTLSecondsAfterFinished = ptr(int32(ttl))
467467
}
468468
}

0 commit comments

Comments
 (0)