From: Tobias Schramm Date: Sun, 18 Feb 2018 12:46:10 +0000 (+0100) Subject: uclient: Handle memory allocation failure for url X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2ac991bc53a56fa1109d9477d9d83e1ddd11e00d;p=oweals%2Fuclient.git uclient: Handle memory allocation failure for url Check ptr to url after allocation to prevent null pointer dereference Signed-off-by: Tobias Schramm --- diff --git a/uclient.c b/uclient.c index 8862b55..1137168 100644 --- a/uclient.c +++ b/uclient.c @@ -59,6 +59,9 @@ __uclient_get_url(const struct uclient_backend *backend, &uri_buf, strlen(location) + 1, &auth_buf, auth_str ? strlen(auth_str) + 1 : 0); + if (!url) + return NULL; + url->backend = backend; url->location = strcpy(uri_buf, location); if (host)