[Bug 3937] New: b16tod: does not accept B-F, due to a wrong comparison

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Tue Mar 24 23:21:31 AEDT 2026


https://bugzilla.mindrot.org/show_bug.cgi?id=3937

            Bug ID: 3937
           Summary: b16tod: does not accept B-F, due to a wrong comparison
           Product: Portable OpenSSH
           Version: 10.2p1
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: trivial
          Priority: P5
         Component: Miscellaneous
          Assignee: unassigned-bugs at mindrot.org
          Reporter: liam at seine.email

There is a trivial correctness bug in the sshbuf-misc.c:b16tod, which
should be fixed as follows:

```
diff --git a/sshbuf-misc.c b/sshbuf-misc.c
index 7b11e4e17..f15322eb3 100644
--- a/sshbuf-misc.c
+++ b/sshbuf-misc.c
@@ -95,7 +95,7 @@ b16tod(const char v)
                return v - '0';
        if (v >= 'a' && v <= 'f')
                return 10 + v - 'a';
-       if (v >= 'A' && v <= 'A')
+       if (v >= 'A' && v <= 'F')
                return 10 + v - 'A';
        return -1;
 }
```

With the current usage I don't see a bug manifesting from it.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list