1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

Extra crash-safety in decoding a DSS signature blob

[originally from svn r968]
This commit is contained in:
Simon Tatham 2001-03-02 17:13:16 +00:00
parent b182356f99
commit 902d0636fc

View File

@ -204,7 +204,7 @@ static int dss_verifysig(void *key, char *sig, int siglen,
*/
if (siglen != 40) { /* bug not present; read admin fields */
getstring(&sig, &siglen, &p, &slen);
if (!p || memcmp(p, "ssh-dss", 7)) {
if (!p || slen != 7 || memcmp(p, "ssh-dss", 7)) {
return 0;
}
sig += 4, siglen -= 4; /* skip yet another length field */