Skip to content

Commit 9b0bdb6

Browse files
committed
Prevent overflow of runc exit code.
It's possible for the Status field of runc.ExitError to be set to -1, in which case conversion to uint32 results in the error message to say that the container exited with code 4294967295 (2^32-1). Signed-off-by: Erik Sipsma <[email protected]>
1 parent 29233b9 commit 9b0bdb6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

executor/runcexecutor/executor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ func exitError(ctx context.Context, err error) error {
309309
Err: err,
310310
}
311311
var runcExitError *runc.ExitError
312-
if errors.As(err, &runcExitError) {
312+
if errors.As(err, &runcExitError) && runcExitError.Status >= 0 {
313313
exitErr = &gatewayapi.ExitError{
314314
ExitCode: uint32(runcExitError.Status),
315315
}

0 commit comments

Comments
 (0)