mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Belt *or* suspenders will be sufficient when casting things to unsigned char.
svn:r3122
This commit is contained in:
+2
-3
@@ -974,12 +974,11 @@ int
|
||||
crypto_pk_check_fingerprint_syntax(const char *s)
|
||||
{
|
||||
int i;
|
||||
const unsigned char *cp = s;
|
||||
for (i = 0; i < FINGERPRINT_LEN; ++i) {
|
||||
if ((i%5) == 4) {
|
||||
if (!TOR_ISSPACE(cp[i])) return 0;
|
||||
if (!TOR_ISSPACE(s[i])) return 0;
|
||||
} else {
|
||||
if (!TOR_ISXDIGIT(cp[i])) return 0;
|
||||
if (!TOR_ISXDIGIT(s[i])) return 0;
|
||||
}
|
||||
}
|
||||
if (s[FINGERPRINT_LEN]) return 0;
|
||||
|
||||
Reference in New Issue
Block a user