libmicrohttpd

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

commit b454d32814534c950fe9d9ab082be1702f9d8f75
parent ccaa16a2649cde9abbcb7355fc292a1e2d5df277
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed,  5 Jan 2011 14:25:18 +0000

fix 1636

Diffstat:
MChangeLog | 1+
Msrc/daemon/digestauth.c | 3++-
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,6 +1,7 @@ Wed Jan 5 15:20:11 CET 2011 Fixing double-locking on non-Linux platforms when using MHD_create_response_from_fd (#1639). -CG + Avoid use of strndup for better portability (#1636). -CG Tue Jan 4 13:07:21 CET 2011 Added MHD_create_response_from_buffer, deprecating diff --git a/src/daemon/digestauth.c b/src/daemon/digestauth.c @@ -689,7 +689,8 @@ MHD_basic_auth_get_username_password(struct MHD_Connection *connection, free(decode); return NULL; } - user = strndup(decode, separator - decode); + user = strdup(decode); + user[separator - decode] = '\0'; /* cut off at ':' */ if (password != NULL) { *password = strdup(separator + 1);