[PATCH][libubootenv] uboot_env: Reject empty strings in validate_int()

5 views
Skip to first unread message

Christian Storm

unread,
Jul 24, 2026, 10:49:54 AM (12 days ago) Jul 24
to swup...@googlegroups.com
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

Stefano Babic

unread,
Jul 27, 2026, 11:56:38 AM (9 days ago) Jul 27
to Christian Storm, swup...@googlegroups.com
Applied to -master, thanks !

Best regards,
Stefano

--
_______________________________________________________________________
Nabla Software Engineering GmbH
Hirschstr. 111A | 86156 Augsburg | Tel: +49 821 45592596
Geschäftsführer : Stefano Babic | HRB 40522 Augsburg
E-Mail: sba...@nabladev.com

Reply all
Reply to author
Forward
0 new messages