mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zipl: check array limits before indexing
Resolves Cppcheck warning: [zipl/boot/menu.c:126]: (style) Array index 'i' is used before limits check. Cc: Stefan Haberland <stefan.haberland@de.ibm.com> Cc: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Jens Remus <jremus@linux.ibm.com> Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Bootmenu Subroutines
|
||||
*
|
||||
* Copyright IBM Corp. 2013, 2017
|
||||
* Copyright IBM Corp. 2013, 2018
|
||||
*
|
||||
* s390-tools is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the MIT license. See LICENSE for details.
|
||||
@@ -123,7 +123,7 @@ static int menu_param(unsigned long *value)
|
||||
/* no number, check for keyword */
|
||||
i = 0;
|
||||
/* skip leading whitespaces */
|
||||
while (ebc_isspace(loadparm[i]) && (i < PARAM_SIZE))
|
||||
while ((i < PARAM_SIZE) && ebc_isspace(loadparm[i]))
|
||||
i++;
|
||||
|
||||
if (!strncmp(&loadparm[i], "PROMPT", 6)) {
|
||||
|
||||
Reference in New Issue
Block a user