mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-03-23 03:38:05 +08:00
staging: atomisp: silence an array overflow warning
Static checkers complain that we should check if "i" is in bounds before we check if "var8[i]" is a NUL char. This bug is harmless but also easy to fix. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2bbe97830a
commit
5d1ae279c2
@ -669,7 +669,7 @@ int gmin_get_config_var(struct device *dev, const char *var, char *out, size_t *
|
||||
/* Our variable names are ASCII by construction, but EFI names
|
||||
* are wide chars. Convert and zero-pad. */
|
||||
memset(var16, 0, sizeof(var16));
|
||||
for (i=0; var8[i] && i < sizeof(var8); i++)
|
||||
for (i = 0; i < sizeof(var8) && var8[i]; i++)
|
||||
var16[i] = var8[i];
|
||||
|
||||
/* To avoid owerflows when calling the efivar API */
|
||||
|
Loading…
x
Reference in New Issue
Block a user