[BUGFIX] Prevent command exit status overflow to non-error status 39/53839/4
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:12:22 +0000 (15:12 +0200)
commit22a209325807c8a4de698333a37d5bdcc019e28d
tree6dfb55534e18cc04576edda7b17d2fe6881dc3d2
parentd45abc0d08646bd23ccfb2334b7d24cc4adc9559
[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/53839
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
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