diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-04-26 17:23:12 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-04-26 17:23:12 +0200 |
commit | 39e6b1d120ced38fd7def997aca282791d8d9c82 (patch) | |
tree | d4b9783d5f3483fcf98ebe96ac4abb1c275f4681 | |
parent | 3cdfeee1bb9e42f5a6c9ace231f944ce97706957 (diff) | |
download | gnunet-39e6b1d120ced38fd7def997aca282791d8d9c82.tar.gz gnunet-39e6b1d120ced38fd7def997aca282791d8d9c82.zip |
minor
-rw-r--r-- | src/reclaim/oidc_helper.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/reclaim/oidc_helper.c b/src/reclaim/oidc_helper.c index 91b024c12..5bcf932f5 100644 --- a/src/reclaim/oidc_helper.c +++ b/src/reclaim/oidc_helper.c | |||
@@ -216,7 +216,7 @@ static char * | |||
216 | url_encode (const char *str) | 216 | url_encode (const char *str) |
217 | { | 217 | { |
218 | char *pstr = (char *) str; | 218 | char *pstr = (char *) str; |
219 | char *buf = malloc (strlen (str) * 3 + 1); | 219 | char *buf = GNUNET_malloc (strlen (str) * 3 + 1); |
220 | char *pbuf = buf; | 220 | char *pbuf = buf; |
221 | while (*pstr) | 221 | while (*pstr) |
222 | { | 222 | { |
@@ -226,8 +226,11 @@ url_encode (const char *str) | |||
226 | else if (*pstr == ' ') | 226 | else if (*pstr == ' ') |
227 | *pbuf++ = '+'; | 227 | *pbuf++ = '+'; |
228 | else | 228 | else |
229 | *pbuf++ = '%', *pbuf++ = to_hex (*pstr >> 4), | 229 | { |
230 | *pbuf++ = '%'; | ||
231 | *pbuf++ = to_hex (*pstr >> 4); | ||
230 | *pbuf++ = to_hex (*pstr & 15); | 232 | *pbuf++ = to_hex (*pstr & 15); |
233 | } | ||
231 | pstr++; | 234 | pstr++; |
232 | } | 235 | } |
233 | *pbuf = '\0'; | 236 | *pbuf = '\0'; |
@@ -241,7 +244,7 @@ static char * | |||
241 | url_decode (const char *str) | 244 | url_decode (const char *str) |
242 | { | 245 | { |
243 | char *pstr = (char *) str; | 246 | char *pstr = (char *) str; |
244 | char *buf = malloc (strlen (str) + 1); | 247 | char *buf = GNUNET_malloc (strlen (str) + 1); |
245 | char *pbuf = buf; | 248 | char *pbuf = buf; |
246 | while (*pstr) | 249 | while (*pstr) |
247 | { | 250 | { |
@@ -342,6 +345,7 @@ OIDC_build_authz_code (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, | |||
342 | { | 345 | { |
343 | if ((1 != SSCANF (nonce_str, "%u", &nonce)) || (nonce > UINT16_MAX)) | 346 | if ((1 != SSCANF (nonce_str, "%u", &nonce)) || (nonce > UINT16_MAX)) |
344 | { | 347 | { |
348 | GNUNET_break (0); | ||
345 | GNUNET_free (code_payload); | 349 | GNUNET_free (code_payload); |
346 | GNUNET_free_non_null (attrs_ser); | 350 | GNUNET_free_non_null (attrs_ser); |
347 | return NULL; | 351 | return NULL; |
@@ -358,6 +362,7 @@ OIDC_build_authz_code (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, | |||
358 | } | 362 | } |
359 | if (GNUNET_SYSERR == GNUNET_CRYPTO_ecdsa_sign (issuer, purpose, &signature)) | 363 | if (GNUNET_SYSERR == GNUNET_CRYPTO_ecdsa_sign (issuer, purpose, &signature)) |
360 | { | 364 | { |
365 | GNUNET_break (0); | ||
361 | GNUNET_free (code_payload); | 366 | GNUNET_free (code_payload); |
362 | GNUNET_free_non_null (attrs_ser); | 367 | GNUNET_free_non_null (attrs_ser); |
363 | return NULL; | 368 | return NULL; |