Check whether value's first character is \0, i.e.,
value is an empty string, and return false.
Signed-off-by: Christian Storm <
christi...@siemens.com>
---
src/uboot_env.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/uboot_env.c b/src/uboot_env.c
index 66ba09a..e8db81a 100644
--- a/src/uboot_env.c
+++ b/src/uboot_env.c
@@ -151,6 +151,9 @@ static bool validate_int(bool hex, const char *value)
{
const char *c;
+ if (!*value)
+ return false;
+
for (c = value; c != value + strlen(value); ++c) {
if (hex && !isxdigit(*c))
return false;
--
2.55.0