1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-03 12:11:33 +01:00

sm: Minor robustness fix for a regression test.

* sm/t-minip12.c (run_one_test): Don't hash if we have no parameters
at all.
--

This fix handles the case that an empty result array is returned by
minip12.c
This commit is contained in:
Werner Koch 2023-10-17 16:42:33 +02:00
parent 2e7a08a829
commit d528de9c6e
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -539,7 +539,10 @@ run_one_test (const char *name, const char *desc, const char *pass,
} }
} }
resulthash = hash_buffer (tmpstring, strlen (tmpstring)); /* Hash only if we have at least one parameter; i.e. the curve
* alone is not sufficient. */
if (result[0])
resulthash = hash_buffer (tmpstring, strlen (tmpstring));
xfree (tmpstring); xfree (tmpstring);
} }