diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/util_str.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/lib/util_str.c b/source4/lib/util_str.c index 961bdb8084..3fe6fd1cc0 100644 --- a/source4/lib/util_str.c +++ b/source4/lib/util_str.c @@ -123,8 +123,11 @@ static int StrCaseCmp_slow(const char *s1, const char *s2) smb_ucs2_t *u1, *u2; int ret; - convert_string_allocate(CH_UNIX, CH_UTF16, s1, strlen(s1)+1, &u1); - convert_string_allocate(CH_UNIX, CH_UTF16, s2, strlen(s2)+1, &u2); + if (convert_string_allocate(CH_UNIX, CH_UTF16, s1, strlen(s1)+1, &u1) == -1 || + convert_string_allocate(CH_UNIX, CH_UTF16, s2, strlen(s2)+1, &u2) == -1) { + /* fallback to a simple comparison */ + return strcasecmp(s1, s2); + } ret = strcasecmp_w(u1, u2); |