aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-01-14 18:26:50 +0000
committerChristian Grothoff <christian@grothoff.org>2011-01-14 18:26:50 +0000
commitc5c36d954b5282f96413c586bb960eac0b97f618 (patch)
treec698cf6c14a9f6f7f931db6305bada6fd8d12873 /src
parent39b6c2e1c5b8a0dea9c9c1df0f9bab8e71b1353b (diff)
downloadlibmicrohttpd-c5c36d954b5282f96413c586bb960eac0b97f618.tar.gz
libmicrohttpd-c5c36d954b5282f96413c586bb960eac0b97f618.zip
nullcheck
Diffstat (limited to 'src')
-rw-r--r--src/daemon/connection.c10
-rw-r--r--src/daemon/digestauth.c5
2 files changed, 10 insertions, 5 deletions
diff --git a/src/daemon/connection.c b/src/daemon/connection.c
index 58e4e722..6740cc23 100644
--- a/src/daemon/connection.c
+++ b/src/daemon/connection.c
@@ -380,12 +380,12 @@ try_ready_normal_body (struct MHD_Connection *connection)
380 return MHD_YES; 380 return MHD_YES;
381} 381}
382 382
383
383/** 384/**
384 * Prepare the response buffer of this connection for 385 * Prepare the response buffer of this connection for sending.
385 * sending. Assumes that the response mutex is 386 * Assumes that the response mutex is already held. If the
386 * already held. If the transmission is complete, 387 * transmission is complete, this function may close the socket (and
387 * this function may close the socket (and return 388 * return MHD_NO).
388 * MHD_NO).
389 * 389 *
390 * @return MHD_NO if readying the response failed 390 * @return MHD_NO if readying the response failed
391 */ 391 */
diff --git a/src/daemon/digestauth.c b/src/daemon/digestauth.c
index dd87b251..72bff56f 100644
--- a/src/daemon/digestauth.c
+++ b/src/daemon/digestauth.c
@@ -690,6 +690,11 @@ MHD_basic_auth_get_username_password(struct MHD_Connection *connection,
690 return NULL; 690 return NULL;
691 } 691 }
692 user = strdup(decode); 692 user = strdup(decode);
693 if (NULL == user)
694 {
695 free (decode);
696 return NULL;
697 }
693 user[separator - decode] = '\0'; /* cut off at ':' */ 698 user[separator - decode] = '\0'; /* cut off at ':' */
694 if (password != NULL) 699 if (password != NULL)
695 { 700 {