mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
When reading a properties file with a line containing a binary zero as first character, an array access at index -1 is attempted, because strlen considers this as an empty string (len = 0). The following array access 'line[len - 1]' accesses the array at index -1. Fix this by checking the line length and skip empty lines. Reviewed-by: Finn Callies <fcallies@linux.ibm.com> Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>