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.
This commit is contained in:

committed by
Asanka C. Herath

parent
e8e56defaf
commit
ff9cb6572d
@@ -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; ) {
|
||||
|
Reference in New Issue
Block a user