[openssh-commits] [openssh] 09/14: upstream: Oops, incorrect hex conversion spotted by claudio.

git+noreply at mindrot.org git+noreply at mindrot.org
Tue Apr 30 12:39:46 AEST 2024


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 54343a260e3aa4bceca1852dde31cd08e2abd82b
Author: deraadt at openbsd.org <deraadt at openbsd.org>
AuthorDate: Tue Apr 2 12:22:38 2024 +0000

    upstream: Oops, incorrect hex conversion spotted by claudio.
    
    While here try to improve how it reads a bit better.  Surprising the
    regression tests didn't spot this error, maybe it fails to roundtrip the
    values.
    
    OpenBSD-Commit-ID: 866cfcc1955aef8f3fc32da0b70c353a1b859f2e
---
 ssh-pkcs11.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/ssh-pkcs11.c b/ssh-pkcs11.c
index de2dbba5..1e76e8b2 100644
--- a/ssh-pkcs11.c
+++ b/ssh-pkcs11.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-pkcs11.c,v 1.61 2024/04/02 09:48:24 claudio Exp $ */
+/* $OpenBSD: ssh-pkcs11.c,v 1.62 2024/04/02 12:22:38 deraadt Exp $ */
 /*
  * Copyright (c) 2010 Markus Friedl.  All rights reserved.
  * Copyright (c) 2014 Pedro Martelletto. All rights reserved.
@@ -1389,14 +1389,13 @@ static int
 h2i(char c)
 {
 	if (c >= '0' && c <= '9')
-		c -= '0';
+		return c - '0';
 	else if (c >= 'a' && c <= 'f')
-		c -= 'a';
+		return c - 'a' + 10;
 	else if (c >= 'A' && c <= 'F')
-		c -= 'A';
+		return c - 'A' + 10;
 	else
 		return -1;
-	return c;
 }
 
 static int

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list