Skip to content

Commit 125d360

Browse files
ThorstenHans0xE282B0
authored andcommitted
fix: use ParseInt instead of Atoi to prevent potential integer overflow
Signed-off-by: Thorsten Hans <[email protected]>
1 parent f8d3f97 commit 125d360

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
@@ -463,7 +463,7 @@ func (sr *ShimReconciler) createJobManifest(shim *rcmv1.Shim, node *corev1.Node,
463463
}
464464
// set ttl for the installer job only if specified by the user
465465
if ttlStr := os.Getenv("SHIM_NODE_INSTALLER_JOB_TTL"); ttlStr != "" {
466-
if ttl, err := strconv.Atoi(ttlStr); err == nil && ttl > 0 {
466+
if ttl, err := strconv.ParseInt(ttlStr, 10, 32); err == nil && ttl > 0 {
467467
job.Spec.TTLSecondsAfterFinished = ptr(int32(ttl))
468468
}
469469
}

0 commit comments

Comments
 (0)