mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
Fix two issues in boot menu input parsing: 1. ebcdic_strtoul returns unsigned long but the value was stored in an int. 2. ebcdic_strtoul could overflow if @value exceeds ULONG_MAX. Both problems are easy to trigger by entering an excessively large value in the boot menu, which can lead to unsigned long overflow and memory corruption. Use a checked addition to prevent overflow and change menu_read() return type to unsigned long. Suggested-by: Eduard Shishkin <edward6@linux.ibm.com> Reviewed-by: Eduard Shishkin <edward6@linux.ibm.com> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>