[openssh-commits] [openssh] 01/02: upstream: Check return value of sscanf.
git+noreply at mindrot.org
git+noreply at mindrot.org
Tue Jun 23 15:56:14 AEST 2026
This is an automated email from the git hooks/post-receive script.
dtucker pushed a commit to branch master
in repository openssh.
commit e683097d90e4698893c86a6f61c8c994b68cbcc6
Author: dtucker at openbsd.org <dtucker at openbsd.org>
AuthorDate: Mon Jun 22 12:08:33 2026 +0000
upstream: Check return value of sscanf.
OpenBSD-Regress-ID: e06a8c769541b1aa7d663cc8859ddabd93847e81
---
regress/unittests/test_helper/test_helper.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/regress/unittests/test_helper/test_helper.c b/regress/unittests/test_helper/test_helper.c
index f734b8f48..450b04595 100644
--- a/regress/unittests/test_helper/test_helper.c
+++ b/regress/unittests/test_helper/test_helper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: test_helper.c,v 1.17 2026/06/16 22:27:10 dtucker Exp $ */
+/* $OpenBSD: test_helper.c,v 1.18 2026/06/22 12:08:33 dtucker Exp $ */
/*
* Copyright (c) 2011 Damien Miller <djm at mindrot.org>
*
@@ -670,7 +670,7 @@ hex2bin(uint8_t *bin, const char *hex, size_t len)
/* Don't use %hhx since it's C99 and older platforms don't have it. */
for (i = 0; i < len; i++) {
- sscanf(hex + i * 2, "%02x", &v);
+ ASSERT_INT_EQ(sscanf(hex + i * 2, "%02x", &v), 1);
ASSERT_U_INT_LE(v, 256);
bin[i] = (uint8_t)v;
}
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list