set nonce ptr to null if string is empty

This commit is contained in:
Mészáros Mihály 2016-09-12 09:40:06 +02:00
parent eacb77740b
commit 959d49a7ef

View File

@ -115,7 +115,7 @@ static int encode_token(const char* server_name,
ns_bzero(&etoken,sizeof(etoken));
// TODO: avoid this hack
if (!*gcm_nonce) gcm_nonce='\0';
if (!*gcm_nonce) gcm_nonce=NULL;
if (encode_oauth_token((const u08bits *) server_name, &etoken, &key, &ot,(const u08bits *) gcm_nonce) < 0) {
fprintf(stderr, "%s: cannot encode oauth token\n",