]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - sshecc.c
ecdsa_newkey: fix a crash where the second curve name is missing or corrupt.
[PuTTY.git] / sshecc.c
index 5f170215dbc2dd9764158b5334254943ae40709c..9f188df89b5cc27622cd73f1a031d098e292d18b 100644 (file)
--- a/sshecc.c
+++ b/sshecc.c
@@ -1770,6 +1770,7 @@ static void *ecdsa_newkey(const struct ssh_signkey *self,
     /* Curve name is duplicated for Weierstrass form */
     if (curve->type == EC_WEIERSTRASS) {
         getstring(&data, &len, &p, &slen);
+       if (!p) return NULL;
         if (!match_ssh_id(slen, p, curve->name)) return NULL;
     }