From ff9cb6572dc3cdde3daaae1aa89c1382334b49b4 Mon Sep 17 00:00:00 2001 From: Asanka Herath Date: Thu, 26 Aug 2010 16:23:42 -0400 Subject: [PATCH] Deal with NULL or empty input for expand_path_tokens() _krb5_expand_path_tokens() should return an empty string if the input string is empty or NULL, instead of always returning a NULL for these two cases. --- lib/krb5/expand_path.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/krb5/expand_path.c b/lib/krb5/expand_path.c index a65ea8c74..70096e1c7 100644 --- a/lib/krb5/expand_path.c +++ b/lib/krb5/expand_path.c @@ -407,6 +407,11 @@ _krb5_expand_path_tokens(krb5_context context, const char *path_left; size_t len = 0; + if (path_in == NULL || *path_in == '\0') { + *ppath_out = strdup(""); + return 0; + } + *ppath_out = NULL; for (path_left = path_in; path_left && *path_left; ) { -- 2.11.4.GIT