@@ -316,7 +316,8 @@ bool oauth2_cache_get(oauth2_log_t *log, oauth2_cache_t *cache, const char *key,
316316 char * hashed_key = NULL ;
317317 char * encrypted_value = NULL ;
318318
319- oauth2_debug (log , "enter: key=%s, type=%s, decrypt=%d" , key ,
319+ oauth2_debug (log , "enter: key=%s, type=%s, decrypt=%d" ,
320+ key ? key : "<null>" ,
320321 cache && cache -> type ? cache -> type -> name : "<n/a>" ,
321322 cache ? cache -> encrypt : -1 );
322323
@@ -350,7 +351,8 @@ bool oauth2_cache_get(oauth2_log_t *log, oauth2_cache_t *cache, const char *key,
350351 oauth2_mem_free (hashed_key );
351352
352353 oauth2_debug (log , "leave: cache %s for key: %s return: %lu bytes" ,
353- rc ? (* value ? "hit" : "miss" ) : "error" , key ,
354+ rc ? (* value ? "hit" : "miss" ) : "error" ,
355+ key ? key : "<null>" ,
354356 * value ? (unsigned long )strlen (* value ) : 0 );
355357
356358 return rc ;
@@ -388,7 +390,8 @@ bool oauth2_cache_set(oauth2_log_t *log, oauth2_cache_t *cache, const char *key,
388390 oauth2_debug (log ,
389391 "enter: key=%s, len=%lu, ttl(s)=" OAUTH2_TIME_T_FORMAT
390392 ", type=%s, encrypt=%d" ,
391- key , value ? (unsigned long )strlen (value ) : 0 , ttl_s ,
393+ key ? key : "<null>" ,
394+ value ? (unsigned long )strlen (value ) : 0 , ttl_s ,
392395 (cache && cache -> type ) ? cache -> type -> name : "<n/a>" ,
393396 cache ? cache -> encrypt : -1 );
394397
@@ -419,9 +422,11 @@ bool oauth2_cache_set(oauth2_log_t *log, oauth2_cache_t *cache, const char *key,
419422 oauth2_mem_free (encrypted );
420423
421424 if (rc )
422- oauth2_debug (log , "leave: successfully stored: %s" , key );
425+ oauth2_debug (log , "leave: successfully stored: %s" ,
426+ key ? key : "<null>" );
423427 else
424- oauth2_error (log , "leave: could NOT store: %s" , key );
428+ oauth2_error (log , "leave: could NOT store: %s" ,
429+ key ? key : "<null>" );
425430
426431 return rc ;
427432}
0 commit comments