[BUGFIX] Prevent command exit status overflow to non-error status 42/53842/2
authorOliver Eglseder <oliver.eglseder@in2code.de>
Wed, 30 Aug 2017 13:53:48 +0000 (15:53 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 31 Aug 2017 13:18:00 +0000 (15:18 +0200)
commitd8b99acfb23cb47e7808f6fc653d8090b9f44839
tree0fde0b2b6d759e7c9d48403985d15b5a5381a04e
parent27f9631eb8eccf35d82c0b6aff0bd5c4b906dba3
[BUGFIX] Prevent command exit status overflow to non-error status

If a command throws an exception the exception code will be used
as exit code of the CLI command. This will result in an integer overflow
since exit codes are limited to 255, whereas 255 is reserved for PHP.
(See PHP exit documentation)

This commit checks if the return code will result in a 0 and change it to 1 instead.
In TYPO3 v9 the exit code is limited by Symfony Console so no change in master is needed.

Resolves: #82246
Releases: 8.7, 7.6
Change-Id: Id85fcbb61d6f0b4dd7f5ee9a1aaf55e648819b9c
Reviewed-on: https://review.typo3.org/53842
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Console/CliRequestHandler.php