2
0

More improvements to error handling.

This commit is contained in:
Maarten Billemont
2017-08-02 14:26:41 -04:00
parent 03080b9ccd
commit 10f2c107c6
7 changed files with 130 additions and 79 deletions

View File

@@ -115,9 +115,10 @@ static const char *mpw_sitePassword_v1(
// Determine the template.
const char *template = mpw_templateForType( passwordType, siteKey[0] );
trc( "type %d, template: %s\n", passwordType, template );
if (!template)
return NULL;
if (strlen( template ) > MPSiteKeySize) {
ftl( "Template too long for password seed: %lu", strlen( template ) );
mpw_free( siteKey, sizeof( siteKey ) );
return NULL;
}