summaryrefslogtreecommitdiffstats
path: root/source/lib/util_unistr.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/lib/util_unistr.c')
-rw-r--r--source/lib/util_unistr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/lib/util_unistr.c b/source/lib/util_unistr.c
index a4952d137ee..64cfd521202 100644
--- a/source/lib/util_unistr.c
+++ b/source/lib/util_unistr.c
@@ -361,7 +361,7 @@ int rpcstr_push(void* dest, const char *src, size_t dest_len, int flags)
void unistr2_to_ascii(char *dest, const UNISTR2 *str, size_t maxlen)
{
- if (str == NULL) {
+ if ((str == NULL) || (str->uni_str_len == 0)) {
*dest='\0';
return;
}
@@ -374,7 +374,7 @@ void unistr2_to_ascii(char *dest, const UNISTR2 *str, size_t maxlen)
void unistr3_to_ascii(char *dest, const UNISTR3 *str, size_t maxlen)
{
- if (str == NULL) {
+ if ((str == NULL) || (str->uni_str_len == 0)) {
*dest='\0';
return;
}