libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit c5c36d954b5282f96413c586bb960eac0b97f618
parent 39b6c2e1c5b8a0dea9c9c1df0f9bab8e71b1353b
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri, 14 Jan 2011 18:26:50 +0000

nullcheck

Diffstat:
Msrc/daemon/connection.c | 10+++++-----
Msrc/daemon/digestauth.c | 5+++++
2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/daemon/connection.c b/src/daemon/connection.c @@ -380,12 +380,12 @@ try_ready_normal_body (struct MHD_Connection *connection) return MHD_YES; } + /** - * Prepare the response buffer of this connection for - * sending. Assumes that the response mutex is - * already held. If the transmission is complete, - * this function may close the socket (and return - * MHD_NO). + * Prepare the response buffer of this connection for sending. + * Assumes that the response mutex is already held. If the + * transmission is complete, this function may close the socket (and + * return MHD_NO). * * @return MHD_NO if readying the response failed */ diff --git a/src/daemon/digestauth.c b/src/daemon/digestauth.c @@ -690,6 +690,11 @@ MHD_basic_auth_get_username_password(struct MHD_Connection *connection, return NULL; } user = strdup(decode); + if (NULL == user) + { + free (decode); + return NULL; + } user[separator - decode] = '\0'; /* cut off at ':' */ if (password != NULL) {