From b70f23c2b581c5d455362ab37f4846de9a910055 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 8 Aug 2012 17:01:00 -0700 Subject: Correctly check for errors in strlower_m() returns. --- source3/param/loadparm.c | 5 ++++- source3/param/service.c | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d4ee8a22f2..5dcb92628c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1653,7 +1653,10 @@ char *canonicalize_servicename(TALLOC_CTX *ctx, const char *src) result = talloc_strdup(ctx, src); SMB_ASSERT(result != NULL); - strlower_m(result); + if (!strlower_m(result)) { + TALLOC_FREE(result); + return NULL; + } return result; } diff --git a/source3/param/service.c b/source3/param/service.c index 5f0910fe0a..85047a8e08 100644 --- a/source3/param/service.c +++ b/source3/param/service.c @@ -191,7 +191,9 @@ int find_service(TALLOC_CTX *ctx, const char *service_in, char **p_service_out) /* Is it a usershare service ? */ if (iService < 0 && *lp_usershare_path(talloc_tos())) { /* Ensure the name is canonicalized. */ - strlower_m(*p_service_out); + if (!strlower_m(*p_service_out)) { + goto fail; + } iService = load_usershare_service(*p_service_out); } -- cgit