mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-31 00:03:07 +03:00
tests: Fix pointer arithmetic in torture_pki_*_publickey_base64
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@ -199,15 +199,19 @@ static void torture_pki_ecdsa_publickey_base64(void **state)
|
||||
assert_true(key_buf != NULL);
|
||||
|
||||
q = p = key_buf;
|
||||
while (*p != ' ') p++;
|
||||
*p = '\0';
|
||||
while (p != NULL && *p != '\0' && *p != ' ') p++;
|
||||
if (p != NULL) {
|
||||
*p = '\0';
|
||||
}
|
||||
|
||||
type = ssh_key_type_from_name(q);
|
||||
assert_true(type == SSH_KEYTYPE_ECDSA);
|
||||
|
||||
q = ++p;
|
||||
while (*p != ' ') p++;
|
||||
*p = '\0';
|
||||
while (p != NULL && *p != '\0' && *p != ' ') p++;
|
||||
if (p != NULL) {
|
||||
*p = '\0';
|
||||
}
|
||||
|
||||
rc = ssh_pki_import_pubkey_base64(q, type, &key);
|
||||
assert_true(rc == 0);
|
||||
|
Reference in New Issue
Block a user