Merge pull request #136 from saradickinson/bugfix/pinsets

Bug fix for segmentation fault when using NULL pin. Unit test to come…
This commit is contained in:
saradickinson 2016-01-07 17:25:22 +00:00
commit b39ddf01d0
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ getdns_dict* getdns_pubkey_pin_create_from_string(
getdns_dict* out = NULL;
/* we only do sha256 right now, make sure this is well-formed */
if (strncmp(PIN_PREFIX, str, PIN_PREFIX_LENGTH))
if (!str || strncmp(PIN_PREFIX, str, PIN_PREFIX_LENGTH))
return NULL;
for (i = PIN_PREFIX_LENGTH; i < PIN_PREFIX_LENGTH + B64_ENCODED_SHA256_LENGTH - 1; i++)
if (!((str[i] >= 'a' && str[i] <= 'z') ||