aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/misc.c5
-rw-r--r--lib/oauth2.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/misc.c b/lib/misc.c
index 442f8f19..a7065757 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -734,6 +734,9 @@ char *get_rfc822_header( char *text, char *header, int len )
int hlen = strlen( header ), i;
char *ret;
+ if( text == NULL )
+ return NULL;
+
if( len == 0 )
len = strlen( text );
@@ -778,5 +781,5 @@ char *get_rfc822_header( char *text, char *header, int len )
}
}
- return( NULL );
+ return NULL;
}
diff --git a/lib/oauth2.c b/lib/oauth2.c
index 4a9d256c..0348d0d0 100644
--- a/lib/oauth2.c
+++ b/lib/oauth2.c
@@ -112,7 +112,7 @@ static void oauth2_access_token_done( struct http_request *req )
if( req->status_code != 200 )
{
}
- else if( strstr( content_type, "application/json" ) )
+ else if( content_type && strstr( content_type, "application/json" ) )
{
atoken = oauth2_json_dumb_get( req->reply_body, "access_token" );
rtoken = oauth2_json_dumb_get( req->reply_body, "refresh_token" );